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.

4

1 回答 1

1

在你的 config.lua 中使用这个:

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

没有任何东西来管理缩放,你正在加载一个 1920x1080(这将占用 2048x2048x4 或 16MB 的内存,只需要引擎将它缩小到 320x480。当你不使用时,你会占用过多的 CPU 和内存数据。

现在,如果您包括:

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

在你的 config.lua 中,然后你可以取你的 1920x1080 并给它一个@4x 后缀(background@4x.png)并将其调整为名为 background@2x.png 的 50% 大小的图像和名为 background 的 25% 大小的图像。 png 然后 Corona SDK 将根据您的设备为您选择合适的大小,这将在旧设备上提高内存和 CPU 效率,对于可以接受它的真正高清设备,使用更高质量的图像。

于 2013-06-09T23:38:47.957 回答