PhaserEditor2D / PhaserEditor2D-v3

A web-based IDE for HTML5 game development. Powered by Phaser.
https://phasereditor2d.com
MIT License
435 stars 62 forks source link

Particle Editor #215

Closed jrabek closed 5 months ago

jrabek commented 2 years ago

Game Engine IDEs like Unity have a nice particle system editor that allow you to preview the particle effect in the editor itself. https://docs.unity3d.com/Manual/PartSysUsage.html

There are several online particle editor tools available that allow you to save the particle system as json. https://phaser-particle-editor.firebaseapp.com/ https://koreezgames.github.io/phaser3-particle-editor/

Phaser itself has a version in its lab site: https://labs.phaser.io/edit.html?src=src/game%20objects/particle%20emitter/particle%20editor.js

It would be nice to copy this functionality within the editor to

  1. Streamline the process of previewing and importing
  2. Align with the version of Phaser being used for creating the particle system and rendering it

The resulting json could be added to the asset files and later used like:

 const particles = this.add.particles("particles");
PhaserEditor2D commented 2 years ago

Yes, I like the in-scene editor of Unity.

So you can drop an emitter object to the scene, tweak its properties there and preview the emitter right in the scene. The only problem I see here (for now), is that it will consume some CPU/GPU power. Right now, the scene editor only renders the scene when needed, it doesn't run an update loop. For previewing the emitter, it needs to run a loop. But ok, that's your option. If your device has power, you can run it and keep it running while you design other elements of the scene.

PhaserEditor2D commented 2 years ago

I transferred the issue here. The other repo is for v1 of the editor :)

PhaserEditor2D commented 2 years ago

Another advantage of having the emitter as a game object is that you can create emitter prefabs! I see the ParticleEmitterManager is a game object.

jrabek commented 2 years ago

oh sorry! I meant to create it here and missed the repo name.

Yeah, so in Unity what they do is don't play the particle emitter by default in the scene. You can play it in the scene to see how it looks next to extra elements but there is an explicit play/pause/stop controls. However when working directly on the particle emitter prefab it is always playing so you can immediately see the results of the updates.

PhaserEditor2D commented 5 months ago

Done, in v4 :)