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

Tileset enum overlay #707

Merged
merged 6 commits into from
Dec 13, 2022
Merged

Conversation

keithclark
Copy link
Contributor

@keithclark keithclark commented Jun 18, 2022

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 tileEnumOverlays boolean setting
  • Adds TilesetEnumChanged event, triggered when an enum value is assigned, changed or removed from a tile.
  • Adds a h2d.Graphics instance to the LayerRenderer, which is used to draw the overlay rectangles

Screenshot 2022-06-18 at 13 37 10

@FaultyFunctions
Copy link

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.

@keithclark
Copy link
Contributor Author

keithclark commented Jun 21, 2022

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.

@keithclark
Copy link
Contributor Author

@deepnight Is this something that has potential?

@deepnight deepnight self-assigned this Jun 30, 2022
@deepnight deepnight added this to the 1.1.4 milestone Jun 30, 2022
@deepnight
Copy link
Owner

Yes :)

@keithclark keithclark marked this pull request as ready for review August 3, 2022 14:30
@deepnight deepnight merged commit 25810c5 into deepnight:dev-1.1.4 Dec 13, 2022
@deepnight
Copy link
Owner

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.

@deepnight
Copy link
Owner

Thanks a lot for this very cool PR :)

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.

3 participants