Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

farhanx

[java] flip an image to horizontal ???Direction problem

This topic is 5219 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

hi! i have made a sprite with some characters , now all characters directions are in sprites at left hand side. Now what i want is to move their direction or flip them (to right hand side) horizontal so they will change their direction to right hand side. I have done this by putting negative value of width but problem is it changes its X axis position that looks too odd....is there any good way to do the same thing without making more sprites????

Share this post


Link to post
Share on other sites
Advertisement
subtract 1/2 of the width of the sprite from the x coordinate of the sprite when it is facing left, and add 1/2 of the width of the sprite to the x coord of the sprite when it is facing right. Try that, if it doesn''t work right away, swap the subtraction and addition.




capn_midnight | Captain Midnight | deviantArt
ACM | SIGGRAPH | Generation5
"I''m tired of all this nonsense about beauty being only skin-deep. That''s deep enough. What do you want - an adorable pancreas?" -Jean Kerr

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!