Page 1 of 1

Text on billboard

Posted: Tue Feb 03, 2009 10:04 am
by interceptor
I'm trying to add some custom text to a billboard, so the user can change what it says. I really can't work out how to do this, or even how to explain it, so i have a picture to explain what i'm trying to do.

This is from Garry's Mod, the text in the bill is changable.

Image

Any ideas folks?

Thanks in advance.

Posted: Tue Feb 03, 2009 10:27 am
by JP
use the scene manager to add a billboard text scene node (probably) and then use functions from the scene collision manager (use shown in the collision tutorial) to detect a mouse click on the billboard and then you can handle putting different text in it.

Posted: Tue Feb 03, 2009 10:37 am
by interceptor
Ah, i'm so stoopid, it didnt even occour to me that there would be a text based billboard. Durrr.

Thanks!

Posted: Tue Feb 03, 2009 3:20 pm
by interceptor
Quick related question,

THe textbillboard needs a const wchar_t. I have an irr::c8, how can i convert an irr::c8 to a const wchar_t? i tryed a cast like

Code: Select all

(const wchar_t *)myirrstring
but it doesnt seem to work? :S Sometimes it returns "0" depending on what the string is.

Posted: Tue Feb 03, 2009 3:30 pm
by JP
c8 cstr = "hello";
core::stringw wstr(cstr);

core::stringw::c_str() returns a wchar_t* for you

Posted: Tue Feb 03, 2009 3:32 pm
by interceptor
JP wrote:c8 cstr = "hello";
core::stringw wstr(cstr);

core::stringw::c_str() returns a wchar_t* for you
You're a bloody legend! Thank you!