Change the font, darnit!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tocs1001
Posts: 10
Joined: Tue Jun 27, 2006 7:15 pm

Change the font, darnit!

Post 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
strale
Posts: 119
Joined: Wed Nov 23, 2005 1:58 pm
Location: Lambrugo Italy
Contact:

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
Tocs1001
Posts: 10
Joined: Tue Jun 27, 2006 7:15 pm

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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!
Image Image Image
Post Reply