playif / play_phaser

A Dart port for Phaser 2D game engine.
MIT License
71 stars 13 forks source link

Input events broken for Text objects #20

Open derrick56007 opened 9 years ago

derrick56007 commented 9 years ago

Hi, the input events for Text objects seem to be broken example:

  create() {
    TextStyle style = new TextStyle(font:'100px Arial', fill: 'white');
    Text play = game.add.text(0, game.world.centerY, 'Play', style);
    play.inputEnabled = true;

    //this doesn't work
    play.events.onInputDown.add((a, b) {
      print("play");
    }, 1);

    Sprite sprite = game.add.sprite(game.world.centerX + 64, game.world.centerY, 'grass');
    sprite.inputEnabled = true;

    //this does
    sprite.events.onInputDown.add((a, b) {
      print("grass");
    }, 1);
  }