Change Button Image with Blueprint, no Asset available, why?

Hello,

currently I’m working with WidgetSwitcher to have a persitent existing menu on the left side and add a central widget, depending on which button is clicked.
After a button1 is clicked, I want to change it’s style to be pressed until button1 is clicked again (which means a “release” and the central widget disappears) Everything is working fine, except of the button image swap.

Now I figured out function Set Button Hardware, but there is no possibility to get an existing asset, also not from the content browser directly.

258880-noassetavailable2.png

Any ideas what I’m doing wrong or which requirements aren’t met, I can’t find some related answers in the archive/google.
(Only Cannot select Image Asset in UMG Blueprint - UI - Unreal Engine Forums which isn’t marked as solved or answered proper for beginners)

Thanks for your advice!

Best regards

Hey, Paranoya84

You can use SetBrush node instead of Set Variable like this.

1 Like

Hello Sertac,

thanks for your advice, but that only works with images:

Like I tried to described, there is a menu with 5 buttons on the left side and I’m currently using a Widget Switcher to change the main widget (like a frame) in the center of the widget.
The buttons are working with 3x different images, normal, hover and pressed. After Button 1 is hit it keeps normal style, but I want so stay the button in pressed style as long as it’s widget is displayed in the center. Maybe there is another approach, but I haven’t figured out a proper solution yet.

Thanks a lot for your time!

Best regards,
Paranoya

You have various options in cases like this, I’m going to present you two possible options, both are viable.

  1. Implement your own UMG Button.

By default, you cannot create widget of base widget types (checkbox, button, text, etc). What you would do in this case is create your own button widget to mimic the functionality of a UMG button (along with your own implementation of functions and event dispatchers). That way, you can call “create widget” on your own custom button widget and place the buttons programatically in various containers of a main widget.

  1. Use checkbox.

A checkbox has two modes, the regular checkbox mode and a toggle button mode. The toggle button mode is what it sounds like. Has two states (on and off) which it keeps track of. You can use this for features like tabs. You would need to implement your own logic for turning multiple ones off in case you create tabs.

hello Majin,

I’ve already read about checkboxes but I hoped to figure out to change button appearance with blueprint. I’ll use checkbox instead. Thanks a lot for your time and answer!

Best regards

Is this what you wanted to do?

Tutorial with a solution to set image in Button: