Results 1 to 5 of 5

Thread: DirectX how to draw text

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Vancouver, BC
    Posts
    21

    DirectX how to draw text

    Does anyone know how to draw text onto the screen?

    Thanks

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Yep, if you want to draw to your Backbuffer you put:
    VB Code:
    1. 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)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Vancouver, BC
    Posts
    21

    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.

  4. #4
    Junior Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    21
    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

  5. #5
    Zaei
    Guest
    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
  •  



Click Here to Expand Forum to Full Width