playif / play_phaser

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

text no change #10

Closed Gi972 closed 9 years ago

Gi972 commented 9 years ago

Hello,

I tried your example basic_02_click_on_an_image, click makes nothing .


Other thing:

create(){
   image = mygame.add.sprite(mygame.world.centerX, mygame.world.centerY, 'man');
   image.anchor.set(0.5,0.5);
   image.inputEnabled = true;
   image.events.onInputDown.add(listener);
   texty = mygame.add.text(250, 16,"click on picture", new TextStyle(fill:'#ea4c89'));
   texty.setText("I changed");
}

setText("I changed") doesnt. (refresh text or on console)


Other thing:

create(){
  image = mygame.add.sprite(mygame.world.centerX, mygame.world.centerY, 'man');
  image.anchor.set(0.5,0.5);
  image.inputEnabled = true;
  image.events.onInputDown.add(listener);
  texty = mygame.add.text(250, 16,"click on picture", new TextStyle(fill:'#ea4c89'));
}

when a use a listener

listener(Sprite s, Pointer p){
   counter++;
    texty.setText("change");
    texty.text= "change $counter";
    Dom.window.console.log(texty.text);
}

Text change only I use setTex() and texty.text both. If I use only setText("changed") or texty.text = "changed", it doesnt

remark: when I look the console texty.text change but no refresh the picture, but setText() make nothing.

I hope you understand and helped you.

Gi

playif commented 9 years ago

Hi @Gi972 I have upgraded the package to 0.11.0. Please let me know if the bug is not fixed.

Gi972 commented 9 years ago

It works Good job! thanks