You can make nice looking tooltips using just font and image tags in your tooltip text. No .layout changes or custom tooltips needed.
Examples from my game:

(My tooltip background is slightly transparent, so some background images/text leak through a but.)
Here's a function I use in my game that takes a CEGUI::Window* and an Item* (a class defined in my game), and sets the tooltip on the window based on the properties of the item. You can see how I set different fonts, images, text colours, and spacing using the tags.
I hand edited this function to strip out unrelated code and hopefully make it more clear. Also, the fonts I use aren't regularly installed with CEGUI so you'll need to replace them with the fonts you use.
Code: Select all
void FormatItemTooltip( CEGUI::Window* i_pItemWidget, const Item* i_pItem )
{
if ( !i_pItemWidget || !i_pItem )
{
assert( false );
return;
}
std::stringstream ssTooltip;
ssTooltip
<< "[font='BlueHighway-12'][colour='FF000000']" << i_pItem->GetName() << std::endl
<< "[top-padding='5'][bottom-padding='10'][image-width='70'][image-height='70'][colour='FFFFFFFF'][image='" << i_pItem->GetIconName() << "']" << std::endl
<< "[top-padding='0'][bottom-padding='0'][font='BlueHighway-10'][colour='FF000000']" << i_pItem->GetDescription() << std::endl
<< "Tech Level: " << i_pItem->GetTechLevel() << std::endl;
i_pItemWidget->setTooltipText( ssTooltip->str() );
}
The Item::GetIconName function will return a string like "set:icons image:vortex_armor", pointing to an image you have defined in a CEGUI .imageset file somewhere.
If you don't like the background colour of the tooltip, it's easy change with an image editor (photoshop, gimp, etc). Just open your skin image (e.g. TaharezLook.png) and change the colours of the tooltip images. If you're having trouble figuring out which image is the tooltip, open your imageset file (e.g. TaharezLook.imageset) and search for "tooltip". It will tell you their position.