- Home /
How to make a UI Panel be anchored to top-Left with offset?
The problem is - panels are not direct children of Canvas, they are aranged in this hierarchy :
So, the GameMenu panel does not resize on resolution change. Speaking of which, all my UI size data is hardcoded from editor, is this a bad way to do it? It won't change on higher resolutions, will it? Then, what is the proper way to do it?
EDIT: i now know it works if you make all panels direct children of a canvas, but it is more convinient to use a container
Answer by IgnoranceIsBliss · Jun 17, 2017 at 12:49 PM
All objects can be anchored to the top-left of their parent, regardless of how deep they are in the hierarchy.
Make sure the parent (GameMenu) is set to stretch along both X and Y axes and take up the whole space (this way, the parent is the size of the whole screen).
Set the alignment of WavesBanner to 'Top Left'
Set the pivot for WavesBanner to '0','1', which means that you're placing the object based on the top-left corner.
Your answer
