PolygonComponent constructor

PolygonComponent({
  1. required List<Vector2> normalizedVertices,
  2. Paint? paint,
  3. Vector2? position,
  4. Vector2? size,
  5. Vector2? scale,
  6. double? angle,
  7. Anchor? anchor,
  8. int? priority,
})

The normalizedVertices should be a list of points that range between -1.0, 1.0 which defines the relation of the vertices in the polygon from the center of the component to the size of the component.

Implementation

PolygonComponent({
  required List<Vector2> normalizedVertices,
  Paint? paint,
  Vector2? position,
  Vector2? size,
  Vector2? scale,
  double? angle,
  Anchor? anchor,
  int? priority,
}) : super(
        HitboxPolygon(normalizedVertices),
        paint: paint,
        position: position,
        size: size,
        scale: scale,
        angle: angle,
        anchor: anchor,
        priority: priority,
      );