gpu_get_depth

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.

 

Syntax:

gpu_get_depth();

 

Returns:

Real

 

Example:

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.