4
\$\begingroup\$

as i told in previous question, i'm using SDL.NET (wrapper in C# of SDL). Unfortunately the API website is down so i'm trying to learn it by myself. I would like simply to print text on my screen / surface ... i don't know how to do!

My goal is to print variable status/values, to "debug" directly on the run and on the screen (in the lower corner for example). Can somebody help me ?

Thank you

\$\endgroup\$
1
\$\begingroup\$

Ok, i found the solution on an example project:

SdlDotNet.Graphics.Font myfont = new SdlDotNet.Graphics.Font("arial.ttf",12);
Point dest = new Point(600,400);            
surfVar = myfont.Render("Values: ",Color.White);
Video.Screen.Blit(surfVar,dest);
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Heh, looks like we found it simultaneously :-) \$\endgroup\$ – coderanger Oct 18 '10 at 19:07
  • \$\begingroup\$ when you can, be sure to make this the accepted answer so it isn't incorrectly categorized as unanswered. \$\endgroup\$ – Tetrad Oct 18 '10 at 19:58
0
\$\begingroup\$

http://forums.tigsource.com/index.php?topic=8531.0 has an example of using Graphics.Font to render text to a surface (which is a wrapper for SDL_ttf I think). Basically you load a TTF font into a Font object and then use .Render on that to make a surface from a given string.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.