Vector2
2D points such as screen pixels and UI anchors
Constructors
1 member Access: shared
- new
(x: number, y: number) -> vector make a 2d vector
Parameters
Name Type Description x number — y number — returns vector —
2D Vector Arithmetic and Screen Bounds
Lifecycle: Shared
Screen-space bounds subtract like any other vector to give a size.
Luau
local min = Vector2.new(0, 0)local max = Vector2.new(1920, 1080)local delta = max - minprint(string.format("Resolution delta: %d x %d", delta.x, delta.y)) Output: Resolution delta: 1920 x 1080