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 pParticle
FM.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 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. -
destroy()
-
Destroy the emitter component.
-
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. -
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 pAlpha
float Transparency of the particles. -
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. -
setDirections(pDirections)
-
Set the directions the particles can take.
Parameters:
Name Type Description pDirections
Array Directions the particles can take. -
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. -
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. -
update(dt)
-
Update the component.
Parameters:
Name Type Description dt
float Fixed delta time in seconds since the last frame.