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

Hide all or tileset / layer tiles #530

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

uggla
Copy link

@uggla uggla commented Apr 21, 2024

This is my first PR for this project, and it certainly deserves to be elaborated, so thank you in advance for your feedback.

Here are the explanations:

For my needs, I wanted to hide all the tiles or only some tiles belonging to a layer in a tilemap. I noticed that the TiledLayersStorage structure only contained the tiles for the last tileset and consequently, when I wanted to hide all the tiles, those belonging to the other tilesets remained visible.
Therefore, I slightly modified the structure from a HashMap of layer --> Storage Entity to
a HashMap of HashMap tileset --> layer -> Storage Entity.

This allows selecting all tiles, tiles of one or more tilesets, and/or one or more layers.

I updated the example in tiled.rs to demonstrate how to either hide/make visible all the tiles or just the tiles of the tileset containing the castle.

Here we can see a bug as only the castle tiles are hidden.
- Rename TiledLayersStorage to TilesetLayerToStorageEntity.
- Change the structure to an Hash of hash:
  Tileset -hash-> Layer -hash-> Storage entity
- Space key show/hide all tiles.
- C key show/hide the castle tiles only.
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