Jump to content

how to change texture of sprite from spritesheet?


BunBunBun
 Share

Recommended Posts

I have the sound button graphic in the spriteSheet file, frame names are "soundButtonOn" and "soundButtonOff"

this.btnSound = game.add.sprite(10, 10, 'sprite_sheet', 'soundButtonOn');this.btnSound.inputEnabled = true;this.btnSound.events.onInputDown.add(this.muteSounds, this);

how to change the texture with frame name 'soundButtonOff'?

muteSounds: function () {    //this.btnSound.changeTexture('sprite_sheet', 'soundButtonOff'); //something like that?}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...