Download

UMG - How to switch a buttons image(slate widget style)

Hi all…

Im trying to switch a buttons style (slate widget style) in event graph UMG For example. i have 6 buttons used, displaying a graphics with lvl 1, lvl2, lvl3 and so on… and i have a locked graphic on lvl 2, lvl3 and so on Which is displayed until you have completed the level before it. i have all that already setup. But im unable to get the graphic to change, i cant seem to find any blueprint node for changing the button’s style widget .

13715-example_lvlload.jpg

Thanks in advanced for any advice.

Hey soulmapp, awesome looking UI. We still need to make a pass and fill out setters for all the properties. Setting the style dynamically is one of the ones that didn’t make it into 4.4.

Great… looking forward to it… many thanks

Scratch what I said previously - so in order to be better in line with the plan for the future. The ability to change the style will be pretty minimal, you’ll only be able to mutate the style (so that setting the dynamic material instance is possible). My recommendation would be to make those level buttons their own widget and to change the visibility of an Image widget that sits above them in an overlay. The plan for the future is to introduce a much more customizable style system, and allowing users to set the style at runtime will conflict with that and make it much harder to preserve backwards compatibility.

I understand what you are saying, Nick, but what if we are using an icon system and have over 400 icons? Are you suggesting that we will need to create 400 image overlays for each block in our system in order to have the image swap out correctly?

Nevermind, Nick. I haven’t had enough coffee this morning and misread what you were saying. Instead of changing the visibility of the image widget, you may use a set texture to change the texture to the asset that you want.

Yup, that’s what I was going for :slight_smile: