Difference between revisions of "Sprite:swapChildrenAt"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Swaps two child sprites at specifed indexes. Can be used to sort sprites into a specific order much faster than adding and removing sprites.
 
Swaps two child sprites at specifed indexes. Can be used to sort sprites into a specific order much faster than adding and removing sprites.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Sprite:swapChildrenAt(index1,index2)
 
Sprite:swapChildrenAt(index1,index2)
 
</source>
 
</source>

Revision as of 14:31, 13 July 2023

Available since: Gideros 2015.04.04
Class: Sprite

Description

Swaps two child sprites at specifed indexes. Can be used to sort sprites into a specific order much faster than adding and removing sprites. <syntaxhighlight lang="lua"> Sprite:swapChildrenAt(index1,index2) </source>

Each index must be between 1 and the index number of the last child

Parameters

index1: (number) the child index of the first sprite to swap
index2: (number) the child index of the second sprite to swap