I created a PNG imageset with GIMP for a pushbutton. It contains 3 images (normal, hover, pushed) along the X-axis (width). The PNG size is 432x48 and the .imageset file is:
Code: Select all
<?xml version="1.0" ?>
<Imageset Name="MainMenuImageset" Imagefile="/data/gui/img/mainmenu.png">
<Image
Name="PushButton"
XPos="0" YPos="0"
Width="144" Height="48"
/>
<Image
Name="PushButton_hover"
XPos="144" YPos="0"
Width="144" Height="48"
/>
<Image
Name="PushButton_clicked"
XPos="288" YPos="0"
Width="144" Height="48"
/>
</Imageset>
But this results in the button image being shorter than what one would expect. In GIMP, the normal button has 144 pixels, while in CEGUI I have to set width to around 170 to get it displayed correctly.
Looks like the same thing goes for height.
Here's a snippet from the .looknfeel file:
Code: Select all
<?xml version="1.0" ?>
<Falagard>
<WidgetLook name="PushButton">
<ImagerySection name="normal_imagery">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim
scale="1.0"
type="Width"
/>
</Dim>
<Dim type="Width">
<ImageDim
imageset="MainMenuImageset"
image="PushButton"
dimension="Width"
/>
</Dim>
<Dim type="Height">
<UnifiedDim
scale="1.0"
type="Height"
/>
</Dim>
</Area>
<Image imageset="MainMenuImageset" image="PushButton" />
<VertFormat type="Stretched" />
</ImageryComponent>
I'm using CEGUI through CrystalSpace, if this makes any difference. The actual button entity is created in C++ code (as opposed to a layout file) and it's wider than necessary. Same thing happens if I set it the correct size, this only affects mouse hover/click events, not the image of the button.
What's wrong?
Thanks.