Sprite:setAnchorPosition: Difference between revisions

From GiderosMobile
added a note
mNo edit summary
Line 5: Line 5:
=== Description ===
=== Description ===
Sets x, y, z anchor position of '''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.
<source lang="lua">
<source lang="lua">
Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)
Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)
</source>
</source>
Meaning '''Sprite''' with dimensions 100x100 and anchor position of 50x50 would rotate around its center.


=== Parameters ===
=== Parameters ===
'''anchorX''': (number) anchor position in Sprite's internal coordinates <br/>
'''anchorX''': (number) anchor position in Sprite internal coordinates<br/>
'''anchorY''': (number) anchor position in Sprite's internal coordinates <br/>
'''anchorY''': (number) anchor position in Sprite internal coordinates<br/>
'''anchorZ''': (number) anchor position in Sprite's internal coordinates '''optional'''<br/>
'''anchorZ''': (number) anchor position in Sprite internal coordinates '''optional'''<br/>


=== Note ===
=== Note ===

Revision as of 06:47, 28 January 2021

Available since: Gideros 2015.03.22
Class: Sprite

Description

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

Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)

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

Parameters

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

Note

setAnchorPoint is available in the Bitmap class: Bitmap:setAnchorPoint