Godot: Option for unfilled Polygon2D node

Created on 18 Jul 2019  路  5Comments  路  Source: godotengine/godot

Godot version:
3.1.1 (stable, official, Windows 64-bit standard)

OS/device including version:
Windows 10, 64-bit

Issue description:
I want to use the Polygon2D node to create unfilled polygons (think old-school, vector-based games lik Atari's Asteroids). The existing Polygon2D node is nearly perfect for this use-case, except that it always produces filled polygons.

I'd like to propose 2 new properties for the Polygon2D as follows:

  • filled - If true, the polygon is filled (as it is today). If false, the polygon is unfilled.
  • strokeWidth - The width of the outline.

I assume the color of the outline would just use the existing color property. If it's possible for the outline to have a different color than the fill, perhaps supporting a color property for both might make sense.

I posted a related question here:
https://godotengine.org/qa/48642/how-to-create-an-unfilled-polygon2d

Steps to reproduce:
None

Minimal reproduction project:
N/A

archived feature proposal core

Most helpful comment

Perhaps a closed option could be added to LineBuilder so that it can produce a closed polygon outline without overdraw? It would probably just need a removal of begin and end caps so that it connects back to the starting vertices.

All 5 comments

Thanks. Yeah, the Line2D class was mentioned in response to the question I opened on the forum too (and referenced above). For now, I'll probably explore that, but...

This seems like a really natural (and useful) enhancement to the existing Polygon2D class - which is why I made the feature request.

Wait - maybe Line2D is what I want. I guess I misunderstood the response I received to my original question (link posted above). Some quick experimentation makes me think I can get what I need from Line2D.

Though, an option to create an unfilled polygon would still be really useful I'd think.

Anyway, thanks for the nudge.

Perhaps a closed option could be added to LineBuilder so that it can produce a closed polygon outline without overdraw? It would probably just need a removal of begin and end caps so that it connects back to the starting vertices.

There's already a proposal that covers this https://github.com/godotengine/godot-proposals/issues/138
so closing.

Was this page helpful?
0 / 5 - 0 ratings