Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Managed Direct3D Font.DrawText problem

Mar 16 2003 3:38 AM
Hello I am learning Direct3D using C# and have run into a problem. I want to put text on the screen, but I am unable to put it where I want it. I want to put the text on the absolute top of the screen, between pixel 2 and 28, but I can't since when I use: fntOut.DrawText("ECEDOI v.0.0.1",new System.Drawing.Rectangle(30,2,300,28),DrawTextFormat.Left | DrawTextFormat.Top,Color.White); I get clipping in the text (the font is 24 pixels high), the text clips at the bottom, but it does not get its top at pixel 2, it gets it at about pixel 10. I try to compensate for this by writing: fntOut.DrawText("ECEDOI v.0.0.1",new System.Drawing.Rectangle(30,-6,300,28),DrawTextFormat.Left | DrawTextFormat.Top,Color.White); then it gets correct at the bottom but it clips at the top at about pixel 10. The font is Trebuchet MS, bold at 24 in height. Please help!!' Y.S. /Rickard Haake