SpriteParticleRenderer class
Renders each particle as a Sprite (a region of an image), batched into a single draw call.
The sprite is drawn centered on the particle, scaled so its width matches
the particle's current size, and tinted by the emitter's colorOverLife
ramp (untinted when unset).
- Inheritance
-
- Object
- ParticleRenderer
- TextureParticleRenderer
- SpriteParticleRenderer
Constructors
- SpriteParticleRenderer(Sprite sprite, {BlendMode? blendMode, Paint? paint})
-
Renders every particle as
sprite. - SpriteParticleRenderer.fromImage(Image image, {BlendMode? blendMode, Paint? paint})
-
Renders every particle as the full
image.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- paint → Paint
-
The paint used for the batched draw call.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sprite → Sprite
-
The sprite drawn for every particle.
final
- srcRect → Rect
-
The region of texture to draw, in texture pixels.
no setteroverride
- texture → Image
-
The texture to draw, or null while the renderer has not loaded yet.
no setteroverride
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.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited