Ollie Posted June 29, 2022 Share Posted June 29, 2022 Hello, I want to judge which PNG should be displayed in the click event, How can I modify it? var aTexture =new PIXI .Texture.from("A.png" ); var bTexture =new PIXI .Texture.from("B.png”); var testBtn = new PIXI.Sprite(aTexture); testBtn.on('click', (event) => { if(true){ testBtn.PIXI.Sprite(aTexture); } else{ testBtn.PIXI.Sprite(bTexture); } }) app.stage.addChild(testBtn); TKS。 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 5, 2022 Share Posted July 5, 2022 https://pixijs.io/examples/#/sprite/texture-swap.js Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.