Difference between revisions of "Sprite:addChildAt"
From GiderosMobile
 (Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Adds a sprite as a child to this sprite. The child is<br /> added at the index position specifi...")  | 
				|||
| Line 12: | Line 12: | ||
<br />  | <br />  | ||
<source lang="lua">  | <source lang="lua">  | ||
| − | + |  Sprite:addChildAt(child,index)  | |
</source>  | </source>  | ||
| − | '''child  | + | '''child''': (Sprite) The child sprite to add. ''''''<br/>  | 
| − | '''index  | + | '''index''': (number) The index position to which the child is added. ''''''<br/>  | 
Revision as of 10:17, 23 August 2018
Available since: Gideros 2011.6
Description
Adds a sprite as a child to this sprite. The child is
added at the index position specified. Indices start from 1.
Sprites can have only one parent. Therefore if you add a child
object that already has a different sprite as a parent,
the sprite is removed from the child list of the other sprite
and then added to this sprite.
 Sprite:addChildAt(child,index)
'child: (Sprite) The child sprite to add. '
'index: (number) The index position to which the child is added. '