I added some code in cegui-0.8.7\samples\DragDropDemo\Sample_DragDropDemo.cpp : bool DragDropDemo::initialise(CEGUI::GUIContext* guiContext)
Code: Select all
bool DragDropDemo::initialise(CEGUI::GUIContext* guiContext)
{
using namespace CEGUI;
d_guiContext = guiContext;
d_usedFiles = CEGUI::String(__FILE__);
// load windows look
SchemeManager::getSingleton().createFromFile("WindowsLook.scheme");
// load font and setup default if not loaded via scheme
Font& defaultFont = FontManager::getSingleton().createFromFile("DejaVuSans-12.font");
// Set default font for the gui context
guiContext->setDefaultFont(&defaultFont);
// set up defaults
guiContext->getMouseCursor().setDefaultImage("WindowsLook/MouseArrow");
//
guiContext->setDefaultTooltipType("WindowsLook/Tooltip");
// load the drive icons imageset
ImageManager::getSingleton().loadImageset("DriveIcons.imageset");
// load the initial layout
guiContext->setRootWindow(
WindowManager::getSingleton().loadLayoutFromFile("DragDropDemo.layout"));
//Here is the code I added
//****************************************************************************************************
Window* DragContainer2 = d_guiContext->getRootWindow()->getChild("MainWindow/Slot6/DragContainer2");
std::stringstream ssTooltip;
ssTooltip
<< "[colour='FF0000FF']" << "axe" << std::endl
<< "------------------------" << std::endl
<< "[top-padding='0'][bottom-padding='0'][colour='FF00FFFF']" << "This is a very sharp ax." << std::endl
<< "------------------------" << std::endl
<< "Tech Level: " << "123" << std::endl
<< "------------------------" << std::endl;
DragContainer2->setTooltipText(ssTooltip.str());
//****************************************************************************************************
// setup events
subscribeEvents();
// success!
return true;
}
All the text does not change the color.
What should I do?