pixijs / particle-emitter

A particle system for PixiJS

Home Page:http://pixijs.io/particle-emitter/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can not use editor export json file

kawais opened this issue · comments

json is download from editor, but occur error:
Cannot use 'in' operator to search for 'framerate' in undefined
pixi version: 6.5.4
particle-emitter version: 5.0.7
`
var json={
"alpha": {
"start": 1,
"end": 0
},
"scale": {
"start": 0.1,
"end": 0.01,
"minimumScaleMultiplier": 1
},
"color": {
"start": "#e4f9ff",
"end": "#3fcbff"
},
"speed": {
"start": 200,
"end": 50,
"minimumSpeedMultiplier": 1
},
"acceleration": {
"x": 0,
"y": 0
},
"maxSpeed": 0,
"startRotation": {
"min": 0,
"max": 360
},
"noRotation": false,
"rotationSpeed": {
"min": 0,
"max": 0
},
"lifetime": {
"min": 0.2,
"max": 0.8
},
"blendMode": "normal",
"frequency": 0.001,
"emitterLifetime": -1,
"maxParticles": 500,
"pos": {
"x": 0,
"y": 0
},
"addAtBack": false,
"spawnType": "circle",
"spawnCircle": {
"x": 0,
"y": 0,
"r": 0
}
}

var emitterContainer = new PIXI.Container()
var emitter = new particles.Emitter(
emitterContainer,
particles.upgradeConfig(json, [])
);
app.stage.addChild(emitterContainer)

// 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;

};

// Start emitting
emitter.emit = true;

// Start the update
update();

`

The second parameter for upgradeConfig() must be an array of textures or urls to textures - it is throwing the error because you have an empty array there.

commented

How to get textures or urls to textures , I met the same question, and I can not understand how to get the second parameter?

Because texture usage and urls are specific to your build process and hosting, there is no way for the editor to give you a url - you have to generate and provide that yourself.