From: parking_turkeys Date: Fri, 17 Jul 2026 17:17:52 +0000 (-0400) Subject: this is wrong and it doesnt work but i want to commit so i can see how i failed later X-Git-Tag: v1.0~32 X-Git-Url: http://git.parking-turkeys.net/?a=commitdiff_plain;h=b145db70b27e131ee5353ba27aa1d1ff84939200;p=aichan-platformer.git this is wrong and it doesnt work but i want to commit so i can see how i failed later --- diff --git a/level.c b/level.c index fd0664a..04439e0 100644 --- a/level.c +++ b/level.c @@ -124,9 +124,29 @@ int drawcharimage(char *filename) }; -int drawdialogueline(char *line) +int drawdialogueline(char *l) { - DrawText(line, CHARADISPLAYWIDTH + DLGPADDING, DLGY + DLGPADDING * 2 ,20, BLACK); //add text wrapping later + //DLGTEXTWIDTH (i always forget how to type this) + char *lines[10] = {""}; // any more wont fit in tbh + + int i, n, x; + i = 0; n = 0; x = 0; + while (l[i] != '\0') { + printf(&l[i]); + //printf("i: %d; n: %d; x: %d\n", i, n, x); + lines[n][x] = l[i]; + if (MeasureText(lines[n], 20) > DLGTEXTWIDTH) { + lines[n][x] = '\0'; + n++; x=0; i--; + }; + + i++; + }; + + for (i = 0; i < 10; i++) {}; + + + //DrawText(l, CHARADISPLAYWIDTH + DLGPADDING, DLGY + DLGPADDING * 2 ,20, BLACK); //add text wrapping later }; int cleanup_level(void)