Page 1 of 1

Change the font, darnit!

Posted: Fri Oct 27, 2006 1:39 am
by Tocs1001
:shock: I tried following the tutorial but its not working at all!

Code: Select all

void CGuiLayer::setFont (const char * file)
{
	IGUISkin* skin = guienv->getSkin();
	IGUIFont* font = guienv->getFont(file);
	if (font)
	{
	        skin->setFont(font);
	}

}
and the string I'm passing it is "BigBoldArial.bmp"

BigBoldArial.bmp was created by the font tool and placed in the debug filter however the font isnt changeing I'm really confused =(

the problem is on the getFont (file); line because its not giving font anything to point to and never jumps inside the if-statement

Posted: Fri Oct 27, 2006 7:23 am
by strale
hi

i used this and work fine

IGUISkin* skin = guienv->getSkin();
IGUIFont* font = guienv->getFont("./Media/Currier.bmp");
if (font) {
skin->setFont(font);
}



how do you use

CGuiLayer::setFont (

may be you dont set the correct path

cheers

Posted: Fri Oct 27, 2006 10:13 am
by JP
Check the console to see if Irrlicht is having trouble finding the font file you're trying to load, possibly your path is wrong.

Posted: Sat Oct 28, 2006 3:02 am
by Tocs1001
Well turns out if I hit the run button from within my IDE relative paths get butchered XD but if i click the exe it all works out 0_o

Posted: Sat Oct 28, 2006 9:03 am
by JP
Does your IDE have a "resources folder" set which it basically sets as the root folder? I know my Java IDE did that, but then it still worked the same wherever you called it from!