-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Make Hexagonal tiles rotate 180 degrees to fit grid #107728
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
base: master
Are you sure you want to change the base?
Conversation
Could you elaborate on that? Like you said, that would seem ideal. |
|
Not sure if this is a good change. For a full-hex tile rotating by 90° doesn't make much sense indeed (as it won't fit the hex grid), but note that the tile visuals might be not matching the tile shape, e.g. it could be only some prop/item in the middle of the tile etc. Thus I'm not sure if 90° rotations are always undesired. AFAICT #107510 is mainly about not being able to rotate by 60°. Being able to rotate hex-tiles by 90° would probably be a non-issue if it would be possible to switch between 90°/60° rotations (and 60° would be the default mode for hexes). Aka I consider 90° rotations for hex tiles as an additional option/feature, not sure if disallowing it editor-wise is a correct solution here, even given 60° rotations are currently not supported at all. Just something to consider before merging. 🙃 |
@@ -1522,18 +1522,30 @@ int TileMapLayerEditorTilesPlugin::_get_transformed_alternative(int p_alternativ | |||
bool transform_flip_v = p_alternative_id & TileSetAtlasSource::TRANSFORM_FLIP_V; | |||
bool transform_transpose = p_alternative_id & TileSetAtlasSource::TRANSFORM_TRANSPOSE; | |||
|
|||
bool is_hexagon = _get_edited_layer()->get_tile_set()->get_tile_shape() == TileSet::TILE_SHAPE_HEXAGON; | |||
|
|||
switch (p_transform) { | |||
case TRANSFORM_ROTATE_LEFT: { // (h, v, t) -> (v, !h, !t) |
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.
Note that the changes make this comment partially outdated (same for case TRANSFORM_ROTATE_RIGHT
), as it refers only to 90° rotations, which now is not what would be always performed.
Ah yeah, I guess that if you have some tiles that are not, like, hexagon-shaped, it make sense... Well that I guess we'll have to keep the "feature" then. |
Fixes #107510
Normally, clicking a "rotate left" or "rotate right" button for a tile in a grid would rotate it 90 degrees. This was fine for square tiles, but would make hexagonal tiles not fit the grid properly. This PR makes hexagonal tiles only rotate 180 degrees when the button is pushed, so it still fits. (making them rotate by 60 degrees would have been ideal, but comes with additional complications).