title: LibGDX draw line
body: <p>I'm trying to make something like a slingshot using libGDX.</p>
  
  <p>My code</p>
  
  <pre><code>if (Gdx.input.isTouched()) {
  
          ShapeRenderer sr = new ShapeRenderer();
          sr.setColor(Color.BLACK);
          sr.setProjectionMatrix(camera.combined);
  
          sr.begin(ShapeType.Line);
          sr.line(player.getLeft().x, player.getLeft().y,
                  Global.game_touch_position.x, Global.game_touch_position.y);
          sr.line(player.getRight().x, player.getRight().y,
                  Global.game_touch_position.x, Global.game_touch_position.y);
          sr.end();
  
      }
  </code></pre>
  
  <p>Doing this i will have the output
  <img src="https://i.stack.imgur.com/P2qy4.png" alt="enter image description here">
  This looks awful, and if I debug on my android phone , the logcat is spammed by the message</p>
  
  <pre><code>02-17 18:55:27.371: D/dalvikvm(7440): GC_CONCURRENT freed 1884K, 40% free 8287K/13635K, paused 15ms+2ms, total 40ms
  </code></pre>
  
  <p>And lags, I have like 30 fps when i touch the screen , and 60 when i don't...</p>
  
  <p>I also need to draw the line with a little bit of thickness, so when the line is bigger, i will have to make it thicker, to give a cool look.</p>
  
  <p>Which is the best way to draw a simple line in libgdx ?
  If I won't find any answer probably i'm going to draw circles from a point of the line to the other..this would look ok , but won't look like a slingshot...</p>
  
  <p>Any help?</p>