Difference between revisions of "Body:getLocalPoint"

m (1 revision: Imported docs from potato.)
m (See Also)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
+
Transform a point from world coordinates to local coordinates.
  
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
local_x, local_y = Body:getLocalPoint( world_x, world_y )
+
localX, localY = Body:getLocalPoint( worldX, worldY )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|world_x|The x position in world coordinates.}}
+
{{param|number|worldX|The x position in world coordinates.}}
{{param|number|world_y|The y position in world coordinates.}}
+
{{param|number|worldY|The y position in world coordinates.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|local_x|The x position in local coordinates.}}
+
{{param|number|localX|The x position in local coordinates.}}
{{param|number|local_y|The y position in local coordinates.}}
+
{{param|number|localY|The y position in local coordinates.}}
 +
 
 
== See Also ==
 
== See Also ==
 
* [[parent::Body]]
 
* [[parent::Body]]
 +
* [[Body:getWorldPoint]]
 +
* [[Body:getWorldPoints]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=}}
+
{{#set:Description=Transform a point from world coordinates to local coordinates.}}
 +
{{#set:Since=000}}
 +
 
 +
== Other Languages ==
 +
{{i18n|Body:getLocalPoint}}

Latest revision as of 04:24, 30 December 2020

Transform a point from world coordinates to local coordinates.

Function

Synopsis

localX, localY = Body:getLocalPoint( worldX, worldY )

Arguments

number worldX
The x position in world coordinates.
number worldY
The y position in world coordinates.

Returns

number localX
The x position in local coordinates.
number localY
The y position in local coordinates.

See Also


Other Languages