Godot: Invert YSort on TileMap and YSort nodes

Created on 25 Jul 2018  路  5Comments  路  Source: godotengine/godot

As everyone knows the TileMap node and YSort node work by allowing objects with a higher Y value overlap objects of a lower Y value. I simply would like a option in these nodes to invert the YSort and allow objects with a lower Y value to overlap objects of a higher Y value. I have drawn a small example of what I mean if it is still unclear.
capture

archived feature proposal core

Most helpful comment

@groud Hey, i'd like to hijack this issue for a more refined feature request:

Deprecate YSort and introduce DirectionalSort. DirectionalSort takes a Vector2 unit vector to determine the direction in which to sort.

This would allow for the original proposal to function, and enable games that take place on diagonal grids or that have skewed perspectives to work better. We can also change it on the fly for cool visual effects.

All 5 comments

@groud Hey, i'd like to hijack this issue for a more refined feature request:

Deprecate YSort and introduce DirectionalSort. DirectionalSort takes a Vector2 unit vector to determine the direction in which to sort.

This would allow for the original proposal to function, and enable games that take place on diagonal grids or that have skewed perspectives to work better. We can also change it on the fly for cool visual effects.

enable games that take place on diagonal grids or that have skewed perspectives to work better

Do you have any example where YSort would not be enough ?

Honestly, I don't see any common use case for that so I don't think it's worth implementing it in the core.

I think this might be possible already by rotating the YSort node so it sorts in the direction you want, and then "unrotating" all its children.

I don't think that is a viable solution. Not only do you need a script that unrotates everything, but it _also_ would rotate the coordinate space everything moves in, forcing you to set everything as top level which means global coordinates only, or to rotate all your game logic with it.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdwardAngeles picture EdwardAngeles  路  3Comments

blurymind picture blurymind  路  3Comments

Zylann picture Zylann  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments

ducdetronquito picture ducdetronquito  路  3Comments