Sprite class Geometry
A single camera-facing textured quad, ready to attach to a Node.
A Sprite wraps a one-instance BillboardGeometry and a SpriteMaterial
into a Mesh you assign to a node (node.mesh = sprite.mesh). The owning
node's transform positions and scales it in the world; width/height
are the quad's size in world units before that transform. Mutating any
property updates the quad in place.
For many sprites (impostor forests, particle-like effects), drive a
BillboardGeometry with a higher capacity directly instead of one
Sprite per quad.
Constructors
- Sprite({TextureSource? texture, double width = 1.0, double height = 1.0, Vector4? color, double rotation = 0.0, BillboardFacing facing = BillboardFacing.spherical, SpriteBlendMode blendMode = SpriteBlendMode.alpha})
- Creates a sprite, optionally textured.
Properties
- color ↔ Vector4
-
Linear RGBA color multiplied with the texture.
getter/setter pair
- facing ↔ BillboardFacing
-
How the quad orients toward the camera.
getter/setter pair
- geometry → BillboardGeometry
-
The backing billboard batch (a single instance).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
Quad height in world units (before the node transform).
getter/setter pair
- material ↔ SpriteMaterial
-
The sprite's material; set its
colorTexture,tint, orblendMode.latefinal - mesh ↔ Mesh
-
The mesh to attach to a node (
node.mesh = sprite.mesh).latefinal - rotation ↔ double
-
In-plane rotation in radians (ignored for
BillboardFacing.velocityStretched).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width ↔ double
-
Quad width in world units (before the node transform).
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited