I'm trying to draw sprites created by texture packer (one big bitmap with informations such as width, height, position, texture rect for each sprite) It's not clear how to draw a sprite in case that it should be rotated by 90 degrees. I tried rotating canvas but I didn't success (sprite didn't appeared in right position)
This is how I draw regular (not rotated) sprites:
Rect srcRect = <a rect in the big bitmap> (for example left=0, top=0, right=100, bottom=80)
Rect destRect = new Rect(spriteOffsetX, spriteOffsetY, spriteOffset.x + spriteWidth, spriteOffset.y + spriteHeight);
canvas.drawBitmap(bitmap, srcRect, destRect, null);
With rotated sprites I rotate canvas
canvas.rotate(-90f, canvas.getWidth() / 2.0f, canvas.getHeight() / 2.0f);
and draw sprite the same way as regular (not rotated) sprite. But it appears in wrong position.
Could somebody help with this problem?