Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cam = view_camera[0];
- var cam_x = camera_get_view_x(cam);
- var cam_y = camera_get_view_y(cam);
- var cam_w = camera_get_view_width(cam);
- var cam_h = camera_get_view_height(cam);
- var zoom_h = 30;
- var zoom_ratio = window_get_width() / window_get_height();
- var zoom_w = zoom_h * zoom_ratio;
- if mouse_wheel_up() {
- camera_set_view_size(cam, cam_w - zoom_w, cam_h - zoom_h);
- camera_set_view_pos(cam, cam_x + zoom_w/2, cam_y + zoom_h/2);
- }
- if mouse_wheel_down() {
- camera_set_view_size(cam, cam_w + zoom_w, cam_h + zoom_h);
- camera_set_view_pos(cam, cam_x - zoom_w/2, cam_y - zoom_h/2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement