SmokeEffect class
A particle effect that creates a smoke animation in Newton.
The SmokeEffect
class extends the Effect
class and provides a particle effect
that simulates rising smoke.
- Inheritance
-
- Object
- Effect<
AnimatedParticle> - SmokeEffect
Constructors
- SmokeEffect({required ParticleConfiguration particleConfiguration, required EffectConfiguration effectConfiguration, double smokeWidth = 30})
Properties
-
activeParticles
→ List<
AnimatedParticle> -
Immutable List of active particles managed by the effect.
no setterinherited
- addedAtRuntime ↔ bool
-
getter/setter pairinherited
- effectConfiguration → EffectConfiguration
-
Configuration for the effect. See EffectConfiguration.
finalinherited
- foreground → bool
-
Should the effect be played in foreground?
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- particleConfiguration → ParticleConfiguration
-
Configuration for particle properties. See ParticleConfiguration.
finalinherited
-
postEffectCallback
↔ ValueChanged<
Effect< ?AnimatedParticle> > -
Register a callback if you want to be notified that a post effect is occurring
getter/setter pairinherited
- random → Random
-
Random number generator for particle properties.
finalinherited
-
rootEffect
↔ Effect<
AnimatedParticle> -
Root effect that triggered this effect
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- smokeWidth → double
-
final
- state → EffectState
-
Current state of the effect
no setterinherited
-
stateChangeCallback
← (void Function(Effect<
AnimatedParticle> , EffectState)?) -
Callback to be notified when state has changed
no getterinherited
- surfaceSize ← Size
-
Sets the size of the animation surface.
no getterinherited
- totalElapsed ↔ double
-
Total elapsed time since the effect started.
getter/setter pairinherited
Methods
-
forward(
int elapsedMillis) → dynamic -
Advances the effect animation based on the elapsed time in milliseconds.
This method is automatically called to update the particle animation.
inherited
-
instantiateParticle(
Size surfaceSize) → AnimatedParticle -
Abstract method to be implemented by subclasses to define particle emission behavior.
override
-
kill(
) → dynamic -
Kills the effect, stopping all particle emission and removing active particles.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
randomAngle(
) → double -
Helper method to generate random angle
within the range EffectConfiguration.minAngle - EffectConfiguration.maxAngle.
inherited
-
randomDistance(
) → double -
Helper method to generate random distance
within the range EffectConfiguration.minDistance - EffectConfiguration.maxDistance.
inherited
-
randomDuration(
) → int -
Helper method to generate random duration
within the range EffectConfiguration.minDuration - EffectConfiguration.maxDuration.
inherited
-
randomFadeInLimit(
) → double -
Helper method to generate random fadeIn limit
within the range EffectConfiguration.minFadeInLimit - EffectConfiguration.maxFadeInLimit
inherited
-
randomFadeOutThreshold(
) → double -
Helper method to generate random fadeOut threshold
within the range EffectConfiguration.minFadeOutThreshold - EffectConfiguration.maxFadeOutThreshold
inherited
-
randomScaleRange(
) → Tween< double> -
Helper method to generate random scale range
within the range (EffectConfiguration.minBeginScale - EffectConfiguration.maxBeginScale)
inherited
-
start(
) → dynamic -
Starts the effect emission, allowing particles to be emitted.
inherited
-
stop(
{bool cancel = false}) → dynamic -
Stops the effect emission, optionally cancelling all active particles.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited