A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order.
$DOCS_URL/tutorials/2d/custom_drawing_in_2d.html
https://github.com/godotengine/godot-demo-projects/tree/master/2d
Multiplies the current scale by the [param ratio] vector.
Returns the angle between the node and the [param point] in radians.
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png]Illustration of the returned angle.[/url]
Returns the [Transform2D] relative to this node's parent.
Adds the [param offset] vector to the node's global position.
Rotates the node so that its local +X axis points towards the [param point], which is expected to use global coordinates.
[param point] should not be the same as the node's position, otherwise the node always looks to the right.
Applies a local translation on the node's X axis based on the [method Node._process]'s [param delta]. If [param scaled] is [code]false[/code], normalizes the movement.
Applies a local translation on the node's Y axis based on the [method Node._process]'s [param delta]. If [param scaled] is [code]false[/code], normalizes the movement.
Applies a rotation to the node, in radians, starting from its current rotation.
Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the [Node2D] it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position.
Transforms the provided global position into a position in local coordinate space. The output will be local relative to the [Node2D] it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent.
Translates the node by the given [param offset] in local coordinates.
Global position. See also [member position].
Global rotation in radians. See also [member rotation].
Helper property to access [member global_rotation] in degrees instead of radians. See also [member rotation_degrees].
Global scale. See also [member scale].
Global skew in radians. See also [member skew].
Global [Transform2D]. See also [member transform].
Position, relative to the node's parent. See also [member global_position].
Rotation in radians, relative to the node's parent. See also [member global_rotation].
[b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees].
Helper property to access [member rotation] in degrees instead of radians. See also [member global_rotation_degrees].
The node's scale, relative to the node's parent. Unscaled value: [code](1, 1)[/code]. See also [member global_scale].
[b]Note:[/b] Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed.
If set to a non-zero value, slants the node in one direction or another. This can be used for pseudo-3D effects. See also [member global_skew].
[b]Note:[/b] Skew is performed on the X axis only, and [i]between[/i] rotation and scaling.
[b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [code]skew = deg_to_rad(value_in_degrees)[/code].
The node's [Transform2D], relative to the node's parent. See also [member global_transform].