I am doing just like in the Main Menu tutorial.
Code: Select all
// Creating Imagesets and defining images
Imageset* MenuImageset = ImagesetManager::getSingletonPtr()->createImagesetFromImageFile("Background","MenuBackground.jpg");
Texture* texturePtr = System::getSingletonPtr()->getRenderer()->createTexture("MenuButtons.jpg", ""); // default resource group
Imageset* ButtonsImageset = ImagesetManager::getSingletonPtr()->createImageset("Buttons", texturePtr);
ButtonsImageset->defineImage("ButtonUp", Point(0.0f,0.0f), Size( 0.5f, 0.5f ), Point(0.0f,0.0f));
ButtonsImageset->defineImage("ButtonDown", Point(0.0f,0.5f), Size( 0.5f, 0.5f ), Point(0.0f,0.0f));
Code: Select all
/*** the menu code ***/
Window* MenuBackground = Wmgr->createWindow("TaharezLook/StaticImage", "Background");
myRoot->addChildWindow( MenuBackground );
MenuBackground->setPosition( UVector2( UDim( 0.0f, 0.0f), UDim( 0.0f, 0.0f ) ) );
MenuBackground->setSize( UVector2( UDim( 1.0f, 0.0f), UDim( 1.0f, 0.0f ) ) ); // full screen
// this is the preferred way to set the image.
MenuBackground->setProperty( "Image", "set:Background image:full_image" );
PushButton* NewGame = (PushButton*)Wmgr->createWindow("TaharezLook/Button", "NewGame");
MenuBackground->addChildWindow( NewGame );
NewGame->setPosition( UVector2( UDim( 0.2f, 0.0f ), UDim( 0.2f, 0.0f ) ) );
NewGame->setSize( UVector2( UDim( 0.4f, 0.0f ), UDim( 0.2f, 0.0f ) ) );
NewGame->setText("New Game");
NewGame->setProperty( "NormalImage", "set:Buttons image:ButtonUp" );
NewGame->setProperty( "HoverImage", "set:Buttons image:ButtonDown" );
NewGame->setProperty( "PushedImage", "set:Buttons image:ButtonDown" );
That's simple but I can't see button images. However full background image works fine. Buttons don't show images and they are in a brown color. What should I do?
Thanks.[/code]