@vf.js/particles
v4.2.8
Published
gui.js implementation for vf v^5
Downloads
5
Readme
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