mapeditor / tiled

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

Option to show unrounded cursor cell coordinates #3677

Open patchuby opened 1 year ago

patchuby commented 1 year ago

Is your feature request related to a problem? Please describe. I use cell based coordinates in my game data or tiled object properties because they're usually more human friendly. And I use the mouse coordinate info on the bottom left to give me those coordinates. But since they're rounded, I usually have estimate how much into a cell the cursor is, if I want sub-cell coordinates. Since I'm doing isometric maps, there is the added difficulty of know the direction of the x & y axis (I'm still not used to it !).

image

Describe the solution you'd like Have an option in the settings to round or not the cursor cell coordinates shown in the bottom left.

eishiya commented 1 year ago

Unrounded cell coordinates would only make sense for the object tools, so this option should only affect those, the tile tools should continue to show the cell's location, which is necessarily rounded. The object locations should probably also be rounded to the nearest N decimal digits, as numbers with a lot of decimal digits aren't all that helpful in most cases, and are technically also rounded simply due to the limitations of floating point variables.

A possible workaround for OP: if you use Tiled objects and object custom properties, you can avoid the need to type coordinates, and can place them visually instead, using e.g. Points, Polylines, rectangles, etc. With "Snap to Fine Grid" and the "Fine grid divisions" setting, you can limit the placement of these objects to some arbitrary precision in terms of your cell. I suspect this is the intended way to deal with locations in Tiled. A downside to this approach is it can clutter your map with a bunch of objects you rarely need to interact with, and it complicates parsing.