Perfect config.lua and build.settings for corona game to be released for ios

Could anyone please provide me in a direction where I can create the perfect config.lua and build.settings file for a game to be released in ios?

At the moment I have config.lua

application = { content = { fps = 60, width = 640, height = 1120, scale = "portrait", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 2.000, ["@4x"] = 4.000 } } }

and build.settings

-- -- For more information on build.settings, see the Project Build Settings guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "landscapeRight", supported = { "landscapeRight", }, }, iphone = { xcassets = "Images.xcassets", plist = { CFBundleIconFiles = {}, -- Required! UILaunchStoryboardName = "MazeBlast", -- Required! UIStatusBarHidden = true, CFBundleDisplayName = "", CFBundleName = "", }, }, }

Is it possible to have a generic set for a game to be released for ios?

First, there is no such thing as a perfect config.lua. You need to build one that fits your specific app and understand the pros and cons of your choice and find what works for you. What you might want to do for a card game could be completely different than what you would do for an Angry Birds type game.

Creating a New Project with Corona’s Welcome Window will give you a baseline project that works for iOS. As for build.settings, look at my inline comments below:

 iphone = { xcassets = "Images.xcassets", plist = { CFBundleIconFiles = {}, -- Required! See #1 UILaunchStoryboardName = "MazeBlast", -- Required! See #2 UIStatusBarHidden = true, CFBundleDisplayName = "", -- See #3 CFBundleName = "", -- See #3 }, },

#1 – This is not required since you’re using the xcassets method of including icons. This line should be removed.

#2 – You must use a Storyboard for UILaunchImages. However, this is not the name of your game, it’s the name of the LaunchImage file. Unless you’ve used Xcode to create a storyboard named "MazeBlast.storyboardc file, our default is to call it “LaunchScreen” and the template created when you do a “New Project” will provide you a LaunchScreen.storyboardc file that you can use.

#3 – It is highly recommended that you **DO NOT** include these in build.settings. Instead, let Corona pull the information from the build dialog window and the provisioning profile.

There are other required keys in the plist as well

Here is the iphone section for a game I’m working on:

 iphone = { xcassets = "Images.xcassets", plist = { UIApplicationExitsOnSuspend = false, UIPrerenderedIcon=true, UIStatusBarHidden=true, NSCalendarsUsageDescription = "", NSPhotoLibraryUsageDescription = "This app does not access the photo library.", NSCameraUsageDescription = "This app does not use the camera.", UILaunchStoryboardName = "LaunchScreen", } },

As for the config.lua, you should learn as much as you can what the different things mean in config.lua. It’s really helpful to try and digest this post: https://coronalabs.com/blog/2018/08/08/understanding-content-scaling-in-corona/

Rob

Agreed with Rob. The ideal config.lua depends on your app or game typology.

That being said, I create all my (platform) games the same, simple way: all critical elements on screen fit within an “iPad” footprint (i.e. a rectangle with proportions 4:3) in the center of the device, and the graphics extend to the left and right fit the longest screen.

Then again, if your app is a more business-oriented app, or something like Tetris, it makes a lot more sense to align to one edge for the screen, and extend to the other direction.

Regarding the image suffix, I will be honest: I don’t do any images at different resolutions at all. I’ve found that just working for the iPad Air resolution (2048 x 1536) works great for 95% of the devices in my market.

First, there is no such thing as a perfect config.lua. You need to build one that fits your specific app and understand the pros and cons of your choice and find what works for you. What you might want to do for a card game could be completely different than what you would do for an Angry Birds type game.

Creating a New Project with Corona’s Welcome Window will give you a baseline project that works for iOS. As for build.settings, look at my inline comments below:

 iphone = { xcassets = "Images.xcassets", plist = { CFBundleIconFiles = {}, -- Required! See #1 UILaunchStoryboardName = "MazeBlast", -- Required! See #2 UIStatusBarHidden = true, CFBundleDisplayName = "", -- See #3 CFBundleName = "", -- See #3 }, },

#1 – This is not required since you’re using the xcassets method of including icons. This line should be removed.

#2 – You must use a Storyboard for UILaunchImages. However, this is not the name of your game, it’s the name of the LaunchImage file. Unless you’ve used Xcode to create a storyboard named "MazeBlast.storyboardc file, our default is to call it “LaunchScreen” and the template created when you do a “New Project” will provide you a LaunchScreen.storyboardc file that you can use.

#3 – It is highly recommended that you **DO NOT** include these in build.settings. Instead, let Corona pull the information from the build dialog window and the provisioning profile.

There are other required keys in the plist as well

Here is the iphone section for a game I’m working on:

 iphone = { xcassets = "Images.xcassets", plist = { UIApplicationExitsOnSuspend = false, UIPrerenderedIcon=true, UIStatusBarHidden=true, NSCalendarsUsageDescription = "", NSPhotoLibraryUsageDescription = "This app does not access the photo library.", NSCameraUsageDescription = "This app does not use the camera.", UILaunchStoryboardName = "LaunchScreen", } },

As for the config.lua, you should learn as much as you can what the different things mean in config.lua. It’s really helpful to try and digest this post: https://coronalabs.com/blog/2018/08/08/understanding-content-scaling-in-corona/

Rob

Agreed with Rob. The ideal config.lua depends on your app or game typology.

That being said, I create all my (platform) games the same, simple way: all critical elements on screen fit within an “iPad” footprint (i.e. a rectangle with proportions 4:3) in the center of the device, and the graphics extend to the left and right fit the longest screen.

Then again, if your app is a more business-oriented app, or something like Tetris, it makes a lot more sense to align to one edge for the screen, and extend to the other direction.

Regarding the image suffix, I will be honest: I don’t do any images at different resolutions at all. I’ve found that just working for the iPad Air resolution (2048 x 1536) works great for 95% of the devices in my market.