Do you want to work on this issue?
You can request for a bounty in order to promote it!
Image Layer improvements: repetition, subrects, and scaling #3114
eishiya posted onGitHub
Although Image Layers aren't a major feature of Tiled and bjorn has expressed reluctance to do anything more with them, I think they have a lot of potential for things that don't make as much sense with Tile and Object layers.
Although it's true that the job Image Layers can do currently can be done by Tile Objects within Tiled, object layers seem like overkill and require more work to set up to do the same task. Parsers can also optimize the use of Image Layers in ways that they can't with Tile Objects, since Objects are generally assumed to be dynamic, whereas Image Layers can be treated as a special case of Tile Layers that have their own tile size and a single tile in them.
A couple of improvements to Image Layers would make them more than worthy of their place as a separate layer type in Tiled:
-
One feature request that's come up multiple times on Discord and here is the ability to set an Image Layer to repeat (tile) in X, Y, or both. This would make them very useful for background art that isn't made out of tiles or has an unusual size. This is especially useful for maps that use parallax. The automatic repetition of a large background image is already a common technique in 2D games, and Image Layers would allow Tiled to represent this in a way very similar to how game engines do it, which is different from a tile layer in that the repetitions are generated at runtime and don't exist in the layer data. Added in 0e7f813
-
A feature that only I seem to have requested: the ability to set a subrect of the chosen image to use, instead of always using the entire image. This would allow Image Layers to be used with atlases or to use slightly different portions of the same image (e.g. to compensate for parallax in neighbouring maps). When/if spritesheet tilesets (#2863) are implemented, Tile Objects will be able to do this too, but as mentioned above, I don't believe Tile Objects are as good a solution for things like this as Image Layers are.
-
An occasionally requested feature: Scale the image in the Image Layer, via X and Y scale factor properties. Currently, the only way to have a scaled background image, such as one might want as a reference, is to put it into a Tileset (typically a Collection of Images) and place it as a Tile Object on some special reference Object Layer, where it can then be scaled (with
Ctrl
to maintain the aspect ratio, if need be). For things like reference images, it would be much simpler to use an Image Layer. Of course, this feature would benefit people using Image Layers for in-game art as well. (Edit: Apparently there's already an issue open for this, #1306)
Image Layers are useful in their own right and aren't just a worse Tile Object layer, and they deserve some love.