Hand-written by Joseph San Nicolas, Roblox Developer
Vector2int16
Constructors
| Name | Description |
| 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
| Name | Type | Description |
| X | number | The x-coordinate of the Vector2int16, also accessible in its lower-case variant. |
| Y | number | The y-coordinate of the Vector2int16, also accessible in its lower-case variant. |