[solved] Buttons image don't show up -...

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

Elric
Just popping in
Just popping in
Posts: 7
Joined: Tue Jun 24, 2008 23:07
Location: Istanbul

[solved] Buttons image don't show up -...

Postby Elric » Thu Jun 26, 2008 18:55

Hi,

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]

Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests