Get size of UMG widget
Hey, I want to get the size of a widget inside a child class of UHorizontalBox in C++. Is that possible?
I have found out, that there are two different approaches for this question.
But this only works, if the UUserWidget* ExamplePanelWidget actually has an UCanvasPanelSlot, for example if you're using an Overlay or HorizontalBox.
You can see the kind of Slot in the UMG Blueprint, if you select the widget and go to the Details-Panel, for example:
2.:You can get the size during runtime from the Geometry of the widget:
But if you try this before the Geometry of the Widget was calculated the first time -- for example during BeginPlay -- you will get a zero vector.
answered Apr 16 '17 at 11:56 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here