Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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);
share|improve this answer
    
Heh, looks like we found it simultaneously :-) –  coderanger Oct 18 '10 at 19:07
    
when you can, be sure to make this the accepted answer so it isn't incorrectly categorized as unanswered. –  Tetrad Oct 18 '10 at 19:58

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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