stagexl_particle 0.3.8

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

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.

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.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);

}

1. Depend on it

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


dependencies:
  stagexl_particle: "^0.3.8"

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.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
0.3.0+2 Feb 1, 2014 Go to the documentation of stagexl_particle 0.3.0+2 Download stagexl_particle 0.3.0+2 archive

All 15 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
64 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95 / 100
Overall score:
Weighted score of the above. [more]
80

Platforms

Detected platforms: web

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

Suggestions

  • Use constrained dependencies.

    The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: browser.

  • The description is too short.

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

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.0 <2.0.0
browser any 0.10.0+2
stagexl ^1.0.0 1.3.0+1
Transitive dependencies
matcher 0.12.1+4
path 1.5.1
petitparser 1.7.0
stack_trace 1.9.1
xml 2.6.0 3.0.0-alpha