Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <allegro.h>
- #include <time.h>
- int main()
- {
- int longueur;
- set_uformat(U_ASCII);
- allegro_init();
- install_keyboard();
- srand(time(NULL));
- set_color_depth(32);
- if (set_gfx_mode(GFX_AUTODETECT_WINDOWED,640,480,0,0)!=0){
- allegro_message(allegro_error);
- allegro_exit();
- return 1;
- }
- textout_ex(screen,font,"textout affiche une chaîne non formatée,",30,30,6,-1);
- textout_centre_ex(screen,font,"textout_centre :",SCREEN_W/2,60,7,6);
- textout_centre_ex(screen,font,"é, è, ê, Ê, î, à, ù.. il y a des accents",SCREEN_W/2,90,7,-1);
- textout_right_ex(screen,font,"Textout_right :",SCREEN_W,120,8,-1);
- textout_right_ex(screen,font,"La chaîne est collée à droite",SCREEN_W,150,8,-1);
- textout_justify_ex(screen,font,"la chaîne est justifiée entre deux bords",
- 50,SCREEN_W-50,180,268,9,-1);
- longueur=text_length(font, "la chaîne est justifiée entre deux bords");
- textprintf_ex(screen, font, 30, 260, 10,5,
- "textprintf : la chaîne du dessus mesure %d pixels", longueur);
- textprintf_centre_ex(screen, font, SCREEN_W/2, 280, 11, -1,
- "textprintf_centre : écran = %d par %d",SCREEN_W,SCREEN_H);
- textprintf_right_ex(screen, font, SCREEN_W, 300, 12, -1, "text_printf_right :"\
- " trois nombres tirés au hasard %d, %d, %d", rand(),rand(),rand());
- textprintf_justify_ex(screen, font, 50, SCREEN_W-50, 350, 300, 13,-1,
- "textprintf_justify : il fait beau... ");
- readkey(); // fonction équivalente à getch() de conio.c ou dans cette utilisation à scanf de // stdio.h
- exit(EXIT_SUCCESS);
- }
- END_OF_MAIN();
Add Comment
Please, Sign In to add comment