Difference between revisions of "Sprite:setAnchorPosition"

From GiderosMobile
m (formatting)
(added a note)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2015.03.22<br/>
'''<translate>Available since</translate>:''' Gideros 2015.03.22<br/>
+
'''Class:''' [[Sprite]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
  
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Sets x, y, z anchor position of [[Special:MyLanguage/Sprite|Sprite]] in its relative coordinates.
+
Sets x, y, z anchor position of '''Sprite''' in its relative coordinates.
  
Meaning Sprite with dimensions 100x100 and anchor position of 50x50 would rotate around its center</translate>
+
Meaning '''Sprite''' with dimensions 100x100 and anchor position of 50x50 would rotate around its center.
 
<source lang="lua">
 
<source lang="lua">
 
Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)
 
Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''anchorX''': (number) <translate>anchor position in Sprite's internal coordinates</translate> <br/>
+
'''anchorX''': (number) anchor position in Sprite's internal coordinates <br/>
'''anchorY''': (number) <translate>anchor position in Sprite's internal coordinates</translate> <br/>
+
'''anchorY''': (number) anchor position in Sprite's internal coordinates <br/>
'''anchorZ''': (number) <translate>anchor position in Sprite's internal coordinates</translate> '''optional'''<br/>
+
'''anchorZ''': (number) anchor position in Sprite's internal coordinates '''optional'''<br/>
 +
 
 +
=== Note ===
 +
'''setAnchorPoint''' is available in the Bitmap class: [[Bitmap:setAnchorPoint]]
  
 
{{Sprite}}
 
{{Sprite}}

Revision as of 01:00, 22 November 2020

Available since: Gideros 2015.03.22
Class: Sprite

Description

Sets x, y, z anchor position of Sprite in its relative coordinates.

Meaning Sprite with dimensions 100x100 and anchor position of 50x50 would rotate around its center.

Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)

Parameters

anchorX: (number) anchor position in Sprite's internal coordinates
anchorY: (number) anchor position in Sprite's internal coordinates
anchorZ: (number) anchor position in Sprite's internal coordinates optional

Note

setAnchorPoint is available in the Bitmap class: Bitmap:setAnchorPoint