ParticleSystem


Inheritance ParticleSystem Container View Module hilo/game/ParticleSystem Requires hilo/core/Hilo, hilo/core/Class, hilo/view/View, hilo/view/Container, hilo/view/Drawable, hilo/util/util Source ParticleSystem.js
ParticleSystem A particle system.


Properties

Show Inherited Properties
Property Defined
emitNum:Number
Emit number.
ParticleSystem
emitNumVar:Number
Emit number variances.
ParticleSystem
emitterX:Number
The emitter x position.
ParticleSystem
emitterY:Number
The emitter y position.
ParticleSystem
emitTime:Number
Emit time interval(in second).
ParticleSystem
emitTimeVar:Number
Emit time interval variances.
ParticleSystem
gx:Number
The gravity x value.
ParticleSystem
gy:Number
The gravity y value.
ParticleSystem
totalTime:Number
Total time.
ParticleSystem

Methods

Show Inherited Methods
Method Defined
ParticleSystem(properties:Object)
Constructor
ParticleSystem
onUpdate(dt:Number)
更新
ParticleSystem
reset(cfg:Object)
Reset the properties.
ParticleSystem
Start emit particles.
ParticleSystem
stop(clear:Boolean)
Stop emit particles.
ParticleSystem

Property Detail

emitNum:Number
Emit number.
Default: 10
emitNumVar:Number
Emit number variances.
Default: 0
emitterX:Number
The emitter x position.
Default: 0
emitterY:Number
The emitter y position.
Default: 0
emitTime:Number
Emit time interval(in second).
Default: 0.2
emitTimeVar:Number
Emit time interval variances.
Default: 0
gx:Number
The gravity x value.
Default: 0
gy:Number
The gravity y value.
Default: 0
totalTime:Number
Total time.
Default: Infinity

Constructor

ParticleSystem(properties:Object)
parameters
properties:Object — properties The properties to create a view object, contains all writeable props of this class
properties.particle:Object — The config of particle.
properties.particle.x:Number Optional, Default: 0 — The x position.
properties.particle.y:Number Optional, Default: 0 — The y position
properties.particle.vx:Number Optional, Default: 0 — The x velocity.
properties.particle.vy:Number Optional, Default: 0 — The y velocity.
properties.particle.ax:Number Optional, Default: 0 — The x acceleration.
properties.particle.ay:Number Optional, Default: 0 — The y acceleration.
properties.particle.life:Number Optional, Default: 1 — The time particle lives(in second).
properties.particle.alpha:Number Optional, Default: 1 — The alpha.
properties.particle.alphaV:Number Optional, Default: 0 — The alpha decline rate.
properties.particle.scale:Number Optional, Default: 1 — The scale.
properties.particle.scaleV:Number Optional, Default: 0 — The scale decline rate.

Method Detail

onUpdate(dt:Number)
更新
parameters
dt:Number — delta time(in milliseconds)
reset(cfg:Object)
Reset the properties.
parameters
cfg:Object
start()
Start emit particles.
stop(clear:Boolean)
Stop emit particles.
parameters
clear:Boolean — Whether or not clear all the particles.