Sprite:globalToLocal: Difference between revisions

From GiderosMobile
No edit summary
m Text replacement - "<source" to "<syntaxhighlight"
Line 5: Line 5:
=== Description ===
=== Description ===
Converts the x,y coordinates from the global to the sprite (local) coordinates.
Converts the x,y coordinates from the global to the sprite (local) coordinates.
<source lang="lua">
<syntaxhighlight lang="lua">
(number), (number) = Sprite:globalToLocal(x,y)
(number), (number) = Sprite:globalToLocal(x,y)
</source>
</source>

Revision as of 13:31, 13 July 2023

Available since: Gideros 2011.6
Class: Sprite

Description

Converts the x,y coordinates from the global to the sprite (local) coordinates. <syntaxhighlight lang="lua"> (number), (number) = Sprite:globalToLocal(x,y) </source>

Parameters

x: (number) x coordinate of the global coordinate
y: (number) y coordinate of the global coordinate

Return values

Returns (number) x coordinate relative to the display object
Returns (number) y coordinate relative to the display object