Tile Sizes by Layer

(Luca Duran) #1


So I’ve dedicated some hours in the past few days to try and get layers to have their own tile sizes.

There’s still quite a bit to do, but I would really appreciate it if people could test it out and leave issues on my branch if they can (even on this thread I guess).

Here’s the branch:

To try it out, clone my repo, checkout the “tilesize-by-layer” branch and compile like how the original github page says.


Right now you can add layers and change their tile sizes separately from the map tile sizes.
The map width, height, tile width and tile height determine two things:

  1. The default values of a newly added layers
  2. The max width and max height in pixels that a layer can. i.e: If a map is 10 by 10 with tile sizes, 32 by 32, then the max layer size is 320 by 320. Meaning if a layer has tile sizes 10 by 10, it’s width and height would both be 32.

Things done/In progress:

  • You can save/load files with different tile sizes for layers. There’s a new xml attribute called “tileHeight” and “tileWidth” in the layer section, so you can access layer tile sizes like that.
  • The grid changes according to the layer tile sizes
  • Tile Height, Tile Width changeable properties, and Height, Width non-changeable properties to see the size of the layer in tiles

Things that need to be done:

  • Fix up broken plugins
  • Fix up variant map converter
  • Fix up python bindings
  • Selection problem
  • Automapping problem
  • Clean up some code

Known bugs:

  • You’ll get the invalid stamp overlay (dark red) when you’re outside of the “map” space but you can still place tiles anywhere on the grid (this makes more sense when you try it out)
  • After changing tile sizes, adjacent tiles may disappear

End Remarks

It’d be cool to get some feedback. I’m pretty new to the github/tiled community as whole, so I didn’t really know where to post this.