[SOLVED] Custom images for PushButtons
Posted: Wed May 10, 2006 12:27
I've been reading the tutorials and searched the forums for this, but I cant find anything that works.
This is the code I'm using:
Nothing shows up, just the text. If I don't set setStandardImageryEnable() the button looks like it normaly would.
What am I doing wrong?
This is the code I'm using:
Code: Select all
CEGUI::Texture* texturePtr = CEGUI::System::getSingletonPtr()->getRenderer()->createTexture("menubuttons.jpg","Data/Media/Menu");
CEGUI::Imageset* ButtonsImageset = CEGUI::ImagesetManager::getSingletonPtr()->createImageset("Buttons", texturePtr);
ButtonsImageset->defineImage("ButtonUp", CEGUI::Point(0.0f,0.0f), CEGUI::Size( 0.5f, 0.5f ), CEGUI::Point(0.0f,0.0f));
ButtonsImageset->defineImage("ButtonDown", CEGUI::Point(0.0f,0.5f), CEGUI::Size( 0.5f, 0.5f ), CEGUI::Point(0.0f,0.0f));
CEGUI::RenderableImage *bleh = new CEGUI::RenderableImage();
CEGUI::RenderableImage *bleh2 = new CEGUI::RenderableImage();
bleh->setImage( &ButtonsImageset->getImage("ButtonUp") );
bleh2->setImage( &ButtonsImageset->getImage("ButtonDown") );
CEGUI::PushButton *button = (CEGUI::PushButton *)CEGUI::WindowManager::getSingletonPtr()->createWindow("TaharezLook/Button", (CEGUI::utf8*)name);
button->setStandardImageryEnabled(false);
button->setCustomImageryAutoSized(true);
button->setNormalImage( bleh );
button->setHoverImage( bleh2 );
button->setPushedImage( bleh2 );
Nothing shows up, just the text. If I don't set setStandardImageryEnable() the button looks like it normaly would.
What am I doing wrong?