Skip to content

Vector2

Vector2 is a 2D vector with an x and y component, commonly used with UI.

Constructors

NameDescription
Vector2.New()Creates a new Vector.
Vector2.New(float n)Creates a new Vector2 with an X and Y value of n.
Vector2.New(float x, float y)Creates a new Vector2 with the specified values.

Properties

NameDescription
float xThe X component of the vector
float yThe Y component of the vector
float magnitudeThe length of this vector
float sqrMagnitudeThe squared length of this vector
float normalizedReturns this vector with a magnitude of 1

Methods

NameDescription
Vector2 Vector2.Lerp(Vector2 a, Vector2 b, float t)Linearly interpolates between two points.