allegro draw text

#include<allegro5/allegro.h> #include<allegro5/allegro_font.h> #include<allegro5/allegro_ttf.h> #include<allegro5/allegro_native_dialog.h> int main() { al_init(); ALLEGRO_DISPLAY *display; display = al_create_display(640, 480); al_init_ttf_addon; al_init_font_addon; ALLEGRO_FONT *font24 = al_load_ttf_font("pacifico.ttf", 24, 0); al_clear_to_color(al_map_rgb(0, 0, 0)); al_draw_text(font24, al_map_rgb(255, 0, 255), 50, 50, ALLEGRO_ALIGN_CENTER, "Hello GAMERS!"); al_flip_display(); al_rest(5.0); al_destroy_display(display); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.