void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value) { widget->setCaption(value); if (style == CS_Super) widget->setTextColour(MyGUI::Colour(0, 1, 0)); else if (style == CS_Sub) widget->setTextColour(MyGUI::Colour(1, 0, 0)); else widget->setTextColour(MyGUI::Colour(1, 1, 1)); }
//Creates a MyGUI::StaticText for HUD. static inline MyGUI::StaticTextPtr createStaticText(const MyGUI::IntCoord &coord, MyGUI::Align align, const Ogre::ColourValue &colour = Ogre::ColourValue::White) { MyGUI::StaticTextPtr txt = GlbVar.gui->createWidget<MyGUI::StaticText>("TextBox", coord, MyGUI::Align::Default, HUD_LAYER); align |= MyGUI::Align::Bottom; txt->setTextAlign(align); txt->setFontName("HUD"); txt->setTextColour(MyGUI::Colour(colour.r, colour.g, colour.b, colour.a)); return txt; }