Page 1 of 1

sos - resolution problem

Posted: Mon Nov 26, 2012 03:29
by spracle
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.

Re: sos - resolution problem

Posted: Fri Jun 21, 2013 11:25
by kevin988
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.