Jump to content

Convert Bitmap Text into a Button ?


Recommended Posts

I have a sneaky feeling that there's an example for this somewhere and I've just missed it. Apologies if that's the case. This is what I'd like to do:

Create some bitmap text:

this.levelText = this.game.add.bitmapText(0, t_sb_y+70, 'myfont', '', 18);



And turn it into a Phaser Button.

Or, just detect when it's been clicked on ....

Any suggestions anyone?



Link to comment
Share on other sites

Same way you would an image such as this.

this.levelText = this.game.add.bitmapText(0, t_sb_y+70, 'myfont', '', 18);this.add(this.levelText);this.levelText.setText(Globals['level'].toString());this.levelText.inputEnabled = true;this.levelText.events.onInputDown.add(listener, this);function listener() {  console.log('clicked');}

Or you could align the BitmapText with a Phaser.Button like this thread discusses.


Link to comment
Share on other sites


  • Recently Browsing   0 members

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