Sprite:setHiddenChildren

From GiderosMobile
Revision as of 12:34, 18 October 2025 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2022.3.1<br/> '''Class:''' Sprite<br/> === Description === Hides children sprites in batch. <syntaxhighlight lang="lua"> Sprite:s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2022.3.1
Class: Sprite

Description

Hides children sprites in batch.

Sprite:setHiddenChildren(children)

Parameters

children: (table) table of children to hide

Example

local sprite = Sprite.new()
local pix = Pixel.new(0xff0000, 1, 32, 32)
pix2 = pix:clone()
pix3 = pix:clone()
pix4 = pix:clone()
pix2:setColor(0x00ff00)
pix3:setColor(0x0000ff)
pix4:setColor(0xff00ff)
-- position
pix:setPosition(1*32, 1*32)
pix2:setPosition(1.5*32, 1.5*32)
pix3:setPosition(2*32, 2*32)
pix4:setPosition(2.5*32, 2.5*32)
-- order
sprite:addChildrenAt ( { pix, pix2, pix3, pix4 } )
stage:addChild(sprite)

sprite:setHiddenChildren( { 1, 3 } )