Reputation: 2357
I'm developing a game in Android and Java. In android I am using andengine for sprite image and i was able to rotate in all directions.
int bikeFrame:
//bikeFrame++,bikeFrame--
bikeSprite.setRotation(bikeFrame);
I want to make the game in j2me also. But in j2me we have only four methods to rotate angle
(TRANS_MIRROR,TRANS_MIRROR 90,TRANS_MIRROR 270,TRANS_MIRROR 180)..
If i take images as frames I am still not getting smooth animation.
How to rotate sprite image in all angles in j2me?
Upvotes: 3
Views: 1238
Reputation: 6895
See this thread, omarhassan123 created a code snippet that should allow you to rotate the image by any angle you like.
There is a library called J2ME ARMY KNIFE that provides all sorts of image manipulation techniques, you can get it here.
Also, see this question: Image rotation algorithm
Another idea: decompile a game called Flexis Extreme. They do a lot of image rotation in real time so you could try to find out how they did it.
Upvotes: 2
Reputation: 4043
If you can, try LWUIT Image.rotate
there is a sample at this page http://lwuit.blogspot.com.br/2008/11/round-round-infinite-progress-and.html
Upvotes: 0