• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Scaling Surface

Imperial

Member
If we are using a surface
Code:
surface = surface_create(view_wview,view_hview);
How to make the surface scale with the view when we Zoom In/Out with this Code
Code:
if mouse_wheel_up()
{
    center_of_space_x = view_xview+view_wview/2;
    center_of_space_y = view_yview+view_hview/2;
    view_wview -= view_wview * zoom_factor;
    view_hview -= view_hview * zoom_factor;
    view_xview = center_of_space_x - view_wview/2;
    view_yview = center_of_space_y - view_hview/2;
}
thanks man for help
 

RangerX

Member
If the surface is the same size as the view, you'd do the same caculations when with the views. There's a function for changing the size of your surface: surface_resize();
 
Top