Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Struggling to get my head around the [LibGDX] Particles Editor  (Read 2354 times)
0 Members and 1 Guest are viewing this topic.
Offline phunni

Senior Newbie

Exp: 17 years

« Posted 2017-08-22 14:07:33 »

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.
Offline phunni

Senior Newbie

Exp: 17 years

« Reply #1 - Posted 2017-08-24 13:05:09 »

Offline tommohawkaction
« Reply #2 - Posted 2017-08-24 13:56:17 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dfour
« Reply #3 - Posted 2017-08-24 15:25:23 »

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:

        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.
        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.
        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.
        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.
        The Duration is the value that sets how long the Effect runs. A duration of 1000 means the effect will last for 1 second.
        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)
        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.
        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.
        Adds an offset on the y axis to each particle. Negative values spawn more to the bottom and positive more to the top.
        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.
        Sets the size of the particles.
        Sets the speed of the particles.
        Sets the angle that the particles face. Only visible if velocity is set.
        Sets the rotation of the particle. Not very useful with the round default image.
        Adds a force to move particles left or right to simulate the wind.
        Adds a force to move particle up or down to simulate gravity.
        Colours the particles from left to right of the gradient defined.
        Sets the opacity of the particle over its lifetime.
        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
Offline phunni

Senior Newbie

Exp: 17 years

« Reply #4 - Posted 2017-08-24 16:38:30 »

@dfour thank you - that looks most helpful.
Offline phunni

Senior Newbie

Exp: 17 years

« Reply #5 - Posted 2017-08-24 22:37:50 »

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
Pages: [1]
  ignore  |  Print  

Riven (847 views)
2019-09-04 15:33:17

hadezbladez (5795 views)
2018-11-16 13:46:03

hadezbladez (2603 views)
2018-11-16 13:41:33

hadezbladez (6211 views)
2018-11-16 13:35:35

hadezbladez (1499 views)
2018-11-16 13:32:03

EgonOlsen (4734 views)
2018-06-10 19:43:48

EgonOlsen (5793 views)
2018-06-10 19:43:44

EgonOlsen (3276 views)
2018-06-10 19:43:20

DesertCoockie (4175 views)
2018-05-13 18:23:11

nelsongames (5501 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!