Vector2int16

Constructors

NameDescription
new(x: number,y: number)Returns a Vector2int16 from the given x and y components. Non-integer components are rounded down. Each component must fall within the signed 16-bit integer range of -32,768 to 32,767; values outside this range cause integer overflow.

Code Snippet

local chunkPosition = Vector2int16.new(12, -4)
print(chunkPosition.X, chunkPosition.Y) --> 12  -4

local nextChunk = chunkPosition + Vector2int16.new(1, 0)
print(nextChunk) --> 13, -4

Properties

NameTypeDescription
XnumberThe x-coordinate of the Vector2int16, also accessible in its lower-case variant.
YnumberThe y-coordinate of the Vector2int16, also accessible in its lower-case variant.