0

It's been about 1,5 week I'm using Corona, and I think that maybe I'm not using it the correct way trying to reach my goals. What are these?:

  • I want to make an HD app.

  • I want my app to look the SAME across all Armv7 (and up) devices.

  • I want to have the lowest loading times, and texture memory load possible.

  • I want my graphics, like Images and Sprites, to look crystal clear in ALL devices.

So, having in mind the above goals, I set up my files like this:

config.lua:

-- config.lua for project: zxc
-- Managed with http://CoronaProjectManager.com
-- Copyright 2013 . All Rights Reserved.

application =
{
    content =
    {
        width = 320,
        height = 480,
        scale = "zoomStretch"
    },
    license =
    {
        google =
        {
            key = "Your key here"
        },
    },
}

build.lua:

-- build.settings for project: BioLab
-- Managed with http://CoronaProjectManager.com
-- Copyright 2013 . All Rights Reserved.

settings = {
    orientation =
    {
        default = "landscapeRight",
    },
    iphone =
    {
        plist=
        {
            UIStatusBarHidden=true,
        },
    },
    android =
        {
            --usesExpansionFile = true,
            usesPermissions =
            {
                "android.permission.INTERNET",
                "com.android.vending.CHECK_LICENSE",
                "android.permission.WRITE_EXTERNAL_STORAGE"
            },
        },
}

Note that I have commented "usesExpansionFile". I will need it for Android, but not yet, so I have commented it for future use.

And now how I load my HD images in my storyboard files. For example:

local background = display.newImageRect(main_menu, "images/menu/main_menu/background.png",  480, 320)
background.x=240
background.y=160

The background.png in my example, is finely nested inside my folders.

It is 1920x1080 with a resolution of 300dpi.

All other images and sprites are high definition as well. Smaller grafics are not 1920x1080 in image size of course, but they are still full HD (their image size is a percentage of an 1920x1080 file, depending of the part of the screen I want them to cover).

AM I OVERDOING IT?

Is 1920x1080 too much? Is 300dpi needed? Remember I want to support all devices with crystal clear graphics. There are Full HD devices like Galaxy s4 and HTC One, getting a big share in the market. Are, in my config.lua, my content width and height settings wrong or right?

The problem is the loading time (which is veeeery long) and Texture Memory usage, which is veeery big.

Please post your TIPS and BEST PRACTICES, fitting my goals.

Thank you.

user2347313
  • 131
  • 2
  • 11
  • I think 1920x1080 is too big. Try to scale down it and have 2 versions. See other games backgrounds, you will se they aren't perfectly clear – vovahost Jun 06 '13 at 12:20

1 Answers1

1

With this in your config.lua:

content =
{
    width = 320,
    height = 480,
    scale = "zoomStretch"
},

without anything to manage scaling, you are loading in a 1920x1080 (which is going to take up 2048x2048x4 or 16MB of memory only to require the engine to scale it down to 320x480. You are taking up excessive CPU and memory when you are not using the data.

Now if you included:

        imageSuffix = 
        {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
        },

in your config.lua, then you could take your 1920x1080 and give it a @4x suffix (background@4x.png) and resize it to a a 50% sized image named background@2x.png and a 25% sized image named background.png then Corona SDK will select the appropriate size based on the the device for you that will be more memory and CPU efficient on older devices and for real HD devices that can take it, use the higher quality image.

Rob Miracle
  • 3,053
  • 1
  • 13
  • 12