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.
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.
You have various options in cases like this, I’m going to present you two possible options, both are viable.
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.
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.
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!