Struggling to get my head around the [LibGDX] Particles Editor

First of all, let me just say: if there is a better (i.e. easier) way to do particles than using the libGDX editor and engine in Java then I’d be happy to hear about it.

I’m fairly sure I get the basic concept of particles and how to use them in libGDX using the built in particles engine. I have a few examples of successfully rendering particles - albeit using the particles that others have created online.

However, trying to create my own particle effects using the editor is stumping me. Up till now, I’ve been told “just play around and see what everything does” and I have tried that. The problem is that I’m not really any the wiser… If I were to get anything like what I wanted it would be more by luck than judgement and not something I’ve achieved thus far.

I don’t know if it’s relevant since it’s my general ability to use the tool that’s lacking, but I’m currently trying to get some small red particles (blood) to splash upwards and then fall to the floor - an effect for when a character dies. In the past I have also tried (and failed )to create a shower of sparks which would be a similar effect except, obviously, using sparks instead of blood.

Anyone who is able to clearly explain how to use this complicated looking tool or explain another approach entirely that I can actually use would earn my undying and eternal gratitude.

Bump

I didn’t really like the interface and the code implementation… I prefer to just code my own… using the Spritebatch as a particle system is pretty fast

Hi phunni,

I have a blog which happens to have an article on the Libgdx particle editor and what each of the parameters do with a couple of examples.

Here is a list of what each of the parameters do:

2D Particle Effect Editor Properties Explained

So what are the different properties in the editor? Well they are:

Image
    This is where we can add our own custom image to be used as a particle. Usually, the default image is fine and will be suitable for most of our effects. Sometimes you will want to add your own. For example, if you wanted a 1-UP effect to pop out of the player you can use an image with 1-UP text.
Default
    This is to reset the image back to the default image if you changed the image previously.
Default (Premultiplied Alpha)
    This set the image to be used to the default image and then sets the blending type. To view the difference, try using the default image with the default fire effect, then swap to the premultiplied alpha version and see what happens.
Count
    The count is used to define how many particles there should be at any time during the effect. The two boxes set the minimum and maximum amount. If the min is 0 and the max is 0 then no particles will ever be made or drawn. If the min and max are both 10 then there will always be 10 particles drawn, if one finishes another is created to replace it.
Delay
    The delay as expected delays the particles from being made. This is useful when you use multiple effects as you can have a fire effect which runs for about 1 second, then a smoke effect with a delay of 0.8-1.0 seconds so the fire appears to change to smoke.
Duration
    The Duration is the value that sets how long the Effect runs. A duration of 1000 means the effect will last for 1 second.
Emission
    This defines how the particles are spawned. If the minimum value is 5 then each second at least 5 particles will spawn. If the max is 100 then up to 100 can spawn per second. This is useful for effects like smoke which should fizzle out the longer it runs. so you can have it start or 20 particles per second and run down to 0. (This requires the duration graph to be used and will be covered later in this tutorial)
Life
    This sets how long a particle will live for. If you set this to 1000 (1 second) the particle will last for 1 second then get removed. This is not 1 second from the start of the effect as a particle can be created at any time.
Life offset
    This allows you to have a particle that starts part way through their life cycle. So particles that have a full life to live all the way down to particles that are just about to be killed off can spawn.
X-Offset
    Adds an offset on the x axis to each particle. Negative values make particles spawn more to the left and positive values to the right.
Y-Offset
    Adds an offset on the y axis to each particle. Negative values spawn more to the bottom and positive more to the top.
Spawn
    This sets the shape of the area where particles can spawn.
Spawn Width
    Sets the width of the spawn shape.
Spawn Height
    Sets the height of the spawn shape.
Size
    Sets the size of the particles.
Velocity
    Sets the speed of the particles.
Angle
    Sets the angle that the particles face. Only visible if velocity is set.
Rotation
    Sets the rotation of the particle. Not very useful with the round default image.
Wind
    Adds a force to move particles left or right to simulate the wind.
Gravity
    Adds a force to move particle up or down to simulate gravity.
Tint
    Colours the particles from left to right of the gradient defined.
Transparency
    Sets the opacity of the particle over its lifetime.
Options
    Allows you to change the properties of the Effect:
        Additive: Additive blending on/off.
        Attached: sets whether the particles move with the emitter or stay in the same place.
        Continuous: Should the effect loop or run once.
        Aligned: Particles should rotate with the emitter on/off.
        Premultiplied Alpha: Premultipled blending on/off.

If you want to learn more you can view it on https://www.gamedevelopment.blog/particle-effects-libgdx-2d/

@dfour thank you - that looks most helpful.

That’s a very helpful tutorial - thanks very much. Much makes sense to me now that didn’t before.

It doesn’t look as though there’s a way to define a “floor” - apart from box2d, which would be massive overkill - so I may just have to implement the “blood splash” myself anyway. Still a massively useful learning experience though - thanks again! @dfour