Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AudioListener3D
- AudioStreamPlayer3D
- BoneAttachment3D
- Camera3D (1)
- CollisionObject3D (2)
- CollisionPolygon3D
- CollisionShape3D
- GridMap
- ImporterMeshInstance3D
- Joint3D (5)
- LightmapProbe
- Marker3D
- NavigationLink3D
- NavigationObstacle3D
- NavigationRegion3D
- OpenXRCompositionLayer (3)
- OpenXRHand
- Path3D
- PathFollow3D
- RayCast3D
- RemoteTransform3D
- ShapeCast3D
- Skeleton3D
- SkeletonModifier3D (7)
- SpringArm3D
- SpringBoneCollision3D (3)
- VehicleWheel3D
- VisualInstance3D (13)
- XRFaceModifier3D
- XRNode3D (2)
- XROrigin3D
- Decal
- FogVolume
- GPUParticlesAttractor3D (3)
- GPUParticlesCollision3D (4)
- GeometryInstance3D (7)
- Light3D (3)
- LightmapGI
- OccluderInstance3D
- OpenXRVisibilityMask
- ReflectionProbe
- RootMotionView
- VisibleOnScreenNotifier3D (1)
- VoxelGI
Table of contents
-
var alpha_antialiasing_edge: float = 0.0 -
var alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF -
var alpha_cut = ALPHA_CUT_DISABLED -
var alpha_hash_scale: float = 1.0 -
var alpha_scissor_threshold: float = 0.5 -
var axis = AXIS_Z -
var billboard = BILLBOARD_DISABLED -
var centered: bool = true -
var double_sided: bool = true -
var fixed_size: bool = false -
var flip_h: bool = false -
var flip_v: bool = false -
var modulate: Color = Color(1, 1, 1, 1) -
var no_depth_test: bool = false -
var offset: Vector2 = Vector2(0, 0) -
var pixel_size: float = 0.01 -
var render_priority: int = 0 -
var shaded: bool = false -
var texture_filter = TEXTURE_FILTER_LINEAR_WITH_MIPMAPS -
var transparent: bool = true -
const func generate_triangle_mesh() -> TriangleMesh -
const func get_draw_flag(flag: int enumSpriteBase3D.DrawFlags) -> bool -
const func get_item_rect() -> Rect2 -
func set_draw_flag(enabled: bool) -> void -
const FLAG_TRANSPARENT = 0 enum DrawFlags -
const FLAG_SHADED = 1 enum DrawFlags -
const FLAG_DOUBLE_SIDED = 2 enum DrawFlags -
const FLAG_DISABLE_DEPTH_TEST = 3 enum DrawFlags -
const FLAG_FIXED_SIZE = 4 enum DrawFlags -
const FLAG_MAX = 5 enum DrawFlags -
const ALPHA_CUT_DISABLED = 0 enum AlphaCutMode -
const ALPHA_CUT_DISCARD = 1 enum AlphaCutMode -
const ALPHA_CUT_OPAQUE_PREPASS = 2 enum AlphaCutMode -
const ALPHA_CUT_HASH = 3 enum AlphaCutMode -
enum DrawFlags -
enum AlphaCutMode
SpriteBase3D #
Node3D, Node, core, not_builtin_classes
2D sprite node in 3D environment.
A node that displays 2D texture information in a 3D environment. See also Sprite3D where many other properties are defined.
Members #
var alpha_antialiasing_edge: float = 0.0#
Threshold at which antialiasing will be applied on the alpha channel.
var alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF#
The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.
var alpha_cut = ALPHA_CUT_DISABLED#
The alpha cutting mode to use for the sprite. See AlphaCutMode for possible values.
var alpha_hash_scale: float = 1.0#
The hashing scale for Alpha Hash. Recommended values between 0 and 2.
var alpha_scissor_threshold: float = 0.5#
Threshold at which the alpha scissor will discard values.
var axis = AXIS_Z#
The direction in which the front of the texture faces.
var billboard = BILLBOARD_DISABLED#
The billboard mode to use for the sprite. See BaseMaterial3D.BillboardMode for possible values.
Note: When billboarding is enabled and the material also casts shadows, billboards will face the camera in the scene when rendering shadows. In scenes with multiple cameras, the intended shadow cannot be determined and this will result in undefined behavior. See GitHub Pull Request #72638 for details.
var centered: bool = true#
If true, texture will be centered.
var double_sided: bool = true#
If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind.
var fixed_size: bool = false#
If true, the label is rendered at the same size regardless of distance.
var flip_h: bool = false#
If true, texture is flipped horizontally.
var flip_v: bool = false#
If true, texture is flipped vertically.
var modulate: Color = Color(1, 1, 1, 1)#
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 CanvasItem.modulate for 2D, colors with values above 1.0 (overbright) are not supported.
Note: If a GeometryInstance3D.material_override 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, BaseMaterial3D.vertex_color_use_as_albedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function.
var no_depth_test: bool = false#
If true, depth testing is disabled and the object will be drawn in render order.
var offset: Vector2 = Vector2(0, 0)#
The texture's drawing offset.
var pixel_size: float = 0.01#
The size of one pixel's width on the sprite to scale it in 3D.
var render_priority: int = 0#
Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.
Note: This only applies if alpha_cut is set to ALPHA_CUT_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).
var shaded: bool = false#
If true, the Light3D in the Environment has effects on the sprite.
var texture_filter = TEXTURE_FILTER_LINEAR_WITH_MIPMAPS#
Filter flags for the texture. See BaseMaterial3D.TextureFilter 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.
var transparent: bool = true#
If true, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
Methods #
const func generate_triangle_mesh() -> TriangleMesh#
Returns a TriangleMesh with the sprite's vertices following its current configuration (such as its axis and pixel_size).
const func get_draw_flag(flag: int enumSpriteBase3D.DrawFlags) -> bool#
Returns the value of the specified flag.
const func get_item_rect() -> Rect2#
Returns the rectangle representing this sprite.
func set_draw_flag(enabled: bool) -> void#
If true, the specified flag will be enabled. See SpriteBase3D.DrawFlags for a list of flags.
Annotations #
Constants #
const FLAG_TRANSPARENT = 0 enum DrawFlags#
If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
const FLAG_SHADED = 1 enum DrawFlags#
If set, lights in the environment affect the sprite.
const FLAG_DOUBLE_SIDED = 2 enum DrawFlags#
If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind.
const FLAG_DISABLE_DEPTH_TEST = 3 enum DrawFlags#
Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
const FLAG_FIXED_SIZE = 4 enum DrawFlags#
Label is scaled by depth so that it always appears the same size on screen.
const FLAG_MAX = 5 enum DrawFlags#
Represents the size of the DrawFlags enum.
const ALPHA_CUT_DISABLED = 0 enum AlphaCutMode#
This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping.
const ALPHA_CUT_DISCARD = 1 enum AlphaCutMode#
This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as alpha testing or 1-bit transparency.
const ALPHA_CUT_OPAQUE_PREPASS = 2 enum AlphaCutMode#
This mode draws fully opaque pixels in the depth prepass. This is slower than ALPHA_CUT_DISABLED or ALPHA_CUT_DISCARD, but it allows displaying translucent areas and smooth edges while using proper sorting.
const ALPHA_CUT_HASH = 3 enum AlphaCutMode#
This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.
Constructors #
Enums #
DrawFlags#
enum DrawFlags {
FLAG_TRANSPARENT = 0,
FLAG_SHADED = 1,
FLAG_DOUBLE_SIDED = 2,
FLAG_DISABLE_DEPTH_TEST = 3,
FLAG_FIXED_SIZE = 4,
FLAG_MAX = 5,
}AlphaCutMode#
enum AlphaCutMode {
ALPHA_CUT_DISABLED = 0,
ALPHA_CUT_DISCARD = 1,
ALPHA_CUT_OPAQUE_PREPASS = 2,
ALPHA_CUT_HASH = 3,
}