I am working on a screen that needs to be displayed on both a 4:3 and 16:10 aspect ratio monitors. Right now I have a bar (Default Window) of logos that is displayed on the right side of the screen. When I setup the screen it was using a 4:3 aspect ration, but when I use it on my 16:10 monitor the icons come out squished. Is their anyway to keep this from happening. I want the icons to scale if the resolution changes, but I want them to do that uniformly. If anyone know how to deal with this in CEGUI please let me know.
Judd
Keeping the aspect ratio of static images.
Moderators: CEGUI MVP, CEGUI Team
jtracy wrote:Assuming I can detect the change what do I have to tell CEGUI in order to keep it from stretching the images when scaling?
Don't use the relative position or size. You can position all widgets with an absolute position, as well as size all widgets with an absolute size.
Also, you can ( should ) remove the 'AutoScaled="true" ' attribute from the <Imageset> tag in your .imageset file.
And finally, if you're making widgets based around images, you probably want to make sure that the specific parts in the .looknfeel file are set to either tile or stretch as appropriate for your case.
I have tried using absolute size and postition, but that casues problems at different resolutions. We have a requirement to run at low and high resolutions. I am not making widgets out of the images yet, this is just placing some logos on the opening screen.
By using the absolute position and size I either get really large logos on the small screen sizes (the logos interfere with the rest of the interface) and normal logos on the large widescreen resolutions or normal logos on the small screen sizes and tiny hard to read logos on the large widscreen resolutions.
If there is no way to scale an image and keep its aspect ratio then I would think that CEGUI is useless for widescreen resolutions.
By using the absolute position and size I either get really large logos on the small screen sizes (the logos interfere with the rest of the interface) and normal logos on the large widescreen resolutions or normal logos on the small screen sizes and tiny hard to read logos on the large widscreen resolutions.
If there is no way to scale an image and keep its aspect ratio then I would think that CEGUI is useless for widescreen resolutions.
You don't get large or small logos on bigger or smaller resolutions. If you are indeed using absolute sizes, then you are specifying the exact amount of pixels that thing will take.
If you are running at a low screen resolution, that amount of pixels will take up a proportionally larger amount of space.
Vice versa for a high screen resolution.
The problem isn't CEGUI. You cannot typically have any image scale and look good, whether scaling down or up [although you'll wind up with better results going down].
Likewise, if you want it to scale, the aspect ratio will of course cause the image to become skewed and look awkward. This isn't a problem with CEGUI.
If you want a clean cut interface at many resolutions, you have to make your graphics [whether they be images or colors or text] look good at the resolutions you're going to support. For unsupported resolutions, you just have to decide what the best way to handle things are, which is usually keeping things at fixed sizes.
There is no magic that can be done here to have something look good in an environment its not designed to handle.
If you are running at a low screen resolution, that amount of pixels will take up a proportionally larger amount of space.
Vice versa for a high screen resolution.
The problem isn't CEGUI. You cannot typically have any image scale and look good, whether scaling down or up [although you'll wind up with better results going down].
Likewise, if you want it to scale, the aspect ratio will of course cause the image to become skewed and look awkward. This isn't a problem with CEGUI.
If you want a clean cut interface at many resolutions, you have to make your graphics [whether they be images or colors or text] look good at the resolutions you're going to support. For unsupported resolutions, you just have to decide what the best way to handle things are, which is usually keeping things at fixed sizes.
There is no magic that can be done here to have something look good in an environment its not designed to handle.
I think the original poster's point is significant. I'm looking for a solution to this problem as well. The question is this:
How can an image be "Stretched" (in CEGUI/Falagard terms) and still maintain the original aspect ratio? CEGUI provides ways to align, tile, or stretch an image both horizontally and vertically, but how can we ensure that such resizing preserves the original aspect?
How can an image be "Stretched" (in CEGUI/Falagard terms) and still maintain the original aspect ratio? CEGUI provides ways to align, tile, or stretch an image both horizontally and vertically, but how can we ensure that such resizing preserves the original aspect?
Arcanoria - a SMORPG project - http://www.arcanoria.com
I came to this thread from a search.
I too have this question, and I think it is a CEGUI thing. I have a static image in the layout and dynamiclly swap the displayed image. These images are not always in the same size and shape, so I want the images "Stretched" but the original image's aspect ratio to be preserved.
Maybe the best short description is I want "BestFit" and an option for "VertFormat" and "HorzFormat".
I too have this question, and I think it is a CEGUI thing. I have a static image in the layout and dynamiclly swap the displayed image. These images are not always in the same size and shape, so I want the images "Stretched" but the original image's aspect ratio to be preserved.
Maybe the best short description is I want "BestFit" and an option for "VertFormat" and "HorzFormat".
Who is online
Users browsing this forum: No registered users and 5 guests