lovr.math.newVec2

Creates a new 2D vector. This function takes the same arguments as Vec2:set.


v = lovr.math.newVec2(x, y)

Arguments

NameTypeDefaultDescription
xnumber0 The x value of the vector.
ynumberx The y value of the vector.

Returns

NameTypeDescription
vVec2 The new vector.

v = lovr.math.newVec2(u)

Arguments

NameTypeDescription
uVec2 A vector to copy the values from.

Returns

NameTypeDescription
vVec2 The new vector.

See also