phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.35k stars 491 forks source link

refresh frame of buttons doesnt work #499

Open LuisBonsembiante opened 6 years ago

LuisBonsembiante commented 6 years ago
samme commented 6 years ago

Do you know if it has ever worked that way?

LuisBonsembiante commented 6 years ago

I dont know but must be...if you need change the frameName in dynamic way is a bad design.

photonstorm commented 6 years ago

No, it has never worked like this. Button frames should be linked to input events really, so if the button is re-enabled AND the pointer isn’t over it, only then should it change the frame.

LuisBonsembiante commented 6 years ago

ok thanks I will change the framename manually if states change

photonstorm commented 6 years ago

I think it's a good idea, I just think it needs to check both things (enabled + over) before changing frame.

LuisBonsembiante commented 6 years ago

Thanks @photonstorm your awesome

LuisBonsembiante commented 6 years ago

Hi guys, Hi @photonstorm .. I have an issue for this....I implemented the solution but the button doesnt refresh the frame inmediately.. the refresh happen in some opportunities whe I move de pointer... I dont know what is the bug...could you help me?.

LuisBonsembiante commented 6 years ago

Hi guys any thought about this?....thanks in advance. @photonstorm

LuisBonsembiante commented 6 years ago

I found the error, I just replaced element.input.enabled for element.inputEnabled