How to Unity
The Ultimate Guide to Unity UI Rect Transform
Unity UI Rect Transform is your friend
Similarly to other game objects in Unity, also UI elements have a transform component, but due to their intrinsically different nature, this transform is way different from the others.
Unity UI elements have a Rect Transform (Rect stands for rectangle). Let’s look at it.
Position
The position (Pos) parameters are not quite the same as in a regular game object, in fact, they strictly depend on the choice you make with the top-left button, Anchors Presets.
Anchor
A choice in this menu would move the white cross you can see on the scene, on the selected Unity UI element. This is its anchor point. In other words, once the anchor is set, let’s say in the top-left corner of the canvas, the position parameters measure the UI element position in terms of distances (x, y, z) from that point.
This leads to another, extremely interesting question:
How are these distances measured?