FadingMovingParticle class
A particle that fades out over time while moving.
Constructors
- FadingMovingParticle({required double lifespan, required Vector2 position, required Vector2 speed, required Vector2 acceleration, required double radius, required Color baseColor, required double fadeOutDuration})
- A particle that fades out over time while moving.
Properties
- acceleration → Vector2
-
The acceleration of the particle.
final
- baseColor → Color
-
The base color of the particle.
final
- fadeOutDuration → double
-
The duration of the fade out effect.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lifespan → double
-
Getter for the current lifespan of this
Particle
.no setterinherited - position → Vector2
-
The position of the particle.
final
- progress → double
-
Getter which should be used by subclasses to get overall progress.
no setterinherited
- radius → double
-
The radius of the particle.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldRemove → bool
-
This method will return true as soon as the particle reaches the end of
its lifespan.
no setterinherited
- speed → Vector2
-
The speed of the particle.
final
Methods
-
accelerated(
{required Vector2 acceleration, Vector2? position, Vector2? speed}) → Particle -
Wraps this particle with a
AcceleratedParticle
.inherited -
moving(
{required Vector2 to, Vector2? from, Curve curve = Curves.linear}) → Particle -
Wraps this particle with a
MovingParticle
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
Canvas canvas) → void -
Should render this
Particle
to given Canvas. -
rotated(
double angle) → Particle -
Rotates this particle to a fixed angle in radians using the
RotatingParticle
.inherited -
rotating(
{double from = 0, double to = pi}) → Particle -
Rotates this particle from a given angle to another one in radians
using
RotatingParticle
.inherited -
scaled(
double scale) → Particle -
Wraps this particle with a
ScaledParticle
.inherited -
scaling(
{double to = 0, Curve curve = Curves.linear}) → ScalingParticle -
Wraps this particle with a
ScalingParticle
.inherited -
setLifespan(
double lifespan) → void -
A control method allowing a parent of this
Particle
to pass down it's lifespan.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
translated(
Vector2 offset) → Particle -
Wraps this particle with a
TranslatedParticle
.inherited -
update(
double dt) → void -
Updates the
_timer
of thisParticle
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited