I'm trying to build an GUI that will work with both Landscape & Portrait mode, so when the user rotates the screen the layout will still work.
This would be simple to use anchors to fill the screen, but I'm using multiple UIPanel with their own backgrounds that are animated in/out.
I can have all UIPanels -> Background anchored and set to OnStart, this will set the Background for the specific panel to the device size. But the issue occurs when user switches to Landscape mode. Then the Background is at the wrong size.
If I change the background update to OnUpdate it will fill the screen. But when animate the UIPanel in/out it will mess up the view.
Hierarchy:
UI Root (2D)
- Camera
- ... some stuff ...
- Views (UIPanel)
- MyScreen (UIPanel)
- text and images
- Background (UITexture) <! -- this one
- MyOtherScreen (UIPanel)
- text and images
- Background (UITexture) <! -- this one
How should I solve this problem?
Tried setting Background manually with Camera.pixelWidth or UIPanel.localCorners without success.