Jump to content

dxDrawText behind something with collision


Recommended Posts

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 by The_GTA
  • Like 2
Link to comment
  • Moderators

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)

 

  • Like 2
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...