SetGearPosition Question
Sun, 2015-11-01 00:54
Hi, i want to ask something about the map coordinates plane, can you explain me where is the origin, and how much ( in pixels) increase by X, Y the coordinate.
Im trying to use this function, but always fail to calculate the coords properly..
0,0 is at the TOP LEFT of the map.
X increases to the right.
Y increases downwards (towards waterline)
The coordinates are in pixels (as in map pixels).
Try this:
* Start a local game (e.g. a quick game).
* Wait until the first turn starts and press P to pause the game
* In chat enter
/lua
to enter lua-parsing mode* Then in chat enter
x,y = GetGearPosition(CurrentHedgehog) AddCaption("Current Hedgehog X=" .. x .. " Y=" ..y)
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Based on this the higher X, Y possible are the dimensions of the map (most cases 2048 x 1024)??
these days most of the time the map is 4096x2048
but. you can place things at negative coordinates too. this just won't work for things that require solidity. like placing a girder.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Ok, i get it and now i know how to magange for default map sizes 2048x1024, will look for higher resolutions..
FWIW, at present, the maximum width of an image map is 16,384 and the maximum height is 65,536.
http://hedgewars.org/kb/PresetMaps has more information on image maps.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev