tiled
tiled copied to clipboard
Image Layer improvements: repetition, subrects, and scaling
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:
-
[x] 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.
I desperately need image layer scaling. It's very useful for bringing in a sketch of a map and then tracing over it.
@Bryan-Legend For this purpose, you can add the sketch to an "Image Collection" tileset and place it as a tile object, since those can be resized. After resizing the tile object to the desired size, you could lock its layer to prevent selecting it by accident.
Thanks! That's finally what I did. Doesn't seem like it would be too difficult to add scale or size properties to the image layer.
On Thu, Aug 18, 2022 at 2:09 AM Thorbjørn Lindeijer < @.***> wrote:
@Bryan-Legend https://github.com/Bryan-Legend For this purpose, you can add the sketch to an "Image Collection" tileset and place it as a tile object, since those can be resized. After resizing the tile object to the desired size, you could lock its layer to prevent selecting it by accident.
— Reply to this email directly, view it on GitHub https://github.com/mapeditor/tiled/issues/3114#issuecomment-1219168410, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAUOGP7CZMWHCMLUK2E7DVZXVS5ANCNFSM5B4NWKZQ . You are receiving this because you were mentioned.Message ID: @.***>
Doesn't seem like it would be too difficult to add scale or size properties to the image layer.
Sure, when not accompanied by any visual tools to scale them but instead just using a property, it's similar in scope to the addition of the repeat options. I'm personally not inclined to duplicate the functionality of tile objects though, which I think are better because they even have a visual resize tool. But of course, tile objects can't currently repeat, though that has also been requested.
I'm personally not inclined to duplicate the functionality of tile objects though
Shall I repeat my spiel from the OP about how Tile Objects and Image Layers handle different needs and how Tile Objects are overkill for background layers? xP I also feel like you keep assuming that it's as quick and easy to create a Tile Object as an Image Layer, which is not the case: Tile Objects require both a layer and an object to be created, and they require a tile, which means a tileset must also be created that contains your reference/background image(s). Image Layers are a much better way to accomplish certain tasks, just like Tile Layers are a much better way to accomplish some tasks that could technically be accomplished with grid-aligned Tile Objects xP
I just want to reiterate that letting us rescale image layers would have made setting up a background reference an easy task for me. Something like this:
- New > Image Layer
- Browse image
- Resize (done)
Instead, I go to discord and find out I need to use an object layer to do this. Something I don't do often anyways, but if that's my only option, here it goes:
- New tileset
- Browse image
- Set tile width/height (hold on, need to find out what that is, since I need the whole image as a single tile) 3a. Browse image in file explorer 3b. Right-click, properties 3c. Detail tab,, see image size (back to step 3)
- Click save as (great, now I have to save this otherwise pointless file somewhere, sigh), browse again
- Switches me to tileset view, click back to the map tab
- Create object layer
- Find tileset tab in the tileset window... (wait, where is it? I have a lot open. What was the name again? Oh wait, found it)
- Click on the giant tile
- Select Insert Tile
- Insert the tile
- Switch to offset layer tool
- Move/resize image... wait, it's not working, what am I doing wrong? Oh, it's the select object tool.
- Switch to select object tool
- Move/re... wait, it's rotating?
- Click the image again. Again. Again. OK, I see what's happening.
- Move/resize.
- Deep sigh...
I later learned there is something called image collections that removes a few steps. But I never would have bothered with something called "image collections" because I'm not making a collection of images, I just need a reference layer. I can't imagine ever even learning they exist without coming to the discord, and since I got my reference image setup, I don't feel the need to go learn what those are. Maybe by the time I'll need another image, this missing feature will be implemented.