CircleComponent.relative constructor
CircleComponent.relative(})
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, {
Vector2? position,
required Vector2 parentSize,
double angle = 0,
Anchor? anchor,
}) : this(
radius: relation * (min(parentSize.x, parentSize.y) / 2),
position: position,
angle: angle,
anchor: anchor,
);