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.

# Transform2D¶

## 属性¶

 Vector2 origin `Vector2(0, 0)` Vector2 x `Vector2(1, 0)` Vector2 y `Vector2(0, 1)`

## 构造函数¶

 Transform2D Transform2D Transform2D(from: Transform2D) Transform2D Transform2D(rotation: float, position: Vector2) Transform2D Transform2D(rotation: float, scale: Vector2, skew: float, position: Vector2) Transform2D Transform2D(x_axis: Vector2, y_axis: Vector2, origin: Vector2)

## 方法¶

 Transform2D affine_inverse() const Vector2 basis_xform(v: Vector2) const Vector2 basis_xform_inv(v: Vector2) const float determinant() const Vector2 get_origin() const float get_rotation() const Vector2 get_scale() const float get_skew() const Transform2D interpolate_with(xform: Transform2D, weight: float) const Transform2D inverse() const bool is_conformal() const bool is_equal_approx(xform: Transform2D) const bool is_finite() const Transform2D looking_at(target: Vector2 = Vector2(0, 0)) const Transform2D orthonormalized() const Transform2D rotated(angle: float) const Transform2D rotated_local(angle: float) const Transform2D scaled(scale: Vector2) const Transform2D scaled_local(scale: Vector2) const Transform2D translated(offset: Vector2) const Transform2D translated_local(offset: Vector2) const

## 操作符¶

 bool operator !=(right: Transform2D) PackedVector2Array operator *(right: PackedVector2Array) Rect2 operator *(right: Rect2) Transform2D operator *(right: Transform2D) Vector2 operator *(right: Vector2) Transform2D operator *(right: float) Transform2D operator *(right: int) Transform2D operator /(right: float) Transform2D operator /(right: int) bool operator ==(right: Transform2D) Vector2 operator [](index: int)

## 常量¶

IDENTITY = `Transform2D(1, 0, 0, 1, 0, 0)` 🔗

FLIP_X = `Transform2D(-1, 0, 0, 1, 0, 0)` 🔗

FLIP_Y = `Transform2D(1, 0, 0, -1, 0, 0)` 🔗

## 属性说明¶

Vector2 origin = `Vector2(0, 0)` 🔗

Vector2 x = `Vector2(1, 0)` 🔗

Vector2 y = `Vector2(0, 1)` 🔗

## 构造函数说明¶

Transform2D Transform2D() 🔗

Transform2D Transform2D(from: Transform2D)

Transform2D Transform2D(rotation: float, position: Vector2)

Transform2D Transform2D(rotation: float, scale: Vector2, skew: float, position: Vector2)

Transform2D Transform2D(x_axis: Vector2, y_axis: Vector2, origin: Vector2)

## 方法说明¶

Transform2D affine_inverse() const 🔗

Vector2 basis_xform(v: Vector2) const 🔗

Vector2 basis_xform_inv(v: Vector2) const 🔗

`transform.basis_xform_inv(vector)` 性当于 `transform.inverse().basis_xform(vector)`。请参阅 inverse

float determinant() const 🔗

Vector2 get_origin() const 🔗

float get_rotation() const 🔗

Vector2 get_scale() const 🔗

float get_skew() const 🔗

Transform2D interpolate_with(xform: Transform2D, weight: float) const 🔗

Transform2D inverse() const 🔗

bool is_conformal() const 🔗

bool is_equal_approx(xform: Transform2D) const 🔗

bool is_finite() const 🔗

Transform2D looking_at(target: Vector2 = Vector2(0, 0)) const 🔗

Transform2D orthonormalized() const 🔗

Transform2D rotated(angle: float) const 🔗

Transform2D rotated_local(angle: float) const 🔗

Transform2D scaled(scale: Vector2) const 🔗

Transform2D scaled_local(scale: Vector2) const 🔗

Transform2D translated(offset: Vector2) const 🔗

Transform2D translated_local(offset: Vector2) const 🔗

## 操作符说明¶

bool operator !=(right: Transform2D) 🔗

PackedVector2Array operator *(right: PackedVector2Array) 🔗

Rect2 operator *(right: Rect2) 🔗

Transform2D operator *(right: Transform2D) 🔗

Vector2 operator *(right: Vector2) 🔗

Transform2D operator *(right: float) 🔗

Transform2D operator *(right: int) 🔗

Transform2D operator /(right: float) 🔗

Transform2D operator /(right: int) 🔗

bool operator ==(right: Transform2D) 🔗

Vector2 operator [](index: int) 🔗