Writing SDL Text

I had a problem for the SDL project, I would like to show the text in the window and let the user enter the text. As far as I know, there is no easy way to achieve this. Do you have any suggestions? Note. I use the C programming language. I know there is a library called SDL_ttf which does not seem to do the work I want.

+4
source share
2 answers

I have to be honest, since I read your question, SDL_ttf arose immediately. It is not too difficult to use, and there are many documents available.

It looks like what you are looking for is a library that provides a simple console interface where your main interaction with the software is the text write(...) and read(...) , and it handles the display, scrolling, etc.

There is a lot of code in this project showing how to implement a simple โ€œconsoleโ€ in the SDL, and SDL_ttf is used for this.

I'm not sure that you will avoid this unless you grab a library that hides it from you, like this one , but you will have less control over the display and the interactivity that this provides.

+4
source

I have to go with benosteen , SDL_ttf is a really good option. For my part, I used this tutorial to work on my project. It is really simple and clear.

EDIT: I had some problems with the Blending SDL_ttf functionality, but I managed to get it to work after QuasarDonkey to find the problem in this question .

See a straightforward example of using and creating a text surface.

+1
source

All Articles