zsparticle

Sparticle System for Away3D
https://github.com/rainyt/zsparticle

To install, run:

haxelib install zsparticle 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

zsparticle

Sparticle HAXE for Away3D project

Sparticle tools: click here

Desc

Under construction, the particle effects editor can be used in Away3D.

Example

import openfl.Lib;
import away3d.loaders.parsers.Parsers;
import away3d.loaders.parsers.ParticleGroupParser;
import away3d.loaders.misc.SingleFileLoader;
import away3d.entities.ParticleGroup;
import away3d.library.assets.Asset3DType;
import openfl.net.URLRequest;
import away3d.events.LoaderEvent;
import away3d.events.Asset3DEvent;
import away3d.loaders.AssetLoader;
import away3d.containers.Scene3D;

class Sparticle {
	public var particleGroup:ParticleGroup;

	public var scene:Scene3D;

	public function new(scene:Scene3D) {
		this.scene = scene;
		Parsers.enableAllBundled();
        SingleFileLoader.enableParser(ParticleGroupParser);
		var loader:AssetLoader = new AssetLoader();
		loader.addEventListener(Asset3DEvent.ASSET_COMPLETE, onAnimation);
		loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onComplete);
		loader.load(new URLRequest("assets/test.awp"));
	}

	private function onAnimation(e:Asset3DEvent):Void {
		if (e.asset.assetType == Asset3DType.CONTAINER && Std.is(e.asset, ParticleGroup)) {
			trace("Add to stage");
			particleGroup = cast(e.asset, ParticleGroup);
			this.scene.addChild(particleGroup);
			particleGroup.animator.start();
			particleGroup.scale(3);
			Lib.setInterval(function(){
				particleGroup.rotationX ++;
			},10);
		}
	}

	private function onComplete(e:LoaderEvent):Void {
		trace("Loader Complete");
	}
}
Contributors
rainy
Version
1.0.0
Published
5 years ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub