UMG - Slate style texture swapping
Sorry if this has been asked, but can a Texture of Material Asset in a Slate Style be changed at run-time by a function in a blueprint widget?
I expected Set Texture to be exposed, as a component,but only Set Text seems be available
For instance, if I wanted to have a texture pulse while waiting for a button to be clicked or swap from red when pressed to green until pressed again.
asked Aug 20 '14 at 07:05 AM in Blueprint Scripting
So the issue currently is that styles are assets, as they should be. But because of that we need to go to some lengths in the API to make it trivial to create dynamic versions of those assets at runtime so that you can do things like, make a standard button style, but override this one thing only when it's Tuesday.
The style system is a hold-over from the raw slate days, and we wont likely be able to address it with a new more awesome system until post October.
That being said, there are some solutions you can currently use, and I should have time before 4.5 to make them improved, but not radically different.
For 4.5, what I'm going to try and do is get in a way for you to at least clone a style, maybe it get cloned on access, not sure yet. Anyway, you'd get the cloned style, then you'd have the freedom to access the material on it and replace it with a dynamic instance that lets you adjust the properties on it...etc.
For Far Future, the plan is to have some kind of appearance system. Where instead of it being just an asset like a style, it's a blueprint, with logic. Then you could create a FlashyButtonAppearance class that extends from ButtonAppearance. Now any button can have this appearance, and it has the capability sniff all of slates and the buttons state in order to change how it appears.
Thoughts / Ideas?
Follow this question
Once you sign in you will be able to subscribe for any updates here