WorldToScreenCoordinates (Harvest)
From OxeyeWiki
(Difference between revisions)
(Created page with '{{HarvestMethod | screenX, screenY = worldToScreenCoordinates(worldX, worldY) | Converts world coordinates to screen coordinates. | {{MethodParam|worldX|Number|The x coordin...') |
|||
Line 15: | Line 15: | ||
harvest.drawText("I'm here", x, y - 15, 1) | harvest.drawText("I'm here", x, y - 15, 1) | ||
</pre> | </pre> | ||
+ | |||
+ | === Resources === | ||
+ | *[http://www.oxeyegames.com/forum/viewtopic.php?p=1523#p1523 Oxeye Game Studio Forum - Harvest Functions] |
Latest revision as of 16:15, 2 December 2009
screenX, screenY = worldToScreenCoordinates(worldX, worldY) | ||
Converts world coordinates to screen coordinates. | ||
Parameter | Expected Type | Description |
worldX | Number | The x coordinate of a point on the world. |
worldY | Number | The y coordinate of a point on the world. |
Returns | ||
Returns two values, screenX and screenY. Both are of the type Number. |
Example
local x,y = harvest.worldToScreenCoordinates(buildingX, buildingY) harvest.drawText("I'm here", x, y - 15, 1)