stagexl_particle 0.3.2 copy "stagexl_particle: ^0.3.2" to clipboard
stagexl_particle: ^0.3.2 copied to clipboard

outdatedDart 1 only

The particle emitter runtime for the StageXL library.

example/example.dart

library example01;

import 'dart:html' as html;
import 'package:stagexl/stagexl.dart';
import 'package:stagexl_particle/stagexl_particle.dart';

void main() {

  var stage = new Stage(html.querySelector('#stage'), webGL: true, color: Color.Black);
  var renderLoop = new RenderLoop();
  renderLoop.addStage(stage);

  //-------------------------

  var particleConfig = {
    "maxParticles":2000,
    "duration":0,
    "lifeSpan":0.7, "lifespanVariance":0.2,
    "startSize":16, "startSizeVariance":10,
    "finishSize":53, "finishSizeVariance":11,
    "shape":"circle",
    "emitterType":0,
    "location":{"x":0, "y":0},
    "locationVariance":{"x":5, "y":5},
    "speed":100, "speedVariance":33,
    "angle":0, "angleVariance":360,
    "gravity":{"x":0, "y":0},
    "radialAcceleration":20, "radialAccelerationVariance":0,
    "tangentialAcceleration":10, "tangentialAccelerationVariance":0,
    "minRadius":0, "maxRadius":100, "maxRadiusVariance":0,
    "rotatePerSecond":0, "rotatePerSecondVariance":0,
    "compositeOperation":"source-over",
    "startColor":{"red":1, "green":0.74, "blue":0, "alpha":1},
    "finishColor":{"red":1, "green":0, "blue":0, "alpha":0}
  };

  var particleEmitter = new ParticleEmitter(particleConfig);
  particleEmitter.setEmitterLocation(400, 300);
  stage.addChild(particleEmitter);
  stage.juggler.add(particleEmitter);

  //-------------------------

  var mouseEventListener = (me) {
    if (me.buttonDown) particleEmitter.setEmitterLocation(me.localX, me.localY);
  };

  var glassPlate = new GlassPlate(800, 600);
  glassPlate.onMouseDown.listen(mouseEventListener);
  glassPlate.onMouseMove.listen(mouseEventListener);
  stage.addChild(glassPlate);

}
12
likes
0
pub points
8%
popularity

Publisher

unverified uploader

The particle emitter runtime for the StageXL library.

Homepage

License

unknown (LICENSE)

Dependencies

browser, stagexl

More

Packages that depend on stagexl_particle