Sorry, the first two lines should read
Me.FontName = "Verdana"
Me.FontSize = 20
Main Topics
Browse All Topics
Hi,
I'm writing a VB application (a game) using DirectX. I need to show some text on the screen, this is the code used:
--------- other code----------
Sub mainloop()
Do
DoEvents
Frames = Frames + 1
ModDX7.SetRect SrcRect, 0, 0, 1024, 768
BackBuffer.BltFast 0, 0, Background, SrcRect, DDBLTFAST_WAIT
BackBuffer.SetForeColor vbRed
BackBuffer.DrawText 10, 745, "SCORE = " & Score, False
DoGame
BackBuffer.BltFast Iguana.x - 80, 660, Sprites, SrcRect, DDBLTFAST_SRCCOLORKEY Or DDBLTFAST_WAIT
View.Flip Nothing, DDFLIP_WAIT
Loop Until Key = vbKeyEscape
End sub
-------------------other code------
The text string "SCORE" is drawn correctly on the screen, but I would like to manipulate the fonts: increasing the size, changing the font type and maybe changing the text color without changing the color of drawn lines too. How can I do this?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To 199057j,
I tried your code but it didn't work.
The code I showed in my question was contained in a .bas module, therefore the Me key word was incorrect.
However, I could find the solution (thanks to your suggestions):
Dim Font as Ifont ' Font object'
. . . . . . . . . . other code. . . . . . . . . . . .
Sub MainLoop()
Set Font = New StdFont 'create a new Font obj'
With Font
Font.Name = "Verdana"
Font.Size = 20
End With
BackBuffer.SetFont Font
BackBuffer. DrawText 10, 740, "1-2-3 Testing", False
. . . . . other code. . . . .
End Sub
Your comment is accepted as answer but it can't be graded more than B, because it wasn't entirely correct.
Thanks for help.
Business Accounts
Answer for Membership
by: l99057jPosted on 2001-06-05 at 12:33:02ID: 6157479
Font.FontName = "Verdana"
Font.FontSize = 20
objDDBackBuffer.SetFont Font
objDDBackBuffer.DrawText 10, 45, "TESTING 1-2-3", False