Here is how I setup the xml:
Code: Select all
<Window Type="TaharezLook/Button" Name="SelectArenaButton4">
<Property Name="Size" Value="w:0.24 h:0.23" />
<Property Name="RelativePosition" Value="x:0.7975 y:0.12" />
<Property Name="NormalImage" Value="set:SelectArenaButton4ImageSet image:SelectArenaButton4Img" />
<Property Name="PushedImage" Value="set:SelectArenaButton4ImageSet image:SelectArenaButton4Img" />
<Property Name="DisabledImage" Value="set:SelectArenaButton4ImageSet image:SelectArenaButton4Img" />
<Property Name="UseStandardImagery" Value="false" />
<Property Name="Alpha" Value="1.0" />
<Property Name="Visible" Value="true" />
<Property Name="HorzFormatting" Value="HorzStretched" />
</Window>
And I tried to enlarge the RenderableImage so that the HorzFormatting::HorzStretched would have an effect. I did that like this:
Code: Select all
CEGUI::Imageset *pSelectArenaImages;
pSelectArenaImages = m_ImagesetManager->getImageset("SelectArenaButton4ImageSet");
CEGUI::RenderableImage buttonImg;
buttonImg.setHorzFormatting(CEGUI::RenderableImage::HorzFormatting::HorzStretched);
buttonImg.setVertFormatting(CEGUI::RenderableImage::VertFormatting::VertStretched);
CEGUI::PushButton *pArenaButton = static_cast<CEGUI::PushButton *>(GuiGetWindow("SelectArenaButton4"));
const CEGUI::RenderableImage *img = pArenaButton->getNormalImage();
float width = img->getSize().d_width;
float height = img->getSize().d_height;
buttonImg.setImage(&pSelectArenaImages->getImage("SelectArenaButton4Img"));
buttonImg.setSize(CEGUI::Size(width*2,height));
pArenaButton->setNormalImage(&buttonImg);
The original width is 246, so I set it to width*2 hoping it would stretch the image out across the entire RenderableImage but it didn't do anything, and the button (the area you can hover and click on) is still 2x the image's length.
Here is a pic to show what I mean
[img align=left]http://www.rayoom.com/button_image.jpg[/img]
Is there any way I can get this Image to stretch out across the button?