• Advertisement

3D Question about Font and Text in Direct3D

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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:) 

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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


  • Advertisement