All Implemented Interfaces:
Mask

public class Polygon extends Shape<Polygon>

A Polygon specifies an area in a the world defined by a sequence of points.

The coordinates of each point are in world units.
  • Method Details

    • addPoint

      public Polygon addPoint(int x, int y)
      Adds a point to the path of this Polygon.
      Parameters:
      x - the x coordinate in world units
      y - the x coordinate in world units
      Returns:
      this Polygon
    • clearPoints

      public Polygon clearPoints()
      Clears the path of this Polygon.
      Returns:
      this Polygon
    • setPointsInterpolationCurve

      public Polygon setPointsInterpolationCurve(Curve curve)
      Sets the transition used to animate the positions of each point. Only used if the path has the same number of points.
      Parameters:
      curve - the transition to animate between coordinates of each point in the path.
      Returns:
      this Polygon