boolean Posted May 9, 2015 Share Posted May 9, 2015 Hi there I'm using a spritemap in my game to hold all my game sprites. I'm basically using it like a manual texture atlas - it's made up of a 32x32 grid that I just draw directly into with all my art assets. What I've found though is that when I'm accessing a 32x32 sprite in my game, it's picking up a single row of pixels from the sprite beside it. Here is a sample of what it looks like: Notice the green line down the center of the orange blob. In my spritesheet it looks like the image below (Note: the blue and pink backgrounds are just so you can see the divisions): I also get a green line above the orange blob since he's below the green square in the spritemap. Is there a setting I'm missing? Is there a way around this? Cheers! Link to comment Share on other sites More sharing options...
Jesse Freeman Posted May 10, 2015 Share Posted May 10, 2015 You're going to want to add at least 2 pixels of padding around each sprite. It's common to have pixel bleed like that in some renderers, I assume it's defaulting to WebGL. If you use something like Texture Packer it will give you the option to add the padding and it will fix everything. Hope that helps. Link to comment Share on other sites More sharing options...
boolean Posted May 10, 2015 Author Share Posted May 10, 2015 Ah nuts, you can't set that in code? Some other frameworks I've used have built in support for padding (plus padding types). Well I'll just pad it manually in the file for now. I've not tried writing any extensions for phaser yet, but if I can figure out where it stores the pixel data it shouldn't be too hard to jam some spacing in there on the fly. Cheers! Link to comment Share on other sites More sharing options...
Recommended Posts