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') |
emit(emitTime, life)
start emit particle
- Source:
Parameters:
Name | Type | Description |
---|---|---|
emitTime |
Number
|
begin emit time; |
life |
String
|
the life of this emitter |
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:
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 |
removeSelfBehaviour(behaviour)
remove the Behaviour for self
- Source:
Parameters:
Name | Type | Description |
---|---|---|
behaviour |
Proton.Behaviour
|
a behaviour |
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