Skip to content

Instantly share code, notes, and snippets.

@katsaii
Last active September 13, 2019 23:20
Show Gist options
  • Save katsaii/9b7468fe3e7a394283f676405c2396ac to your computer and use it in GitHub Desktop.
Save katsaii/9b7468fe3e7a394283f676405c2396ac to your computer and use it in GitHub Desktop.
Sets the size of a window in GameMaker and centres to the first display in a single frame.
gml_pragma("forceinline");
/// @desc Sets the window to the desired size and centres it.
/// @param w {Integer} The width to set the window to.
/// @param h {Integer} The height to set the window to.
window_set_rectangle(
(display_get_width() - argument0) div 2,
(display_get_height() - argument1) div 2,
argument0, argument1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment