ScreenToWorldCoordinates (Harvest)
From OxeyeWiki
(Difference between revisions)
(7 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
{{HarvestMethod | {{HarvestMethod | ||
| | | | ||
- | worldX, worldY | + | worldX, worldY = screenToWorldCoordinates(screenX, screenY) |
| | | | ||
Converts screen coordinates to world coordinates. | Converts screen coordinates to world coordinates. | ||
| | | | ||
- | {{MethodParam|screenX|Number|The x coordinate of the current screen}} | + | {{MethodParam|screenX|Number|The x coordinate of a point on the current screen.}} |
- | {{MethodParam|screenY|Number|The y coordinate of the current screen}} | + | {{MethodParam|screenY|Number|The y coordinate of a point on the current screen.}} |
| | | | ||
- | Returns | + | Returns two values, worldX and worldY. Both are of the type Number. |
}} | }} | ||
=== Example === | === Example === | ||
Line 15: | Line 15: | ||
harvest.spawnChargeBomb(x, y) | harvest.spawnChargeBomb(x, y) | ||
</pre> | </pre> | ||
+ | |||
+ | === Resources === | ||
+ | *[http://www.oxeyegames.com/forum/viewtopic.php?p=1523#p1523 Oxeye Game Studio Forum - Harvest Functions] |
Latest revision as of 16:14, 2 December 2009
worldX, worldY = screenToWorldCoordinates(screenX, screenY) | ||
Converts screen coordinates to world coordinates. | ||
Parameter | Expected Type | Description |
screenX | Number | The x coordinate of a point on the current screen. |
screenY | Number | The y coordinate of a point on the current screen. |
Returns | ||
Returns two values, worldX and worldY. Both are of the type Number. |
Example
local x,y = harvest.screenToWorldCoordinates(mouseX, mouseY) harvest.spawnChargeBomb(x, y)