al_draw_text
void al_draw_text(const ALLEGRO_FONT *font,
ALLEGRO_COLOR color, float x, float y, int flags,
char const *text)
Introduced in 5.0.0
Writes the 0-terminated string text
onto bmp
at position x
, y
, using the specified font
.
The flags
parameter can be 0 or one of the following flags:
- ALLEGRO_ALIGN_LEFT - Draw the text left-aligned (same as 0).
- ALLEGRO_ALIGN_CENTRE - Draw the text centered around the given position.
- ALLEGRO_ALIGN_RIGHT - Draw the text right-aligned to the given position.
See also: al_draw_ustr, al_draw_textf, al_draw_justified_text
Examples: ex_bitmap_flip, ex_bitmap_target, ex_blend, ex_color, ex_display_options, ex_draw_bitmap, ex_logo, ex_membmp, ex_mouse_cursor, ex_timer, ex_transform, ex_vsync
Most helpful discussions:
- best way for drawing tinted text (2)
- Problem with function 'al_draw_text'
- Grabber With Allegro 5?
- al_load_bitmap question
- MOUSE question
- Is using TTFs really that complicated?
- Having Trouble with exit(1) - Stalling Program
- My second game, space invader simplified
- Vivace extra points. Its there a better way of doing this one.
- I'm new
Other recent discussions:
- Allegro5 and OpenGL. Problem with drawing Allegro primitives
- [Please Help] Allegro 5 Text File Output
- Breaking your program ... on purpose
- al_draw_textf causing crash
- I am looking for correct detailed instructions how to build Allegro....
- why is my code failing
- Difficulty compiling on Windows
- Screen is cleared and a new one appears Allegro5 in C?
- Same code - slow on Windows, fast on Linux - timer fires too slow?
- A little bit of fun for family and friends