NoviceWithManyProblems Posted December 8, 2021 Share Posted December 8, 2021 How do I interrupt the display of dxDrawText behind anything with collison e.g. walls? Link to comment
The_GTA Posted December 8, 2021 Share Posted December 8, 2021 (edited) Hello NoviceWithManyProblems, how about you render your text on a texture/render-target and then use dxDrawMaterialPrimitive3D to render that color buffer into 3D space? This way you can draw only the closest pixels, obstructing any behind depth-enabled triangles. Please mind that GTA SA collisions are only very roughly approximated to visible triangles. Edited December 8, 2021 by The_GTA 2 Link to comment
Moderators IIYAMA Posted December 8, 2021 Moderators Share Posted December 8, 2021 Another approach would be checking if there is something between the camera and the text position.https://wiki.multitheftauto.com/wiki/IsLineOfSightClear But it does have some flaws, like for example being blocked by transparent collisions Or the camera center is blocked by collision, but the sides are not when peaking around a corner. (Can be fixed by using more lines or using this function https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition) 2 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now