vector2

From Teverse

A vector2 represents a single point in 2D space.

Constructors

vector2

vector2 vector2(number x, number y) Creates a vector2 containing the coordinates x and y.

Example:

local vector = vector2(1, 1)
print(vector)

This would output 1,1

Properties

x

Type: number
The x-coordinate.

y

Type: number
The y-coordinate.

Methods

lerp

vector2 vector2:lerp(vector2 target, number t)
returns an interpolated copy of the vector2.
t is clamped between 0 and 1. If t is 0, the returned vector2 will be unchanged. If t is 1, the returned vector2 will be target

.