Home » Community » Newbie corner » "\n" does not work on DrawText
Re: "\n" does not work on DrawText [message #46091 is a reply to message #46089] |
Thu, 03 March 2016 11:11   |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Hello,
DrawTexe does not interprete \n, you have to split the string, and to call DrawTexe repeatedly to display each line.
for example:
void DrawAsLines(Draw& w, int x, int y, WString s)
{
int n = 0;
int dh = 14;
int line_size = 13;
while (n + line_size < s.GetCount())
{
String next = s.Mid(n, line_size);
n += line_size;
w.DrawTexe(x, y, next);
y += dh;
}
String next = s.Mid(n);
w.DrawTexe(x, y, next);
}
regards
omari.
|
|
|
Goto Forum:
Current Time: Sat May 03 18:21:04 CEST 2025
Total time taken to generate the page: 0.02570 seconds
|