Zini
16-10-2007 12:50:35
The Sheet::setDefaultFont method seems to be not working anymore. From what I see in the soruce, the following is happening:
The parent-widget create method is called and executes the following code:
he Label constructor creates a Text object:
And the Text object constructor does this:
But the Label is becoming a child of the sheet only, after the Label constructor has finished. Therefore in the Text constructor this
owner->getParentSheet() == NULL
is allways true and the default font is never used.
The parent-widget create method is called and executes the following code:
Label* newLabel = new Label(name,Size(35,15),"qgui.label.png",mGUIManager);
addChild(newLabel);
he Label constructor creates a Text object:
mText = new Text(mInstanceName+".Text",mQuadContainer,this);
And the Text object constructor does this:
if(owner->getParentSheet() == NULL)
{
Ogre::FontManager* fm = Ogre::FontManager::getSingletonPtr();
setFont(fm->getResourceIterator().getNext()->getName());
mColor = Ogre::ColourValue::White;
}
else
{
setFont(owner->getParentSheet()->getDefaultFont());
mColor = owner->getParentSheet()->getDefaultTextColor();
}
But the Label is becoming a child of the sheet only, after the Label constructor has finished. Therefore in the Text constructor this
owner->getParentSheet() == NULL
is allways true and the default font is never used.