claytron Posted November 12, 2017 Share Posted November 12, 2017 So I loaded a tilemap into my phaser game. They are based around 32x32 pixel blocks. I have some tiles that don't use the full 32x32 size, and when rendered in Phaser it shows part of it as white instead of transparent. Is there a way to fix this? Or do I just need to make all my tiles 32x32? Link to comment Share on other sites More sharing options...
rich Posted November 13, 2017 Share Posted November 13, 2017 Fixed the tileset image - the problem is the tiles contain white instead of transparent pixels, so edit them in an art package. DiegoMontania 1 Link to comment Share on other sites More sharing options...
claytron Posted November 13, 2017 Author Share Posted November 13, 2017 So even though the tileset is a png they won't be transparent? What do you mean edit them in an art package? Does that mean I need to do something in between making the map and Tiled and loading it into my Phaser game? Thanks for the reply. Sorry if this has been covered. I couldn't find a solution. Link to comment Share on other sites More sharing options...
rich Posted November 13, 2017 Share Posted November 13, 2017 If the pixels are transparent, Phaser will render them as transparent. If they're appearing as white then either you've got a white background to your game (which is showing through the transparent pixels), or the pixels are just white to begin with and need fixing first. Link to comment Share on other sites More sharing options...
claytron Posted November 13, 2017 Author Share Posted November 13, 2017 Ugh. I don't know what I'm doing wrong. Here is what I'm getting. capture is the view in photoshop capture2 is the view in browser capture3 is my map in tiled Link to comment Share on other sites More sharing options...
rich Posted November 13, 2017 Share Posted November 13, 2017 Upload the actual tileset image, not just a screen grab of it. Link to comment Share on other sites More sharing options...
claytron Posted November 14, 2017 Author Share Posted November 14, 2017 Link to comment Share on other sites More sharing options...
claytron Posted November 14, 2017 Author Share Posted November 14, 2017 I've saved it as a png. And tried exporting it as a png supporting transparency... Link to comment Share on other sites More sharing options...
rich Posted November 14, 2017 Share Posted November 14, 2017 Your PNG has an entirely white background, so this is what Phaser will render. What art package are you making the tileset in? Link to comment Share on other sites More sharing options...
claytron Posted November 14, 2017 Author Share Posted November 14, 2017 Photoshop and Tiled. This png is displayed as having a white background too, but it renders transparent. Link to comment Share on other sites More sharing options...
rich Posted November 14, 2017 Share Posted November 14, 2017 The PNG above (the rats one) has a transparent background. It has been saved out correctly as a PNG-24. The tileset PNG a few posts above that has a white background. Open the tileset PNG in to Photoshop and color pick the background. It's solid white. It has no transparency at all. Fix that, and it'll display properly in-game. Link to comment Share on other sites More sharing options...
claytron Posted November 14, 2017 Author Share Posted November 14, 2017 I'm not sure why this worked, but I used quick-export as PNG and it worked. I'm not sure why it didn't work when I didn't do a manual export. Thanks for the help Rich!! Link to comment Share on other sites More sharing options...
Recommended Posts