Sign in to follow this  
soccerdude21490

[java] rotate a Graphics Image? something like "zuma", don't remember how to do it

Recommended Posts

Hey everyone, well I want to know if anyone knows how to rotate an image? I did it last year, but I don't remember how I did it or where I found out how to do it (I lost the code in numerous reformats of my computer). But basictly if anyone has ever played the game Zuma http://www.tomdownload.com/games/puzzles/images/zuma_big3.jpg , the piece in the center rotates around in a circle to aim at the other balls, thats basictly what I want to do, so if anyone knows how to do it, can you please post some code examples! Thanks!

Share this post


Link to post
Share on other sites
Just cast the Graphics reference to Graphics2D and use Graphics2D.rotate() to rotate your context prior to rendering the image. Alternately you can specify the AffineTransform to use within the drawImage() call.

Share this post


Link to post
Share on other sites
Hi, I was just working on this same problem a few days ago and I think my original thread posting here might be of help.

My goal was to adjust where the player was pointing by having the player pointing to the position of the mouse cursor.

Hope this helps,
- Casey

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this