Does anyone know how to draw text onto the screen?
Thanks
Printable View
Does anyone know how to draw text onto the screen?
Thanks
Yep, if you want to draw to your Backbuffer you put:...To the best of my knowledge. The actual message may come before the coordinates (50 = X, 60 = Y).VB Code:
BackBuffer.DrawText 50, 60, "Hello!", False
Thanks for the tip, but I'm still having problems.
I'm just a beginner and I wish to see some sample code.
I'm trying to write a text in a triangle and I'm still kind of lost.
Thanks.
In DirectX 7 and lower it's also possible to retrieve the Device Context (DC) of the Backbuffer and then use this DC with any of the normal Win32 GDI functions like TextOut, etc...
It must be something like:
but I'm not quite sure of this.Code:Dim hDC as long
hDC = BackBuffer.GetDC ' BackBuffer must be an DirectXSurface
I'm also not sure if (and how) this works with DirectX8 as the MS documentation isn't very good...
You cannot get a DC to a surface in D3D8. For drawing text, you must rely on the ID3DXFont interface (which is crap), or your own custom font class.
Z.