Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Using Java2D

Started by sponge Nov 22, 2003 at 12:16 PM 0 replies 600+ views
Original Post
sponge
sponge
Ok i want to write a sopwith clone (like Sopwith vs. Ack-Ack/paratrooper) as a simple applet, and to do this i need to rotate an image (for the plane). Now, my question is how would you rotate and flip one image of a plane and load it into an Image array? The loading into an array is easy enough, the only problem is don''t know how to rotate&flip an Image or how to copy it for that matter. I found a rotate method in the Graphics2D class but I''m not sure how to use it. Any help? I know i can also just draw 64 different planes but I''m too lazy and that''s unprofessional. Any help would be appreciated. Thanx..
OrangyTang
OrangyTang
You need to create a blank image first for your copy. Then you do a getGraphics to grab hold of the Graphics2D object. Then you can use the rotate method (or an AffineTransform for more control) while drawing your existing image onto the graphics object of the second one.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.