-
Notifications
You must be signed in to change notification settings - Fork 191
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
Helpers overhaul #268
Helpers overhaul #268
Conversation
…als errors in mouse position -> tile position.
Brief overview:
|
|
||
/// Calculates a [`Vec2`] position for a tilemap so that when set to this position, it shows up | ||
/// centered on the screen. | ||
pub fn get_tilemap_center(size: &TilemapSize, tile_size: &TilemapTileSize) -> Vec2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If our tiles are centered now do we need this? Or is that only the case for hex/iso?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but I think so? This is for centering the whole tilemap, right? Currently, our tiles are "centered" in the sense that the center of a tile with TilePos(0, 0)
lies at [0, 0]
in world space.
…ng to order systems using before/after.
Per discussions, an overhaul of helpers that also with the following issues:
Feature Request: API to translate map coords to screen coords #30
Layout of hex tiles is inaccurate, with error accumulating #58
Make neighbour helpers public #278
It provides the ground work for dealing with (but does not yet generate mouse events):
What remains before the PR can move out of draft stage:
docs need to be updated/cleaned up (there are a lot of docs around that no longer belong where they are, or need to be simplified)
update hex shader code to use new tile position to world position code for hexagons
create an example that uses the new code, and confirms that world position -> tile position works correctly
An extension to this PR would create mouse events as requested in #40