surface_resize(surface_id, w, h);
|surface_id||The ID of the surface to change.|
|w||The width of the new surface.|
|h||The height of the new surface.|
This function will resize a surface to the given dimensions (in pixels). The surface_id is that of a surface you have created previously, or the application_suface, and the function will resize that surface. Note that this will neither crop nor stretch the contents of the surface, but rather it destroys the current surface and recreates it with the same handle (surface_id) with the new dimensions, meaning that it will need to be cleared and drawn to again (unless it is the application_surface in which case GameMaker: Studio will do this automatically).
NOTE: If you are resizing the application surface, these changes will not be registered until the start of the next draw frame, meaning that calling the surface_get_width() or surface_get_height() functions in the same event or step will return the previous values.
if view_wport !=
surface_get_width(application_surface) || view_hport !=
The above code will check the view port size against that of the surface "aplication_surface" and if it is different, the surface is re-sized.