| 1 | #include<iostream> |
| 2 | #include <allegro.h> |
| 3 | using namespace std; |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | BITMAP *plan = NULL; |
| 8 | BITMAP *pawn = NULL; |
| 9 | |
| 10 | allegro_init(); |
| 11 | install_keyboard(); |
| 12 | set_color_depth(16); |
| 13 | set_gfx_mode(GFX_AUTODETECT,1280,1024,0,0); |
| 14 | set_palette(default_palette); |
| 15 | clear_to_color(screen,15); |
| 16 | |
| 17 | plan = load_bitmap("plan.bmp",default_palette); |
| 18 | pawn = load_bitmap("pawn.bmp",default_palette); |
| 19 | |
| 20 | |
| 21 | |
| 22 | blit(plan,screen,0,0,0,0,plan->w,plan->h); |
| 23 | blit(pawn,screen,0,0,0,0,pawn->w,pawn->h); |
| 24 | text_mode(-1); |
| 25 | textout(screen,font,"ESC - The end of program",10,1000,2); |
| 26 | |
| 27 | destroy_bitmap(plan); |
| 28 | destroy_bitmap(pawn); |
| 29 | |
| 30 | readkey(); |
| 31 | allegro_exit(); |
| 32 | return 0; |
| 33 | } |
| 34 | END_OF_MAIN() |
In dev C++ I can see after compile this code:
C:\Documents and Settings\windows\Pulpit\main.cpp In function `int _mangled_main()':
24 C:\Documents and Settings\windows\Pulpit\main.cpp [Warning] `text_mode' is deprecated (declared at C:/Dev-Cpp/include/allegro/alcompat.h:155)
24 C:\Documents and Settings\windows\Pulpit\main.cpp [Warning] `text_mode' is deprecated (declared at C:/Dev-Cpp/include/allegro/alcompat.h:155)
25 C:\Documents and Settings\windows\Pulpit\main.cpp [Warning] `textout' is deprecated (declared at C:/Dev-Cpp/include/allegro/alcompat.h:157)
25 C:\Documents and Settings\windows\Pulpit\main.cpp [Warning] `textout' is deprecated (declared at C:/Dev-Cpp/include/allegro/alcompat.h:157)




And How can I enlarge text: "ESC - The end of program" ??
Old commands.
textout() and textprintf() have been replaced with textout_ex() and textprintf_ex(), which, instead of having to set the text mode ahead of time, take both a foreground and background colour, and if you set the background to -1, it will be transparent.
To make the text at the end bigger, you can either make yourself a bigger font and load it into your program, or you can print your text onto a bitmap and use stretch_blit() to paste it to the screen as big as you want.
--- Kris Asick (Gemini)
--- http://www.pixelships.com
I don't understand english very well - so haw can I write this in a new style:
"text_mode(-1);
textout(screen,font,"ESC - The end of program",10,1000,2);"
??
textout_ex(screen,font,"ESC - The end of program",10,1000,2,-1);
You do not need text_mode().
--- Kris Asick (Gemini)
--- http://www.pixelships.com
Thank you very much !!!!