pixijs / pixi-particles-editor

PIXI-based particle editor
http://pixijs.github.io/pixi-particles-editor/
MIT License
65 stars 20 forks source link

Generated config not compatible with EmitterConfigV3 #21

Open goldenratio opened 2 years ago

goldenratio commented 2 years ago

Hi, any plans on adding feature to export config as v3 from editor?

andrewstart commented 2 years ago

In theory, yes, but on top of new features that need to be supported, the editor is very old and needs to be rewritten in order to be properly maintainable. I just have not had the time to do so. That's why I made sure that the runtime can ingest older configs for use in the latest version of the library.

schellenbergk commented 1 year ago

The workaround is to convert your config to v3...

import {
  upgradeConfig,
  Emitter,
  EmitterConfigV1,
  EmitterConfigV3
} from '@pixi/particle-emitter'
......
    const { default: config } = await import(
      `../configs/particle-effect.json`
    )
    const cfgV1: EmitterConfigV1 = config
    const cfgV3: EmitterConfigV3 = upgradeConfig(cfgV1, texture)

    this.emitter = new Emitter(container, cfgV3)

This seems to work perfectly.