Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
omari is currently offline  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.
 
Read Message
Read Message
Read Message
Previous Topic: Can't Ultimate++ use Japanese?
Next Topic: Can't Ultimate++ use Japanese?
Goto Forum:
  


Current Time: Sat May 03 18:21:04 CEST 2025

Total time taken to generate the page: 0.02570 seconds