Config File and Build.Settings File

I’m having trouble with my build.settings file and config.lua file fighting each other.  Both work independently but won’t work together.

I designed my game around the code in the config.lua file.  I also designed splash screen images for all the different platforms because I didn’t want the graphics to look stretched or blurry.  Additionally, if someone could explain the difference between the two file types that would also help me out.

Thanks

config.lua

[lua]

application =

{

    content =

    {

    width = 1536,

    height = 2048,

    scale = “letterbox”,

    yAlign = “top”,

    fps = 60

    }

}

[/lua]

build.settings

[lua]

settings =

{

    iphone =

    {

        plist =

        {

            – Icon image files table (see section above)

            CFBundleIconFiles = {

            },

            – Launch image files table

            UILaunchImages = {

                {  – iPhone 4 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{320, 480}”

                },

                {  – iPhone 4 LandscapeLeft

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default”,

                    [“UILaunchImageOrientation”] = “LandscapeLeft”,

                    [“UILaunchImageSize”] = “{320, 480}”

                },

                {  – iPhone 4 LandscapeRight

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default”,

                    [“UILaunchImageOrientation”] = “LandscapeRight”,

                    [“UILaunchImageSize”] = “{320, 480}”

                },

                {  – iPhone 5 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-568h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{320, 568}”

                },

                {  – iPhone 5 LandscapeLeft

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-568h”,

                    [“UILaunchImageOrientation”] = “LandscapeLeft”,

                    [“UILaunchImageSize”] = “{320, 568}”

                },

                {  – iPhone 5 LandscapeRight

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-568h”,

                    [“UILaunchImageOrientation”] = “LandscapeRight”,

                    [“UILaunchImageSize”] = “{320, 568}”

                },

                {  – iPad Portrait

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-Portrait”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{768, 1024}”

                },

                {  – iPad LandscapeLeft

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-Landscape”,

                    [“UILaunchImageOrientation”] = “LandscapeLeft”,

                    [“UILaunchImageSize”] = “{768, 1024}”

                },

                {  – iPad LandscapeRight

                    [“UILaunchImageMinimumOSVersion”] = “7.0”,

                    [“UILaunchImageName”] = “Default-Landscape”,

                    [“UILaunchImageOrientation”] = “LandscapeRight”,

                    [“UILaunchImageSize”] = “{768, 1024}”

                },

                {  – iPhone 6 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-667h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{375, 667}”

                },

                {  – iPhone 6 LandscapeLeft

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-667h”,

                    [“UILaunchImageOrientation”] = “LandscapeLeft”,

                    [“UILaunchImageSize”] = “{375, 667}”

                },

                {  – iPhone 6 LandscapeRight

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-667h”,

                    [“UILaunchImageOrientation”] = “LandscapeRight”,

                    [“UILaunchImageSize”] = “{375, 667}”

                },

                {  – iPhone 6 Plus Portrait

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-736h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{414, 736}”

                },

                {  – iPhone 6 Plus LandscapeLeft

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-Landscape-736h”,

                    [“UILaunchImageOrientation”] = “LandscapeLeft”,

                    [“UILaunchImageSize”] = “{414, 736}”

                },

                {  – iPhone 6 Plus LandscapeRight

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-Landscape-736h”,

                    [“UILaunchImageOrientation”] = “LandscapeRight”,

                    [“UILaunchImageSize”] = “{414, 736}”

                },

            },

        }

    },

}

[/lua]

config.lua is a file that manages certain operations regarding the content area of your screen. You set your desired width/height and Corona will scale that up or down to fit the actual pixel resolution of the device. You set the scale mode (letterbox, zoomEven, etc.) and the frames per second that the engine updates with.

build.settings is a file that generally includes device specific entries, such as permissions for android, or Xcode plist settings for iOS. This is also the place where orientations have to be defined, since they are set in the device build before Corona starts up. Config.lua is processed after the app is initialized. They really have nothing to do with each other, with one exception.

The config.lua file is always treated as if the device is in portrait mode. That is width should always be less than height. In build.settings you set the orientation of your app, which can be landscape or portrait or all orientations.

Your build.settings seems to be missing a few things. You might want to review this tutorial:  https://coronalabs.com/blog/2014/07/08/tutorial-understanding-build-settings/

You say it’s not working. How is it not working? Are you getting errors? Can you describe what’s going on?

Rob

Rob,

Actually what I said is incorrect.  The splash screen always uses the default image.  If I remove the line

[lua]

scale = “letterbox”,

[/lua]

then the default image is stretched to the size of the screen, which makes sense.

The game never uses the correct splash screen image and always loads the file named “Default.png”

All my splash screen images are located in the directory of my main.lua file and the names are as follows:

Default.png

Default@2x.png

Default-568h@2x.png

Default-667h@2x.png

Default-Portrait.png

Default-Portrait@2x.png

The issue persists even if I remove all the code in the config.lua file.

First of all are you building for Android or iOS?  If you’re building for Android, it doesn’t really support launch screens. We only pick up Default.png and show it because way back in the day, people wanted it. Android will never use any other file.

For iOS there could be several things going on. One, you could have an error in your build.settings. I didn’t see anything obvious. Next, you don’t specify any orientation information. Without an initial orientation, some devices may not know which one to pick up.

Hi Rob,

I’ve been working on this problem and trying a lot of different things but still am unable to get the splash screens to display the correct image.

Could you provide a working example?

Thanks,

Dallas

config.lua is a file that manages certain operations regarding the content area of your screen. You set your desired width/height and Corona will scale that up or down to fit the actual pixel resolution of the device. You set the scale mode (letterbox, zoomEven, etc.) and the frames per second that the engine updates with.

build.settings is a file that generally includes device specific entries, such as permissions for android, or Xcode plist settings for iOS. This is also the place where orientations have to be defined, since they are set in the device build before Corona starts up. Config.lua is processed after the app is initialized. They really have nothing to do with each other, with one exception.

The config.lua file is always treated as if the device is in portrait mode. That is width should always be less than height. In build.settings you set the orientation of your app, which can be landscape or portrait or all orientations.

Your build.settings seems to be missing a few things. You might want to review this tutorial:  https://coronalabs.com/blog/2014/07/08/tutorial-understanding-build-settings/

You say it’s not working. How is it not working? Are you getting errors? Can you describe what’s going on?

Rob

Rob,

Actually what I said is incorrect.  The splash screen always uses the default image.  If I remove the line

[lua]

scale = “letterbox”,

[/lua]

then the default image is stretched to the size of the screen, which makes sense.

The game never uses the correct splash screen image and always loads the file named “Default.png”

All my splash screen images are located in the directory of my main.lua file and the names are as follows:

Default.png

Default@2x.png

Default-568h@2x.png

Default-667h@2x.png

Default-Portrait.png

Default-Portrait@2x.png

The issue persists even if I remove all the code in the config.lua file.

First of all are you building for Android or iOS?  If you’re building for Android, it doesn’t really support launch screens. We only pick up Default.png and show it because way back in the day, people wanted it. Android will never use any other file.

For iOS there could be several things going on. One, you could have an error in your build.settings. I didn’t see anything obvious. Next, you don’t specify any orientation information. Without an initial orientation, some devices may not know which one to pick up.

Hi Rob,

I’ve been working on this problem and trying a lot of different things but still am unable to get the splash screens to display the correct image.

Could you provide a working example?

Thanks,

Dallas