mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

"Pixel perfect tile object selection" should work on semi-transparent areas as well #3404

user72356 posted onGitHub

Is your feature request related to a problem? Please describe. In https://github.com/mapeditor/tiled/issues/1477, you implemented an improved object selection mechanism that ignores transparent pixels so that one can select objects positioned below the transparent areas of other objects. I still have issues selecting objects below semi-transparent areas, for example shadows, fog, glass, etc. See attached screenshot for an example.

Describe the solution you'd like Hopefully a simple modification to your existing code, change the alpha pixel check to consider anything less than 100% opaque as transparent for the purpose of selecting objects.

image


Treating anything less than 100% opaque would be a problem for objects that are entirely or largely translucent, such as lamp glows, glass, gradients, etc. Some users may want to be able to click an object's shadow to select it, too. Different tilesets (and users!) have different cutoffs for what's appropriate to count as transparent.

Perhaps the pixel-perfect object selection checkbox should have a slider/field next to it where users can specify the maximum alpha at which a pixel counts as transparent, which would default to 0 to match the current behaviour, but can be changed to a larger value if one wants.

posted by eishiya almost 3 years ago

Actually I have a better idea... We should be able to cycle between each object under the cursor on subsequent clicks on the same location. Like many software that deal with layers in fact.

posted by user72356 almost 3 years ago

I haven't seen any software that do that, but it seems like a decent idea. If implemented, it should be optional to prevent accidental selection changes.

Also, in case you're unaware: if you alt+right click on a spot with multiple objects while using the Select Objects Tool, you'll get a menu with all the objects in that spot listed, which is very useful if the objects are named.

posted by eishiya almost 3 years ago

I think you can cycle by holding Alt while left clicking, and indeed there is an Alt right click menu too.

posted by bjorn almost 3 years ago

Good point on the Alt+left click and Alt+right click. It's good that it's cycling! Unfortunately it doesn't let me grab and move the selected object, even if it appears to be the current selection. See the animated screenshot below.

Would you consider making the cycling the default behavior rather than needing Alt? I think it qualifies as a non-disrupting enough... (and of course we should be able to move the selected object)

Animation

EDIT: So I found out that I could move the selected layer obtained via cycling, only if I kept the Alt key pressed down while moving. If not pressing down, the top layer is moved even though the bottom layer is the one surrounded with a dashed line. I think this is quite counter-intuitive. I still think the UX would benefit from having cycling as the default behavior and not having to press anything extra to move the selected layer.

posted by user72356 almost 3 years ago

Disagree on plain clicking cycling objects as a default, though it would be a fine option in Preferences. I am generally against features where repeating the same input does different things being default because it can be confusing and because it's very easy to accidentally cycle if you have jittery fingers/mouse. The fact that the various mouse buttons and modifiers aren't customizable is one of Tiled's big usability gaps in my opinion, and this is a fine demonstration of that.

That said, I think that if you drag with some Objects selected and with Select Objects as your active tool, you pretty much always want to move those objects and not make a new selection, so I think some changes to what initiates a new selection might be good - though it would require some logic regarding what amount of movement still counts as a click rather than a drag. It would remove the need to hold Alt while moving lower objects, too, leaving Alt only required to select them.

posted by eishiya almost 3 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests