DrawText Error

SpiralEdge
05-05-2006, 03:36 AM
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?

Moohasha
05-20-2006, 08:12 PM
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:

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.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum