iKest Posted February 24, 2016 Share Posted February 24, 2016 if x or y is not an integer (for example when using tweens with Easing.Bounce.Out or arcade physics), then sprite rendered from spritesheet whith shift... How to fix it? Link to comment Share on other sites More sharing options...
rich Posted February 24, 2016 Share Posted February 24, 2016 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 More sharing options...
iKest Posted February 25, 2016 Author Share Posted February 25, 2016 Thx for explanation. Rounding course is the most obvious solution. It's just not very easy if you dinamically creating a lot of sprites. And where better to do rounding, in update, prerender of render? Link to comment Share on other sites More sharing options...
lukaMis Posted February 25, 2016 Share Posted February 25, 2016 Where ever you set the x and y of a sprite. Just do this: mySprite.x = Math.round(value): mySprite.y = Math.round(value): or mySprite = this.game.add.sprite(Math.round(value), Math.round(value), 'key'); Link to comment Share on other sites More sharing options...
iKest Posted February 25, 2016 Author Share Posted February 25, 2016 2 hours ago, lukaMis said: Where ever you set the x and y of a sprite. Just do this: ......... During tweenind or physics movements coordinates altered automatically. Link to comment Share on other sites More sharing options...
rich Posted February 26, 2016 Share Posted February 26, 2016 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 More sharing options...
Recommended Posts