Class Vec2

A x y coordinate

Functions

Vec2.new (x, y) Creates a new Vector2.

Fields

Vec2.x The x of the Vector
Vec2.y The y of the Vector

Methods

Vec2:add (adds) Adds 2 Vec2s.
Vec2:mul (scalar) Multiplies a Vec2 by a scalar.


Functions

Methods
Vec2.new (x, y)
Creates a new Vector2.

Parameters:

  • x float the x position
  • y float the y position

Returns:

    Vec2 the new Vector

Fields

Vec2.x
The x of the Vector
Vec2.y
The y of the Vector

Methods

Vec2:add (adds)
Adds 2 Vec2s.

Parameters:

  • adds Vec2 the second Vector

Returns:

    Vec2 the sum of the two Vectors
Vec2:mul (scalar)
Multiplies a Vec2 by a scalar.

Parameters:

  • scalar float the scalar

Returns:

    Vec2 the product of the Vector and scalar
generated by LDoc 1.5.0 Last updated 2024-05-23 11:40:37