DX9.0C Graphics Library or Font Nazi?

rifter1818

Junior Contributor
Joined
Sep 11, 2003
Messages
255
Location
A cold dark place
Im having trouble with 3d Text (Mesh.FromText) in the fact that no matter what font i send to it its allways the same new Font("Arial",12) == new Font("Arial",4) == new Font("Courier",32). Someone help me avoid the facist font ideals of Directx!
C#:
System.Drawing.Font f = new System.Drawing.Font("Courier",12);
This = Mesh.TextFromFont(D.device,f,"This game was made using",0.001F,0.3F);
f= new System.Drawing.Font("Arial",16);
MESH2 = Mesh.TextFromFont(D.device,f,"My Lame atempt at a Game Engine",0.001F,0.5F);
f= new System.Drawing.Font("Courier",8);
V = Mesh.TextFromFont(D.device,f,"V1.0.0",0.001F,0.2F);
Not my final choices in fonts but right now when i render all three mesh's are the same font and size.

PS, if you cant allready tell ive decided to make my posts as obscure as possible whilst remaining on topic. Thus Font Nazi! Cheers
 
I'm having font problems as well, except i just cant render it.
M Font class looks like this

Visual Basic:
[/font]
[font=Courier New][color=#0000ff]Public[/color][color=#0000ff]Class[/color] clsText[/font]
[font=Courier New] [/font]
[font=Courier New][color=#0000ff]Dim[/color] TheFont [color=#0000ff]As[/color] Microsoft.DirectX.Direct3D.Font = [/font][color=#0000ff][font=Courier New]Nothing[/font]
[font=Courier New] [/font]
[/color][font=Courier New][color=#0000ff]Dim[/color] rect [color=#0000ff]As[/color][color=#0000ff]New[/color] Rectangle(0, 0, 0, 0)[/font]
[font=Courier New] [/font]
[font=Courier New][color=#0000ff]Dim[/color] x [color=#0000ff]As[/color] Microsoft.DirectX.Vector3[/font]
[font=Courier New] [/font]
[font=Courier New][color=#0000ff]Dim[/color] y [color=#0000ff]As[/color] Microsoft.DirectX.Vector3[/font]
[font=Courier New] [/font]
[font=Courier New][color=#0000ff]Public[/color][color=#0000ff]Sub[/color][color=#0000ff]New[/color]([color=#0000ff]ByVal[/color] d3ddev [color=#0000ff]As[/color] Microsoft.DirectX.Direct3D.Device, [color=#0000ff]Optional[/color][color=#0000ff]ByVal[/color] fontname [color=#0000ff]As[/color][color=#0000ff]String[/color] = "Courier", [color=#0000ff]Optional[/color][color=#0000ff]ByVal[/color] Size [color=#0000ff]As[/color][color=#0000ff]Integer[/color] = 10)[/font]
[font=Courier New] [/font]
[font=Courier New]TheFont = [color=#0000ff]New[/color] Microsoft.DirectX.Direct3D.Font(d3ddev, [color=#0000ff]New[/color] System.Drawing.Font(fontname, Size))[/font]
[font=Courier New] [/font]
[font=Courier New][color=#0000ff]End[/color][/font][color=#0000ff][font=Courier New]Sub[/font]
[font=Courier New] [/font]
[/color][font=Courier New][color=#0000ff]Public[/color][color=#0000ff]Sub[/color] Drawtext([color=#0000ff]ByVal[/color] text [color=#0000ff]As[/color][color=#0000ff]String[/color], [color=#0000ff]ByVal[/color] Color [color=#0000ff]As[/color] System.Drawing.Color)[/font]
[font=Courier New] [/font]
[color=#008000][font=Courier New]' TheFont.DrawText(text, rect, Microsoft.DirectX.Direct3D.DrawTextFormat.NoClip, Color) [/font][/color]
[color=#008000][font=Courier New][/font][/color] 
[color=#008000][font=Courier New]^^ The above line won't work, it needs a sprite as a first argument?[/font]
[font=Courier New] [/font]
[/color][font=Courier New][color=#0000ff]End[/color][/font][color=#0000ff][font=Courier New]Sub[/font]
[font=Courier New] [/font]
[font=Courier New]End[/font][/color][color=#0000ff][font=Courier New]Class[/font]
[font=Courier New] [/font]
[/color][font=Courier New]

Argh! The stupid forums squish all my words together.. and it changes my actual post too ... and the automatic doublespacing of code with no indents ..... this is getting annoying - I think i'm gonna 'address' this in Suggestions/Bugs/Comments

Well the code tells you how to 'pick' the font, but now I can't render it?? O_o
 
If im not mistaken

Your rendering 2d Text, and all your missing is as follows
Sprite s = new sprite(device);
s.begin(SpriteFlags.AlphaBlend);
font.drawtext(s,text......);
s.end();
....
and that works for rendering 2d text, my problem is 3d text however.
 
Back
Top