How to overlay an image over the tiles of a tilemap?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By thatfella12

How would i overlay images onto a tile map such that an image is only visible on its respective tiles and transparent everywhere else. I attached an image to hopefully explain what i’m trying to do more clearly.

I would greatly appreciate any help on this, thanks! :slight_smile:

While testing I thought this method wasn’t actually working but it does. There is probably a better way. However here is one way to do it.

Add a texture rect as a node above the tilemap that will show the picture.
Select the tileset for that tilemap and select each tile that will ‘show through’ the picture below and set its z value to -1.
Those tiles will be drawn behind the texture rect.
Here is an image with a single grass tile showing through the texture below. Note that this is only one tile from the set that gets drawn behind the image.

Technically, I suppose this answers the question “How do you underlay an image under a tilemap” but the outcome seems to be the same.

LeslieS | 2023-01-05 04:53