Vec2() - newo2001/HTML5-Canvas-Wrapper GitHub Wiki
Creates a Vec2 object.
A float (or int) value to represent the length of the vector's x-component.
A float (or int) value to represent the length of the vector's y-component.
If y is not set it will be initialized with the value of the vector's x-component.
A new Vec2 with the specified lengths.
Creates a Vector of which the x-component is 1.5 long and the y-component is 5.0 long.
new Vec2(x, [y])
let vec = new Vec2(1.5, 5);
- This is the constructor for the Vec2 type.