PolygonHitbox.relative constructor
PolygonHitbox.relative(})
With this constructor you define the PolygonHitbox in relation to the
parentSize of the hitbox.
Example: [[1.0, 0.0], [0.0, -1.0], [-1.0, 0.0], [0.0, 1.0]]
This will form a diamond shape within the bounding size box.
NOTE: Always define your shape in a counter-clockwise fashion (in the
screen coordinate system)
Implementation
PolygonHitbox.relative(
List<Vector2> relation, {
Vector2? position,
required Vector2 parentSize,
double angle = 0,
Anchor? anchor,
}) : super.relative(
relation,
position: position,
parentSize: parentSize,
angle: angle,
anchor: anchor,
shrinkToBounds: true,
);