Vector4 - Mtax-Development/GML-OOP GitHub Wiki

Description

Constructs a Vector container for two x and y coordinate pairs.

It is a universal constructor containing two sets of values expressing two points on a two-dimensional plane, horizontal as x and vertical as y. This is the minimum information request to construct a rectangular shape in such space, which is the usual use of this constructor.

Vector2 is a similar constructor with only one set of such values.

Specification

Destruction
Elements
Garbage Collection
None

Properties

Name
Type
Default
Modifiable
x1
undefined
Yes
y1
undefined
Yes
x2
undefined
Yes
y2
undefined
Yes

Construction types

Name
Arguments
Argument note
Four numbers
x1 {real}
y1 {real}
x2 {real}
y2 {real}
One number for all values
{real} value
Number pair
first {real}
second {real}
First number will be set to x1 and y1.Second number will be set to x2 and y2.
From array
array {real[]}
Array positions will be applied depending on its size: 1: array[0] will be set to all values. 2: array[0] will be set to x1 and y1, array[1] will be set to
x2 and y2. 4+: array[0] will be set to x1, array[1] will be set to y1, array[2] will be set to x2, array[3] will be set to y2.
From Scale or Vector2
other {Scale|Vector2}
Vector2 pair
first {Vector2}
second {Vector2}
Empty
Constructor copy
other {Vector4}
⚠️ **GitHub.com Fallback** ⚠️