Skip to content

Commit

Permalink
Merge pull request #76 from yperess/master
Browse files Browse the repository at this point in the history
Add ability to add a custom initializer.
  • Loading branch information
plattysoft authored Jul 16, 2017
2 parents 49dffb3 + 98c8ddf commit 1746429
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,19 @@ public ParticleSystem setAccelerationModuleAndAndAngleRange(float minAcceleratio
return this;
}

/**
* Adds a custom initializer for emitted particles. The most common use case is the ability to
* update the initializer in real-time instead of adding new ones ontop of the existing one.
* @param initializer The non-null initializer to add.
* @return This.
*/
public ParticleSystem addInitializer(ParticleInitializer initializer) {
if (initializer != null) {
mInitializers.add(initializer);
}
return this;
}

/**
* Initializes the acceleration for emitted particles with the given angle. Acceleration is
* measured in pixels per square millisecond. The angle is measured in degrees with 0°
Expand Down

0 comments on commit 1746429

Please sign in to comment.