I’ve recently been toying with MonoGame.Extended for personal use, working to expand its functionality to include group layers, which it currently doesn’t recognize. However I’ve come to find the behavior of group layer offsets in Tiled somewhat counter-intuitive.
In other layer-based visual editors like Photoshop or Gimp, moving layers into, out of, or between groups doesn’t change the absolute positioning of that layer. Rather, when you move a group, it collectively moves the individual positions of its children. If you then move any of those layers out of the group, that layer’s position doesn’t change.
In Tiled, group layers have their own independent offsets, which are instead added to the positions of their children. Moving a layer into or out of a group layer with a non-zero offset causes that layer to appear to shift around.
Layer and group visibility/opacity should obviously remain independent, but does storing a group layer’s offset independent of its children offer any advantages I’m overlooking? Would it be more intuitive for Tiled to mimic the behavior of other visual editors by removing group layer offsets and instead changing the offsets of child layers when moving a group?
Hmm, I guess it depends on the use-case. In editors like Photoshop and GIMP, the positioning of layers is purely visual and the grouping is only for organizational purposes. However, in Tiled this feature of offsetting layers was primarily introduced to improve support for stacked tiles, so you could offset a layer by 32 pixels upwards if you had tiles that were “physically” 32 pixels high and wanted to place another layer of tiles on top.
When group layers were introduced, I considered that you may want to group a tile and an object layer together with such an offset so that your objects align with the tiles sitting at the same height. If you would now move those layers between groups, you would probably expect the offset to adjust automatically depending on which group you move them into.
Can you elaborate a bit more on your use of the layer offset and why this group offset isn’t helpful in your case?
Having given it some time, I think you’re right. I’m stuck in that mentality of using layers and grouping purely visually as I expected from other editors. Also hadn’t considered the value of offsety not just as a visual offset but also doubling as z-index, which may prove useful.