🔢Vec2

Vec2 metatable

Fields

Name
Type
Description

x

number

y

number

Vec2(x: number, y: number): Vec2

Name
Type
Description

x

number

y

number

Create a new Vec2.


Vec2(): Vec2

Create a new Vec2(0,0).


:__tostring(): string


:__add(other: Vec2|number): Vec2

Overload for operator +

Name
Type
Description

other


:__sub(other: Vec2|number): Vec2

Overload for operator -

Name
Type
Description

other


:__div(other: Vec2|number): Vec2

Overload for operator /

Name
Type
Description

other


:Length(): number

Returns the length of the vector.


:Get(): number, number

Returns x, y of this vector.


:GetX(): number

Returns x of this vector. The same as Vec2.x.


:GetY(): number

Returns y of this vector. The same as Vec2.y.


:SetX(value: number): nil

Name
Type
Description

value

number

Sets x. The same as Vec2.x = value.


:SetY(value: number): nil

Name
Type
Description

value

number

Sets y. The same as Vec2.y = value.

Last updated