ReX
Senior Member
Posts: 1732
Registered: 05-00 |
Csabo, I think I understand the problem you are facing. Meanwhile, while aligning the sprites I realized that a simple formula to auto-align sprites would not always work, particularly in the horizontal axis. Here's what I'm referring to:
Vertical axis auto-alignment can be generally achieved by defining a fixed value for the y-offset (e.g., 5 units), or even allowing the user to define that value. As the "anchor point" for the sprite is always the floor, having a fixed y-offset for each frame will generally work fine.
Horizontal axis auto-alignment, however, might be a different story. The standard formula of (sprite width)/2 works only on actors that are symmetric across the y-axis. If an actor has some part that extends beyond the main body in one direction (e.g., a one-tentacled creature with the tentacle only on the left side; a marching soldier with a rifle on one shoulder), then applying the standard formula will result in lateral "shifting" of the sprite frames. Ideally, what one ought to be able to do (which would be virtually impossible via auto-aligning) is to define the y-axis of the sprite, and rotate the frames around that axis.
Anyhow, please forgive the long-winded narrative above. Don't worry about working on auto-alignment for png format sprites. I don't think I will be creating too many more, as the other aspects of it have been quite tedious and time-consuming.
|