eu_genes Posted October 20, 2014 Share Posted October 20, 2014 I have spritesheet circles.png, size sprite 56x56this.load.spritesheet('circles', 'img/circles.png', 56, 56, 2);this.add.sprite(x, y, 'circles', 1);but in result i have artifactWTF? Link to comment Share on other sites More sharing options...
lewster32 Posted October 20, 2014 Share Posted October 20, 2014 Don't draw right up to the edges of the frame, as some of the next frame will spill over into it when scaled, moved, rotated etc. Leave a 1 pixel gap between the edges of your sprites and the edges of each frame and you should be fine. Link to comment Share on other sites More sharing options...
rich Posted October 20, 2014 Share Posted October 20, 2014 Yup, if you use a texture atlas instead of a sprite sheet you'll find most atlas software has a default automatic padding of 2px for this reason. Link to comment Share on other sites More sharing options...
stupot Posted October 21, 2014 Share Posted October 21, 2014 The pixels don't exactly spill over into your desired frame, you are actually using pixel info outside of your frame. With scaling, the sampling of the source pixels isn't always constrained to your frame, under the right conditions (scale/antialiasing mode etc) it will sample the pixels neighbouring your frame boundary. This isn't a new thing, it's been wasting a lot of time for a lot of people since forever. You will most often get away with just a single pixels worth of nothingness (zero alpha) inbetween your frames. You won't need this at the edge of the graphic unless texture wrapping is being applied. Link to comment Share on other sites More sharing options...
Recommended Posts