×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Question Question about how your mobile application automatically adjust with screen size

    Hi to all,
    Hope you all will be fine. Actually i made a game. The background image is 240 x 320 (width x height). For small screen resolution like 170 x 202 i used the view port. So if screen resolution is less than 240x 320 everything is OK. But if screen resolution is larger than 240 x 320 then it looks awkward. Lot of white screen appears after 240 and 320 . Game screen starts from 0 and goes to 240 pixels. But if mobile width is large, then after 240 all the screen just white. Same goes for height case.
    So i want to ask how can i overcome this case? Means whatever the mobile screen size, my game application automatically adjust with screen size. Any solution any idea. Because game can be played on different screen sizes.

    Thanks.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Question about how your mobile application automatically adjust with screen size

    Do not use a background image at all. Sorry, but there are a lot of solutions for this. The most common one is to use a pattern as background image. This way, you show your image several times, and you user will not notice. If you use a picture, move your whole game to the center and fill the background with a color and/or a pattern around of that image. However, at the end you have a totally different problem: The pixel density of your screen could much higher than you envision: Your objects and own fonts get too small.

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Question about how your mobile application automatically adjust with screen size

    I'd suggest you produce multiple JARs, to suit different screen sizes. If you make use of method like getHeight() and getWidth() in Canvas and Image, you should be able to use the same code across all sizes, and just provide a different set of PNGs.

    Keep some of your existing "view port" idea... You want to support as many sizes as possible from one JAR... so you have one for 320x240... one for all sizes 176x200 to 176x220, and so on.

    Graham.

Similar Threads

  1. Replies: 2
    Last Post: 2010-11-25, 09:04
  2. How to adjust UI according to screen size?
    By sweetsweet24 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-12-09, 04:41
  3. A new application to clean your mobile screen.
    By annie92 in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2006-01-23, 17:30
  4. A new application to clean your mobile screen.
    By annie92 in forum Streaming and Video
    Replies: 0
    Last Post: 2006-01-23, 17:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •