deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.44k stars 192 forks source link

[Feature Request] Option to use Polygon for Entity's shape #1126

Open hyperkvlt opened 4 months ago

hyperkvlt commented 4 months ago

Only being able to use rectangle shape for entity can be quite restrictive, so I think it would be nice for LDTK to be able to use Polygon shape as well using the diagonal points of the grid. It would be pretty useful for area trigger, collider, character confiner, and camera confiner.

ldtk polygon v3

The polygon would have somre restriction to prevent it from having empty space within the polygon to avoid complexity.

points

And it would remove unused points

no point v2

At first I thought of suggesting to create freeform rect using grid points since I feel it would be more fitting with LDTK, but it feels less flexible compared to simple polygon. On good side, it would be able to fit with the grid

ldtk green v2