carenalgas / popochiu

Godot plugin to make point-and-click adventure games, inspired by tools like Adventure Game Studio and PowerQuest.
https://carenalgas.github.io/popochiu/
MIT License
186 stars 19 forks source link

Create a gizmo for polygon editing #243

Open stickgrinder opened 4 months ago

stickgrinder commented 4 months ago

Benefit description

Currently all the Popochiu Objects that depend on a polygon (be it an InteractionPolygon2D or a NavigationRegion2D), allow the editing of the polygon shape through a button that selects the inner node "behind the scene".

This works, but it is susceptible to a lot of problems. For example:

We need a better solution

Solution description

As silly as it can sound, we need to implement a new 2D gizmo, using the same implementation strategy we used in #232.

By painting on the viewport we may create a polygon gizmo tool that connects to one or multiple elements inside its node, and sports a tailored interaction.

Most of its behaviors will mimic normal polygon editing, but it may be switched from read-only (see-only) to editing mode, or change more polygons at once. Or even allow the creation of "holes" that are very useful in walkable areas.

Exclusions

None at the moment

Implications

This gizmo can be based on GD Extensions as suggested by @drbbgh, but this may be unfeasible if we want to represent more polygons with a single gizmo. We have to check.