Class: EmitterComponent

EmitterComponent

FM.EmitterComponent

new EmitterComponent(pOffset, pOwner)

The emitter component is used for the emission of particles.
Parameters:
Name Type Description
pOffset FM.Vector The vector specifying the offset from the upper left corner of the game object at which the particles should spawn.
pOwner FM.GameObject The game object that owns this component.
Author:
  • Simon Chauvin
Source:

Extends

Members

name :FM.ComponentTypes

Component's name.
Type:
Inherited From:
Source:

owner :FM.GameObject

Component's owner.
Type:
Inherited From:
Source:

Methods

add(pParticle) → {FM.GameObject}

Add a particle to this emitter.
Parameters:
Name Type Description
pParticle FM.GameObject Particle to add to the emitter.
Source:
Returns:
The particle added.
Type
FM.GameObject

createParticles(pNumber, pImage, pWidth, pHeight, pAlpha, pZIndex)

Add particles to this emitter.
Parameters:
Name Type Description
pNumber int Number of particles to create.
pImage FM.ImageAsset Image to use as a particle.
pWidth int Width of the particles.
pHeight int Height of the particles.
pAlpha float Transparency of the particles.
pZIndex int Z depth of the particles.
Source:

destroy()

Destroy the emitter component.
Source:

emit(pLifeSpan, pFrequency, pQuantity)

Start emitting particles.
Parameters:
Name Type Description
pLifeSpan float Time to live for each particle.
pFrequency float Time between each emission.
pQuantity int Number of particles to emit at each emission.
Source:

getAlpha() → {float}

Retrieve the transparency of the particles.
Source:
Returns:
Current transparency of the particles.
Type
float

setAlpha(pAlpha)

Set the transparency of the particles.
Parameters:
Name Type Description
pAlpha float Transparency of the particles.
Source:

setAngularVelocity(pMin, pMax)

Set the rotation's speed of all particles.
Parameters:
Name Type Description
pMin int Minimum angular velocity of a particle.
pMax int Maximum angular velocity of a particle.
Source:

setDirections(pDirections)

Set the directions the particles can take.
Parameters:
Name Type Description
pDirections Array Directions the particles can take.
Source:

setXVelocity(pMin, pMax)

Set the horizontal velocity of all particles.
Parameters:
Name Type Description
pMin int Minimum horizontal velocity of a particle.
pMax int Maximum horizontal velocity of a particle.
Source:

setYVelocity(pMin, pMax)

Set the vertical velocity of all particles.
Parameters:
Name Type Description
pMin int Minimum vertical velocity of a particle.
pMax int Maximum vertical velocity of a particle.
Source:

update(dt)

Update the component.
Parameters:
Name Type Description
dt float Fixed delta time in seconds since the last frame.
Source: