Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  

Auto alignment of sprites in png format

Recommended Posts

I had read somewhere that XWE supported auto alignment of sprites in png format, and I did a search of the forums to come up with this thread. The closest reference is what Csabo said: There's a "W: Auto button", which controls whether the image is displayed as an weapon sprite or not. You can toggle three settings: Auto (like XWE old behavior), OFF or ON.

Is there something I need to switch on or off to enable auto alignment? Here's what I do to import png format sprites:

    1. Always Load PNG Files as Raw Data box is checked off in the View\Options\Special tab.
    2. Double Click on the Sprites button in the Filter Tool Bar.
    3. Import the png images I want.
The problem is that the sprites are not auto aligned. This means I have to manually align dozens of images. How do I auto-align them?

Share this post

Link to post

Hi Rex,

Sorry for the delay. XWE cannot do what you're looking for yet. I understand your request perfectly, but this functionality is a bit weird... When PNGs are imported, the whole approach is "import as Raw". But if we're going to auto align them, then it's not just raw data anymore, the PNG will actually be modified. I've been thinking about this for a while, but haven't figured all the details yet. I'll try to add it as soon as I can.

Share this post

Link to post

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.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this