Sprite3D
2D sprite node in a 3D world.
Sprite3D.swift:17class Sprite3D
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.
This object emits the following signals:
Superclasses
class SpriteBase3D
2D sprite node in 3D environment.
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.
Type members
Instance members
var frame: Int32
Current frame to display from sprite sheet.
hframes
orvframes
must be greater than 1.var frameChanged: SimpleSignal
Emitted when the
frame
changes.var frameCoords: Vector2i
Coordinates of the frame to display from sprite sheet. This is as an alias for the
frame
property.hframes
orvframes
must be greater than 1.var hframes: Int32
The number of columns in the sprite sheet.
var regionEnabled: Bool
If
true
, the sprite will useregionRect
and display only the specified part of its texture.var regionRect: Rect2
The region of the atlas texture to display.
regionEnabled
must betrue
.var texture: Texture2D?
Texture2D
object to draw. IfmaterialOverride
is used, this will be overridden. The size information is still used.var textureChanged: SimpleSignal
Emitted when the
texture
changes.var vframes: Int32
The number of rows in the sprite sheet.