CircleComponent.relative constructor

CircleComponent.relative(
  1. double relation, {
  2. required Vector2 parentSize,
  3. Vector2? position,
  4. Vector2? scale,
  5. double? angle,
  6. Anchor? anchor,
  7. Paint? paint,
  8. List<Paint>? paintLayers,
  9. Iterable<Component>? children,
  10. ComponentKey? key,
})

With this constructor you define the CircleComponent in relation to the parentSize. For example having a relation of 0.5 would create a circle that fills half of the parentSize.

Implementation

CircleComponent.relative(
  double relation, {
  required Vector2 parentSize,
  super.position,
  super.scale,
  super.angle,
  super.anchor,
  super.paint,
  super.paintLayers,
  super.children,
  super.key,
}) : super(size: Vector2.all(relation * min(parentSize.x, parentSize.y)));