Jump to content

Misaligned sprites


Deathspike
 Share

Recommended Posts

Hi guys,

 

This is really hard question to ask and answer. I have a basic sprite sheet with 32x32 frames and created a class that extends from Phaser.Sprite (TypeScript). After defining a few animations and configuring arcade physics and hooking up buttons to move around with animations, I noticed some frames are misaligned.

 

It looks like the y-axis is misaligned by 1px so I can see the top of the frame directly beneath the selected frame. This happens on SOME frames, not all of them, and not consistently. This is a truly horrible question as there is nothing to go on, so I'm just asking for general guidance that I can try or something that might be known?

 

Thanks!

Link to comment
Share on other sites

You need to provide some padding around your frames as when your sprites are not at whole number positions, or scaled/rotated in such a way that the pixels of your sprite do not line up exactly with the pixels of your display, parts of nearby frames will 'leak' into your current frame. Typically you'd provide spacing of 2 pixels between each frame.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...