Exemplo n.º 1
0
 public void drawLine(
     TextureRegion tex, Vector2 p1, Vector2 p2, Color col, float width, boolean precise) {
   Vector2 v = SolMath.getVec(p2);
   v.sub(p1);
   drawLine(tex, p1.x, p1.y, SolMath.angle(v, precise), v.len(), col, width);
   SolMath.free(v);
 }
Exemplo n.º 2
0
 public void drawCircle(
     TextureRegion tex, Vector2 center, float radius, Color col, float width, float vh) {
   float relRad = radius / vh;
   int pointCount = (int) (160 * relRad);
   Vector2 pos = SolMath.getVec();
   if (pointCount < 8) pointCount = 8;
   float lineLen = radius * SolMath.PI * 2 / pointCount;
   float angleStep = 360f / pointCount;
   float angleStepH = angleStep / 2;
   for (int i = 0; i < pointCount; i++) {
     float angle = angleStep * i;
     SolMath.fromAl(pos, angle, radius);
     pos.add(center);
     draw(tex, width, lineLen, (float) 0, (float) 0, pos.x, pos.y, angle + angleStepH, col);
   }
   SolMath.free(pos);
 }