ID3DXFont z-depth

Started by
3 comments, last by yuhaobo 17 years, 8 months ago
Hi, does anyone know if it's possible to pursuade ID3DXFont to use depth values for the text it draws? I'm currently passing it my own implementation of a ID3DXSprite interface, which sets the Z value for the position to something more reasonable than 0.0f, but I'm wondering if there's a cleaner way. Cheers, Steve
Advertisement
I've been using ID3DXSprite::SetTransform() for changing the z-value which sounds like exactly what you're doing. I went hunting the docs a while ago to see if there was any way within the ID3DXFont interface itself but couldn't find anything. Unless the interface has changed since the October 2005 SDK (most recent version I'm using), I think that's the only way you can do it. It's not so bad! [grin]
You could always set both minz and maxz in the viewport to the desired depth value. Not that I would do it this way, but it is a way.
.
Thanks for the replies - I never thought of using SetTransform()...

My method has some more advantages. I can DrawText once and add the sprite calls to my scene graph, and I can use my texture sheet manager to manage the textures it generates. Which gives me a reasonable boost in FPS (70FPS -> 82FPS).
hi, I'm currently in the same problem, can you elaborate in more details how u change the z-value of ID3DXFONT?

thanks

This topic is closed to new replies.

Advertisement