application_surface

This global, built-in variable can be used to access the application surface, for use in any of the surface functions. This surface is permanently available and is where the game is drawn by GameMaker.

The regular Draw events (Draw Begin, Draw and Draw End) draw to this surface by default. Other Draw events (like Pre/Post Draw and Draw GUI) do not draw on the application surface. See Draw Events for more information on how those events work.

 

Syntax:

application_surface;

 

Returns:

Surface

 

Example:

var _cam_width = 320;
var _cam_height = 180;
var _resolution_scale = 4;

surface_resize(application_surface, _cam_width * _resolution_scale, _cam_height * _resolution_scale);

This defines the size of the in-game camera (320 x 180), and a resolution scale value (4x), which is how large the target resolution should be in relation to the in-game camera.

The camera size is multiplied with that resolution scale and applied as the size of the application surface, which defines the game's resolution.