x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

alt text

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. alt text

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!

Best regards

Product Version: UE 4.20
Tags:
more ▼

asked Nov 08 '18 at 07:03 PM in Blueprint Scripting

avatar image

Paranoya84
3 1 2

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Nov 09 '18 at 08:24 PM

avatar image

MajinSephiroth
1.2k 31 8 32

avatar image Paranoya84 Nov 11 '18 at 12:23 PM

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

(comments are locked)
10|2000 characters needed characters left

Hey, Paranoya84

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

alt text

setbrush.png (69.8 kB)
more ▼

answered Nov 09 '18 at 02:26 PM

avatar image

Sertac Ogan
1.5k 30 10 46

(comments are locked)
10|2000 characters needed characters left

Hello Sertac,

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

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

more ▼

answered Nov 09 '18 at 07:21 PM

avatar image

Paranoya84
3 1 2

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question