From 4ce1b46c11162cd1cea2dfb35e05db36ddc262a3 Mon Sep 17 00:00:00 2001 From: Thomas Edvalson Date: Sat, 1 Feb 2014 00:16:03 -0500 Subject: [PATCH] Added bassic support for newline character --- src/actors/Text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actors/Text.cpp b/src/actors/Text.cpp index 445c4d8..8f474fb 100644 --- a/src/actors/Text.cpp +++ b/src/actors/Text.cpp @@ -30,10 +30,12 @@ namespace cpp3ds { int width = screen.getWidth(); - for (i = 0; i width) { + for (i = 0; i < strlen(text); i++){ + if (tmp_x+8 > width || text[i] == '\n') { line++; tmp_x = this->x + x; + if (text[i] == '\n') + continue; } drawChar(screen, text[i], tmp_x, this->y+y+(line*8)); tmp_x = tmp_x+8;