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

Support isometric positioning #200

Open
bitbrain opened this issue Jul 27, 2019 · 0 comments
Open

Support isometric positioning #200

bitbrain opened this issue Jul 27, 2019 · 0 comments
Assignees
Labels
🍃 improvement 🗺 tmx TiledMap editor issues
Projects

Comments

@bitbrain
Copy link
Owner

bitbrain commented Jul 27, 2019

Currently, positioning is always orthogonal and does not consider other tiled maps such as isometric. As a result, positioning an object within Tiled has a different result within braingdx.

New Terminology

  • Map Position a map position is the amount of pixels (x,y) distanced from the origin, however in the orientation of the tiled map itself.
  • World Position world position is the amount of pixels (x,y) distanced from the origin (0,0)
  • Indexed Position an indexed position is the distance of tiles distanced from the origin tile

Design

The new design for position calculations still requires translations between indices and positions, as well as translating map positions to world positions.

interface PositionTranslator {
   float toWorldX(int indexX);
   float toWorldY(int indexY);
   float toWorldX(float mapX);
   float toWorldY(float mapY);
   int toIndexX(float worldX);
   int toIndexY(float worldY);
}

see reference implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍃 improvement 🗺 tmx TiledMap editor issues
Projects
Core
  
Icebox
Development

No branches or pull requests

1 participant