Question about Font and Text in Direct3D

Started by
4 comments, last by oeria2000 6 years, 4 months ago

I have started my "small game" for a few days, I use DirectX 9(some reason i chose this old version of dx) as my graphic engine, I need the effect like the show below. I think that i may need some depth sorting algorism? The text seems to be drawed on 2d surface(sorted and always be the front)?, I'm a beginer in DX, not too much experience... Any suggestion to me is welcome, thanks

txt.png.49ef225e3a1dd86f1aba1c8415415947.png

Advertisement

Your question is not very clear - do you want the text to always be in front of the tree?  We would also need more context about how you are drawing these things.

It does sound like you need to sort the things you're drawing, but how you do that will depend on how you're drawing things, and what you want the result to look like.

You can just z test the stream of characters so turn depth test enabled on for text rendering

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

On ‎2017‎年‎9‎月‎28‎日 at 10:34 PM, NightCreature83 said:

You can just z test the stream of characters so turn depth test enabled on for text rendering

thanks NightCreature83, i'll try,  i think it could be the method, i draw text using ID3DXFont::DrawText(),  how can i set z depth before drawing(fixed pipeline)? this method seems always draw things on front of all,  more help please, tks:) 

On ‎2017‎年‎9‎月‎28‎日 at 9:40 PM, trjh2k2 said:

Your question is not very clear - do you want the text to always be in front of the tree?  We would also need more context about how you are drawing these things.

It does sound like you need to sort the things you're drawing, but how you do that will depend on how you're drawing things, and what you want the result to look like.

thanks trjh2k2, i draw text using ID3DXFont::DrawText(), but i found that it draw text always be the front, sometimes i need the text behind the scene object, like "tony" in my image. any help? thanks :)

This topic is closed to new replies.

Advertisement