4

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

stighy
  • 417
  • 6
  • 30
  • 60

2 Answers2

1

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);
stighy
  • 417
  • 6
  • 30
  • 60
0

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.

coderanger
  • 6,147
  • 36
  • 38