Attention: Here be dragons

This is the `latest` (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

# Vector2i¶

## 属性¶

 int x `0` int y `0`

## 构造函数¶

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

## 方法¶

 Vector2i abs ( ) const float aspect ( ) const Vector2i clamp ( Vector2i min, Vector2i max ) const float length ( ) const int length_squared ( ) const int max_axis_index ( ) const int min_axis_index ( ) const Vector2i sign ( ) const Vector2i snapped ( Vector2i step ) const

## 操作符¶

 bool operator != ( Vector2i right ) Vector2i operator % ( Vector2i right ) Vector2i operator % ( int right ) Vector2i operator * ( Vector2i right ) Vector2 operator * ( float right ) Vector2i operator * ( int right ) Vector2i operator + ( Vector2i right ) Vector2i operator - ( Vector2i right ) Vector2i operator / ( Vector2i right ) Vector2 operator / ( float right ) Vector2i operator / ( int right ) bool operator < ( Vector2i right ) bool operator <= ( Vector2i right ) bool operator == ( Vector2i right ) bool operator > ( Vector2i right ) bool operator >= ( Vector2i right ) int operator [] ( int index ) Vector2i Vector2i

## 常量¶

AXIS_X = `0`

X 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

AXIS_Y = `1`

Y 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

ZERO = `Vector2i(0, 0)`

ONE = `Vector2i(1, 1)`

MIN = `Vector2i(-2147483648, -2147483648)`

MAX = `Vector2i(2147483647, 2147483647)`

LEFT = `Vector2i(-1, 0)`

RIGHT = `Vector2i(1, 0)`

UP = `Vector2i(0, -1)`

DOWN = `Vector2i(0, 1)`

## 属性说明¶

int x = `0`

int y = `0`

## 构造函数说明¶

Vector2i Vector2i ( )

Vector2i Vector2i ( Vector2i from )

Vector2i Vector2i ( Vector2 from )

Vector2i Vector2i ( int x, int y )

## 方法说明¶

Vector2i abs ( ) const

float aspect ( ) const

Vector2i clamp ( Vector2i min, Vector2i max ) const

float length ( ) const

int length_squared ( ) const

int max_axis_index ( ) const

int min_axis_index ( ) const

Vector2i sign ( ) const

Vector2i snapped ( Vector2i step ) const

## 操作符说明¶

bool operator != ( Vector2i right )

Vector2i operator % ( Vector2i right )

```print(Vector2i(10, -20) % Vector2i(7, 8)) # 输出 "(3, -4)"
```

Vector2i operator % ( int right )

```print(Vector2i(10, -20) % 7) # 输出 "(3, -6)"
```

Vector2i operator * ( Vector2i right )

```print(Vector2i(10, 20) * Vector2i(3, 4)) # 输出 "(30, 80)"
```

Vector2 operator * ( float right )

```print(Vector2i(10, 15) * 0.9) # 输出 "(9, 13.5)"
```

Vector2i operator * ( int right )

Vector2i operator + ( Vector2i right )

```print(Vector2i(10, 20) + Vector2i(3, 4)) # 输出 "(13, 24)"
```

Vector2i operator - ( Vector2i right )

```print(Vector2i(10, 20) - Vector2i(3, 4)) # 输出 "(7, 16)"
```

Vector2i operator / ( Vector2i right )

```print(Vector2i(10, 20) / Vector2i(2, 5)) # 输出 "(5, 4)"
```

Vector2 operator / ( float right )

```print(Vector2i(10, 20) / 2.9) # 输出 "(5, 10)"
```

Vector2i operator / ( int right )

bool operator < ( Vector2i right )

bool operator <= ( Vector2i right )

bool operator == ( Vector2i right )

bool operator > ( Vector2i right )

bool operator >= ( Vector2i right )

int operator [] ( int index )

Vector2i operator unary+ ( )

Vector2i operator unary- ( )