Engine. Particle

Particle Object - Created automatically by Particle Emitters

Constructor

new Particle(position, tileInfo, angle, colorStart, colorEnd, lifeTime, sizeStart, sizeEnd, fadeRate, additive, trailScale, localSpaceEmitteropt, destroyCallbackopt)

Create a particle with the passed in settings Typically this is created automatically by a ParticleEmitter

Parameters:
NameTypeAttributesDescription
positionVector2

World space position of the particle

tileInfoTileInfo

Tile info to render particles

anglenumber

Angle to rotate the particle

colorStartColor

Color at start of life

colorEndColor

Color at end of life

lifeTimenumber

How long to live for

sizeStartnumber

Size at start of life

sizeEndnumber

Size at end of life

fadeRatenumber

How quick to fade in/out

additiveboolean

Does it use additive blend mode

trailScalenumber

If a trail, how long to make it

localSpaceEmitterParticleEmitter<optional>

Parent emitter if local space

destroyCallbackParticleCallbackFunction<optional>

Callback when particle dies

Extends

  • EngineObject

Members

additive

Properties
TypeDescription
boolean

Is it additive

colorEnd

Properties
TypeDescription
Color

Color at end of life

colorStart

Properties
TypeDescription
Color

Color at start of life

destroyCallback

Properties
TypeDescription
ParticleCallbackFunction

Called when particle dies

fadeRate

Properties
TypeDescription
number

How quick to fade in/out

lifeTime

Properties
TypeDescription
number

How long to live for

localSpaceEmitter

Properties
TypeDescription
ParticleEmitter

Parent emitter if local space

sizeEnd

Properties
TypeDescription
number

Size at end of life

sizeStart

Properties
TypeDescription
number

Size at start of life

trailScale

Properties
TypeDescription
number

If a trail, how long to make it

Methods

render()

Render the particle, automatically called each frame, sorted by renderOrder

update()

Update the object physics, called automatically by engine once each frame