ScreenToWorldCoordinates (Harvest)

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
{{HarvestMethod
{{HarvestMethod
|
|
-
worldX, worldY = screenToWorldCoordinates(screenX, screenY)
+
worldX, worldY screenToWorldCoordinates(screenX, screenY)
|
|
Converts screen coordinates to world coordinates.
Converts screen coordinates to world coordinates.
Line 8: Line 8:
{{MethodParam|screenY|Number|The y coordinate of the current screen}}
{{MethodParam|screenY|Number|The y coordinate of the current screen}}
|
|
-
Returns to values, worldX and worldY. Both are of the type Number.
+
Returns two values, worldX and worldY. Both are of the type Number.
}}
}}
=== Example ===
=== Example ===

Revision as of 22:39, 1 December 2009

worldX, worldY screenToWorldCoordinates(screenX, screenY)

Converts screen coordinates to world coordinates.

Parameter Expected Type Description
screenX Number The x coordinate of the current screen
screenY Number The y coordinate of the current screen
Returns

Returns two values, worldX and worldY. Both are of the type Number.

Harvest Library

Example

local x,y = harvest.screenToWorldCoordinates(mouseX, mouseY)
harvest.spawnChargeBomb(x, y)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox