Beispiel #1
0
void draw_font(int x, int y, int fontcolour, int backgroundcolour, int c, int Erase, FontSize size){
	//turn into switch/case if we add more fonts
	if (size == SMALL){
		OutGraphicsCharFont1(x, y, fontcolour, backgroundcolour, c, Erase);
	} else if(size == MEDIUM){
		OutGraphicsCharFont2a(x, y, fontcolour, backgroundcolour, c, Erase);
	}
}
/*
 * Draw text string on a single line.
 * Preconditions: text != NULL
 * Note: Writing a space character with erase set to true will set all pixels
 * in the character to the background colour
 */
void Text(int x, int y, int font_color, int background_color, char *text, int erase)
{
	const int text_char_x_size = 12;
	if (text != NULL) {
		int i;
		for (i = 0; text[i] != '\0'; i++) {
			  OutGraphicsCharFont2a(x+(text_char_x_size * i), y, font_color, background_color, (int) text[i], erase);
		}
	}
}