Difference between revisions of "Sprite:globalToLocal"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
<br />
+
<translate><br />
 
Converts the x,y coordinates from the global to the sprite's (local) coordinates.<br />
 
Converts the x,y coordinates from the global to the sprite's (local) coordinates.<br />
 
<br />
 
<br />
<br />
+
<br /></translate>
 
<source lang="lua">
 
<source lang="lua">
 
(number), (number) = Sprite:globalToLocal(x,y)
 
(number), (number) = Sprite:globalToLocal(x,y)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''x''': (number) x coordinate of the global coordinate. <br/>
+
'''x''': (number) <translate>x coordinate of the global coordinate.</translate> <br/>
'''y''': (number) y coordinate of the global coordinate. <br/>
+
'''y''': (number) <translate>y coordinate of the global coordinate.</translate> <br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (number) 1. x coordinate relative to the display object.<br/>
+
'''Returns''' (number) <translate>1. x coordinate relative to the display object.</translate><br/>
'''Returns''' (number) 2. y coordinate relative to the display object.<br/>
+
'''Returns''' (number) <translate>2. y coordinate relative to the display object.</translate><br/>

Revision as of 13:38, 23 August 2018

Available since: Gideros 2011.6

Description


Converts the x,y coordinates from the global to the sprite's (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) 1. x coordinate relative to the display object.
Returns (number) 2. y coordinate relative to the display object.