Class Emitter

java.lang.Object
tripleplay.particle.Emitter

public class Emitter extends Object
Emits and updates particles according to a particle system configuration.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final List<Effector>
    The effectors used by this emitter.
    The generator that adds new particles to this emitter.
    The initializers used by this emitter.
    final Layer
    The layer to which this emitter is attached.
    final react.Signal<Emitter>
    A signal emitted when this emitter has no live particles and no generator.
    final react.Signal<Emitter>
    A signal emitted when the generator for this emitter is exhausted.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Emitter(ParticleBatch batch, react.Signal<Clock> paint, int maxParticles, Tile tile)
    Creates an emitter that uses batch to render its particles.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addParticles(int count)
    Adds the specified number of particles.
    void
    Configures this emitter to destroy its layer when it runs out of particles.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • layer

      public final Layer layer
      The layer to which this emitter is attached.
    • generator

      public Generator generator
      The generator that adds new particles to this emitter.
    • initters

      public final List<Initializer> initters
      The initializers used by this emitter.
    • effectors

      public final List<Effector> effectors
      The effectors used by this emitter.
    • onExhausted

      public final react.Signal<Emitter> onExhausted
      A signal emitted when the generator for this emitter is exhausted.
    • onEmpty

      public final react.Signal<Emitter> onEmpty
      A signal emitted when this emitter has no live particles and no generator.
  • Constructor Details

    • Emitter

      public Emitter(ParticleBatch batch, react.Signal<Clock> paint, int maxParticles, Tile tile)
      Creates an emitter that uses batch to render its particles. When this emitter's layer is added to the scene graph, it will connect itself to paint to drive the particle animations, and when its layer is removed, it will disconnect from paint.
      Parameters:
      batch - the particle batch to use when rendering our particles.
      paint - the paint signal which will drive this emitter.
      maxParticles - the maximum number of active particles.
      tile - the texture to use when rendering particles.
  • Method Details

    • addParticles

      public void addParticles(int count)
      Adds the specified number of particles. One usually does not call this manually, but rather configures generator with a generator that adds particles as desired.
    • destroyOnEmpty

      public void destroyOnEmpty()
      Configures this emitter to destroy its layer when it runs out of particles.