I'm working on porting a game that was originally made to work in some resolutions, but now I have to support resizing (hence changing aspect ratio) during gameplay.
GUI elements are anchored so everything looks good when you start the game at a specific resolution. Also, UIRoot is set to FixedSize.
For supporting resizing I made a generic script that changes the Manual Height of the UIRoot proportionally with the new aspect ratio. So for example, when the window is rescaled to a narrower aspect ratio, the gui elements would be scaled to a smaller size to fit the width (imagine a horizontal toolbar of buttons that need to fit the width).
The problem with this solution is that some elements have a delta in their Y position to be properly positioned beneath another element, and changing the Manual Height of the UIRoot won't change this delta, so I end up with elements in wrong position or under other elements.
Is there a way to "reload" these elements, so their position and size can be recalculated based on the new aspect ratio?