Sprite:setAnchorPosition: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2015.03.22<br/> === Description === Sets x, y, z anchor position of `Sprite` in it's relative coordinates. Meaning Sprite with dimens..."
 
mNo edit summary
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2015.03.22<br/>
'''Available since:''' Gideros 2015.03.22<br/>
'''Class:''' [[Sprite]]<br/>
=== Description ===
=== Description ===
Sets x, y, z anchor position of `Sprite` in it's relative coordinates.
Sets x, y, z anchor position of '''Sprite''' in its relative coordinates.
<syntaxhighlight lang="lua">
Sprite:setAnchorPosition(anchorX,anchorY,anchorZ)
</syntaxhighlight>
 
Meaning '''Sprite''' with dimensions 100x100 and anchor position of 50x50 would rotate around its center.
 
=== Parameters ===
'''anchorX''': (number) anchor position in Sprite internal coordinates<br/>
'''anchorY''': (number) anchor position in Sprite internal coordinates<br/>
'''anchorZ''': (number) anchor position in Sprite internal coordinates '''optional'''<br/>
 
=== Note ===
To manipulate individual anchors you can use '''[[Sprite:set]]'''.


Meaning Sprite with dimensions 100x100 and anchor position of 50x50 would rotate around its center
{{Sprite}}
<source lang="lua">
= Sprite:setAnchorPosition(anchorXanchorYanchorZ,)
</source>
'''anchorX:''' (number) Anchor position in Sprite's internal coordinates ''''''<br/>
'''anchorY:''' (number) Anchor position in Sprite's internal coordinates ''''''<br/>
'''anchorZ:''' (number) Anchor position in Sprite's internal coordinates '''optional'''<br/>

Latest revision as of 15:28, 11 May 2025

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

To manipulate individual anchors you can use Sprite:set.