I just started playing with a very simple game and I do not want to create sprites images for every single body,I just need to colour them with different colours.
As per this thread, ShapeRendere seems to be not a very good idea and it is more for development: When to use ShapeRenderer, Mesh + SpriteBatch, Box2D and Scene2D in Libgdx?
Also, tint can be only be used on textures which require images as well: https://github.com/libgdx/libgdx/wiki/Spritebatch,-textureregions,-and-sprite
This is one the bodies I am trying to colour:
//Dynamic Body
bodyDef = new BodyDef();
//bodyDef.gravityScale
bodyDef.type = BodyType.DynamicBody;
bodyDef.position.set(camera.viewportWidth / 2, camera.viewportHeight / 2);
body = world.createBody(bodyDef);
CircleShape dynamicCircle = new CircleShape();
dynamicCircle.setRadius(10f);
FixtureDef fixtureDef = new FixtureDef();
fixtureDef.shape = dynamicCircle;
fixtureDef.density = 2.5f;
fixtureDef.friction = 0.25f;
fixtureDef.restitution = 0.75f;
body.createFixture(fixtureDef);
Any ideas?