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

Object Positions #15

Open
Zulu-Inuoe opened this issue Jan 14, 2019 · 0 comments
Open

Object Positions #15

Zulu-Inuoe opened this issue Jan 14, 2019 · 0 comments

Comments

@Zulu-Inuoe
Copy link
Owner

Creating this from #14

Tiled Objects (in an Object Layer) have 'surprising' behaviour with regards to the meaning of the X and Y coordinates:

  1. Rectangles and ellipses without width/height values use X/Y as their center
  2. Rectangles and ellipses with their width/height values set use X/Y as their top-left corner
  3. Polygon objects use X/Y to position the first point in the polygon. Rotations rotate about this point
  4. Tile Objects use X/Y as the bottom-left corner
  5. Text Objects use X/Y as their top-left corner

These rules apply even for collision objects in the Tile Collision Editor.

We'd like to come up with a way for users of this library to not have to implement this logic over and over.
My proposed fix would be to keep this code as-is and consider it the 'low level interface'. Then provide a 'high level interface' that provides better-behaving position functions to make it easier for library users so they don't each have to encode these very specific rules in order to get a 1-to-1 with the Tiled editor.

More concretely, something like providing places for object-center, object-left, etc.
We can also toss other utility style functions into this 'high level interface' to overall ease making use of Tiled.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant