containsLocalPoint method

  1. @override
bool containsLocalPoint(
  1. Vector2 point
)
override

Checks whether the point is within this component's bounds.

This method should be implemented for any component that has a visual representation and non-zero size. The point is in the local coordinate space.

Implementation

@override
bool containsLocalPoint(Vector2 point) {
  return hitboxes.any(
    (hitbox) => hitbox.containsLocalPoint(
      hitbox.parentToLocal(point, output: _temporaryPoint),
    ),
  );
}