
Untitled
By: a guest on
Nov 8th, 2010 | syntax:
None | size: 0.43 KB | hits: 121 | expires: Never
#include <SDL/SDL_ttf.h>
TTF_Init();
TTF_Font *font;
font = TTF_OpenFont("somefont.ttf", 24); /* 24 is the size */
/* char* texto */
SDL_Color foregroundColor = { 255, 255, 0 };
SDL_Color backgroundColor = { 0, 0, 0 };
SDL_Surface* textSurface = TTF_RenderText_Shaded(font, texto,
foregroundColor, backgroundColor);
SDL_Rect textLocation = { 0, 0, 0, 0 };
SDL_BlitSurface(textSurface, NULL, scr, &textLocation);