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 (3)
- Weird issue with font, can anybody help?
- Drawing text slows down FPS dramatically
- Mixing Allegro 5 with OPENGL
- Locking bitmap is slower than not (?)
- My Allegro5 Menu System
- Hello, font loading keeps crashing in allegro5?
- Memory leak in allegro5
- Keyboard Interrupting on Mouse Positions?
- Help using mouse events in creating a Menu
Other recent discussions:
- [A5] al_draw_text() not drawing a character
- trying to move font....
- Scaled font print call?
- al_mangled_main() issue OSX while creating a standalone bundle
- Keyboard input
- Yet another text rendering bug
- Network Client draw issue, Network Server draws fine.
- al_draw_soft_line
- How to make a ASCII game?
- Rotate text with transformations