Vector2i¶
A 2D vector using integer coordinates.
Description¶
A 2-element structure that can be used to represent 2D grid coordinates or any other pair of integers.
It uses integer coordinates and is therefore preferable to Vector2 when exact precision is required. Note that the values are limited to 32 bits, and unlike Vector2 this cannot be configured with an engine build option. Use int or PackedInt64Array if 64-bit values are needed.
Note: In a boolean context, a Vector2i will evaluate to false
if it's equal to Vector2i(0, 0)
. Otherwise, a Vector2i will always evaluate to true
.
Tutorials¶
Properties¶
|
||
|
Constructors¶
Vector2i ( ) |
|
Methods¶
abs ( ) const |
|
aspect ( ) const |
|
length ( ) const |
|
length_squared ( ) const |
|
max_axis_index ( ) const |
|
min_axis_index ( ) const |
|
sign ( ) const |
|
Operators¶
operator != ( Vector2i right ) |
|
operator % ( Vector2i right ) |
|
operator % ( int right ) |
|
operator * ( Vector2i right ) |
|
operator * ( float right ) |
|
operator * ( int right ) |
|
operator + ( Vector2i right ) |
|
operator - ( Vector2i right ) |
|
operator / ( Vector2i right ) |
|
operator / ( float right ) |
|
operator / ( int right ) |
|
operator < ( Vector2i right ) |
|
operator <= ( Vector2i right ) |
|
operator == ( Vector2i right ) |
|
operator > ( Vector2i right ) |
|
operator >= ( Vector2i right ) |
|