ldtk
ldtk copied to clipboard
Tileset enum overlay
This change adds an overlay to tileset layers to show which tiles have which enum values assigned to them. It's triggered by clicking a new "Tile enums" option in the tool palette. Tiles with an enum value are outlined in the relevant colour, as defined in the tileset editor. Tiles with multiple enum values are indicated by nested outlines.
I made this change because I was finding it difficult to determine if tiles had enum set correctly. See #698. Also, this is my first encounter with a Haxe project so I could have taken the wrong approach with this, and there could be unforeseen issues that I've not though of.
Summary of changes:
- Adds a new "Tile enums" item to the editing options
- Adds a new
tileEnumOverlaysboolean setting - Adds
TilesetEnumChangedevent, triggered when an enum value is assigned, changed or removed from a tile. - Adds a
h2d.Graphicsinstance to theLayerRenderer, which is used to draw the overlay rectangles
Amazing stuff! Does it fair well with enums that have images assigned to them from a tileset, or does it just use the enum colors? Also I would maybe group the button with the grid toggle and the eye icon instead of putting on the bottom, but that's just a minor change.
Amazing stuff! Does it fair well with enums that have images assigned to them from a tileset, or does it just use the enum colors?
At the moment it just uses the assigned enum colours. I thought the layers may become cluttered and hard to scan if tiles and enum images were mixed together, but it's something I could look at.
Also I would maybe group the button with the grid toggle and the eye icon instead of putting on the bottom, but that's just a minor change.
I've already done that locally. It made more sense up with the other two options :) I can commit / push the change if you're planning to build the project yourself?
I'm not going to spend much more time on this until the feature has been properly evaluated and I know I'm on the right track.
@deepnight Is this something that has potential?
Yes :)
This was merged in 1.1.4 branch, which should be released in the next few weeks.
- I fixed a visual bug with X-flipped tiles (overlay was off to the right)
- I added support for enum overlays to Auto-Layers as well, as the tiles they generate might also be tagged.
Thanks a lot for this very cool PR :)