Number2

A Number2 contains 3 number values (X & Y). It can represent different things in 2D space, like points or positions.

Constructors

Number2 ( number x, number y )

Creates a Number2 with values x and y.

local myNumber2 = Number2(1, 2)

Functions

Returns a copy of the Number2.

local n1 = Number2(1, 0, 0)
local n2 = n1 -- n2 is not a copy but a direct reference to n1
n2.X = 10
print(n1.X) -- now n1.X == 10

-- using Copy:
local n1 = Number2(1, 0, 0)
local n2 = n1:Copy() -- n2 is a copy of n1, they're not the same Number2
n2.X = 10
print(n1.X) -- n1.X is still 1

Properties

Same as Y property.

Same as X property.

X value of the Number2.

myNumber2.X = 42
print(myNumber2.X)

Y value of the Number2.

myNumber2.Y = 42
print(myNumber2.Y)