Piko
18-06-2009 20:42:14
Here is my problem. I want to make a change to every widget that is created by MyGui, it's not the example I give, but I want to know if I have this figured out.
So assume that if I create a class that inherits IWidgetFactory called MyWidgetFactory, and simply create my own createWidget function that goes a little like this,
Then register the new factory to WidgetManager, will every single widget created by MyGui regardless of how it was created will have an alpha value of 0.0f?
Am I right in thinking this is how it works.
So assume that if I create a class that inherits IWidgetFactory called MyWidgetFactory, and simply create my own createWidget function that goes a little like this,
WidgetPtr MyWidgetFactory::createWidget (WidgetStyle _style, const std::string &_skin, const IntCoord &_coord, Align _align, WidgetPtr _parent, ICroppedRectangle *_croppedParent, IWidgetCreator *_creator, const std::string &_name)
{
WidgetPtr tempWidget = IWidgetFactory::createWidget(_style, _skin, _coord, _align, _parent, _croppedParent, _creator, _name);
tempWidget->setAlpha(0.0f);
return tempWidget;
}
Then register the new factory to WidgetManager, will every single widget created by MyGui regardless of how it was created will have an alpha value of 0.0f?
Am I right in thinking this is how it works.