For my useless month project, I am working on an emulator to run J2ME programs on Android. But now I'm stuck in a J2ME Sprite implementation. In particular, the transformations used in it.
In my sprite, I have a bitmap with three characters. I would like to draw a second frame, flipped or rotated 90 degrees. What would be the best way to do this?
I have the following code that draws this frame without any transformations.
frameX, frameY - coordinates of the frame position when creating a 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 it, I need to do uterine magic on canvas, but I could not understand it :)
source
share