claytron

Problem with transparency in tilemap

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?

Share this post


Link to post
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. 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.