Skip to content

Commit 8ecf79d

Browse files
committed
Add help and tooltips for tileset atlas mode
Signed-off-by: Tomas Slusny <[email protected]>
1 parent 1b2f6ef commit 8ecf79d

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

docs/manual/editing-tilesets.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tileset.
1010
Two Types of Tileset
1111
--------------------
1212

13-
A tileset is a collection of tiles. Tiled currently supports two types
13+
A tileset is a collection of tiles. Tiled currently supports three types
1414
of tilesets, which are chosen when creating a new tileset:
1515

1616
Based on Tileset Image
@@ -21,6 +21,13 @@ Based on Tileset Image
2121
between or around their tiles or those that have extruded the border
2222
pixels of each tile to avoid color bleeding.
2323

24+
Tileset Atlas
25+
This tileset uses a single image but allows you to define custom tile
26+
regions that can vary in size and position. This is useful for tilesets
27+
with varied tile sizes, y-sorting, multi-tile objects, or when you need
28+
to dynamically adjust tile boundaries. Tiles can be arranged, moved, and
29+
resized using the *Rearrange Tiles* mode (see :ref:`rearranging-tiles`).
30+
2431
Collection of Images
2532
In this type of tileset each tile refers to its own image file. It
2633
is useful when the tiles aren't the same size, or when the packing
@@ -175,6 +182,34 @@ both tile layers and tile objects.
175182
Collision shapes rendered on the map. This map is from `Owyn's Adventure
176183
<https://store.steampowered.com/app/1020940/Owyns_Adventure/>`__.
177184

185+
.. _rearranging-tiles:
186+
187+
Rearranging Tiles (Atlas Tilesets)
188+
-----------------------------------
189+
190+
When working with a Tileset Atlas, you can customize the tile regions using the
191+
*Rearrange Tiles* mode. This mode allows you to move, resize, create, and delete
192+
tile regions within the tileset image. Click the *Rearrange Tiles* |rearrange-tiles-icon|
193+
button in the toolbar to enter this mode.
194+
195+
When in Rearrange Tiles mode, the following mouse controls are available:
196+
197+
* **Left-click and drag on a tile** - Moves the tile to a new position
198+
* **Left-click and drag on a tile corner** - Resizes the tile
199+
* **Left-click and drag on empty space** - Creates a new tile region
200+
* **Right-click and drag** - Deletes all tiles overlapping the selection area
201+
* **Hold Shift** - Disables grid snapping for precise positioning
202+
203+
This is particularly useful for:
204+
205+
* Creating tilesets with varied tile sizes
206+
* Implementing y-sorting with tiles of different heights
207+
* Defining multi-tile objects as single tiles
208+
* Adjusting tile boundaries after importing an image
209+
210+
.. |rearrange-tiles-icon|
211+
image:: ../../src/tiled/resources/images/22/stock-tool-move-22.png
212+
178213
.. _tile-animation-editor:
179214

180215
Tile Animation Editor

src/tiled/newtilesetdialog.ui

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,25 @@
6868
<property name="text">
6969
<string>Based on Tileset Image</string>
7070
</property>
71+
<property name="toolTip">
72+
<string>A single image containing a grid of fixed-size tiles</string>
73+
</property>
7174
</item>
7275
<item>
7376
<property name="text">
7477
<string>Tileset Atlas</string>
7578
</property>
79+
<property name="toolTip">
80+
<string>A single image with custom tile regions that can be rearranged (useful for varied tile sizes, y-sorting, etc.)</string>
81+
</property>
7682
</item>
7783
<item>
7884
<property name="text">
7985
<string>Collection of Images</string>
8086
</property>
87+
<property name="toolTip">
88+
<string>A collection of individual tile images</string>
89+
</property>
8190
</item>
8291
</widget>
8392
</item>

src/tiled/tileseteditor.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,19 @@ void TilesetEditor::setCurrentDocument(Document *document)
377377

378378
currentChanged(tilesetView->currentIndex());
379379
selectionChanged();
380+
setRelocateTiles(mRelocateTiles->isChecked());
381+
382+
// Use detailed tooltip for atlas tileset
383+
if (tilesetDocument && tilesetDocument->tileset()->isAtlas()) {
384+
mRelocateTiles->setToolTip(tr("Rearrange Tiles") + QLatin1String("\n\n") +
385+
tr("Left-click and drag to move tiles") + QLatin1String("\n") +
386+
tr("Left-click tile corners to resize") + QLatin1String("\n") +
387+
tr("Left-click empty space to create new tiles") + QLatin1String("\n") +
388+
tr("Right-click and drag to delete tiles") + QLatin1String("\n") +
389+
tr("Hold Shift to disable grid snapping"));
390+
} else {
391+
mRelocateTiles->setToolTip(tr("Rearrange Tiles"));
392+
}
380393
} else {
381394
currentChanged(QModelIndex());
382395
}
@@ -956,6 +969,18 @@ void TilesetEditor::setRelocateTiles(bool relocateTiles)
956969
if (relocateTiles) {
957970
mWangDock->setVisible(false);
958971
mTileCollisionDock->setVisible(false);
972+
973+
// Only show rearrange mode hint for atlas tilesets
974+
if (mCurrentTilesetDocument && mCurrentTilesetDocument->tileset()->isAtlas()) {
975+
mStatusInfoLabel->setText(tr("Rearrange Mode: Left-click to move/resize tiles | Right-click to delete | Shift to disable snapping"));
976+
}
977+
} else {
978+
// Restore atlas hint if we're viewing an atlas tileset
979+
if (mCurrentTilesetDocument && mCurrentTilesetDocument->tileset()->isAtlas()) {
980+
mStatusInfoLabel->setText(tr("Atlas Tileset: Use 'Rearrange Tiles' mode to customize tile regions"));
981+
} else {
982+
mStatusInfoLabel->clear();
983+
}
959984
}
960985
}
961986

0 commit comments

Comments
 (0)