pixi js:显示和隐藏其中包含所有元素的容器

pixijs: show and hide container with all ements in it

我有 tab: PIXI.Container 上面有一堆精灵。 我相信这应该很容易,我是Pixi的新手,但对JS有所了解

我有按钮。单击按钮应该 show/hide 给定容器。 但是,我无法让它工作。

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

我应该如何隐藏所有精灵的容器? 然后我怎样才能显示带有所有精灵的容器?

尝试使用 pixijs。download/dev/docs/PIXI.Container.html#visible

示例:https://github.com/kittykatattack/learningPixi#displaying-sprites <- 这里使用 anySprite.visible = false; 隐藏精灵,但您也可以在容器上进行类似操作。

您可以使用其中之一:
anySprite.visible = false

anySprite.alpha = 0;