Table of Contents

Class SpriteBase3D

Namespace
Godot
Assembly
GodotSharp.dll

A node that displays 2D texture information in a 3D environment. See also Sprite3D where many other properties are defined.

public class SpriteBase3D : GeometryInstance3D, IDisposable
Inheritance
SpriteBase3D
Implements
Derived
Inherited Members

Properties

AlphaAntialiasingEdge

Threshold at which antialiasing will be applied on the alpha channel.

public float AlphaAntialiasingEdge { get; set; }

Property Value

float

AlphaAntialiasingMode

The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.

public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }

Property Value

BaseMaterial3D.AlphaAntiAliasing

AlphaCut

The alpha cutting mode to use for the sprite. See SpriteBase3D.AlphaCutMode for possible values.

public SpriteBase3D.AlphaCutMode AlphaCut { get; set; }

Property Value

SpriteBase3D.AlphaCutMode

AlphaHashScale

The hashing scale for Alpha Hash. Recommended values between 0 and 2.

public float AlphaHashScale { get; set; }

Property Value

float

AlphaScissorThreshold

Threshold at which the alpha scissor will discard values.

public float AlphaScissorThreshold { get; set; }

Property Value

float

Axis

The direction in which the front of the texture faces.

public Vector3.Axis Axis { get; set; }

Property Value

Vector3.Axis

Billboard

The billboard mode to use for the sprite. See BaseMaterial3D.BillboardModeEnum for possible values.

public BaseMaterial3D.BillboardModeEnum Billboard { get; set; }

Property Value

BaseMaterial3D.BillboardModeEnum

Centered

If true, texture will be centered.

public bool Centered { get; set; }

Property Value

bool

DoubleSided

If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind.

public bool DoubleSided { get; set; }

Property Value

bool

FixedSize

If true, the label is rendered at the same size regardless of distance.

public bool FixedSize { get; set; }

Property Value

bool

FlipH

If true, texture is flipped horizontally.

public bool FlipH { get; set; }

Property Value

bool

FlipV

If true, texture is flipped vertically.

public bool FlipV { get; set; }

Property Value

bool

Modulate

A color value used to multiply the texture's colors. Can be used for mood-coloring or to simulate the color of ambient light.

Note: Unlike Modulate for 2D, colors with values above 1.0 (overbright) are not supported.

Note: If a MaterialOverride is defined on the SpriteBase3D, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in Modulate will be ignored. For a BaseMaterial3D, VertexColorUseAsAlbedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function.

public Color Modulate { get; set; }

Property Value

Color

NoDepthTest

If true, depth testing is disabled and the object will be drawn in render order.

public bool NoDepthTest { get; set; }

Property Value

bool

Offset

The texture's drawing offset.

public Vector2 Offset { get; set; }

Property Value

Vector2

PixelSize

The size of one pixel's width on the sprite to scale it in 3D.

public float PixelSize { get; set; }

Property Value

float

RenderPriority

Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies if AlphaCut is set to Disabled (default value).

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

public int RenderPriority { get; set; }

Property Value

int

Shaded

If true, the Light3D in the Environment has effects on the sprite.

public bool Shaded { get; set; }

Property Value

bool

TextureFilter

Filter flags for the texture. See BaseMaterial3D.TextureFilterEnum for options.

Note: Linear filtering may cause artifacts around the edges, which are especially noticeable on opaque textures. To prevent this, use textures with transparent or identical colors around the edges.

public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }

Property Value

BaseMaterial3D.TextureFilterEnum

Transparent

If true, the texture's transparency and the opacity are used to make those parts of the sprite invisible.

public bool Transparent { get; set; }

Property Value

bool

Methods

GenerateTriangleMesh()

Returns a TriangleMesh with the sprite's vertices following its current configuration (such as its Axis and PixelSize).

public TriangleMesh GenerateTriangleMesh()

Returns

TriangleMesh

GetItemRect()

Returns the rectangle representing this sprite.

public Rect2 GetItemRect()

Returns

Rect2

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_name

Name of the method to check for.

Returns

bool

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_name

Name of the signal to check for.

Returns

bool

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_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool