Why can not change the text color in the tooltip ?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

0xaa55
Just popping in
Just popping in
Posts: 2
Joined: Wed Jul 19, 2017 00:37

Why can not change the text color in the tooltip ?

Postby 0xaa55 » Wed Jul 19, 2017 00:59

Hi,
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;
}


Image
All the text does not change the color.
What should I do?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Why can not change the text color in the tooltip ?

Postby Ident » Thu Aug 17, 2017 19:56

Just change the style of the tooltip to whatever you want. The tooltip has a look n' feel. You can edit it to be whatever you want there. Try to look at other look n' feels to get ideas of how to change colours etc.
CrazyEddie: "I don't like GUIs"

0xaa55
Just popping in
Just popping in
Posts: 2
Joined: Wed Jul 19, 2017 00:37

Re: Why can not change the text color in the tooltip ?

Postby 0xaa55 » Fri Oct 13, 2017 01:05

Ident wrote:Just change the style of the tooltip to whatever you want. The tooltip has a look n' feel. You can edit it to be whatever you want there. Try to look at other look n' feels to get ideas of how to change colours etc.


Thank you.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 32 guests