Hello,
I run into this situation quite often: I am using relative coordinates so the gui works at different sizes and resolutions. Somtimes the gui consists of circles and I set relative their size to e.g. (0.1, 0.1). When the circle is displayed it doesn't appear as a circle, but as an ellipse. This is because my resolution is like 800x600 and the aspect ratio is not 1. Therefore the circle gets a size of 0.1 * 800, 0.1 * 600 which is 80,60 (an ellipse).
What's the recommended way to deal with aspect issues? Has CEGUI some builtin functionality to make this easier to work with? How are you dealing with aspect ratio issues?
-Matthias
P.S.: I know I can do all the scaling myself, but this seems a bit too much work.
Relative coordinates and aspect ratio
Moderators: CEGUI MVP, CEGUI Team
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Hi,
Fonts and Imagesets have a method called "setNativeResolution", who accept a width and height. They update internal scaling factors, according to the values passed. It's good practice to call these methods after loading fonts and/or imagery.
HTH.
Fonts and Imagesets have a method called "setNativeResolution", who accept a width and height. They update internal scaling factors, according to the values passed. It's good practice to call these methods after loading fonts and/or imagery.
HTH.
Check out my released snake game using Cegui!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
Yes this is something of an issue, and when you factor in things such as folks with widescreen monitors vs those with standard 4:3 screens it becomes a real nightmare. I have to be honest and say that this did not receive any thought at all when creating the system (because at the time, and the reason for the systems creation, this was not an issue I had to think about ).
One thing you might be able to try is to have a square 'root' window. this will then cause all added content to have equal dimensions when using the same scale values on both the x and y axis.
CE.
Yes this is something of an issue, and when you factor in things such as folks with widescreen monitors vs those with standard 4:3 screens it becomes a real nightmare. I have to be honest and say that this did not receive any thought at all when creating the system (because at the time, and the reason for the systems creation, this was not an issue I had to think about ).
One thing you might be able to try is to have a square 'root' window. this will then cause all added content to have equal dimensions when using the same scale values on both the x and y axis.
CE.
Who is online
Users browsing this forum: No registered users and 7 guests