1private ShapeRenderer shapeRenderer;
2
3// in create method:
4shapeRenderer = new ShapeRenderer();
5shapeRenderer.setAutoShapeType(true);
6
7// in render method:
8shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
9shapeRenderer.setColor(Color.GREEN);
10shapeRenderer.rect(x, y, width, height);
11shapeRenderer.end();