Thanks for explaining the workflow used for your games Nick! It will help while we wait for the reusable styling
Slate is definitely not more productive, even with re-usable styling.
The recommended approach is to make a widget style it, and re-use that user widget. Just allowing the Style objects to be re-used wouldn’t be that great. They’re old and designed for Slate, they don’t have concepts like animation, there’s no way to embed animation tracks into them. They have little in the way of state transition concepts. To get all that, I could make a new kind of button user widget, re-expose the clicked, embed all the styling data I want, state transitions and animation I want into a user widget, add a named slot to allow content to be added to it, and now I’ve got a styled, re-usable button.
I want to be able to re-use all of that animation and state logic in any kind of styling system we make. I also want to be able to do overrides on individual options, but that’s difficult to do with UProperties, because they have no internal way of knowing if they were set by the user and should therefore function as an override. It also has to be not a nightmare for users to make their own style sets for their own custom widgets. Likely - you’re talking a whole new set of widgets with a brand new styling system on them.
Np
Thanks Nick.
As always very useful information for UMG.
Now I understand that I have to build UMG user widget to get the stuff done.
I basically try in UMG user widget in editor but I can t get something working. I don’t know how to create public event, create properties that sync etc… I may follow the c++ road with UMG widget that implement my classes, maybe because I m more familiar to it and it easy to find sample in the current widget that you put in place.
Have a great day !
Hi,
I tried to do a quick test with a widget that derived from TextBlock and I add a enum to select predefined style that I’m adding in my StyleObject.
In SynchronizeProperties, I called MyTextBlock->SetTextStyle with the one that I selected but it has no effect on the widget.
The SetTextStyle is done after calling Super::SynchronizeProperties so it’s not overriden by the “current” textblock implementation.
Any idea of what I should do to reflect style changes?
Thanks,
But, what about if you want a common style for buttons for example. Then you’d have to edit EVERY SINGLE BUTTON IN THE APPLICATION.
Nah, most people make a new button, encased in a UUserWidget, or they derive from SButton and make a new UWidget that has built in style options.
I understand that creating a ‘parent’ widget for e.g. button with certain style and reusing it is the recommended approach, but how to preview buttons or other elements created this way while designing in UMG? Current system doesn’t allow to preview things like text on a button (Thread about the issue: HERE)
Is Play In Editor the only option to see how our buttons will look with corresponding text on them?
I Saw on trello that UMG Styling has been planned to be done in March: Trello
Does this job has been completed? can we expect this for 4.12?
Thanks,
Nope. Mainly what we’ve done is Performance and stability.
Hey, any news on this?
Nope. You can always make your own UserWidget base class that has an event you run at design time.