Skip to content

Implement isometric & hexagonal tilemaps #1213

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

Merged

Conversation

OverloadedOrama
Copy link
Member

@OverloadedOrama OverloadedOrama commented Apr 6, 2025

Implements the ability to create isometric and hexagonal (both pointy-top and flat-top orientations) tilesets when creating a tilemap layer. They work the same way as rectangular tilemap layers, you draw on isometric/hexagonal grids and Pixelorama automatically creates/modifies tiles in the tileset.

Isometric tilemap:

2025-04-07.00-03-32.mp4

Hexagonal tilemaps with both orientations:

2025-04-08.18-06-19.mp4

Unfortunately, it is not possible to create tiles that are bigger than the cell size (by having pixels outside of their cell), since Pixelorama would have no way to tell which pixels belong to which tiles. In order to implement this, I introduced a new "place-only mode" to tilemap layers. By enabling this mode, you will only be able to place tiles and you won't be able to modify existing tiles anymore on that layer. Activating this is also permanent. However, you can still modify tiles in other tilemap layers that share the same tileset.

Isometric place-only tilemap with overlapping pixels:

2025-04-07.00-19-48.mp4

Resizing selected content is not yet supported in isometric and hexagonal tilemaps. The bucket tool is also quite problematic, even on rectangular tilemaps before this PR, so I will try to fix it after this PR is merged. EDIT: Fixed in 1cc5a67.

This PR also changes how resizing the project affects tilemaps and tilesets. Resizing the canvas or cropping it to content simply moves the offset of each tilemap layer while not affecting the tilesets, but scaling the project also scales the size of the tiles by the same amount that the project was scaled. For example, scaling a 64x64 project to 128x64 would scale 16x16 tiles to 32x16.

Fixes/improvements:

  • The indices that appear when holding Control now scale based on the grid cell size
  • Using the bucket tool on draw tiles mode on an empty tilemap should no longer crash the app.
  • Fixed crash when switching between tilemap layers with different tilesets, while having selected tiles the positions of which do not exist on the new tilemap's tileset.
  • Duplicating tilesets in the project properties no longer crash the app when a previously deleted tileset is still selected.

@OverloadedOrama OverloadedOrama changed the title Implement isometric tilemaps Implement isometric & partial hexagonal tilemaps Apr 7, 2025
@OverloadedOrama OverloadedOrama changed the title Implement isometric & partial hexagonal tilemaps Implement isometric & hexagonal tilemaps Apr 7, 2025
It is not working for isometric tilemaps at the moment. If we find a solution, we should re-enable it.
Needed for place-only tilemaps with overlapping pixels
Not perfect but should be better
…d the new selected tiles do not exist in the new tileset
Not currently supported in normal mode, as we need a mask for that first.
@OverloadedOrama OverloadedOrama merged commit 199c109 into Orama-Interactive:master Apr 8, 2025
4 checks passed
@OverloadedOrama OverloadedOrama deleted the isometric-tilemap branch April 8, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant