D3d_set_depth - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

NOTOC {{-}}

Notation

Description

Sets the depth value used for 3D rendering. When drawing takes place in 3D, generally a depth buffer (or Z-buffer) is used to sort the distance each pixel is on the screen to the current projection, when a new pixel is rendered if only copies to the screen if it has a low distance to the camera (a lower depth). The same concept applies in the draw order of 2D objects who make proper use of their depth constant.

Parameters

  • depth The depth value to set for drawing.

Return Values

No values are returned from the function.

Example Call

d3d_set_depth(obj_player.depth + 1);
d3d_draw_block(-20, -20, -20, 20, 20, 20, background_get_texture(bg_example), 1, 1);

This demonstrates setting the depth higher than the obj_player object by an increment of 1 and then rendering a cube. This basically means were trying to draw the cube before the player.

Category:Function:All