summaryrefslogtreecommitdiff
path: root/src/libs/txt/txt.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-10-03 17:13:19 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-10-03 17:13:19 -0700
commit271889386861ab8685cebddcebeaa87eea3fa417 (patch)
tree7c1a9bb573dd16b554592b24cc3c5083483779b2 /src/libs/txt/txt.h
parent30214bf817c1e18235fcddacac851ecc5cbe66a0 (diff)
libs/txt: implement txt_render_fragment_offsetted() variant
Instead of rigid txt_align_t enums to specify how the text is aligned relative to the x/y coordinates, you specify float offsets in normalized coordinates -1..+1 allowing fine-grained control of the offsets. modules/asc will use this to automatically adjust the offsets when requested, so x/y coordinates may be varied dynamically using taps with the text automagically adjusting its offset to try stay in-fragment.
Diffstat (limited to 'src/libs/txt/txt.h')
-rw-r--r--src/libs/txt/txt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libs/txt/txt.h b/src/libs/txt/txt.h
index 9318546..04cf09e 100644
--- a/src/libs/txt/txt.h
+++ b/src/libs/txt/txt.h
@@ -29,5 +29,6 @@ txt_t * txt_new(const char *str);
txt_t * txt_newf(const char *fmt, ...);
txt_t * txt_free(txt_t *txt);
void txt_render_fragment_aligned(txt_t *txt, til_fb_fragment_t *fragment, uint32_t color, int x, int y, txt_align_t alignment);
+void txt_render_fragment_offsetted(txt_t *txt, til_fb_fragment_t *fragment, uint32_t color, int x, int y, float x_offset, float y_offset);
#endif
© All Rights Reserved