我有一个问题 PixiJS6.2.0. 我是生成一个圆圈这是我想要的互动。 我要将事件上的点击,徘徊等。 给它。
圆圈是被显示。 没有什么上面。 这似乎是唯一的 pointerupoutside 事件被触发。
这是我迄今为止:
const buttonTexture = new PIXI.Graphics();
buttonTexture.beginFill(0xff0000);
buttonTexture.drawCircle(buttonX, buttonY, buttonWidth * 0.8);
buttonTexture.endFill();
buttonTexture.hitArea = new PIXI.Circle(buttonX, buttonY, buttonWidth * 0.8);
buttonTexture.interactive = true;
buttonTexture.buttonMode = true;
buttonTexture.on('pointerdown', (e) => console.log(e));
buttonTexture.on('pointerup', (e) => console.log(e));
buttonTexture.on('pointerupoutside', (e) => console.log(e));
buttonTexture.on('pointerover', (e) => console.log(e));
buttonTexture.on('pointerout', (e) => console.log(e));
this.pixi.app.stage.addChild(buttonTexture);
击中的圆击和其他地方之后击中触发一个机。日志。
我尝试:
- 叫一切都在requestAnimationFrame
- 分析的质感到精灵和使sprite互动。
- 增加股票和呈现阶段(据我所知,这不应该是需要Pixi.JS 6)
任何人都有一个暗示是什么问题可能是什么?