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

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

Introduction

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

Prototype

public float getCenterY() 

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;//w  w  w  . ja va2s.co 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);
}