Sets the vector to the specified values.
x value
y value
reference to this vector, for chaining.
-- Create a new Vector
local vector = osrs.Vector2.new(10, 10)
-- Print out the X and Y of the vector
osrs.print("X: " .. tostring(vector.x) .. " Y: " .. tostring(vector.y))
-- Change the x and y of the vecor using set
vector:set(15, 5)
-- Print out the X and Y of the vector
osrs.print("X: " .. tostring(vector.x) .. " Y: " .. tostring(vector.y))
StaticnewInstantiates a new Vector2.
Optionalx: numberx value, or 0 if not set.
Optionaly: numbery value, or 0 if not set.
the newly created Vector2.
Represents a 2-dimensional vector.