Jump to content

How to make a button look like its pressed?


Gods
 Share

Recommended Posts

The phaser examples shows how to do buttons with multiple images. I was wondering what are some ways you can make a single button image look like they're pressed.

 

is it possible to lower the button a few pixel on press? or animate the button? lmk :)

Link to comment
Share on other sites

Tweening scale will be easiest way i think
button.events.onInputDown.add(this.onInputDown, this);function onInputDown(button) {    game.add.tween(button.scale).to({x: 0.8, y: 0.8}, 200, Phaser.Easing.Cubic.Out, true)    game.add.tween(button.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Cubic.Out, true, 200)}

 

 
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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