Difference between revisions of "Sprite:getNumChildren"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 +
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />

Revision as of 09:27, 24 August 2018

Available since: Gideros 2011.6
Class: Sprite

Description


Returns the number of children of this sprite.

(number) = Sprite:getNumChildren()

Return values

Returns (number) The number of children of this sprite.

Examples

Example

local container1 = Sprite.new()
local container2 = Sprite.new()

local sprite1 = Sprite.new();
local sprite2 = Sprite.new();

container2:addChild(container1)
container1:addChild(sprite1)
container1:addChild(sprite2)

print(container1:getNumChildren()) --&gt; 2
print(container2:getNumChildren()) --&gt; 1
print(sprite1:getNumChildren()) --&gt; 0
print(sprite2:getNumChildren()) --&gt; 0