As a beginner(in GdxLib+Android), i found that for rendering particular screen, we can render that using both ways then when to use specific ones? & What is the best option for Updating the smaller part/region of the screen?


1 Answer 1


per documentation ShapeRenderer isn't efficient and shouldn't be used intensively.

Renders points, lines, rectangles, filled rectangles and boxes. This class is not meant to be used for performance sensitive applications but more oriented towards debugging.

That being said, I asked for opinions on its real impact here, but since I've got no answer yet, I decided to give a try. It's working nice so far but if you can use a texture, I'd say to go with that. (I'm not using a texture because I'm writing a small library and don't want to include non code).

  • \$\begingroup\$ Got it. Thanks. Any comments on 2nd Question - about updating small regions of the screen? \$\endgroup\$
    – vintesh
    Feb 21, 2013 at 14:54
  • \$\begingroup\$ @vintesh Sorry, but I really didn't get what you want to know there. English isn't my primary language. \$\endgroup\$
    – petervaz
    Feb 21, 2013 at 14:58
  • \$\begingroup\$ I want to know that suppose i have rendered the whole grid/screen using the Texture but now suppose i want to change the one rectangle area then what should i use... ? I am using code spriteBatch.begin(); spriteBatch.draw(texture, x,y,x,y); spriteBatch.end(); code but i failed to get change the rect. \$\endgroup\$
    – vintesh
    Feb 21, 2013 at 16:04
  • 1
    \$\begingroup\$ @vintesh just to be sure, are you making that second call inside the draw() method? perhaps if you shared you code it would be easier to help. \$\endgroup\$
    – petervaz
    Feb 21, 2013 at 16:41
  • \$\begingroup\$ link I am unable to update the position of TILE of the grid that code is in "app.game.robo.objects.renderer" package. \$\endgroup\$
    – vintesh
    Feb 21, 2013 at 18:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .