# LibGDX ShapeRenderer rotated

I'm having a weird problem with the LibGDX ShapeRenderer where it draws everything rotated. Here are some images to show you what i mean:

This is what it looks like in Tiled(Map Editor):

This is how it looks like in game:

As you can see, its rotated.

Heres the Code i use to render the mapobjects:

    shapeRenderer.setProjectionMatrix(cam.combined);
shapeRenderer.setColor(1, 1, 0, 1);
shapeRenderer.begin(ShapeType.Line);
for (RectangleMapObject o : MovementSystem.objects.getByType(RectangleMapObject.class)) {
Rectangle rect = o.getRectangle();
shapeRenderer.rect(rect.x, rect.y, rect.height, rect.width);
}

shapeRenderer.end();


The rectangle is positioned at the right place and it is definitely NOT rotated! I checked this with a small collision detection test where i moved another rectangle over this one. So it just gets drawn like this and i have no idea why^^ Would be nice if anybody could help me :)

• rect expects first the width, then the height of the rectangle. You pass them the other way around. Is that intentional? Aug 5, 2014 at 15:02