This function returns the current depth (i.e. the z coordinate) for the 2D drawing functions (such as sprites or primitives).
By default, it will be equal to the current layer's depth, but this can be changed using gpu_set_depth.
gpu_get_depth();
var _depth = gpu_get_depth();
show_debug_message($"The depth used for drawing is currently set to: {_depth}");
The code above gets the current depth value used for drawing using gpu_get_depth and outputs it in a debug message.