flip images?
BlitzMax Forums/BlitzMax Beginners Area/flip images?
| ||
is there a way to flip an image so that a character that's facing left would then be facing right? |
| ||
SetScale -1,1 DrawImage charFacingLeftImage,x,y |
| ||
Likewise, you can turn it upside-down by SetScale 1,-1 |
| ||
You can also make it backwards, upside-down and squished by SetScale -1,-0.3 :) |
| ||
I had a way of doing this but it involved saving a new picture with the character facing backwards. So whenever I pushed 'S' for example, the character-facing-backward's image would show up, not the one facing forward. |
| ||
I had a way of doing this but it involved saving a new picture with the character facing backwards. That's not very efficient if the flipped image is identical (save for being flipped, of course). |
| ||
I had a way of doing this but it involved saving a new picture with the character facing backwards. Big downside of that is that you need two copies of the images in question in video memory, which may raise the minimum requirements of your game (e.g. doing a setscale using the same image your game may still work on a videocard with 32MB videoram, but using an extra image may push it just beyond that) Also, either you'll have an initial slowdown to create the flipped image on the fly, or you'll increase the size of your game download by needlessly including additional media for the flipped versions... Instead, pressing 'S' could set a variable (e.g. 'flipsprite=true'), and in your drawing yroutine you put a 'if slipsprite=true then setscale -1,1' to do the flipping |