-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow moving all polygon points or center them at the node's origin in polygon editors #266
Comments
Adding another tool for offsetting would be certainly useful. Honestly it would be nice if all those vertex-based 2D nodes could have an option to construct any shape with That way, you could simply translate all the points however you want within the editor, and internal points should be updated automatically. Of course that depends on how complex your shape is. As a bonus, it would be much easier to animate any vertex, as simple as changing offset/rotation/scale of an individual |
EDITED: clean up and give the summary of my findings. Sorry for people who may have read the old message in the email notifications! Currently, the behavior is like this:
If we reuse the blue Edit points sub-mode + drag from right inside the shape (action 2) to batch move all points, it's more logical as I expect the Edit points tool to move actual points relatively to the origin, not the whole Node. However, mind that after that, only action 4 (Move Mode) will reliably move the shape. There is also Action 3 but it is not convenient to do. So I would also suggest to implement point 1 at some point, so we can disable point editing altogether and move the Node as a normal Node. That said, if you make batch move all points a brand new sub-mode as suggested in the OP, or you reuse Edit Points but require user to first select all points (with shortcut or drag rectangle select) before moving them, like Inkscape (which doesn't support drag-and-drop all points if you drag from inside the shape), then you can keep the current behavior of 2 which will play the role of classic Node drag with origin. So I'll wait and see which implementation you choose before posting a suggestion to disable Edit polygon points entirely, as depending on the implementation, Edit points sub-mode may be very close to it already. GIF example of action 3 followed by action 2: see how the origin moves in both actions |
Describe the project you are working on:
Game with CollisionPolygons2D.
Describe the problem or limitation you are having in your project:
This actually does not apply to this particular project, but my overall experience with CollisionPolygons2D. Their (probably) biggest problem is that when you create a polygon, you are stuck with it. The points are always in the same relative position to origin, unless of course you move them manually one by one by the same offset. Which is most of the time unreasonable thing to do. It's also a shortcoming of not being able to select multiple points, but that's another thing.
Describe how this feature / enhancement will help you overcome this problem or limitation:
So to alleviate that, I suggest that we should be able to change the polygon's "offset" relative to the origin. I mean, drag all the points at once, without changing the polygon's actual position. Also, there should be an option to automatically set the offset to value that makes the polygon's origin point be in the center of the shape.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
(imagine that the gizmo represent's this polygon's
position
.Describe implementation detail for your proposal (in code), if possible:
Being able to move the polygon "offset" would be probably a new tool in Polygon2D editor. Also centering the polygon would be done with a button. Other than that it's some simple vector maths.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Well, you can move all the points using a script, but you can't do that using CanvasItem editor without a plugin, which is more complex to do.
Is there a reason why this should be core and not an add-on in the asset library?:
Polygon2Ds just need this built-in.
The text was updated successfully, but these errors were encountered: