HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.97k stars 434 forks source link

Add disabled status to FlxButton #3083

Closed itulau closed 6 months ago

itulau commented 6 months ago

A very common feature that is missing from FlxButton which I think would be beneficial to have: A DISABLED state for FlxButton which would make the button ignore inputs and be displayed as being unable to be clicked (greyed out).

Vortex2Oblivion commented 6 months ago

Would it be a good idea to add a disabled state to more flixel ui stuff Like FlxUICheckBox for example? Would need to make a pr on the flixel addons and ui repositories too ofc.

Geokureli commented 6 months ago

Would it be a good idea to add a disabled state to more flixel ui stuff Like FlxUICheckBox for example? Would need to make a pr on the flixel addons and ui repositories too ofc.

We discuss this in https://github.com/HaxeFlixel/flixel/pull/3087. The changes are being made here: https://github.com/itulau/flixel-ui/commit/601bf1fe0c2cacc0bdf0773a4d9606c134f158f7

itulau commented 6 months ago

Yes, https://github.com/itulau/flixel-ui/tree/flx-button-disabled contains my latest changes which should probably remove some issues related to adding the new disabled status. What I'm missing now is a demo to test those changes, which is becoming a bit tricky since I don't use flixel-ui's classes that much so I'm not sure where to begin.

Geokureli commented 6 months ago

I don't use flixel-ui's classes that much so I'm not sure where to begin.

Try some of the demos:

Also, in your branch, I'm wondering if the toggle button graphic should have 2 disabled states, seeing how it has 2 of every other kind?