For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it.
In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would be the best way for it?
I have following code that paints the given frame without any transformations.
frameX, frameY are frame position coordinates on give sprite bitmap.
Rect src = new Rect(frameX, frameY, frameX + spriteWidth, frameY + spriteHeight);
Rect dst = new Rect(paintX, paintY, paintX + spriteWidth, paintY + spriteHeight);
canvas.drawBitmap(image, src, dst, null);
As I understand I need to make some matrix magic on the canvas, but I have not been able to figure this out :)