gpu_get_depth

此函数返回 2D 绘图函数 (例如精灵或图元) 的当前深度 (即 z 坐标)。

默认情况下,它等于当前层的深度,但可以使用 gpu_set_depth 进行更改。

 

语法:

gpu_get_depth();

 

返回:

Real

 

例子:

var _depth = gpu_get_depth();
show_debug_message($"The depth used for drawing is currently set to: {_depth}");

上面的代码使用 gpu_get_depth 获取用于绘制的当前深度值,并将其输出到调试消息中。