stagexl_particle 0.4.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 49

The StageXL Particle library is an extension to the StageXL Library to show particle effects. You can use particle effects to simulate fire, smoke, explosions or similar things. Often those effects will make your game visually more appealing.

NOTE: as of version 0.10.0-dev, StageXL_Particle requires a Dart 2 SDK.

Particle Emitter

The particle emitter is a DisplayObject you can add to the display list. It is also the origin where all particles are emitted. Use the particle designer on the StageXL homepage to configure all the parameters necessary to get a great looking particle emitter.

http://www.stagexl.org/runtimes/particle_emitter.html

StageXL

The StageXL library is intended for Flash developers who want to migrate their projects as well as their skills to HTML5. Therefore the library provides the familiar Flash API built on open web standards.

How To

The StageXL Particle repository on GitHub contains an example how to use the Particle Emitter and how to add it to the Stage. Start with the Particle Designer to configure the particle effect as desired. Then copy the generated JSON string to your Dart project and simply create the ParticleEmitter as shown in the example. Don't forget to add the ParticleEmitter to the Juggler for the animation.

https://github.com/bp74/StageXL_Particle/blob/master/example/example.dart

Build

Build Status

changelog

This file contains highlights of what changes on each version of the StageXL_Particle package. This file is normally updated whenever we push a new version to pub.

Pub version 0.4.0

  • Raised dependency to StageXL 1.4.0
  • Ready for Dart 2.0 stable

Pub version 0.4.0-dev

  • Raised dependency to StageXL 1.3.2-dev
  • Ready for Dart 2.0

Pub version 0.3.8

  • Added support for strong mode

Pub version 0.3.7

  • Updated to StageXL 1.0.0

Pub version 0.3.7

  • Updated to StageXL 0.13.0

Pub version 0.3.6

  • Updated to StageXL 0.12.0

Pub version 0.3.5+1

  • Updated to StageXL 0.11.0

Pub version 0.3.4

  • Updated to StageXL 0.10.2

Pub version 0.3.3

  • Updated to StageXL 0.10.0

Pub version 0.3.2

  • Updated pubspec package versions.

Pub version 0.3.1

  • Added dedicated Canvas2D and WebGL renderer

Pub version 0.3.0

  • Support for WebGL renderer in StageXL

Pub version 0.2.0

  • Set version of dependencies according to Dart 1.0 release.

Pub version 0.1.1

  • Some minor changes to align with the latest Dart changes.

Pub version 0.1.0

  • Moved Particle emitter runtime from StageXL to StageXL_Particle.

example/example.dart

library example01;

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

void main() {

  StageXL.stageOptions.renderEngine = RenderEngine.WebGL;
  StageXL.stageOptions.backgroundColor = Color.Black;

  var stage = new Stage(html.querySelector('#stage'));
  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 = (MouseEvent 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);

}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  stagexl_particle: ^0.4.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:stagexl_particle/stagexl_particle.dart';
  
Version Uploaded Documentation Archive
0.4.0 Dec 8, 2018 Go to the documentation of stagexl_particle 0.4.0 Download stagexl_particle 0.4.0 archive
0.3.8 Jun 27, 2017 Go to the documentation of stagexl_particle 0.3.8 Download stagexl_particle 0.3.8 archive
0.3.7 Nov 21, 2015 Go to the documentation of stagexl_particle 0.3.7 Download stagexl_particle 0.3.7 archive
0.3.6 Jun 22, 2015 Go to the documentation of stagexl_particle 0.3.6 Download stagexl_particle 0.3.6 archive
0.3.5+1 Mar 25, 2015 Go to the documentation of stagexl_particle 0.3.5+1 Download stagexl_particle 0.3.5+1 archive
0.3.5 Mar 25, 2015 Go to the documentation of stagexl_particle 0.3.5 Download stagexl_particle 0.3.5 archive
0.3.4 Nov 29, 2014 Go to the documentation of stagexl_particle 0.3.4 Download stagexl_particle 0.3.4 archive
0.3.3 Sep 6, 2014 Go to the documentation of stagexl_particle 0.3.3 Download stagexl_particle 0.3.3 archive
0.3.2 May 23, 2014 Go to the documentation of stagexl_particle 0.3.2 Download stagexl_particle 0.3.2 archive
0.3.1 Mar 3, 2014 Go to the documentation of stagexl_particle 0.3.1 Download stagexl_particle 0.3.1 archive

All 16 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
8
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

We analyzed this package on Dec 8, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: web

Primary library: package:stagexl_particle/stagexl_particle.dart with components: html.

Health suggestions

Fix lib/src/particle.dart. (-1 points)

Analysis of lib/src/particle.dart reported 2 hints:

line 13 col 7: The value of the field '_rotation' isn't used.

line 14 col 7: The value of the field '_rotationDelta' isn't used.

Fix lib/src/particle_emitter.dart. (-1 points)

Analysis of lib/src/particle_emitter.dart reported 2 hints:

line 35 col 10: The value of the field '_shape' isn't used.

line 57 col 10: The value of the field '_compositeOperation' isn't used.

Fix lib/stagexl_particle.dart. (-0.50 points)

Analysis of lib/stagexl_particle.dart reported 1 hint:

line 21 col 6: The function '_ensureBool' isn't used.

Format lib/src/particle_color.dart.

Run dartfmt to format lib/src/particle_color.dart.

Format lib/src/particle_render_program.dart.

Run dartfmt to format lib/src/particle_render_program.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
stagexl >=1.4.0 <2.0.0 1.4.0+2
Transitive dependencies
collection 1.14.11
petitparser 2.0.2
xml 3.2.3
Dev dependencies
build_runner ^1.0.0
build_test ^0.10.2
build_web_compilers ^0.4.0+4