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 2 will do this automatically).
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.|
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.