Unexpected Image Scaling

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
ChronosWS
Just popping in
Just popping in
Posts: 1
Joined: Sun May 08, 2005 02:23

Unexpected Image Scaling

Postby ChronosWS » Sun May 08, 2005 02:32

I am trying to set up a background image for my various menu screens, using a TGA file which is presently the same size as my render window (1024x768.) However, it appears for some reason that this image is being stretched vertically about 30% and I am not sure why.

My imageset:

<?xml version="1.0" ?>
<Imageset Name="MainMenu" Imagefile="MainMenu.tga" NativeHorzRes="1024" NativeVertRes="1024" AutoScaled="false">
<Image Name="Background" XPos="0" YPos="0" Width="1024" Height="768" />
</Imageset>

The relevant window:

<?xml version="1.0" ?>
<GUILayout>
<Window Type="DefaultGUISheet" Name="MainMenu">
<Window Type="TaharezLook/StaticImage" Name="MainMenu/Background">
<Property Name="Position" Value="x:0.0 y:0.0" />
<Property Name="Size" Value="w:1.0 h:1.0" />
<Property Name="RelativeMaxSize" Value="w:1.0 h:1.0" />
<Property Name="BackgroundImage" Value="set:MainMenu image:Background" />
<Property Name="Disabled" Value="True" />
</Window>
...

I have been able to get the aspect ratio to look correct by increasing the width to about 1.33, but then both the right and bottom parts of the image are cut off instead of just the bottom part.

My current theory is that this somehow has something to do with the fact that textures (or internal texture storage) is square. The following is from the runtime dump:

Texture: MainMenu.tga: Loading 1 faces(PF_R8G8B8,1024x768x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.

NOTE: I have tried various settings for NativeHorzRes and NativeVertRes, as well as turning AutoScaled on and off, but nothing has had the desired effect.

Is there some setting somewhere I need to tweak to make this work, or should I convert my source image to 1024x1024?

Thanks.

Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests