rolandino Posted July 20, 2014 Share Posted July 20, 2014 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); this.add(this.levelText); this.levelText.setText(Globals['level'].toString()); And turn it into a Phaser Button. Or, just detect when it's been clicked on .... Any suggestions anyone? Thanks, R Link to comment Share on other sites More sharing options...
Dumtard Posted July 20, 2014 Share Posted July 20, 2014 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.http://www.html5gamedevs.com/topic/7837-how-do-i-align-text-with-a-sprite/?hl=text Link to comment Share on other sites More sharing options...
rolandino Posted July 20, 2014 Author Share Posted July 20, 2014 Doh. Simples. Thanks v much for the reply. Link to comment Share on other sites More sharing options...
Recommended Posts