Table of Contents

Class UI

Namespace
MagicUI.Core
Assembly
MagicUI.dll

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

Rect

Properties

Perpetua

The Perpetua font

public static Font Perpetua { get; }

Property Value

Font

TrajanBold

The Trajan Bold font

public static Font TrajanBold { get; }

Property Value

Font

TrajanNormal

The Trajan Normal font

public static Font TrajanNormal { get; }

Property Value

Font

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 Vector2

The position in parent space

elementSize Vector2

The size of the element

parentSize Vector2

The size of the element's parent

Returns

Vector2

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

pos Vector2

The position in screen space

elementSize Vector2

The size of the element

Returns

Vector2

Remarks

Reference screen space is the coordinate system with (0, 0) in the top-left and (1920, 1080) in the bottom-right.