Difference between revisions of "Sprite:swapChildrenAt"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2015.04.04<br/>
+
'''Available since:''' Gideros 2015.04.04<br/>
=== <translate>Description</translate> ===
+
'''Class:''' [[Sprite]]<br/>
<translate><br />
+
 
Swaps two child sprites at specifed indexes. Each index must be between 1<br />
+
=== Description ===
and the index number of the last child.  Can be used to sort sprites into<br />
+
Swaps two child sprites at specifed indexes. Can be used to sort sprites into a specific order much faster than adding and removing sprites.
a specific order much faster than adding and removing sprites.<br/>
+
<syntaxhighlight lang="lua">
<br /></translate>
+
Sprite:swapChildrenAt(index1,index2)
<source lang="lua">
+
</syntaxhighlight>
Sprite:swapChildrenAt(index1,index2)
+
 
</source>
+
'''Each index must be between 1 and the index number of the last child'''
=== <translate>Parameters</translate> ===
+
 
'''index1''': (number) <translate>The child index of the first sprite to swap.</translate> <br/>
+
=== Parameters ===
'''index2''': (number) <translate>The child index of the second sprite to swap.</translate> <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/>
 +
 
 +
{{Sprite}}

Latest revision as of 14:33, 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.

Sprite:swapChildrenAt(index1,index2)
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