Vector2i

Vector used for 2D math using integer coordinates.

Description

2-element structure that can be used to represent positions in 2D space or any other pair of numeric values.

It uses integer coordinates.

Tutorials

Methods

Vector2i Vector2i ( int x, int y )
Vector2i Vector2i ( Vector2 from )

Constants

  • AXIS_X = 0 --- Enumerated value for the X axis.
  • AXIS_Y = 1 --- Enumerated value for the Y axis.
  • ZERO = Vector2i( 0, 0 ) --- Zero vector.
  • ONE = Vector2i( 1, 1 ) --- One vector.
  • LEFT = Vector2i( -1, 0 ) --- Left unit vector.
  • RIGHT = Vector2i( 1, 0 ) --- Right unit vector.
  • UP = Vector2i( 0, -1 ) --- Up unit vector.
  • DOWN = Vector2i( 0, 1 ) --- Down unit vector.

Method Descriptions

Constructs a new Vector2i from the given x and y.


Constructs a new Vector2i from Vector2. The floating point coordinates will be truncated.