Jump to content

Problem with transparency in tilemap


claytron
 Share

Recommended Posts

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

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

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

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.

Photoshop_2017-11-14_14-58-56.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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