Wintermute Engine Forum

Wintermute Engine => WME Lite => Topic started by: piere on July 21, 2012, 11:15:59 PM

Title: Game does not take up entire screen when running.
Post by: piere on July 21, 2012, 11:15:59 PM
Hello when I run the sample touch demo, or my own game, the screen resolution does not take up the entire screen. There are 2 black spaces on the ends of the game. This happens on the iphone ios simulator, and when actually testing on my iphone. I tried low and even high resolutions and this issue is still happening. Below is a screenshot of the issue. Any suggestions to fix this? Thanks  for the help.

Title: Re: Game does not take up entire screen when running.
Post by: Dan Peach on July 22, 2012, 06:51:12 AM
This is not an issue per se. It's because the aspect ratio of the game doesn't match the aspect ratio of the iPhone. The demo game resolution is 800x600, which is a 4:3 aspect ratio, whereas the iPhone4/4S resolution is 960x640, which is a 3:2 aspect ratio.

WME Lite will upscale the image as far as it can to fit the display of the device, so in the case of the iPhone4/4S it will upscale the image until it hits 640 (the height of the iPhone resolution in landscape), but this puts the horizontal resolution at only 853.3 pixels, which is less than the 960 pixels available, which results in the black bars down the side. Or, in the case of older iPhones that have a resolution of 480x320, WME Lite will downscale the image as far as it can, from 600 (the height of the game) to 320 (the height of the iPhone), resulting in a horizontal reslution of 426.6, which again is less than the 480 pixels available. The iPad however has an aspect ratio of 4:3, so if you run the game on the ipad you won't see any black bars.

The only way to solve this "issue" is to change the background images of the game to fit the aspect ratio of the device. However, if you change the aspect ratio to fit the iPhone then you will have problems on the iPad. The only way around this is to create separate packages for the iPhone and iPad as explained here:

http://res.dead-code.org/doku.php/wmelite:filesystem

...or possibly use the Game.DeviceType method to check whether the game is running on iPhone or iPad, although I'm not sure how that will work in relation to the game's resolution.

Title: Re: Game does not take up entire screen when running.
Post by: piere on July 22, 2012, 10:24:07 AM
Thank you ! I now understand  ::beer