How to customize disable state in UMG?

I want to change style of button when it is disabled. How to do it?

You need to make a separate UMG blueprint of only the button with the style that you want it to be when it is disabled. Make a local variable inside of your main UMG blueprint and set its type to be your newly created UMG button style BP that you made. Then on whatever event you call or however you get to it being disabled, drag the main button that you want to be changed towards the end of your function or after a sequence and drag off of the pin and type in set style, grab the variable referencing your disabled button and drag off and type get style. Drag from the get style into the button you want to change set style node and there you have it.

also make sure your button in your main UMG BP is a variable

Maybe I did not express myself so well. When I switch off button, it becomes gray. I want to color it has not changed. More precisely. I need to disable all events, but that appearance should remain unchanged.

47751-3.png

I made transparent button. But when I switch off button, the image below is obscured. Even in this options, the problem remains unsolved.

I want the picture in full color. At the same time, I want to disable mouse events.

47752-5.png

But I get it:

47753-4.png

My blueprint is very simple:

47754-6.png

I found a solution. I just need to hide the button.

I’m still not entirely sure what it is you’re trying to do but did you intend for the CellImage NOT to be parented to the CellButton, or did you want the CellImage to be on the button and disappear when the button does? I’m sorry I’m just having a hard time understanding the goal, if you had pictures of the entire UMG Designer Tab and illustrate what you want done I believe I can help

Oh now I understand, yeah that is mainly to grey out an option you can’t select
This is a small work around you can do, just the base, the rest is decided by what you want to happen when the button is either interactive or not interactive.

just use whatever event(in this case a second button) to toggle a Boolean that allows the buttons function to pass through, I believe that greying out of the button is intentional just for the reason it signifies it cant be interacted with, hopefully this small work around sets you on the right path

Yes, that works too. Thanks. Bad that it does not work out “of the box”. Here, in the answers I’ve seen screenshots from the old version (~4.6). There has been a style for the off-state (disabled). Why it was removed?

I have no clue, it may just be because that is how most people imagine an inactive button, just being grayed out, the widget style and brush blueprints are also essentially useless since everything is done in the designer tab, maybe it just wasn’t a necessary customization

Some UnrealEngine decisions look for me as really out of any common sense, so does the “Behavior - Is Enabled” check box which “greys out” visuals.

So, to really enable/disable widget interactivity against mouse actions use “Behavior - Visibility” combo-box (or “Set Visibility” blueprint node) with
Values:

  • “Visible” - presented on screen and accept mouse actions;
  • “Hit Test Invisible” - presented on screen, but DO NOT accept mouse actions including children;
  • “Self Hit Test Invisible” - presented on screen, but DO NOT accept mouse actions excluding children, so for this widget only;

But still for some reason game engine developers skip “non-visible, but clickable” areas.

4 Likes