diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-27 19:47:31 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-27 19:47:31 -0500 |
commit | aea002f290e5eddde98eb394fa7a9145c325fffe (patch) | |
tree | 11533f72e6f56cabf26d02cd5e48d69f666b51f4 /text.h | |
parent | 4554db338221f8fd1c7b4855b8d5bc50780815d2 (diff) |
buttons (for warn overwrite popup)
Diffstat (limited to 'text.h')
-rw-r--r-- | text.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -20,6 +20,18 @@ typedef struct { float min_x, max_x, min_y, max_y; } TextRenderState; +typedef enum { + ANCHOR_TOP_LEFT, + ANCHOR_TOP_MIDDLE, + ANCHOR_TOP_RIGHT, + ANCHOR_MIDDLE_LEFT, + ANCHOR_MIDDLE, + ANCHOR_MIDDLE_RIGHT, + ANCHOR_BOTTOM_LEFT, + ANCHOR_BOTTOM_MIDDLE, + ANCHOR_BOTTOM_RIGHT, +} Anchor; + extern bool text_has_err(void); // Get the current error. Errors will NOT be overwritten with newer errors. extern char const *text_get_err(void); @@ -39,6 +51,7 @@ extern void text_get_size(Font *font, char const *text, float *width, float *hei extern void text_get_size32(Font *font, char32_t const *text, u64 len, float *width, float *height); // Write text, but using a state, starting at (x, y) -- state->x and state->y are ignored. This allows you to control min/max_x/y. extern void text_render_with_state(Font *font, TextRenderState *state, char const *text, float x, float y); +extern void text_render_anchored(Font *font, char const *text, float x, float y, Anchor anchor); // Begin writing characters. extern void text_chars_begin(Font *font); // Finish writing characters. |