- applyScale
void applyScale(Vector2 ratio)
Multiplies the current scale by the 'ratio' vector.
- getAngleTo
double getAngleTo(Vector2 point)
Returns the angle between the node and the 'point' in radians.
- getGlobalPosition
Vector2 getGlobalPosition()
- getGlobalRotation
double getGlobalRotation()
- getGlobalRotationDegrees
double getGlobalRotationDegrees()
- getGlobalScale
Vector2 getGlobalScale()
- getPosition
Vector2 getPosition()
- getRelativeTransformToParent
Transform2D getRelativeTransformToParent(GodotObject parent)
Returns the Transform2D relative to this node's parent.
- getRotation
double getRotation()
- getRotationDegrees
double getRotationDegrees()
- getScale
Vector2 getScale()
- getZIndex
long getZIndex()
- globalTranslate
void globalTranslate(Vector2 offset)
Adds the 'offset' vector to the node's global position.
- isZRelative
bool isZRelative()
- lookAt
void lookAt(Vector2 point)
Rotates the node so it points towards the 'point'.
- moveLocalX
void moveLocalX(double delta, bool scaled)
Applies a local translation on the node's X axis based on the Node._process's delta. If scaled is false, normalizes the movement.
- moveLocalY
void moveLocalY(double delta, bool scaled)
Applies a local translation on the node's Y axis based on the Node._process's delta. If scaled is false, normalizes the movement.
- opAssign
Node2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(Node2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
- rotate
void rotate(double radians)
Applies a rotation to the node, in radians, starting from its current rotation.
- setGlobalPosition
void setGlobalPosition(Vector2 position)
- setGlobalRotation
void setGlobalRotation(double radians)
- setGlobalRotationDegrees
void setGlobalRotationDegrees(double degrees)
- setGlobalScale
void setGlobalScale(Vector2 scale)
- setGlobalTransform
void setGlobalTransform(Transform2D xform)
- setPosition
void setPosition(Vector2 position)
- setRotation
void setRotation(double radians)
- setRotationDegrees
void setRotationDegrees(double degrees)
- setScale
void setScale(Vector2 scale)
- setTransform
void setTransform(Transform2D xform)
- setZAsRelative
void setZAsRelative(bool enable)
- setZIndex
void setZIndex(long z_index)
- toGlobal
Vector2 toGlobal(Vector2 local_point)
Converts a local point's coordinates to global coordinates.
- toLocal
Vector2 toLocal(Vector2 global_point)
Converts a global point's coordinates to local coordinates.
- translate
void translate(Vector2 offset)
Translates the node by the given offset in local coordinates.
- globalPosition
Vector2 globalPosition [@property getter]
Vector2 globalPosition [@property setter]
- globalRotation
double globalRotation [@property getter]
double globalRotation [@property setter]
Global rotation in radians.
- globalRotationDegrees
double globalRotationDegrees [@property getter]
double globalRotationDegrees [@property setter]
Global rotation in degrees.
- globalScale
Vector2 globalScale [@property getter]
Vector2 globalScale [@property setter]
- globalTransform
Transform2D globalTransform [@property getter]
Transform2D globalTransform [@property setter]
- position
Vector2 position [@property getter]
Vector2 position [@property setter]
Position, relative to the node's parent.
- rotation
double rotation [@property getter]
double rotation [@property setter]
Rotation in radians, relative to the node's parent.
- rotationDegrees
double rotationDegrees [@property getter]
double rotationDegrees [@property setter]
Rotation in degrees, relative to the node's parent.
- scale
Vector2 scale [@property getter]
Vector2 scale [@property setter]
The node's scale. Unscaled value: (1, 1)
- transform
Transform2D transform [@property getter]
Transform2D transform [@property setter]
- zAsRelative
bool zAsRelative [@property setter]
If true the node's Z-index is relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5.
- zAsRelative
bool zAsRelative [@property getter]
If true the node's Z-index is relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5.
- zIndex
long zIndex [@property getter]
long zIndex [@property setter]
Z-index. Controls the order in which the nodes render. A node with a higher Z-index will display in front of others.
A 2D game object, parent of all 2D related nodes. Has a position, rotation, scale and Z-index.
A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order.