Search code examples
javalibgdxparticles

particle effect does not appear in libgdx?


EDIT
OK I found this video that explains how to use it : http://www.youtube.com/watch?v=LCLa-rgR_MA

it works with this code:

//in create
effect = new ParticleEffect();
FileHandle fileDir = Gdx.files.internal("data");
effect.load(Gdx.files.internal("data/myParticleTxtFile"), fileDir);
effect.start();

//in render
effect.draw(batch, Gdx.graphics.getDeltaTime());
batch.end();

Previous message: I created a particle effect with the particle editor, I added the text file to the data folder. The particle constructor needs an atlas, so I created a new atlas with TexturePacker but I could not make it work.


Solution

  • OK I found this video that explains how to use it : http://www.youtube.com/watch?v=LCLa-rgR_MA

    it works with this code:

    //in create
    effect = new ParticleEffect();
    FileHandle fileDir = Gdx.files.internal("data");
    effect.load(Gdx.files.internal("data/myParticleTxtFile"), fileDir);
    effect.start();
    
    //in render
    effect.draw(batch, Gdx.graphics.getDeltaTime());
    batch.end();