show_debug_overlay

This function toggles The Debug Overlay. This overlay is disabled by default.

The debug overlay enables a menu with three options: FPS (open by default), Log, and Audio. It displays the GameMaker version in the top-right corner, along with the version and name of the project: 

If the optional minimised parameter is set to false, the overlay is opened with the FPS window minimised, only showing basic info in the header.

To create custom debug views that will appear under the Views menu, see Creating Debug Views.

NOTE This function will not work on the HTML5 target due to the different way it works compared to all the other targets.

NOTE To bring up The Debug Overlay with the Log window open, use show_debug_log instead.

 

Syntax:

show_debug_overlay(enable[, minimised, scale, alpha]);

Argument Type Description
enable Boolean Enable (true) or disable (false) the debug overlay
minimised Boolean OPTIONAL Whether to open the FPS window minimised (doesn't apply to any other windows or debug views)
scale Real OPTIONAL The scale factor to draw the overlay with (default is 1)
alpha Real OPTIONAL The alpha value to draw the overlay with (default is 0.8)

 

Returns:

N/A

 

Example 1: Basic Use

if keyboard_check_pressed(ord("O"))
{
    global.debug = !global.debug;
    show_debug_overlay(global.debug);
}

The above code toggles the debug on or off whenever the "O" key is pressed.

 

Example 2: Additional Parameters

show_debug_overlay(true, true, 2, 0.5);

The above code opens the debug overlay minimised and draws it with a scale factor of 2 and an alpha of 0.5.