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

Pixi.js:onclick change Texture

$
0
0

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) => {
iftrue){
testBtn.PIXI.Sprite(aTexture);
}
else{
testBtn.PIXI.Sprite(bTexture);
}
})
app.stage.addChild(testBtn);

TKS。


Viewing all articles
Browse latest Browse all 3980

Trending Articles



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