Directx and text???
I know the search is down, but I did look on the internet, and have not found any answers that I understand. My question:
How do you put text ( example: score) on the screen with directDraw? I would like to use true type fonts, or at least somthing that looks nice? I imagine there is an easy way, but I don''t know what it is.
Thanks for nay help you can give.
I think, therfore I am.
I think?
I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming
My Twitter: https://twitter.com/indieprogram
My Book: http://amzn.com/1305076532
You can use the DeviceContext-way and another way.
I use DC-way although people say that its slow.
You can do a strlen(TEXT) for the length.
.lick
I use DC-way although people say that its slow.
HDC myDc = 0; // Device Context_surface_->GetDC( &myDc ); // Attach DC to the SurfaceSetTextColor(myDC , RGB(0,255,0)); // Set Text ColorSetBkColor(myDc , RGB(0,0,0)); // Set Backgr ColorTextOut( myDc, 0 , 0 , "Hi" , 2 ); // (DC,xpos,ypos,TEXT,TEXTLENGTH)
You can do a strlen(TEXT) for the length.
.lick
As far as I am aware your options are use the GDI text as Pipo has pointed out, or write your own font code to output the text as images. I have looked into this a little before, and it seems the quickest way to get text out is by using the GDI functions.
it is the quickest way in coding, but in compiling or rendering this takes longer. i think...
There are some utility files that come with the directx samples that include text (even 3d text).
In the Common files of the DirectX SDK is the source for putting text to the screen (d3dfont.h and d3dfont.cpp). You can use any fonts that are on your computer.
Chris Z.
ZeroFX Interactive
[edited by - ZeroEffect on October 8, 2002 9:56:49 AM]
Chris Z.
ZeroFX Interactive
[edited by - ZeroEffect on October 8, 2002 9:56:49 AM]
Chris Z. GPU FX
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement