Change Button Image with Blueprint, no Asset available, why?
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.
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 https://answers.unrealengine.com/questions/395885/cannot-select-image-asset-in-umg-blueprint.html which isn't marked as solved or answered proper for beginners)
Thanks for your advice!
asked Nov 08 '18 at 07:03 PM in Blueprint Scripting
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.
2) 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.
answered Nov 09 '18 at 08:24 PM
You can use SetBrush node instead of Set Variable like this.
answered Nov 09 '18 at 02:26 PM
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
answered Nov 09 '18 at 07:21 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here