Class Sprite3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. See also SpriteBase3D where properties such as the billboard mode are defined.
public class Sprite3D : SpriteBase3D, IDisposable
- Inheritance
-
Sprite3D
- Implements
- Inherited Members
Constructors
Sprite3D()
public Sprite3D()
Properties
Frame
Current frame to display from sprite sheet. Hframes or Vframes must be greater than 1. This property is automatically adjusted when Hframes or Vframes are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to 0
.
public int Frame { get; set; }
Property Value
FrameCoords
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.
public Vector2I FrameCoords { get; set; }
Property Value
Hframes
The number of columns in the sprite sheet. When this property is changed, Frame is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, Frame is reset to 0
.
public int Hframes { get; set; }
Property Value
RegionEnabled
If true
, the sprite will use RegionRect and display only the specified part of its texture.
public bool RegionEnabled { get; set; }
Property Value
RegionRect
The region of the atlas texture to display. RegionEnabled must be true
.
public Rect2 RegionRect { get; set; }
Property Value
Texture
Texture2D object to draw. If MaterialOverride is used, this will be overridden. The size information is still used.
public Texture2D Texture { get; set; }
Property Value
Vframes
The number of rows in the sprite sheet. When this property is changed, Frame is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, Frame is reset to 0
.
public int Vframes { get; set; }
Property Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
Events
FrameChanged
Emitted when the Frame changes.
public event Action FrameChanged
Event Type
TextureChanged
Emitted when the Texture changes.
public event Action TextureChanged