I am working on a J2ME landscape game.I have created a rectangle using fillRect() like this.
gr.fillRect(52,180,5,10);
Now I want to do rotation,and check collision with this rectangle.Is this possible?Is there any way to convert this fillrect() image to a sprite? How can I manage it?
I have done it with immutable image.I used same coordinates as fillRect()
Image source; // the image to be copied
source = Image.createImage(...);
Image copy = Image
.createImage(source.getWidth(), source.getHeight());
Graphics g = copy.getGraphics();
g.drawImage(source, 0, 0, TOP|LEFT);
But it is impossible to rotate.