Difference between revisions of "Sprite:addChild"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
 
Adds a sprite as a child to this sprite. The child is<br />
 
Adds a sprite as a child to this sprite. The child is<br />
Line 14: Line 14:
 
  Sprite:addChild(child)
 
  Sprite:addChild(child)
 
</source>
 
</source>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
 
'''child''': (Sprite) <translate>The child sprite to add.</translate> <br/>
 
'''child''': (Sprite) <translate>The child sprite to add.</translate> <br/>

Revision as of 07:29, 24 August 2018

Available since: Gideros 2011.6

Description


Adds a sprite as a child to this sprite. The child is
added as a last child of this Sprite instance.

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:addChild(child)

Parameters

child: (Sprite) The child sprite to add.