Example usage for com.badlogic.gdx.math.collision BoundingBox getCenterX

List of usage examples for com.badlogic.gdx.math.collision BoundingBox getCenterX

Introduction

In this page you can find the example usage for com.badlogic.gdx.math.collision BoundingBox getCenterX.

Prototype

public float getCenterX() 

Source Link

Usage

From source file:com.quadbits.gdxhelper.actors.ParticleEffectActor.java

License:Apache License

@Override
public void drawDebug(ShapeRenderer shapes) {
    super.drawDebug(shapes);

    if (!this.getDebug() || effect == null)
        return;/*from  www  . j  av a 2  s. c  o  m*/
    shapes.set(ShapeRenderer.ShapeType.Line);
    shapes.setColor(getStage().getDebugColor());
    BoundingBox boundingBox = effect.getBoundingBox();
    float centerX = boundingBox.getCenterX();
    float centerY = boundingBox.getCenterY();
    float width = boundingBox.getWidth();
    float height = boundingBox.getHeight();
    shapes.rect(centerX - width / 2, centerY - height / 2, width, height);
}