Example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer circle

List of usage examples for com.badlogic.gdx.graphics.glutils ShapeRenderer circle

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer circle.

Prototype

public void circle(float x, float y, float radius) 

Source Link

Document

Calls #circle(float,float,float,int) by estimating the number of segments needed for a smooth circle.

Usage

From source file:broken.shotgun.throwthemoon.actors.Boss.java

License:Open Source License

@Override
public void drawDebug(ShapeRenderer shapes) {
    if (!getDebug())
        return;//  w  w w  .  j  av  a  2s.co m
    shapes.set(ShapeRenderer.ShapeType.Line);
    shapes.setColor(Color.GRAY);
    shapes.rect(getX(), getY(), getWidth(), getHeight());
    shapes.setColor(Color.GREEN);
    shapes.rect(collisionArea.x, collisionArea.y, collisionArea.width, collisionArea.height);
    shapes.setColor(Color.RED);
    shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f);
}

From source file:broken.shotgun.throwthemoon.actors.Moon.java

License:Open Source License

@Override
public void drawDebug(ShapeRenderer shapes) {
    super.drawDebug(shapes);
    if (!getDebug())
        return;//from  ww w  . ja  va 2s .c o  m
    shapes.setColor(Color.GRAY);
    shapes.rect(getX(), getY(), getWidth(), getHeight());
    shapes.setColor(Color.RED);
    shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f);
}

From source file:broken.shotgun.throwthemoon.actors.Player.java

License:Open Source License

@Override
public void drawDebug(ShapeRenderer shapes) {
    if (!getDebug())
        return;/*ww  w.  j av  a 2 s  .co  m*/
    shapes.set(ShapeRenderer.ShapeType.Line);
    shapes.setColor(Color.GRAY);
    shapes.rect(getX(), getY(), getWidth(), getHeight());
    shapes.setColor(Color.GREEN);
    shapes.rect(collisionArea.x, collisionArea.y, collisionArea.width, collisionArea.height);
    shapes.setColor(Color.RED);
    shapes.rect(attackArea.x, attackArea.y, attackArea.width, attackArea.height);
    shapes.setColor(Color.RED);
    shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f);
}

From source file:com.jmstudios.pointandhit.ShootAnimation.java

License:Open Source License

public void draw(ShapeRenderer shapeRenderer) {
    if (shooting) {
        ShapeType previousType = shapeRenderer.getCurrentType();
        shapeRenderer.set(ShapeType.Filled);
        shapeRenderer.setColor(targetManager.currentTheme.bullet);
        shapeRenderer.circle(currentX, currentY, currentRadius);
        shapeRenderer.set(previousType);
    }//from   w ww  .jav a 2  s  . com
}

From source file:com.jmstudios.pointandhit.Target.java

License:Open Source License

public void draw(ShapeRenderer shapeRenderer) {
    ShapeType previousType = shapeRenderer.getCurrentType();
    shapeRenderer.set(ShapeType.Filled);
    if (currentRadius > 0) {
        shapeRenderer.setColor(targetManager.currentTheme.target);
        shapeRenderer.circle(centerPosition.x, centerPosition.y, getRadius());
    }/* w w  w. j  a  v  a 2 s  .  co m*/
    if (dying) {
        shapeRenderer.setColor(targetManager.currentTheme.background); // Background color
        shapeRenderer.circle(centerPosition.x, centerPosition.y, currentDyingRadius);
    }
    shapeRenderer.set(previousType);
}

From source file:com.jmstudios.pointandhit.UserPointer.java

License:Open Source License

public void draw(ShapeRenderer shapeRenderer, GameTheme gameTheme) {
    ShapeType previousType = shapeRenderer.getCurrentType();
    shapeRenderer.set(ShapeType.Filled);
    shapeRenderer.setColor(gameTheme.userPointer);
    Vector2 centerPosition = getCenterPosition();
    shapeRenderer.circle(centerPosition.x, centerPosition.y, radius);
    shapeRenderer.set(previousType);/*from w  ww.  j av  a 2 s. c o m*/
}

From source file:com.nebula2d.editor.framework.components.Circle.java

License:Open Source License

@Override
public void render(GameObject selectedObject, SpriteBatch batcher, Camera cam) {
    if (gameObject != null && r % 360 != 0) {
        batcher.end();/*from   w  w w .  j av a 2  s.c om*/
        ShapeRenderer shape = new ShapeRenderer();
        shape.setProjectionMatrix(cam.combined);
        shape.setColor(Color.RED);
        shape.begin(ShapeRenderer.ShapeType.Line);

        float x = gameObject.getPosition().x;
        float y = gameObject.getPosition().y;

        shape.circle(x, y, r);

        shape.end();
        batcher.begin();
    }
}

From source file:com.nebula2d.editor.framework.GameObject.java

License:Open Source License

public void render(GameObject selectedObject, SpriteBatch batcher, Camera cam) {
    if (renderer != null && renderer.isEnabled()) {
        renderer.render(selectedObject, batcher, cam);
    } else {//  w w w .  jav  a 2  s .co m
        batcher.end();
        Gdx.gl.glEnable(GL20.GL_BLEND);
        ShapeRenderer shape = new ShapeRenderer();
        shape.setProjectionMatrix(cam.combined);
        OrthographicCamera ortho = (OrthographicCamera) cam;
        shape.begin(ShapeRenderer.ShapeType.Filled);
        shape.setColor(new Color(0f, 1f, 0f, 0.5f));
        shape.circle(getPosition().x, getPosition().y, 4 * ortho.zoom);
        shape.end();
        Gdx.gl.glDisable(GL20.GL_BLEND);
        batcher.begin();
    }
    for (IRenderable renderable : renderables) {
        if (((Component) renderable).isEnabled()) {
            renderable.render(selectedObject, batcher, cam);
        }
    }
}

From source file:com.tussle.collision.CollisionCircle.java

License:Open Source License

public void draw(ShapeRenderer drawer) {
    drawer.circle((float) x, (float) y, (float) radius);
}

From source file:com.tussle.collision.CollisionStadium.java

License:Open Source License

public void draw(ShapeRenderer drawer) {
    drawer.circle((float) startx, (float) starty, (float) radius);
    drawer.circle((float) endx, (float) endy, (float) radius);
    double len = FastMath.hypot(endx - startx, endy - starty);
    if (len > 0) {
        double dx = (starty - endy) * radius / len;
        double dy = (endx - startx) * radius / len;
        drawer.line((float) (startx + dx), (float) (starty + dy), (float) (endx + dx), (float) (endy + dy));
        drawer.line((float) (startx - dx), (float) (starty - dy), (float) (endx - dx), (float) (endy - dy));
    }//  www .  java  2s  .  com
}