The code as it stands, first for creating the ImageButton, then the normal Button:
Code: Select all
CEGUI::FrameWindow* ArenaLayer::createBuildMenu() {
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::FrameWindow* window = dynamic_cast<CEGUI::FrameWindow*>(winMgr.createWindow("TaharezLook/FrameWindow", "buildMenu"));
{
CEGUI::PushButton* button = dynamic_cast<CEGUI::PushButton*>(winMgr.createWindow("TaharezLook/ImageButton", "button"));
//button->setProperty("NormalImage", "set:TaharezLook image:CheckboxNormal");
//button->setProperty("NormalImage", "TaharezLook/CheckboxNormal");
button->setProperty("Position", "{{0,0},{0,0}}");
button->setProperty("Size", "{{0,64},{0,20}}");
button->setProperty("NormalImage", "TaharezLook/CheckboxNormal");
button->setProperty("HoverImage", "TaharezLook/CheckboxNormal");
button->setProperty("PushedImage", "TaharezLook/CheckboxNormal");
button->setProperty("DisabledImage", "TaharezLook/CheckboxNormal");
window->addChild(button);
//CEGUI::System::getSingletonPtr()->getDefaultGUIContext().getRootWindow()->addChild(button);
}
{
CEGUI::PushButton* button = dynamic_cast<CEGUI::PushButton*>(winMgr.createWindow("TaharezLook/Button", "button2"));
button->setText(std::string{ "X[colour='88888888']X[colour='ffffffff']X[image-size='w:32 h:32'][image='" } + TextureController::Instance.getCEGUIImageName(TileType::DEER) + std::string{ "']" });
window->addChild(button);
}
VLOG(2) << "Created buildMenu";
return window;
}
The resulting window:
http://i.imgur.com/OkpxUTH.png
The button you see in the window is the second Button, the one using text markup. The first button doesn't show up at all.
Any ideas or advice?