Simply (hu i guess) make a test when your pointer is on min/max screen size height then tilt up/down, same for width min/max and pan left/right...