godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

TileSet > Physics > Collision shape edit: add Translate shape mode (or allow batch move points) #6309

Open hsandt opened 1 year ago

hsandt commented 1 year ago

Describe the project you are working on

A platformer with tilemap

Describe the problem or limitation you are having in your project

I cannot translate whole polygonal collision shapes for my tiles, so if my shape is offset compared to the visual sprite because: a. I offset my sprites in my spritesheet b. this bug: https://github.com/godotengine/godot/issues/73517

then I must move each point manually with high precision. Or edit numerical values in a text editor (causing a crash, see https://github.com/godotengine/godot/issues/73518)

Describe the feature / enhancement and how it helps to overcome the problem or limitation

a. A translate shape mode where you can drag and drop the whole shape would help.

b. Alternatively, allowing batch selection and move of existing points would also allow moving the entire shape. It's even more flexible as it would also allow moving only 2 or 3 points together, thus moving shape edges.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

a. Translate shape tool mode

There are already a few edit modes:

image

We could add a Translate/Move shape mode among them, with an associated button & icon After enabling this mode, drag and drop on the shape area (at least inside the collision shape) would move the shape entirely. Snapping would occur as usual.

We could also integrate this in the standard point edit mode, in this case only move the whole shape when dragging and dropping from inside the shape, not when cursor is near a point, to distinguish both behaviors.

b. Batch select and move

Allow multiple point selection when holding Shift, and/or when dragging and dropping from outside points to create a selection rectangle (as in vector editors when editing a curve with key points).

Then, when you move one point, you move all the selected ones at the same time.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

It's the built-in collision shape editor.

Calinou commented 1 year ago