diff --git a/source/arm9/ui.c b/source/arm9/ui.c index 23b95a9..5c744f0 100644 --- a/source/arm9/ui.c +++ b/source/arm9/ui.c @@ -92,14 +92,21 @@ va_end(args); size_t len = strlen(tmp); - printf("%*s\n", (width - len) / 2, tmp); + printf("%*s%s\n", (width - len) / 2, "", tmp); } /* Prints a given text at a certain position in the current window */ -/*void uiPrintTextAt(unsigned x, unsigned y, format, args...) +void uiPrintTextAt(unsigned int x, unsigned int y, const char *const format, ...) { - // TODO -}*/ + char tmp[256]; + + va_list args; + va_start(args, format); + vsnprintf(tmp, 256, format, args); + va_end(args); + + printf("\x1b[%u;%uH%s", y, x, tmp); +} /* Prints a given text surrounded by a graphical window */ /* centered in the middle of the screen. */