Example usage for com.badlogic.gdx.graphics.g2d ParticleEffect draw

List of usage examples for com.badlogic.gdx.graphics.g2d ParticleEffect draw

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d ParticleEffect draw.

Prototype

public void draw(Batch spriteBatch, float delta) 

Source Link

Usage

From source file:se.danielj.skuttandenyancat.systems.EffectSystem.java

License:GNU General Public License

@Override
protected void process(Entity e) {
    Position position = pm.get(e);
    Matrix4 m = new Matrix4();
    m.translate(position.getX(), position.getY(), 0);
    batch.setTransformMatrix(m);//from   w  w w .j  a  v  a 2s . c  o  m
    ParticleEffect particleEffect = em.get(e).getParticleEffect();
    particleEffect.draw(batch, world.getDelta());
    if (particleEffect.isComplete()) {
        particleEffect.dispose();
        world.deleteEntity(e);
    }
    m.translate(-position.getX(), -position.getY(), 0);
    batch.setTransformMatrix(m);
}

From source file:se.danielj.slashatthegame.systems.EffectSystem.java

License:GNU General Public License

@Override
protected void process(Entity e) {
    Position position = pm.get(e);
    Matrix4 m = new Matrix4();
    m.translate(position.getX() * 10 + 75, position.getY() * 10 + 75, 0);
    batch.setTransformMatrix(m);//w  ww .  ja  va 2  s.  com
    ParticleEffect particleEffect = em.get(e).getParticleEffect();
    particleEffect.draw(batch, world.getDelta());
    //      if (particleEffect.isComplete()) {
    //         em.get(e).dispose();
    //         world.deleteEntity(e);
    //      }
    m.translate(-position.getX(), -position.getY(), 0);
    batch.setTransformMatrix(m);
}