CircleComponent constructor

CircleComponent({
  1. double? radius,
  2. Vector2? position,
  3. double? angle,
  4. Anchor? anchor,
  5. int? priority,
  6. Paint? paint,
})

With this constructor you can create your CircleComponent from a radius and a position. It will also calculate the bounding rectangle size for the CircleComponent.

Implementation

CircleComponent({
  double? radius,
  Vector2? position,
  double? angle,
  Anchor? anchor,
  int? priority,
  Paint? paint,
}) : super(
        position: position,
        size: Vector2.all((radius ?? 0) * 2),
        angle: angle,
        anchor: anchor,
        priority: priority,
        paint: paint,
      );