-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for Tileset Atlas #4166
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
base: master
Are you sure you want to change the base?
Conversation
This sounds like a partial implementation of the Tile Atlas concept discussed in #2863? Image rects were added as a first step towards this. You may want to see the discussion there about why this should probably be a separate tileset type rather than just extending image rects to "Based on Tileset Image" tilesets. |
Looking through it, yea. Even though I think you are overcomplicating it a bit there with the off-grid tiles like the 16x19 example there as that one also fits in 16x32 so the grid display can always just remain in the regular baseline grid set on the tileset, so dont think new view is even needed. New tileset type, I guess the benefit would be to just inherently save all the image recs instead of saving just the custom ones? which means image recs would be able to also get removed (which would be ideal for merging tiles, which is the feature im trying to replicate here from godot and I think godot mostly works like that anyway, and I think you are also talking about ending on something like that eventually). |
Ok got some progress done, I for now added boolean "atlas" on the tileset and adjusted how everything is rendered when set to atlas (grid is no longer used at all and every image rect is drawn directly, and indexAt also uses image rects for resolving tiles they are clicking on). Also added ability to delete tiles, add and merge is something I want to look at next after resolving some rendering quirks this still has |
0e7a8cd
to
ccf6221
Compare
I think as far as functionality goes i think i have most of stuff working properly now Issues:
|
Ok got merging and everything else done, for now in Rearrange Tiles mode:
|
9a0e2c7
to
750233b
Compare
f89c64e
to
5a8ab44
Compare
Ok I think this is now properly ready for review, I was doing some testing since yesterday and I think i fixed everything I found and im happy with the implementation. I did not adjusted documentation or stuff like python bindings etc, I think that can be done as finishing touches after this is reviewed and if the implementation even makes sense (I tried my best but I was not familiar with Tiled codebase at all until I started working on this PR). |
5a8ab44
to
f0ded07
Compare
46d27d3
to
d537614
Compare
Dynamic wrapping should now work as well. And spacing and margin also works. |
51d5023
to
eba4409
Compare
Added support for corner resizing as well, with left click drag on existing tile near corners EDIT: Also added support for proper snapping with spacing and margin |
c2674d8
to
600b5bc
Compare
8ecf79d
to
fa94ca7
Compare
Useful for y-sorting, multi tile objects, base tile images changing, etc. - Add new "atlas" property to tileset that determines if tileset is atlas tileset or not - Atlas property is set on tileset creation through type - If generate tiles based on grid option is enabled, atlas tileset will pre-generate grid tiles - Atlas tileset always saves all image rects For controls, go to rearrange tiles mode: - Left-click and drag to move tiles - Left-click tile corners to resize - Left-click and drag empty space to create new tiles - Right-click and drag to delete tiles - Hold Shift to disable grid snapping Signed-off-by: Tomas Slusny <[email protected]>
fa94ca7
to
61c199f
Compare
Useful for y-sorting, multi tile objects, base tile images changing, etc.
pre-generate grid tiles
For controls, go to rearrange tiles mode:
Closes #1008