Class UI
Class containing various UI utilities and constants
public static class UI
- Inheritance
-
UI
- Inherited Members
Fields
Screen
A rectangle representing the screen
public static readonly Rect Screen
Field Value
Properties
Perpetua
The Perpetua font
public static Font Perpetua { get; }
Property Value
TrajanBold
The Trajan Bold font
public static Font TrajanBold { get; }
Property Value
TrajanNormal
The Trajan Normal font
public static Font TrajanNormal { get; }
Property Value
Methods
UnityParentRelativePosition(Vector2, Vector2, Vector2)
Converts a position in parent space to a unity position
public static Vector2 UnityParentRelativePosition(Vector2 pos, Vector2 elementSize, Vector2 parentSize)
Parameters
pos
Vector2The position in parent space
elementSize
Vector2The size of the element
parentSize
Vector2The size of the element's parent
Returns
Remarks
Parent space is the coordinate system with (0, 0) in the top-left and (W, H) in the bottom-right, where W is the width of the parent and H is the height of the parent
UnityScreenPosition(Vector2, Vector2)
Converts a position in reference screen space to a unity position
public static Vector2 UnityScreenPosition(Vector2 pos, Vector2 elementSize)
Parameters
Returns
Remarks
Reference screen space is the coordinate system with (0, 0) in the top-left and (1920, 1080) in the bottom-right.