DrawText Error
DrawText Error
DrawText Error
DrawText Error
DrawText Error
DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error
DrawText Error DrawText Error
DrawText Error
Go Back  Xtreme Visual Basic Talk > > > > DrawText Error


Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2006, 04:36 AM
SpiralEdge's Avatar
SpiralEdge SpiralEdge is offline
Regular
 
Join Date: Sep 2004
Posts: 51
Default DrawText Error


Code:
fntOut.DrawText(Nothing, IIf(bRenderWireframe, "F1 - Solid", "F1 - Wireframe"), _
                        New Drawing.Rectangle(5, 5 + (5 * (iFontSize + 6)), 0, 0), _
                        DrawTextFormat.Left Or DrawTextFormat.Top, _
                        Drawing.Color.FromArgb(255, 200, 128, 64))
Recently I've been having problems with the sprite part of the DrawText function. I want the Sprite to be 'Null' because the SDK says that if you leave it null it will just create its own sprite. For some reason when I use nothing or null, I get errors. Anyone have any ideas?

fntOut.DrawText(Nothing, <-- this is the part of the code that is giving me an error.

I don't remember having to even deal with sprites in the past. Whats the deal?
Reply With Quote
  #2  
Old 05-20-2006, 09:12 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default

When you say "this is the part of the code that is giving me an error," do you mean that VS is underlining the Nothing keyword and saying something is wrong with it, or that it's just crashing there and you're pretty sure it's the Nothing keyword? I had no problems whatsoever using the Direct3D.Font object using Nothing in place of a sprite, you just have to make sure that you correctly instanciate the object. You have to create a Drawing.Font object first for it to associate with, like such:

Code:
Dim pFont As New Drawing.Font("Aerial", 10, FontStyle.Bold, GraphicsUnit.Pixel) fntOut = New Direct3D.Font(D3DDevice, pFont)
But if you have done that, please be a little more specific about the actual error you are getting back.
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
DrawText Error
DrawText Error
DrawText Error DrawText Error
DrawText Error
DrawText Error
DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error DrawText Error
DrawText Error
DrawText Error
 
DrawText Error
DrawText Error
 
-->