4.2.2 • Published 2 months ago

custom-pixi-particles v4.2.2

Weekly downloads
91
License
GNU
Repository
github
Last release
2 months ago

CustomPIXIParticles by @lukasz-okuniewicz

CustomPIXIParticles is a lightweight and flexible library for creating and managing particle effects in PIXI.js applications. It provides a simple API for defining particle emitters, textures, and configurations, allowing developers to create a wide range of visual effects with ease.

Features

  • Easy-to-use API: Create particle emitters with just a few lines of code
  • Flexible configuration: Customize particle behavior, appearance, and animation
  • High performance: Render particles efficiently without impacting application performance
  • Compatible with PIXI.js v7: Works seamlessly with the latest version of PIXI.js

Versions Compatibility

PixiJSCustomPIXIParticles
v5.x - v6.xv4.x
v7.xv5.x

Demo

custom-pixi-particles

Installation:

npm install custom-pixi-particles

Usage:

Import or require the library:

const customPixiParticles = require('custom-pixi-particles')
// or
import customPixiParticles from 'custom-pixi-particles'
// Define array of textures
const textures = ['texture1.png', 'texture2.png']
// Define generated emiter config
const emitterConfig = {...}
// Create particles
this.particles = customParticles.create({ textures, emitterConfig })
// Start to play
this.particles.play()
// Add particles to PIXI container
container.addChild(this.particles)

API Reference

create

// All possible params which can be passed during particles creation
this.particles = customPixiParticles.create({
  textures: [String],
  animatedSpriteZeroPad: Number,
  animatedSpriteIndexToStart: Number,
  emitterConfig: Object,
  finishingTextures: [String],
  vertices: Boolean,
  position: Boolean,
  rotation: Boolean,
  uvs: Boolean,
  tint: Boolean,
  maxParticles: Number,
  maxFPS: Number,
  tickerSpeed: Number,
})
// Callback function called when the particle animation completes.
this.particles.onComplete = () => {
  //...
}
// Define array of new textures
const newTextures = ['texture3.png', 'texture4.png']
// Updates the particle emitter's textures.
this.particles.setTextures(newTextures)
// Updates the particle emitter's configuration.
this.particles.updateConfig({
  // Update emitter configuration properties
})
// Sets the paused state
pause(isPaused)

// Starts the emitter
start()

// Resets the particle emitters in this class without removing existing particles and plays them
play()

// Immediately stops emitting particles
stopImmediately()

// Destroy particles
destroy()

// Terminates the emitter
stop()

// Resets the emitters to their initial state
resetEmitter()

// Update textures used by the emitter
setTextures(textures)

// Updates the configuration of the emitter
updateConfig(config, resetDuration = true)

// Updates the position of the emitter
updatePosition(position, resetDuration = true)

// Clear pools
clearPool()

Additional Resources

Editor for particles: custom-pixi-particles-editor

4.2.2

2 months ago

4.2.1

3 months ago

4.2.0

3 months ago

5.1.1

4 months ago

4.1.17

4 months ago

5.1.0

5 months ago

4.1.10

10 months ago

4.1.11

10 months ago

4.1.16

5 months ago

4.1.12

10 months ago

4.1.13

10 months ago

4.1.14

10 months ago

4.1.15

10 months ago

5.0.2

11 months ago

5.0.1

11 months ago

5.0.0

11 months ago

4.1.8

11 months ago

4.1.7

11 months ago

4.1.9

11 months ago

4.1.4

12 months ago

4.1.6

11 months ago

4.1.5

12 months ago

4.1.3

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

4.0.25

1 year ago

4.1.0

1 year ago

4.0.23

1 year ago

4.0.24

1 year ago

4.0.19

1 year ago

4.0.21

1 year ago

4.0.20

1 year ago

4.0.22

1 year ago

4.0.18

1 year ago

4.0.10

1 year ago

4.0.16

1 year ago

4.0.15

1 year ago

4.0.17

1 year ago

4.0.12

1 year ago

4.0.11

1 year ago

4.0.14

1 year ago

4.0.13

1 year ago

4.0.5

1 year ago

4.0.4

1 year ago

4.0.7

1 year ago

4.0.6

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

4.0.9

1 year ago

4.0.8

1 year ago

3.0.4

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

3.0.9

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.7

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago