panCamera method

void panCamera(
  1. Vector2 to, [
  2. double sensitivity = 1.0
])

Implementation

void panCamera(Vector2 to, [double sensitivity = 1.0]){
  final double x = (!cameraControls.panX)?0:((to.x - _from.x)/100 * sensitivity);
  final double y = (!cameraControls.panY)?0:((to.y - _from.y)/100 * sensitivity);

  position.x += x;
  position.y -= y;

  _from.x = to.x;
  _from.y = to.y;
}