godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 86 forks source link

Align TileMapLayer Horizontally Alongside Node2D #10095

Open agrimminck opened 3 months ago

agrimminck commented 3 months ago

Describe the project you are working on

An Squared-Grid Isometric Online RPG

image

Describe the problem or limitation you are having in your project

As my project uses diagonal-isometric art, it is required to align items horizontally alongside the tile map layer. Right now it can only sort it on the y-axis, but I can't sort it on the X axis, so it ends up looking like the image above. When a character is on the same y coordinate as a tilemap cell, it does always look under it, or if I do some tweaks, always look over it.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would let me align the tile map (trees in the image) with the Node2Ds (characters in the image) so they can get on top of the tilemap if they are to the right and viceversa

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Use the same behaviour as y-sorting, which can handle tile cells with Node2D's at this point in time, but for the horizontal axis

If this enhancement will not be used often, can it be worked around with a few lines of script?

I have tried and searched on forums on the internet and found nothing about a way to go around this. The only thing that can be achieved is to have a diamond-shaped-cells, that way the y-sorting works because it is a diagonal setup

Is there a reason why this should be core and not an add-on in the asset library?

There is no reason for it to be core. It could be an addon aswell

KoBeWi commented 3 months ago

This was already implemented in https://github.com/godotengine/godot/pull/92787 I think.

agrimminck commented 3 months ago

This was already implemented in godotengine/godot#92787 I think.

I tested that feature but it only works on tilemaps, it does not include Node2D's that are wished to be aligned alongside the tilemap

agrimminck commented 3 months ago

Here's an image of how it works perfectly on diamond-shaped tilemaps image