globalToLocal method

Vector2 globalToLocal(
  1. Vector2 point, {
  2. Vector2? output,
})

Converts from the global (canvas) coordinate space to local (camera = viewport + viewfinder).

Opposite of localToGlobal.

Implementation

Vector2 globalToLocal(Vector2 point, {Vector2? output}) {
  final viewportPosition = viewport.globalToLocal(point, output: output);
  return viewfinder.globalToLocal(viewportPosition, output: output);
}