Hugo Locurcio 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
..
screenshots 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
README.md 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
icon.webp 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
icon.webp.import 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
line_10px.png 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
line_10px.png.import 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
line_30px.png 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
line_30px.png.import 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
polygons_lines.gd 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
polygons_lines.tscn 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому
project.godot 78bbd99f0d Add a 2D polygons and lines demo 5 місяців тому

README.md

2D Polygons and Lines

A demo of solid and textured 2D polygons and lines using Polygon2D and Line2D.

In this project, solid Line2Ds are antialiased by using a specially crafted texture. By using a texture that is solid white on all its pixels except the top and bottom edges (which are fully transparent white), the border appears smooth thanks to bilinear filtering. A more extensive variation of this concept (which works better with variable-width lines) can be found in the unofficial Antialiased Line2D add-on.

2D multisample antialiasing (MSAA) is also supported when using the Forward+ and Mobile rendering methods. This is a slower approach, but it works on all 2D drawing performed within the viewport, including Polygon2D nodes or custom drawing. This approach can be used at the same time as the aforementioned Line2D antialiasing technique.

Language: GDScript

Renderer: Mobile

Screenshots

Screenshot