Offset globalToViewportPosition(Offset position) { if (!hasGameRef) return position; return gameRef.globalToViewportPosition(position.toVector2()).toOffset(); }