Proton Documentation
Proton is an easily customizable html5 particle engine including six different types of renderers.
Proton overview
Proton parts
Utils
all Utils are static, there is no need to create an instance
Available utils
- Proton.Util
- Proton.DomUtil
- Proton.WebGLUtil
- Proton.CanvasUtil
- Proton.MStack
Behaviour
Note: you can add more than just one behaviour to the emitter
Behaviours will manipulate the particles. You can add as much behaviours as you want.
Example
// this example shows how to add a specific behaviour to the Proton instance
var proton = new Proton;
var emitter = new Proton.Emitter();
var attractionBehaviour = new.Proton.Attraction(new Proton.Vector2D())
emitter.addBehaviour(attractionBehaviour);
emitter.emit('once');
proton.addEmmiter(emitter);
Available behaviours
- Proton.Alpha
- Proton.Attraction
- Proton.Collision
- Proton.Color
- Proton.CrossZone
- Proton.Force
- Proton.Gravity
- Proton.GravityWell
- Proton.RandomDrift
- Proton.Repulsion
- Proton.Rotate
- Proton.Scale
Particle initializations
These settings are for manipulating the particle. Giving more mass or even another radius.
Example
var emitter = new Proton.Emitter();
// add one or more
emitter.addInitialize(new Proton.Mass(1));
emitter.addInitialize(new Proton.Radius(0.4, 1));
Available initializations
Todo add documentation in ./src/initialize