0

I have been playing around with LibGDX.

I cannot figure out how to draw an arc with a certain thickness on a 2D canvas. This is what I got so far:

    //draw the outline of the rectangle
    shapeRenderer.begin(ShapeType.Line);
    shapeRenderer.setColor(255/255.0f, 109/255.0f, 120/255.0f, 1f);
    shapeRenderer.arc(0, 0, 30, 0, 270);
    shapeRenderer.end();
Irfan
  • 4,301
  • 6
  • 29
  • 46
Danny Watts
  • 579
  • 1
  • 6
  • 18

1 Answers1

2

Not sure here been a while since i have used libgdx but:

shapeRenderer.begin(ShapeType.Line);
shapeRenderer.setColor(255/255.0f, 109/255.0f, 120/255.0f, 1f);
shapeRenderer.arc(0, 0, 30, 0, 270);
Gdx.gl10.glLineWidth(lineWidth)
shapeRenderer.end();

Might do the trick.

Irfan
  • 4,301
  • 6
  • 29
  • 46
RustyH
  • 473
  • 7
  • 22
  • Not that a `glLineWidth` other than `1.0` is not supported in all OpenGL ES implementations. See: http://stackoverflow.com/questions/16680908/libgdx-gl10-gllinewidth?rq=1 – P.T. Apr 15 '14 at 05:19
  • And also, the width won't be the same on android and desktop – Boldijar Paul Apr 15 '14 at 17:57