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

A 2×3 matrix representing a 2D transformation.

Description

A 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, and scaling. It consists of three Vector2 values: x, y, and the origin.

For more information, read the "Matrices and transforms" documentation article.

Примечание

There are notable differences when using this API with C#. See API различия C# и GDScript for more information.

Tutorials

Properties

Vector2

origin

Vector2(0, 0)

Vector2

x

Vector2(1, 0)

Vector2

y

Vector2(0, 1)

Constructors

Transform2D

Transform2D ( )

Transform2D

Transform2D ( Transform2D from )

Transform2D

Transform2D ( float rotation, Vector2 position )

Transform2D

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

Transform2D

Transform2D ( Vector2 x_axis, Vector2 y_axis, Vector2 origin )

Methods

Transform2D

affine_inverse ( ) const

Vector2

basis_xform ( Vector2 v ) const

Vector2

basis_xform_inv ( Vector2 v ) const

float

determinant ( ) const

Vector2

get_origin ( ) const

float

get_rotation ( ) const

Vector2

get_scale ( ) const

float

get_skew ( ) const

Transform2D

interpolate_with ( Transform2D xform, float weight ) const

Transform2D

inverse ( ) const

bool

is_conformal ( ) const

bool

is_equal_approx ( Transform2D xform ) const

bool

is_finite ( ) const

Transform2D

looking_at ( Vector2 target=Vector2(0, 0) ) const

Transform2D

orthonormalized ( ) const

Transform2D

rotated ( float angle ) const

Transform2D