Difference between revisions of "Sprite:globalToLocal"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Converts the x,y coordinates from the global to the sprite's (local) coordinates.<br /> <br />...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Sprite]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Converts the x,y coordinates from the global to the sprite (local) coordinates.
Converts the x,y coordinates from the global to the sprite's (local) coordinates.<br />
+
<syntaxhighlight lang="lua">
<br />
+
(number), (number) = Sprite:globalToLocal(x,y)
<br />
+
</syntaxhighlight>
<source lang="lua">
+
 
(number) (number), = Sprite:globalToLocal(xy,)
+
=== Parameters ===
</source>
+
'''x''': (number) x coordinate of the global coordinate<br/>
'''x:''' (number) x coordinate of the global coordinate. ''''''<br/>
+
'''y''': (number) y coordinate of the global coordinate<br/>
'''y:''' (number) y coordinate of the global coordinate. ''''''<br/>
+
 
'''Returns''' (number) 1. x coordinate relative to the display object.<br/>
+
=== Return values ===
'''Returns''' (number) 2. y coordinate relative to the display object.<br/>
+
'''Returns''' (number) x coordinate relative to the display object<br/>
 +
'''Returns''' (number) y coordinate relative to the display object<br/>
 +
 
 +
{{Sprite}}

Latest revision as of 15:33, 13 July 2023

Available since: Gideros 2011.6
Class: Sprite

Description

Converts the x,y coordinates from the global to the sprite (local) coordinates.

(number), (number) = Sprite:globalToLocal(x,y)

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