How to add a "Widget" in a extended UUserWidget.
After extending a UUserWidget class and set it to the parent class in the WidgetBlueprint. How can i add a new member to that Widget as i whould a component for a actor?
asked Nov 10 '14 at 01:03 AM in C++ Programming
I am not sure you can really easily force widgets onto the scene without changing engine code.
Alternatively you could though manually add the widgets you want in UMG and then catch them in code and do things with them.
I have started doing this in places in our code now. I wrote a menu slate widget (and UMG version) to handle lots of common stuff we needed and my extended UserWdiget class searches for the first widget with this type and binds to it.
I do this in RebuildWidget, after the super.
I do this so that we can put our menu widget in any layout choice we want without me having to change code. But once they added it I then can change anything else I want. I progamatically add the relevant menu items, what to do on the click op options, what the keyboard/controller/touch input mean, handle the localization etc.
This approach might help you here, sure you have to manually add the widgets you want, but since you probably only have to do this one or twice, its usually not too bad a headache.
Let me know if this is helpful at all and if you want any more information about what I have done.
answered Nov 10 '14 at 10:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here