Vector2 - Mtax-Development/GML-OOP GitHub Wiki

Description

Constructs a Vector container for x and y coordinate pair.

It is a universal constructor containing two values that can be expressed on a two-dimensional plane, horizontal as x and vertical as y. Examples of what these values represent include positioning, speed, or graphical and mathematical values.

Scale is a similar constructor with the same properties, but for a more specific purpose.
Vector4 is a similar constructor with two sets of such values.

Specification

Destruction
Elements
Garbage Collection
None

Properties

Name
Type
Default
Modifiable
x
undefined
Yes
y
undefined
Yes

Construction types

Name
Arguments
Argument note
Two numbers
x {real}
y {real}
One number for all values
{real} value
From array
array {real[]}
Array positions will be applied depending on its size:
1: array[0] will be set to x and y.
2+: array[0] will be set to x, array[1] will be set to y.
From Scale
scale {Scale}
Empty
Constructor copy
other {Vector2}
⚠️ **GitHub.com Fallback** ⚠️