convertLocalToGlobalCoordinate method

Vector2 convertLocalToGlobalCoordinate(
  1. Vector2 point
)
inherited

Converts a local coordinate (i.e. w.r.t. the game widget) to a global coordinate (i.e. w.r.t. the app itself). If the widget occupies the whole app ("full screen" games), or is not attached to Flutter, this operation is the identity.

Implementation

Vector2 convertLocalToGlobalCoordinate(Vector2 point) {
  if (!isAttached) {
    return point.clone();
  }
  return _gameRenderBox!.localToGlobal(point.toOffset()).toVector2();
}