In BrickVerse, the Vector2
datatype is often used in working with GUI elements and 2D mouse positions.
Vector2.new ( number x, number y ) |
---|
Returns a Vector2 from the given x and y components. |
Vector2 Vector2.zero |
---|
A Vector2 with a magnitude of zero. This API member is a constant, and must be accessed through the
|
Vector2 Vector2.one |
---|
A Vector2 with a value of 1 on every axis. This API member is a constant, and must be accessed through the
|
Vector2 Vector2.xAxis |
---|
A Vector2 with a value of 1 on the X axis. This API member is a constant, and must be accessed through the
|
Vector2 Vector2.yAxis |
---|
A Vector2 with a value of 1 on the Y axis. This API member is a constant, and must be accessed through the
|
number Vector2.X |
---|
The x-coordinate of the Vector2. |
number Vector2.Y |
---|
The y-coordinate of the Vector2. |
number Vector2.Magnitude |
---|
The length of the vector. |
Vector2 Vector2.Unit |
---|
A normalized copy of the vector. |
number Vector2:Cross ( Vector2 other ) |
---|
Returns the cross product of the two vectors. |
number Vector2:Dot ( Vector2 v ) |
---|
Returns a scalar dot product of the two vectors. |
Vector2 Vector2:Lerp ( Vector2 v, number alpha ) |
---|
Returns a Vector2 linearly interpolated between this Vector2 and v by the fraction alpha |
Vector2 Vector2:Max ( Tuple others... ) |
---|
Returns a
|
local b = Vector2.new(2, 1) |
print(a:Max(b)) -- Vector2.new(2, 2) |
Vector2 Vector2:Min ( Tuple others... ) |
---|
Returns a
|
print(a:Min(b)) -- Vector2.new(1, 1) |