I'm making a game through LibGDX and working with Java in Eclipse. I'm using the ShapeRenderer class to create a normal rectangle and rotate it continuously. I am using the logic given from the LibGDX docs to rotate the rectangle:
Drawing the rectangle is done by:
shapeRenderer.rect(x, y, width, height);
However, the example given in docs to rotate the rectangle requires the following code:
shapeRenderer.rect(-width / 2, -height / 2, width, height);
You can see the code to rotate the shape requires the "x" and "y" parameters to have the width and height of the rectangle, this means that I lose control of where I want to position the rectangle whilst it rotates (granted the rectangle does rotate exactly how I want it to just not where I want it to). The rectangle's POSITION because of this code is now proportional to its SIZE. Is there any way around this because I need to give the rectangle a given size and a different x, y co-ordinate. Thank you in advance.