UI position
There are two types of positions - Anchor
and Offset
. Both have Min
and Max
. Min
value is the bottom left corner position, and Max
is the top right one. Both Min
and Max
have X and Y values and are such string: "X Y"
.
Anchors are numbers that represent width and height in percents (%) from 0.0 (0%) to 1.0 (100%).
Offsets are accurate values that are width and height in pixels relative to 1280x720. Example: You made a 100x100 box for 1280x720 and if you switch to 2560x1440, it will be 200x200 pixels.
Anchors are applied before offsets. If you want offsets to be relative to the screen center, make all anchors 0.5 0.5
so that both corners are in the center. Then to make a 100x100 box you should use offsets -50 -50
for bottom left corner and 50 50
for top right one.