diff --git a/src/main/java/tech/fastj/graphics/game/Polygon2D.java b/src/main/java/tech/fastj/graphics/game/Polygon2D.java index 154474b0..62e14aab 100644 --- a/src/main/java/tech/fastj/graphics/game/Polygon2D.java +++ b/src/main/java/tech/fastj/graphics/game/Polygon2D.java @@ -112,6 +112,16 @@ public static Polygon2DBuilder create(Pointf[] points, RenderStyle renderStyle, return new Polygon2DBuilder(points, renderStyle, shouldRender); } + /** + * Creates a {@code Polygon2D} from the specified points. + * + * @param points {@code Pointf} array that defines the points for the {@code Polygon2D}. + * @return The resulting {@code Polygon2D}. + */ + public static Polygon2D fromPoints(Pointf[] points) { + return new Polygon2DBuilder(points, DefaultRenderStyle, Drawable.DefaultShouldRender).build(); + } + /** * Gets the original points that were set for this polygon. *