Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pixijs: show and hide container with all elements in it

Tags:

pixi.js

I have tab: PIXI.Container with a bunch of sprites on it. I believe this should be so easy, I am new to Pixi, but have knowledge in JS.

I have button. Clicking on button should show/hide given container. However, I cannot get it work.

btn.on('pointerdown',(event) => this.onClick(btn, tab));

How should I hide container with all sprites on it? And then how can I show back container with all sprites on it?

like image 846
renathy Avatar asked Oct 20 '25 03:10

renathy


1 Answers

Try using pixijs.download/dev/docs/PIXI.Container.html#visible

example: https://github.com/kittykatattack/learningPixi#displaying-sprites <- here sprite is hidden using anySprite.visible = false; , but you can do it similarily on container too.

like image 136
domis86 Avatar answered Oct 22 '25 04:10

domis86



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!