From bea8415263dddc1cb892c121446194688703bf27 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Fri, 15 May 2026 07:23:41 -0400 Subject: allow tyui to format text --- teensy/teensy_ui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'teensy/teensy_ui.c') diff --git a/teensy/teensy_ui.c b/teensy/teensy_ui.c index d9ce33b..662c487 100644 --- a/teensy/teensy_ui.c +++ b/teensy/teensy_ui.c @@ -1,6 +1,7 @@ #include "teensy_ui.h" #include +#include #include "teensy_list.h" @@ -287,8 +288,13 @@ void tyui_end_window(void) uictx.active = &uictx.root; } -void tyui_text(const char *text) +void tyui_text(const char *fmt, ...) { + va_list args; + va_start(args, fmt); + char *text = ty_format_args(fmt, args); + va_end(args); + text_cmd(text, next_pos(TEXT_HEIGHT)); } -- cgit v1.3-2-g0d8e