How to use a tileset of "stackable" tiles? (PlanetCute tileset)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Andre Scutieri
:warning: Old Version Published before Godot 3 was released.

Hello, I’ve already made some projects using Godot, but only using “normal” tiles (square ones with 16x16 and so on). But this new project of mine wants to use the PlanetCute tileset, a “stackable” one with 151x171 tiles. Every tile has a “front” face and a “top” face. For it to be stackable, I need to paint one on top of the other, so the bottom one only shows its “front”, and the topmost block shows both its “front” and its “top”. You can see how here:

In the rightmost column, starting from the bottom up, you see a “dirt” block (front only), on top of it another “dirt” block (front + top), and behind it another “dirt” (top only).

I imported the tiles into my tileset and changed its offset so the + cursor would be centered on the “front” face, like this:

centered

But when I try to stack it on my tilemap, the layers overdraw each other:

overdrawing

I tried changing the Z index, drawing from the topmost down, from the bottommost up, no avail. I think there is something wrong with the way I’m configuring the tiles in my tileset, before importing it to my tilemap, but I have no idea about it. How can I use this tileset in my project?

The whole tileset can be obtained here: direct link to the zip!

:bust_in_silhouette: Reply From: kidscancode

Hi, I was actually in the middle of doing a tilemap tutorial when I saw your post. I downloaded your images and tested them out, here’s what I got working:
enter image description here

I used a Cell size of (101, 80) which seemed to space the tiles out great, and set Tile Origin to “Center”. For doing the other layers, I just made each one have an offset of +/- (0, 120) to shift it up or down. Tilemaps are in order, bottom layer first.

enter image description here

Hope this helps! Let me know if you’d like a Godot project download, too.