Jump to content

Wrong render sprite from spritesheet if x,y is not an integer


iKest
 Share

Recommended Posts

The position of a sprite will make no difference to the frame being rendered. What the above looks like is just standard canvas anti-aliasing because you're using sub-pixel values, so it interpolates the pixels for you, producing those nasty side-effects.

The solution? Round your pixels.

Link to comment
Share on other sites

During motion it doesn't matter so much, it's when it comes to a stop you will notice it.

The renderer has a roundPixels flag, which will round most (but not all) things for you automatically. You can enable it with:

game.renderer.renderSession.roundPixels = true;

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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