Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mirror a sprite
#5
oblo Wrote:EDIT: I've just got to understand it. The function mirrors something it's already printed on the screen, but don't mirror sprites "on the go" (that's what's I was looking for Sad )

Cheers.

I don't think you can write a function to mirror a sprite that's generic. A function returns one number. Sprites are always made of multiple bytes (sometimes quite a lot of bytes). This is the core of a routine that can be used to mirror sprites; but since there's no way to know how you are ordering your data for the sprites (size of sprite, order from left to right or columns, masking data, colour data?) there's no way to write a simple piece of code that works for your game. What you have here is the core function that reverses the pixels. You'd have to build a sprite flip routine that works for your sprite shape and size and features using this as the key bit.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)