Developer   API   Game Development   Particle System   Emitter

  •  Config(0)
  •  Properties(12)
  •  Methods(8)
  •  Events(2)

Emitter : BaseClass

Emitter manages the creation and ongoing state of particles.

Properties

  • count : Integer
    Returns number of particles.
  • defaults : Object
    Sets default controls options.
  • emissionRate : Integer
    Defines emission rate, default is set to 4.
  • maxParticles : Integer
    Defines maximum allowed particles.
  • options : Object
    Position of navigation bar.
  • particleClass : Class
    Particle class.
  • particleLife : Integer
    Time since the particle's creation, default is set to -1.
  • position : Vector
    Location of the emitter center.
  • size : Integer
    How large the particle is for rendering (doesn't affect particle dynamics or collision). Default size is 8.
  • spread : Float
    Spread angle definition. Default is set to Math.PI / 32.
  • this
    Construct of the object calls following method in order.
  • velocity : Vector
    Velocity vector (direction and speed).

Methods

  • addParticle(options = null) : Particle
    Method to add particle. Options adjust the particle.
  • afterInitControls
    Method is executed after init controls.
  • beforeInitControls
    Method is executed before init controls.
  • draw(canvas)
    Method draw defines action whithin onDraw.
  • init()
    Init instance.
  • moveTo(point) : Vector
    Set new emiter possition.
  • process(fields = null)
    Method process defines action within onProcess Event.
  • undefined(k,v)
    Special property executed when priperty is undefined. It can be that JSON format is in format "key" : "value". Key is an string, so if this is the case methot return "value". Ass well as k is a regular property of the class it returns getter of this property.

Events

  • onParticleCreated(sender) : Function
    Event onParticleCreated, defines action after particle is created
  • onParticleDestroyed(sender) : Function
    Event onParticleDestroyed, defines action after particle is destroyed.

Remarks

Emitter uses Initializers to customise the initial state of particles that it creates; their position, velocity etc. These are added to the emitter using the addParticle method.