GetLocalLeft()
Returns the x coordinate of the left edge of this RectTransform in its parent's coordinate space.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public float GetLocalLeft()
Returns
Type | Description |
|---|---|
| float | The x coordinate of the left edge, measured from the lower-left corner of the parent RectTransform's rect. If there is no parent RectTransform, returns the value relative to the element's own rect origin. |
Remarks
All four edge-position methods — RectTransform.GetLocalBottom, RectTransform.GetLocalTop, RectTransform.GetLocalLeft, and RectTransform.GetLocalRight — share the same coordinate system, whose origin is at the lower-left corner of the parent rect. Use RectTransform.SetLocalLeft to move the left edge to a specific position without changing the element's size.
Additional Resources: RectTransform.GetLocalBottom, RectTransform.GetLocalRight, RectTransform.SetLocalLeft.