[SDL] How do I get SDL_TTF to print out numbers?

Pieter Hulshoff phulshof at xs4all.nl
Sun Mar 27 01:15:46 PST 2005


On Sunday 27 March 2005 10:30, James OMeara wrote:
> OK, let's say I've got a game where each time you hit something, 1 get's
> added to your current score. My score is an integer/long, but I want to
> print it out to the screen using SDL_TTF.
> How do I go about doing this?

For C:
man 3 printf
Just place the number in a string, and print that.

For C++:
Just << it to a string, then use .c_str( ) to be able to use it in the 
RenderText function.

Regards,

Pieter Hulshoff





More information about the SDL mailing list