Global

Methods

addBehaviour(behaviour)

add the Behaviour to particles;

you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);

Source:
Parameters:
Name Type Description
behaviour Proton.Behaviour

like this new Proton.Color('random')

addInitialize(initialize)

add the Initialize to particles;

you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);

Source:
Parameters:
Name Type Description
initialize Proton.Initialize

like this new Proton.Radius(1, 12)

addSelfBehaviour(behaviour)

add the Behaviour to emitter;

you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);

Source:
Parameters:
Name Type Description
behaviour Proton.Behaviour

like this new Proton.Color('random')

addSelfInitialize()

add initialize to this emitter

Source:

destroy()

Destory this Emitter

Source:

destroy()

Destory this Emitter

Source:

destroy()

Destory this particle

Source:

emit(emitTime, life)

start emit particle

Source:
Parameters:
Name Type Description
emitTime Number

begin emit time;

life String

the life of this emitter

emit()

start emit particle

Source:

removeAllBehaviours()

remove all behaviours

Source:

removeAllParticles()

create single particle;

can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})

Source:

removeAllParticles()

remove current all particles

Source:

removeBehaviour(behaviour)

remove the Behaviour

Source:
Parameters:
Name Type Description
behaviour Proton.Behaviour

a behaviour

removeInitialize(initialize)

remove the Initialize

Source:
Parameters:
Name Type Description
initialize Proton.Initialize

a initialize

removeInitializers()

remove all Initializes

Source:

removeSelfBehaviour(behaviour)

remove the Behaviour for self

Source:
Parameters:
Name Type Description
behaviour Proton.Behaviour

a behaviour

stopEmit()

stop emiting

Source:

stopEmit()

stop emiting

Source:

Type Definitions

Callback(particle, otherParticle)

The callback after collision

Source:
Parameters:
Name Type Description
particle Proton.Particle
otherParticle Proton.Paritcle

rgbObject

Properties:
Name Type Description
r Number

red value

g Number

green value

b Number

blue value

Source:
Type:
  • Object