SpriteBase3D
2D sprite node in 3D environment.
SpriteBase3D.swift:11class SpriteBase3D
A node that displays 2D texture information in a 3D environment. See also Sprite3D
where many other properties are defined.
Superclasses
class GeometryInstance3D
Base node for geometry-based visual instances.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var alphaAntialiasingEdge: Double
Threshold at which antialiasing will be applied on the alpha channel.
var alphaAntialiasingMode: BaseMaterial3D.AlphaAntiAliasing
The type of alpha antialiasing to apply. See
BaseMaterial3D.AlphaAntiAliasing
.var alphaCut: SpriteBase3D.AlphaCutMode
The alpha cutting mode to use for the sprite. See
AlphaCutMode
for possible values.var alphaHashScale: Double
The hashing scale for Alpha Hash. Recommended values between
0
and2
.var alphaScissorThreshold: Double
Threshold at which the alpha scissor will discard values.
var axis: Vector3.Axis
The direction in which the front of the texture faces.
var billboard: BaseMaterial3D.BillboardMode
The billboard mode to use for the sprite. See
BaseMaterial3D.BillboardMode
for possible values.var centered: Bool
If
true
, texture will be centered.var doubleSided: Bool
If
true
, texture can be seen from the back as well, iffalse
, it is invisible when looking at it from behind.var fixedSize: Bool
If
true
, the label is rendered at the same size regardless of distance.var flipH: Bool
If
true
, texture is flipped horizontally.var flipV: Bool
If
true
, texture is flipped vertically.var modulate: Color
A color value used to multiply the texture’s colors. Can be used for mood-coloring or to simulate the color of light.
var noDepthTest: Bool
If
true
, depth testing is disabled and the object will be drawn in render order.var offset: Vector2
The texture’s drawing offset.
var pixelSize: Double
The size of one pixel’s width on the sprite to scale it in 3D.
var renderPriority: Int32
Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.
var shaded: Bool
If
true
, theLight3D
in theEnvironment
has effects on the sprite.var textureFilter: BaseMaterial3D.TextureFilter
Filter flags for the texture. See
BaseMaterial3D.TextureFilter
for options.var transparent: Bool
If
true
, the texture’s transparency and the opacity are used to make those parts of the sprite invisible.func generateTriangleMesh(
) -> TriangleMesh? Returns a
TriangleMesh
with the sprite’s vertices following its current configuration (such as itsaxis
andpixelSize
).func getItemRect(
) -> Rect2 Returns the rectangle representing this sprite.
Subclasses
class AnimatedSprite3D
2D sprite node in 3D world, that can use multiple 2D textures for animation.
class Sprite3D
2D sprite node in a 3D world.