debug_get_callstack


描述

This function generates an array of strings, where thecurrent script is listed first. The exact string format will vary depending on the target platform chosen, but it will mostly have the script/event name, then a colon : and then the line number, something like this:

"gml_Script_script2:1"
"gml_Script_script1:32"
"gml_Script_script0:64"
"gml_Object_object0_Create_0:1"


语法:

debug_get_callstack()


返回:

Array


例如:

if debug_mode
    {
    if keyboard_check(vk_escape)
        {
        var _a = debug_get_callstack();
        for (var i = 0; i < array_length_id(_a); ++i;)
            {
            show_debug_message(_a[i]);
            }
        }
    }

The above code checks to see if debug mode is enabled and if it is it checks to see if a key ios being held down. If it is it then outputs the current call stack to the console,