Collision Editor sub-tile mouse snap

When I hold [cmd] on OSX in the Collision Editor I can “snap” the collision box to the tile’s edges. This works nicely with tiles that have their collision borders actually at the tile’s borders.

But for some tiles, I want the collision to “snap” to half the tile’s width and/or height.

For instance, I need a pixel-perfect collision tile that looks like this:

+-------+
|       |
|       |
|       |
|       +
|      /|
|     / |
|    /  |
+---+---+

+-------+
|       |
|       |
|       |
|       +
|    __/|
| __/   |
|/      |
+---+---+

So, it seems the polygon points of the collider are defined in the tmx file:

I can edit them like this to make them “pixel perfect”, but it would be nice to just be able to edit those points in the collision editor.

In the current version of Tiled, you can use “Snap to Fine Grid” (View menu) and set up the number of fine grid divisions in the settings.

On the master branch, there is also a new “Snap to Pixels” option added to the View menu. This functionality is already available in the snapshot builds.

That works perfectly! It’s perhaps to be noted that you then should NOT hold [cmd].

1 Like