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. |
- 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 pParticleFM.GameObject Particle to add to the emitter. Returns:
The particle added.- Type
- FM.GameObject
-
createParticles(pNumber, pImage, pWidth, pHeight, pAlpha, pZIndex)
-
Add particles to this emitter.
Parameters:
Name Type Description pNumberint Number of particles to create. pImageFM.ImageAsset Image to use as a particle. pWidthint Width of the particles. pHeightint Height of the particles. pAlphafloat Transparency of the particles. pZIndexint Z depth of the particles. -
destroy()
-
Destroy the emitter component.
-
emit(pLifeSpan, pFrequency, pQuantity)
-
Start emitting particles.
Parameters:
Name Type Description pLifeSpanfloat Time to live for each particle. pFrequencyfloat Time between each emission. pQuantityint Number of particles to emit at each emission. -
getAlpha() → {float}
-
Retrieve the transparency of the particles.
Returns:
Current transparency of the particles.- Type
- float
-
setAlpha(pAlpha)
-
Set the transparency of the particles.
Parameters:
Name Type Description pAlphafloat Transparency of the particles. -
setAngularVelocity(pMin, pMax)
-
Set the rotation's speed of all particles.
Parameters:
Name Type Description pMinint Minimum angular velocity of a particle. pMaxint Maximum angular velocity of a particle. -
setDirections(pDirections)
-
Set the directions the particles can take.
Parameters:
Name Type Description pDirectionsArray Directions the particles can take. -
setXVelocity(pMin, pMax)
-
Set the horizontal velocity of all particles.
Parameters:
Name Type Description pMinint Minimum horizontal velocity of a particle. pMaxint Maximum horizontal velocity of a particle. -
setYVelocity(pMin, pMax)
-
Set the vertical velocity of all particles.
Parameters:
Name Type Description pMinint Minimum vertical velocity of a particle. pMaxint Maximum vertical velocity of a particle. -
update(dt)
-
Update the component.
Parameters:
Name Type Description dtfloat Fixed delta time in seconds since the last frame.