Difference between revisions of "Sprite:swapChildrenAt"

(Created page with "__NOTOC__ '''Available since:''' Gideros 2015.04.04<br/> === Description === <br /> Swaps two child sprites at specifed indexes. Each index must be between 1<br /> and the ind...")
 
Line 8: Line 8:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
= Sprite:swapChildrenAt(index1index2,)
+
Sprite:swapChildrenAt(index1,index2)
 
</source>
 
</source>
'''index1:''' (number) The child index of the first sprite to swap. ''''''<br/>
+
'''index1''': (number) The child index of the first sprite to swap. ''''''<br/>
'''index2:''' (number) The child index of the second sprite to swap. ''''''<br/>
+
'''index2''': (number) The child index of the second sprite to swap. ''''''<br/>

Revision as of 11:19, 23 August 2018

Available since: Gideros 2015.04.04

Description


Swaps two child sprites at specifed indexes. Each index must be between 1
and the index number of the last child. Can be used to sort sprites into
a specific order much faster than adding and removing sprites.

 Sprite:swapChildrenAt(index1,index2)

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