phaser-ce icon indicating copy to clipboard operation
phaser-ce copied to clipboard

refresh frame of buttons doesnt work

Open LuisBonsembiante opened this issue 7 years ago • 9 comments

  • A bug in the API:
    • Phaser version(s):Phaser CE
    • What should happen: Button input.enabled= false/true take the correct frame;
    • What happens instead: Just mantain the down frame dont refresh when enabled again

LuisBonsembiante avatar Mar 16 '18 16:03 LuisBonsembiante

Do you know if it has ever worked that way?

samme avatar Mar 16 '18 20:03 samme

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

LuisBonsembiante avatar Mar 16 '18 20:03 LuisBonsembiante

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.

photonstorm avatar Mar 16 '18 22:03 photonstorm

ok thanks I will change the framename manually if states change

LuisBonsembiante avatar Mar 17 '18 04:03 LuisBonsembiante

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

photonstorm avatar Mar 17 '18 16:03 photonstorm

Thanks @photonstorm your awesome

LuisBonsembiante avatar Mar 19 '18 12:03 LuisBonsembiante

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 avatar May 22 '18 13:05 LuisBonsembiante

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

LuisBonsembiante avatar Jun 28 '18 15:06 LuisBonsembiante

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

LuisBonsembiante avatar Jun 28 '18 15:06 LuisBonsembiante