Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create multiple images with different sizes.<br> This is the choice i am going with now,<br> let's assume base image has size 100x70 and base screen res is 320x480.</p> <pre><code>baseImage.png 100x70 | 320x480 for IPhone and Android mdpi normal screen baseImage@2.png 200x140 | 640x960 for IPhone 4 baseImage@ipad.png 213x149 | 768x1024 for IPads and Android mdpi xlarge screen baseImage@hdpi.png 150x105 | 480x800 for Android hdpi normal screen </code></pre> <p>based from <a href="http://developer.android.com/resources/dashboard/screens.html" rel="nofollow">here</a>:</p> <pre><code>top 3 Android screen density and size hdpi normal 66.3% mdpi normal 18.5% mdpi xlarge 4.9% </code></pre> <hr> <p>First, change all image initialization code to use <code>newImageRect()</code>.<br> It will load the corresponding image file with the nearest resolution and ratio.<br> If no better fit was found it will load the base image.</p> <pre><code>local img = display.newImageRect("baseImage.png",100,70) --100 is base width -- 70 is base height </code></pre> <p>then set a base resolution for the app and naming convention for multiple res images in config.lua.</p> <pre><code>application = { content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2"] = 2, ["@ipad"] = 2.133, --1024/480 ["@hdpi"] = 1.5, --480/320 }, }, } </code></pre> <p><strong>Summary</strong>: The screen will zoom to show all stuff on screen. It will automatically load the smallest possible image. The cons is on devices with ratio 1.5 or above there will be excess black area on left and right side of the screen. </p> <p>That's all I hope.<br> We don't have IPad 3 (with a ridiculous 2048x1536 res) for testing yet, so I can't comment.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload