mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
11.23k stars 1.76k forks source link

Large-tiles aware tools #3436

Open huwpascoe opened 2 years ago

huwpascoe commented 2 years ago

It would be useful if the stamp, shape and fill tool had an option to account for the size of larger tiles.

issue

eishiya commented 2 years ago

Every tile, no matter its size, occupies one cell, and that's the cell you see highlighted in your second screenshot. This is the "proper" behaviour. All orthographic maps render tiles with bottom left origin. Consider the common scenario where a larger tile is just a simple prop that sticks out of its tile, like a tree - you wouldn't want that to occupy 4x4 cells - if you did, you'd place it as 4x4 tiles. Consider also that in many cases, larger tiles aren't a perfect multiple of the map's tile size.

Since you marked this as a feature, are you looking for some sort of tile-size-aware mode on the various painting tools that will skip filling cells that are overlapped by a previously placed tile? If so, please be clearer about that. Right now, it sounds like you're reporting a bug that isn't actually a bug xP

huwpascoe commented 2 years ago

Yes, that's what I'm asking for essentially, I had difficulty describing! And the ability to choose which corner the large tile aligns with.

eishiya commented 2 years ago

For now, that could be scripted with custom tools, if you're so inclined.

You can change the way the larger tiles align by changing the Drawing Offset in the Tileset Properties.

huwpascoe commented 2 years ago

That'd be great but there's no drawing offset, just the "Image Rect" property that changes the source rectangle of the image.

eishiya commented 2 years ago

As I said, the drawing offset is in the Tileset Properties, not the Tile properties. it's tileset-wide.

eishiya commented 1 year ago

Until large-tile modes can be added to existing tools, maybe this scripted tool can be of use for some: https://github.com/eishiya/tiled-scripts/tree/main/Large%20Tile%20Stamp%20Tool It works similarly to the Stamp Brush, but spreads the tiles out so that large tiles don't overlap each other. Here's an example of placing some 16x16 tiles on a 4x4 grid: image

It lacks a lot of the regular Stamp Brush's convenience features such as letting you flip/rotate your brush, line mode, and Random Mode. Flips/rotations can be achieved by switching back to the Stamp Brush and performing them with that, at least. All of these can be added via scripting and PRs are welcome - I'm just too lazy to put the work in for a tool I don't need myself :'D