All Projects → pixijs → Pixi Particles

pixijs / Pixi Particles

Licence: mit
A particle system for PixiJS

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Pixi Particles

particle-emitter
A particle system for PixiJS
Stars: ✭ 709 (+27.75%)
Mutual labels:  javascript-library, particles, pixijs
Particleeffectsbuttons
A little library that can be used for bursting particles effects on buttons and other elements
Stars: ✭ 1,122 (+102.16%)
Mutual labels:  particles, javascript-library
Pixi Sound
WebAudio API playback library, with filters. Modern audio playback for modern browsers.
Stars: ✭ 201 (-63.78%)
Mutual labels:  pixijs, javascript-library
party-js
A JavaScript library to brighten up your user's site experience with visual effects!
Stars: ✭ 858 (+54.59%)
Mutual labels:  javascript-library, particles
Integrations
Ways to incorporate Svelte into your stack
Stars: ✭ 487 (-12.25%)
Mutual labels:  javascript-library
Vue Json Tree View
A JSON Tree View Component for Vue.js
Stars: ✭ 418 (-24.68%)
Mutual labels:  javascript-library
Machinejs
[UNMAINTAINED] Automated machine learning- just give it a data file! Check out the production-ready version of this project at ClimbsRocks/auto_ml
Stars: ✭ 412 (-25.77%)
Mutual labels:  javascript-library
Scrollload
scroll bottom load more data pull refresh 滚动到底部加载更多数据 下拉刷新
Stars: ✭ 411 (-25.95%)
Mutual labels:  javascript-library
Wind Js
An demo animation of wind on a Canvas layer in the JSAPI
Stars: ✭ 548 (-1.26%)
Mutual labels:  javascript-library
Pixi Live2d
Display live2D model as a sprite in pixi.js.
Stars: ✭ 537 (-3.24%)
Mutual labels:  pixijs
Minio Js
MinIO Client SDK for Javascript
Stars: ✭ 468 (-15.68%)
Mutual labels:  javascript-library
Mainloop.js
Provides a well-constructed main loop useful for JavaScript games and other animated or time-dependent applications.
Stars: ✭ 425 (-23.42%)
Mutual labels:  javascript-library
Awesome Pixijs
My list of awesome pixi.js related parties
Stars: ✭ 489 (-11.89%)
Mutual labels:  pixijs
Cheetah Grid
The fastest open-source data table for web.
Stars: ✭ 417 (-24.86%)
Mutual labels:  javascript-library
Solidarity
Solidarity is an environment checker for project dependencies across multiple machines.
Stars: ✭ 540 (-2.7%)
Mutual labels:  javascript-library
Creepyface
A JavaScript library that makes your face follow the pointer. 🤪🖱️👆
Stars: ✭ 412 (-25.77%)
Mutual labels:  javascript-library
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (-16.04%)
Mutual labels:  pixijs
Pixi Filters
Collection of community-authored custom display filters for PixiJS
Stars: ✭ 524 (-5.59%)
Mutual labels:  pixijs
Detect Gpu
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Stars: ✭ 460 (-17.12%)
Mutual labels:  pixijs
Jsstore
A complete IndexedDB wrapper with SQL like syntax.
Stars: ✭ 430 (-22.52%)
Mutual labels:  javascript-library

Pixi Particles

Build Status Dependency Status GitHub version

A particle system library for the PixiJS library. Also, we created an interactive particle editor to design and preview custom particle emitters which utilitze PixiParticles.

Breaking changes in v3 from v2

  • On Emitter, playOnce() no longer sets autoUpdate to true. Set it manually before use. playOnceAndDestroy() is unaffected.
  • On Emitter, start* and end* properties for alpha, color, scale, and speed have been replaced by a singly linked list of PropertyNode objects.
  • Dropped support for PIXI v3. Please use v4 or v5.

Sample Usage

Please see the examples for various pre-made particle configurations.

// Create a new emitter
// note: if importing library like "import * as particles from 'pixi-particles'"
// or "const particles = require('pixi-particles')", the PIXI namespace will
// not be modified, and may not exist - use "new particles.Emitter()", or whatever
// your imported namespace is
var emitter = new PIXI.particles.Emitter(

	// The PIXI.Container to put the emitter in
	// if using blend modes, it's important to put this
	// on top of a bitmap, and not use the root stage Container
	container,

	// The collection of particle images to use
	[PIXI.Texture.fromImage('image.jpg')],

	// Emitter configuration, edit this to change the look
	// of the emitter
	{
		alpha: {
			list: [
				{
					value: 0.8,
					time: 0
				},
				{
					value: 0.1,
					time: 1
				}
			],
			isStepped: false
		},
		scale: {
			list: [
				{
					value: 1,
					time: 0
				},
				{
					value: 0.3,
					time: 1
				}
			],
			isStepped: false
		},
		color: {
			list: [
				{
					value: "fb1010",
					time: 0
				},
				{
					value: "f5b830",
					time: 1
				}
			],
			isStepped: false
		},
		speed: {
			list: [
				{
					value: 200,
					time: 0
				},
				{
					value: 100,
					time: 1
				}
			],
			isStepped: false
		},
		startRotation: {
			min: 0,
			max: 360
		},
		rotationSpeed: {
			min: 0,
			max: 0
		},
		lifetime: {
			min: 0.5,
			max: 0.5
		},
		frequency: 0.008,
		spawnChance: 1,
		particlesPerWave: 1,
		emitterLifetime: 0.31,
		maxParticles: 1000,
		pos: {
			x: 0,
			y: 0
		},
		addAtBack: false,
		spawnType: "circle",
		spawnCircle: {
			x: 0,
			y: 0,
			r: 10
		}
	}
);

// Calculate the current time
var elapsed = Date.now();

// Update function every frame
var update = function(){

	// Update the next frame
	requestAnimationFrame(update);

	var now = Date.now();

	// The emitter requires the elapsed
	// number of seconds since the last update
	emitter.update((now - elapsed) * 0.001);
	elapsed = now;

	// Should re-render the PIXI Stage
	// renderer.render(stage);
};

// Start emitting
emitter.emit = true;

// Start the update
update();

Note on Emitter Cleanup

When using PixiJS 3 or 4, the SpriteRenderer in WebGL may keep a reference to your particles after you have destroyed your emitter. To ensure that they are garbage collected, in WebGL only, reset the SpriteRenderer's sprite batching with yourRenderer.plugins.sprite.sprites.length = 0;. This is not needed in PixiJS 5.

Documentation

http://pixijs.github.io/pixi-particles/docs/

Installation

PixiParticles can be installed or NPM.

npm install pixi-particles

Examples

Typescript

You can use require to get the namespace for pixi-particles, or use a triple slash reference for using the PIXI.particles namespace.

// Note: Must also include the pixi.js typings globally!
import particles = require('pixi-particles');

let myEmitter:particles.Emitter = new particles.Emitter(myContainer);
// Note: Must also include the pixi.js typings globally!
/// <reference path="node_modules/pixi-particles/ambient.d.ts" />
require('pixi-particles');

let myEmitter:PIXI.particles.Emitter = new PIXI.particles.Emitter(myContainer);

Use in Haxe

Externs for Haxe have been added to adireddy's Pixi externs - these are out of date but may be updated in a fork.

Contributer Note

This project uses yarn rather than npm to take advantage of the workspaces feature for the tests, making it easier to have standalone tests that share dependencies where possible.

License

Copyright (c) 2015 CloudKid

Released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].