CircleHitbox.relative constructor

CircleHitbox.relative(
  1. double relation, {
  2. required Vector2 parentSize,
  3. Vector2? position,
  4. double? angle,
  5. Anchor? anchor,
  6. bool isSolid = false,
  7. CollisionType collisionType = CollisionType.active,
})

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

Implementation

CircleHitbox.relative(
  super.relation, {
  required super.parentSize,
  super.position,
  super.angle,
  super.anchor,
  bool isSolid = false,
  CollisionType collisionType = CollisionType.active,
})  : shouldFillParent = false,
      super.relative() {
  this.isSolid = isSolid;
  this.collisionType = collisionType;
}