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

Image collection support with texture atlases #273

Merged
merged 6 commits into from
Nov 4, 2022

Conversation

coz-eduardo-hernandez
Copy link
Contributor

@coz-eduardo-hernandez coz-eduardo-hernandez commented Nov 2, 2022

Issue #173

These are the smallest number of commits from my repo that give support to Image collections:

  1. Changes a variable assignment that did not have to depend on a global tileset height
  2. Adds the Tiled map/tileset files for testing
  3. Adds a file/module called 'atlas.lua' which does the actual loading. Even though it's a separate file, I'm not sure how to implement it as a pure plugin without touching STI code.
  4. Changes STI code to use the atlas module; the most significant change is adding the function setAtlasTiles as an alternative to setTiles when an atlas is used
  5. After making the pull request I tested it with a pet project, and found that I needed to add utils.format_path, so I added this commit
  6. Skips handling the tileset images in a collection if the tileset is empty, and adds an update to the test map to test for it

Regarding the fourth commit: at some point Tiled stopped exporting the tileset image filename when the tileset is external (non-embedded), so now there's an assert in Map:init for external tilesets, since maps with them will not load.

To run the Image collection test just run main.lua.

@karai17 karai17 merged commit 2b1ada6 into karai17:master Nov 4, 2022
@karai17
Copy link
Owner

karai17 commented Nov 4, 2022

Looks good! Thanks for implementing this!

@Serif-7
Copy link

Serif-7 commented Nov 4, 2022

Lol, I literally was dealing with this problem a few hours ago and realized I had to embed the tilesets. If I had that clear error message you wrote it would have saved me some time!

@coz-eduardo-hernandez
Copy link
Contributor Author

Lol, I literally was dealing with this problem a few hours ago and realized I had to embed the tilesets. If I had that clear error message you wrote it would have saved me some time!

At the time of the last release of STI external Tilesets were supported, but Tiled changed what information it exports, so now the previous approach to external Tilesets won't work

@coz-eduardo-hernandez coz-eduardo-hernandez deleted the image_collections branch November 4, 2022 23:02
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