Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

deep and child

$
0
0

hi all ,

I have make some button in my script for show/hide some object like that :
 

var background = PIXI.Sprite.fromImage('images/sol2.jpg');
app.stage.addChild(background);
var varbg = 1;




function backg() {
	if (varbg < 1) {
	app.stage.addChild(background);
	varbg = 1;
	}
else 
	{
	 (varbg > 0)
	app.stage.removeChild(background);
	varbg = 0 ;	
	}
}

in the beginning my other object ( like bunny) , it's in front of the background.

When I clic on button for hide background, it's ok my background disapear like a charm .

but when a REclick on my button for show the background , my background reapear on the front of the canvas , Over my other object :( .

 

So, my question is : It's possible to add a deep level at a child ?

 

thanks for your help


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>