@vf.js/particles
TypeScript icon, indicating that this package has built-in type declarations

4.2.8 • Public • Published

vf-spine

Install

npm i @vf.js/particles

Usage

import { ParticlesSystem } from '@vf.js/particles';

Basic example

var app = new vf.Application();

document.body.appendChild(app.view);

app.loader
    .add('firecrackerCaidai_png', 'firecrackerCaidai.png')
    .add('firecrackerCaidai_json', 'firecrackerCaidai.json')
    .load(function (loader, resources) {
        const container = new vf.ParticleContainer();
        container.x =  this.app.view.width / 2 ;
        container.y =  this.app.view.height / 2 ;
        this.addChild(container);

        const image = stepLoader.take("firecrackerCaidai_png").texture;
        const data = stepLoader.take("firecrackerCaidai_json").data;
        const particles = ParticlesSystem.from(this.app,image,data,container);

        particles.on(ParticlesSystem.EVENT_START,()=>{
            console.log('EVENT_START');
        })
        particles.on(ParticlesSystem.EVENT_COMPLETE,()=>{
            console.log('EVENT_COMPLETE');
            particles.play();
        });
        //particles.getParticles().maxSpeed =1000;
        //particles.getParticles().startSpeed.value = 600;
        //particles.getParticles().minimumScaleMultiplier = 0.1;
        particles.play();
    });

Building

npm install

Readme

Keywords

none

Package Sidebar

Install

npm i @vf.js/particles

Weekly Downloads

2

Version

4.2.8

License

MIT

Unpacked Size

492 kB

Total Files

11

Last publish

Collaborators

  • ifyx
  • 8088