Page 1 of 1

GUI Item - Can you use two fonts?

Posted: Tue Dec 13, 2005 11:55 pm
by ndavey
Hi All,
Been seaching the forum, can't find anything that answers my question...

Q. Is it possible to have multiple fonts in the same gui?
eg. have a static text item with one font and everything else with another font?

I know I can set the font for the whole gui by setting the font for the skin, but I can't see a way of setting a font for a specific object..

Possible or not?

Cheers
Neil

Posted: Wed Dec 14, 2005 2:11 am
by Guest
with a bit of modification yes it is... or anything for that matter.

how extensive it is I couldn't say.

why can't you use seperate text boxes?

have you even seen the user modfied gui objects?

several people have already made multiple font text/chat boxes, consoles, table and tab controls you name it.

I'll be sure to keep this in mind while I create my own gui set.

~Midnight~

Posted: Wed Dec 14, 2005 3:20 am
by ndavey
Thanks Midnight...

I feel like a goose... bit more poking through the help doc (RTFM wins again :)) and I found what I was after..

setOverrideFont in IGUIStaticText class...
Same applies to buttons and edit boxes..

Code: Select all

r = env->addStaticText(L"some Text",rect<s32>(10,110,250,200), false,true,wnd1,0,false);
font = env->getFont("somefont.bmp");
r->setOverrideFont(font);
doh... so simple once you know how... :)

Neil

Posted: Tue Jan 10, 2006 4:30 pm
by G-ray
And how to do this in .NET version?