TextureParticleRenderer class abstract
Base class for renderers that draw every particle as a transformed, tinted copy of a single texture region, batched into one Canvas.drawRawAtlas call.
Each particle is drawn centered on its position, rotated by its rotation, and uniformly scaled so the texture region's width matches the particle's current size. The particle's color tints the texture through BlendMode.modulate, so white texture pixels take on the particle color exactly.
- Inheritance
-
- Object
- ParticleRenderer
- TextureParticleRenderer
- Implementers
Constructors
- TextureParticleRenderer({BlendMode? blendMode, Paint? paint})
- Creates a texture renderer.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- paint → Paint
-
The paint used for the batched draw call.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- srcRect → Rect
-
The region of texture to draw, in texture pixels.
no setter
- texture → Image?
-
The texture to draw, or null while the renderer has not loaded yet.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onLoad(
) → FutureOr< void> -
Called once when the owning component loads. Override to prepare
textures or other resources.
inherited
-
render(
Canvas canvas, ParticleBuffer particles) → void -
Renders all live particles in
particles. The canvas is already transformed to the emitter component's local coordinate system.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited