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)
- 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
- GUI Design and Implementation for Noobs
- 7Zip file of my game - Alien Cookbook
Other recent discussions:
- Builtin font doesn't work in resizeable display on windows
- Mouse Addon causing program crash
- How to call function al_draw_multiline_text?
- Game Crashing and I'm not sure why?
- letters are rendered in their seperated form, this may require glyph hook maybe?
- Mingw do not find Allegro lib
- got a bug in my FULLSCREEN WINDOWED MODE switchout
- How do i print numbers
- Weird flex with my Bitmaps on my Screen
- Input routine works, then does not (-1)