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.
Checking the stable version of the documentation...
Sprite2D¶
Inherits: Node2D < CanvasItem < Node < Object
General-purpose sprite node.
Description¶
A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
get_rect ( ) const |
|
is_pixel_opaque ( Vector2 pos ) const |
Signals¶
frame_changed ( )
Emitted when the frame changes.
texture_changed ( )
Emitted when the texture changes.
Property Descriptions¶
bool centered = true
If true
, texture is centered.
bool flip_h = false
If true
, texture is flipped horizontally.
bool flip_v = false
If true
, texture is flipped vertically.
int frame = 0
Current frame to display from sprite sheet. hframes or vframes must be greater than 1.
Vector2i frame_coords = Vector2i(0, 0)
Coordinates of the frame to display from sprite sheet. This is as an alias for the frame property. hframes or vframes must be greater than 1.
int hframes = 1
The number of columns in the sprite sheet.
Vector2 offset = Vector2(0, 0)
The texture's drawing offset.
bool region_enabled = false
If