Jump to content
  • Advertisement
Sign in to follow this  
soccerdude21490

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

This topic is 4033 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!