Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Y coord have decrease as this go up (offset, objects position) ? #3869

Closed
webrobot1 opened this issue Jan 9, 2024 · 1 comment
Closed
Labels
bug Broken behavior.

Comments

@webrobot1
Copy link

webrobot1 commented Jan 9, 2024

A lot of system have:

as Y go up it will be increase, but tiled have another reaction. As example look how MYSQL see polygon from example map (Unity engine have a same coord's system)
image

If start poin is 0, 0 all what will be lower foк Y must be decrease, not increase as in Tiled

image

And like example is standart coord grill (up is increase, tiled have decrease)

image

@webrobot1 webrobot1 added the bug Broken behavior. label Jan 9, 2024
@webrobot1 webrobot1 changed the title Why Y coord have decrease as this go up ? Why Y coord have decrease as this go up (offset, objects position) ? Jan 9, 2024
@bjorn
Copy link
Member

bjorn commented Jan 9, 2024

A lot of system have:

While that's true, a lot of other systems (especially GUI applications and 2D rendering APIs) use a downwards Y axis with 0,0 in the top-left. See for example the coordinate system used by QPainter, GTK, Java Swing and 2D API, LÖVE's coordinate system, SDL's rects, Allegro, CSS object model, etc.

The Y axis going down means Tiled uses a left-handed coordinate system. It's not right or wrong, it just needs to be taken into account when rendering Tiled maps using a framework with a right-handed coordinate system.

There is an issue open about supporting an inverted Y axis in Tiled (#249), however its most recent implementation (#2040) is a little stuck because inverting the Y axis is not just a display change, but also affects object origins and should possibly even affect the direction of the rotation. It's unclear to me whether it is really worth supporting.

@bjorn bjorn closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

2 participants