|
-
Mar 12th, 2002, 12:54 AM
#1
Thread Starter
Junior Member
DirectX how to draw text
Does anyone know how to draw text onto the screen?
Thanks
-
Mar 12th, 2002, 01:03 AM
#2
Good Ol' Platypus
Yep, if you want to draw to your Backbuffer you put:
VB Code:
BackBuffer.DrawText 50, 60, "Hello!", False
...To the best of my knowledge. The actual message may come before the coordinates (50 = X, 60 = Y).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 12th, 2002, 12:50 PM
#3
Thread Starter
Junior Member
Is there a sample code somewhere?
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.
-
Mar 12th, 2002, 12:51 PM
#4
Junior Member
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:
Code:
Dim hDC as long
hDC = BackBuffer.GetDC ' BackBuffer must be an DirectXSurface
but I'm not quite sure of this.
I'm also not sure if (and how) this works with DirectX8 as the MS documentation isn't very good...
Last edited by Raptor; Mar 12th, 2002 at 01:00 PM.
VB 6.0; VC++ 6.0; PERL; PASCAL; BASIC; PHP4; HTML; mySQL
-
Mar 12th, 2002, 01:49 PM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|