Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Game does not take up entire screen when running.  (Read 1948 times)

0 Members and 1 Guest are viewing this topic.

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Game does not take up entire screen when running.
« 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.

« Last Edit: October 26, 2015, 11:21:13 AM by piere »
Logged

Dan Peach

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 100
    • View Profile
    • Viperante - Game Development
Re: Game does not take up entire screen when running.
« Reply #1 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.

« Last Edit: July 22, 2012, 06:55:45 AM by Dan Peach »
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Game does not take up entire screen when running.
« Reply #2 on: July 22, 2012, 10:24:07 AM »

Thank you ! I now understand  ::beer
Logged
 

Page created in 0.157 seconds with 23 queries.