Check out example codes for "stop camera if it hits edge of room gml". It will help you in understanding the concepts better.

Code Example 1

x = clamp(x, camera_width/2, room_width-(camera_width/2);
y = clamp(y, camera_height/2, room_height-(camera_height/2);
var vn = matrix_build_lookat(x, y, -10, x, y, 0, 0, 1, 0);

Learn ReactJs, React Native from akashmittal.com