reckfellENGINE

Sprite3D

2D sprite node in a 3D world.

On this page
class Sprite3DReckfellSharpInherits SpriteBase3D

2D sprite node in a 3D world.

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.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

Sprite3DConstructor
# Sprite3D
C#
public Sprite3D();

Properties7

FrameProperty
# Frame
C#
public int Frame { get; set; }

Current frame to display from sprite sheet. Sprite3D.Hframes or Sprite3D.Vframes must be greater than 1. This property is automatically adjusted when Sprite3D.Hframes or Sprite3D.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.

FrameCoordsProperty
# FrameCoords
C#
public Vector2I FrameCoords { get; set; }

Coordinates of the frame to display from sprite sheet. This is as an alias for the Sprite3D.Frame property. Sprite3D.Hframes or Sprite3D.Vframes must be greater than 1.

HframesProperty
# Hframes
C#
public int Hframes { get; set; }

The number of columns in the sprite sheet. When this property is changed, Sprite3D.Frame is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, Sprite3D.Frame is reset to 0.

RegionEnabledProperty
# RegionEnabled
C#
public bool RegionEnabled { get; set; }

If true, the sprite will use Sprite3D.RegionRect and display only the specified part of its texture.

RegionRectProperty
# RegionRect
C#
public Rect2 RegionRect { get; set; }

The region of the atlas texture to display. Sprite3D.RegionEnabled must be true.

TextureProperty
# Texture
C#
public Texture2D Texture { get; set; }

Texture2D object to draw. If GeometryInstance3D.MaterialOverride is used, this will be overridden. The size information is still used.

VframesProperty
# Vframes
C#
public int Vframes { get; set; }

The number of rows in the sprite sheet. When this property is changed, Sprite3D.Frame is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, Sprite3D.Frame is reset to 0.

Methods14

GetFrameint
# GetFrame
C#
public int GetFrame();
Returns int
GetFrameCoordsVector2I
# GetFrameCoords
C#
public Vector2I GetFrameCoords();
Returns Vector2I
GetHframesint
# GetHframes
C#
public int GetHframes();
Returns int
GetRegionRectRect2
# GetRegionRect
C#
public Rect2 GetRegionRect();
Returns Rect2
GetTextureTexture2D
# GetTexture
C#
public Texture2D GetTexture();
Returns Texture2D
GetVframesint
# GetVframes
C#
public int GetVframes();
Returns int
IsRegionEnabledbool
# IsRegionEnabled
C#
public bool IsRegionEnabled();
Returns bool
SetFramevoid
# SetFrame
C#
public void SetFrame(int frame);
Parameters
NameTypeDefault
frameint—
SetFrameCoordsvoid
# SetFrameCoords
C#
public void SetFrameCoords(Vector2I coords);
Parameters
NameTypeDefault
coordsVector2I—
SetHframesvoid
# SetHframes
C#
public void SetHframes(int hframes);
Parameters
NameTypeDefault
hframesint—
SetRegionEnabledvoid
# SetRegionEnabled
C#
public void SetRegionEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetRegionRectvoid
# SetRegionRect
C#
public void SetRegionRect(Rect2 rect);
Parameters
NameTypeDefault
rectRect2—
SetTexturevoid
# SetTexture
C#
public void SetTexture(Texture2D texture);
Parameters
NameTypeDefault
textureTexture2D—
SetVframesvoid
# SetVframes
C#
public void SetVframes(int vframes);
Parameters
NameTypeDefault
vframesint—

Signals and events2

FrameChangedEvent
# FrameChanged
C#
public event Action FrameChanged;

Emitted when the Sprite3D.Frame changes.

TextureChangedEvent
# TextureChanged
C#
public event Action TextureChanged;

Emitted when the Sprite3D.Texture changes.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.