wchar_t and new line
Posted: Tue Jul 07, 2009 2:11 pm
Ok so im trying to display the "objectives" of my game only when tab is being pressed. Font->draw() can do this for me. However, it needs to be in wchar_t format.
So i created a string like so:
I then convert this string to wchar_t and then draw it.
However, this doesnt work. it doesnt recongise the \n for a new line. Is there a way to correct this?
Also, how would i go about display a int in a wchar_t? as im assuing "%d" wont work with this either.. This is so i can display something like "score: 5"
Thanks
So i created a string like so:
Code: Select all
stringw objectiveText("Press 'Left Click' To fire.\n"
"Kill 5 enemy's to proceed.\n"
"Press 'E' to activate the teleportation sphere.\n"
"Press 'Escape' to quit.");
Code: Select all
const wchar_t * wide = objectiveText.c_str();
if(drawObjective == true)
{
font->draw(wide,
core::rect<s32>(125,10,200, 200),
SColor(255,1,1,255));
}
Also, how would i go about display a int in a wchar_t? as im assuing "%d" wont work with this either.. This is so i can display something like "score: 5"
Thanks