Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.GdxRuntimeException


    renderer.color(c2.r, c2.g, c2.b, c2.a);
    renderer.vertex(x2, y2, z2);
  }

  public void curve (float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, int segments) {
    if (currType != ShapeType.Line) throw new GdxRuntimeException("Must call begin(ShapeType.Line)");
    checkDirty();
    checkFlush(segments * 2 + 2);

    // Algorithm from: http://www.antigrain.com/research/bezier_interpolation/index.html#PAGE_BEZIER_INTERPOLATION
    float subdiv_step = 1f / segments;
View Full Code Here


   * @param y2 y of second point
   * @param x3 x of third point
   * @param y3 y of third point */
  public void triangle (float x1, float y1, float x2, float y2, float x3, float y3) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");
    checkDirty();
    checkFlush(6);
    if (currType == ShapeType.Line) {
      renderer.color(color);
      renderer.vertex(x1, y1, 0);
View Full Code Here

   * @param col1 color of the point defined by x1 and y1
   * @param col2 color of the point defined by x2 and y2
   * @param col3 color of the point defined by x3 and y3 */
  public void triangle (float x1, float y1, float x2, float y2, float x3, float y3, Color col1, Color col2, Color col3) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");
    checkDirty();
    checkFlush(6);
    if (currType == ShapeType.Line) {
      renderer.color(col1.r, col1.g, col1.b, col1.a);
      renderer.vertex(x1, y1, 0);
View Full Code Here

  /** Draws a rectangle in the x/y plane. The x and y coordinate specify the bottom left corner of the rectangle. The
   * {@link ShapeType} passed to begin has to be {@link ShapeType#Filled} or {@link ShapeType#Line}. */
  public void rect (float x, float y, float width, float height) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();
    checkFlush(8);

    if (currType == ShapeType.Line) {
View Full Code Here

   * @param col2 The color at (x + width, y)
   * @param col3 The color at (x + width, y + height)
   * @param col4 The color at (x, y + height) */
  public void rect (float x, float y, float width, float height, Color col1, Color col2, Color col3, Color col4) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();
    checkFlush(8);

    if (currType == ShapeType.Line) {
View Full Code Here

   * @param col3 The color at (x + width, y + height)
   * @param col4 The color at (x, y + height) */
  public void rect (float x, float y, float width, float height, float originX, float originY, float rotation, Color col1,
    Color col2, Color col3, Color col4) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();
    checkFlush(8);

    float r = (float)Math.toRadians(rotation);
View Full Code Here

  }

  /** Draws a rectangle with one edge centered at x1, y1 and the opposite edge centered at x2, y2. */
  public void rectLine (float x1, float y1, float x2, float y2, float width) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();
    checkFlush(8);

    Vector2 t = tmp.set(y2 - y1, x1 - x2).nor();
View Full Code Here

  /** Draws a cube. The x, y and z coordinate specify the bottom left front corner of the rectangle. The {@link ShapeType} passed
   * to begin has to be {@link ShapeType#Line}. */
  public void box (float x, float y, float z, float width, float height, float depth) {
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();

    depth = -depth;

View Full Code Here

  }

  /** Draws two crossed lines. */
  public void x (float x, float y, float radius) {
    if (currType != ShapeType.Line) throw new GdxRuntimeException("Must call begin(ShapeType.Line)");
    line(x - radius, y - radius, x + radius, y + radius);
    line(x - radius, y + radius, x + radius, y - radius);
  }
View Full Code Here

  }

  public void arc (float x, float y, float radius, float start, float angle, int segments) {
    if (segments <= 0) throw new IllegalArgumentException("segments must be > 0.");
    if (currType != ShapeType.Filled && currType != ShapeType.Line)
      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");
    checkDirty();

    float theta = (2 * MathUtils.PI * (angle / 360.0f)) / segments;
    float cos = MathUtils.cos(theta);
    float sin = MathUtils.sin(theta);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.utils.GdxRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.