ParticleEmitterComponent constructor
ParticleEmitterComponent({
- required ParticleEmitter emitter,
- required ParticleRenderer renderer,
- bool removeOnFinish = true,
- bool worldSpace = false,
- bool emitting = true,
- Random? random,
- Vector2? position,
- Vector2? size,
- Vector2? scale,
- double? angle,
- Anchor? anchor,
- Iterable<
Component> ? children, - int? priority,
- ComponentKey? key,
Creates a particle emitter component.
emitter describes what to spawn and how it behaves; renderer
describes how it is drawn. When removeOnFinish is true (the
default), the component removes itself once emission has naturally
finished and the last particle has died; endless emitters are never
removed automatically. Pass a seeded random for deterministic
behavior.
Implementation
ParticleEmitterComponent({
required this.emitter,
required this.renderer,
this.removeOnFinish = true,
this.worldSpace = false,
bool emitting = true,
Random? random,
super.position,
super.size,
super.scale,
super.angle,
super.anchor,
super.children,
super.priority,
super.key,
}) : // `this._emitting` requires Dart 3.12, but the minimum SDK is 3.11.
// ignore: prefer_initializing_formals
_emitting = emitting,
random = random ?? Random(),
_buffer = ParticleBuffer(emitter.maxParticles),
_burstFired = List.filled(emitter.bursts.length, false);