sos - resolution problem

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
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

sos - resolution problem

Postby spracle » Mon Nov 26, 2012 03:29

Hi,CE. Long time no see :-)

A resolution problem has puzzled me for a few days:

Our game need 4 kinds of resolution-- 1280 * 720, 1366 * 768, 1600 * 900, 1920 * 1080. We made our layout in coordinate(0,x). You see the scale factor is always 0 and we edited it at 1280 * 720 mode .When resolution changed to 1366 * 768 ,I calculate x like this x = x * 1366 / 1280(width) or x = x * 768 / 720(heigh), the same way to 1600 * 900 and 1920 * 1080.

Every thing seems Ok,eh? Yeah, it's perfect in all four mode when game is fullScreen,even when changed resolution without restarted the game. But when game in window mode, odd things happened: without restarted the game,I changed this resolution from 1280 * 720 to 1366 * 768, it's ok; from 1280 * 720 to 1600 * 900, it's ok;from 1280 * 720 to 1920 * 1080, it's not ok. I set the resolution to 1920 * 1080, and restart the game, it's ok too..

What's special for 1920 * 1080 is that the monitor's biggest resolution is 1920 * 1080, and when in window mode,the client rect is actually 1904 * 1002(title and frame board need some space). Of course I notify cegui system the resolution is 1904 * 1002, but it not work anyway!

The problem is that all window's rendered postion is left-top offset for some pixels.Just the rendered position, because the logic position is ok,I can click it in the right place.

kevin988
Just popping in
Just popping in
Posts: 1
Joined: Fri Jun 21, 2013 11:21

Re: sos - resolution problem

Postby kevin988 » Fri Jun 21, 2013 11:25

spracle wrote:Hi,CE. Long time no see :-)

A resolution problem has puzzled me for a few days:

Our game need 4 kinds of resolution-- 1280 * 720, 1366 * 768, 1600 * 900, 1920 * 1080. We made our layout in coordinate(0,x). You see the scale factor is always 0 and we edited it at 1280 * 720 mode .When resolution changed to 1366 * 768 ,I calculate x like this x = x * 1366 / 1280(width) or x = x * 768 / 720(heigh), the same way to 1600 * 900 and 1920 * 1080.

Every thing seems Ok,eh? Yeah, it's perfect in all four mode when game is fullScreen,even when changed resolution without restarted the game. But when game in window mode, odd things happened: without restarted the game,I changed this resolution from 1280 * 720 to 1366 * 768, it's ok; from 1280 * 720 to 1600 * 900, it's ok;from 1280 * 720 to 1920 * 1080, it's not ok. I set the resolution to 1920 * 1080, and restart the game, it's ok too..

What's special for 1920 * 1080 is that the monitor's biggest resolution is 1920 * 1080, and when in window mode,the client rect is actually 1904 * 1002(title and frame board need some space). Of course I notify cegui system the resolution is 1904 * 1002, but it not work anyway!

The problem is that all window's rendered postion is left-top offset for some pixels.Just the rendered position, because the logic position is ok,I can click it in the right place.


Great thing to do is to follow the article. for more click resolution.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests