Sprite:globalToLocal: Difference between revisions

From GiderosMobile
No edit summary
m Text replacement - "</source>" to "</syntaxhighlight>"
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
<languages />
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
'''Class:''' [[Sprite]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
=== <translate>Description</translate> ===
=== Description ===
<translate><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 />
<br /></translate>
<source lang="lua">
(number), (number) = Sprite:globalToLocal(x,y)
(number), (number) = Sprite:globalToLocal(x,y)
</source>
</syntaxhighlight>
=== <translate>Parameters</translate> ===
 
'''x''': (number) <translate>x coordinate of the global coordinate.</translate> <br/>
=== Parameters ===
'''y''': (number) <translate>y coordinate of the global coordinate.</translate> <br/>
'''x''': (number) x coordinate of the global coordinate<br/>
=== <translate>Return values</translate> ===
'''y''': (number) y coordinate of the global coordinate<br/>
'''<translate>Returns</translate>''' (number) <translate>1. x coordinate relative to the display object.</translate><br/>
 
'''<translate>Returns</translate>''' (number) <translate>2. y coordinate relative to the display object.</translate><br/>
=== Return values ===
'''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 13: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