Leia depth control

Any ideas on how to implement z depth to have control over what is behind the screen or in front of the screen by means of using Z-depth? I noticed Leia’s tools adjusting that behind the scenes via script or programming. I would like to control that manually.