mapeditor/tiled

Do you want to work on this issue?

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

Define snapping behaviour on a class basis #3594

patchuby posted onGitHub

I currently have snapping disabled permanently as it's often more a hindrance with my use cases. I use non-aligned to grid tiles mostly for visual stuff. But for gameplay stuff (like trigger zones, doors, etc...) I use rectangles where I sometimes limit behaviour on a cell size basis (i.e grid) so snapping would be really useful to show on tiled what the zones will actually be in-game. Combined with the already existing request of being able to snap to the fine grid, this would increase by a significant amount the user-friendliness and versatility of Tiled (for my use cases anyways).


Have you tried holding Ctrl while Snapping is enabled to temporarily disable snapping? Could that perhaps be adequate in your case? A benefit of this option is that you can use it when still creating new objects, before you've had the chance to assign a Class to them.

How would you expect per-Class snapping to work when moving several objects? Would each one have to snap independently? Would it use the most/least restrictive option for all of them?

posted by eishiya about 2 years ago

I could use ctrl but honestly I use snapping in 5-10% of my time with a map, so it's a bigger bother than it's worth using it this way. Is it possible to do the reverse, enable with CTRL ?

That's a very good question, I hadn't thought of that. It would have to be an option for the user to choose I feel. For my case I would say disabled if there is one disabled but I suspect I'm in the minority here.

posted by patchuby about 2 years ago

Is it possible to do the reverse, enable with CTRL ?

Yes, I think that's the default actually. Ctrl always toggles the option in View > Snapping temporarily. From not snapping to snapping, or from snapping to not snapping. When snapping is off, Ctrl + Shift temporarily enables snapping to the Fine Grid.

Yet, I think controlling the default snapping behavior based on the object class is quite a nice idea. Though it is unfortunate that we can't have this snapping preference on object creation then. Possibly we could solve that, if we could already specify which class of object we'd like to create before placing it. Placing a template would be another potential workaround, since then we do know the class.

Regarding the behavior when multiple objects are selected, I think it should just use the coarsest snapping behavior for all of them.

posted by bjorn about 2 years ago

Ah well the CTRL thing does make things easier ! The class controlled behaviour would still be useful for people creating map but not knowing the actual in-game behaviour (though it's probably only valid for 'big' indie teams)

posted by patchuby about 2 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests