Libgdx Particle2D looking weird

150 views Asked by At

I have a little application and inserted a particle. Everything is fine, but the Particle is stretched or at least looking weird. This should be a simple call, but i did not find an answer yet.

Particle in Particle Editor looks good, in App looks not good.

Loading Code

    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    app.getAssets().getLogger().setLevel(Application.LOG_DEBUG);
    Gdx.app.log("MyTag", "my informative message");

    app.getAssets().load("badlogic.jpg",Texture.class);
    app.getAssets().load("uiskin.json",Skin.class);
    app.getAssets().load("particle1.p", ParticleEffect.class);
    app.getAssets().load("particle2.p", ParticleEffect.class);

Init code

ParticleEffect effect;
SpriteBatch batch;

    batch = new SpriteBatch();
    effect = app.getAssets().get("particle2.p", ParticleEffect.class);
    //Setting the position of the ParticleEffect
    effect.setPosition(100, 100);
    effect.start();

Render code

    batch.begin();
    //Updating and Drawing the particle effect
    effect.draw(batch, delta);
    batch.end();;
    if(effect.isComplete()){
        effect.reset();
    }

Camera

    app.V_WIDTH = width;
    app.V_HEIGHT = height;
    app.getCamera().setToOrtho(false, app.V_WIDTH, app.V_HEIGHT);
    stage.getViewport().update(width, height, true);

Particle how it should look

0

There are 0 answers