Hi , i had been hear about corona ultimate lua config file . And i have questions about this , this file work with all devices ? , where i can download the latest version of this file ? , what are the sizes that you use use for each image preffix ? .
You will get mixed opinions on this. There are two versions of it. One has a big if statement that tests to see if you’re an iPad, phone, etc. Then there is the “modernizing” version which does a calculation to determine the aspect ratio. You should not use the first one for certain. It doesn’t handle Android devices very well at all. When that was created there were few screen sizes to worry about and the “modernizing” one works better… however…
Depending on what you’re trying to make, it could make your life rather difficult, or it could help simplify it. Without knowing what you’re planning on making, it’s hard to suggest what you should do.
Next, calling API calls inside of config.lua “just happens to work”. It’s not something our Engineers intended you ever do. We recently had a change on desktop apps that no longer allows making API calls in config.lua. For mobile builds it still works. So doing so is technically “unsupported” and we can’t guarantee that it will work in the future.
What it comes down to is how important is a fixed distance between objects important to you. As I explained in the other post, in a game like Angry Birds, the distance between the sling-shot and the pigs matters. It has to be the same distance on a phone and a tablet or it changes how the game plays. Tile-map style platform games are also the kind where the distance between objects matters. You wouldn’t want the distance on a jump between blocks to be so far players can’t make it on one device or so close they overjump them on others. But if your making a business app, it makes a lot of sense to have 0, 0 as the top left corner and you just fill down the page until you run out of screen.
Given that we can’t guarantee that you will be able to call the API’s needed to calculate the aspect ratio in the future, there is another way to accomplish the goals of the ultimate config.lua without the math. It takes advantage of the fact that you can align the green content area (in the graph in the other post). We default it to center, but you can shift it to align to the top-left. If you do this, 0, 0 will be the top, left corner. display.actualContentHeight, display.actualContentWidth will be bottom, right. However it breaks display.contentCenterX, display.contentCenterY. Instead you would have to calculate your own center points by dividing display.actualContent* by two and using those values in your code. This keeps config.lua calculation free.
Rob
You will get mixed opinions on this. There are two versions of it. One has a big if statement that tests to see if you’re an iPad, phone, etc. Then there is the “modernizing” version which does a calculation to determine the aspect ratio. You should not use the first one for certain. It doesn’t handle Android devices very well at all. When that was created there were few screen sizes to worry about and the “modernizing” one works better… however…
Depending on what you’re trying to make, it could make your life rather difficult, or it could help simplify it. Without knowing what you’re planning on making, it’s hard to suggest what you should do.
Next, calling API calls inside of config.lua “just happens to work”. It’s not something our Engineers intended you ever do. We recently had a change on desktop apps that no longer allows making API calls in config.lua. For mobile builds it still works. So doing so is technically “unsupported” and we can’t guarantee that it will work in the future.
What it comes down to is how important is a fixed distance between objects important to you. As I explained in the other post, in a game like Angry Birds, the distance between the sling-shot and the pigs matters. It has to be the same distance on a phone and a tablet or it changes how the game plays. Tile-map style platform games are also the kind where the distance between objects matters. You wouldn’t want the distance on a jump between blocks to be so far players can’t make it on one device or so close they overjump them on others. But if your making a business app, it makes a lot of sense to have 0, 0 as the top left corner and you just fill down the page until you run out of screen.
Given that we can’t guarantee that you will be able to call the API’s needed to calculate the aspect ratio in the future, there is another way to accomplish the goals of the ultimate config.lua without the math. It takes advantage of the fact that you can align the green content area (in the graph in the other post). We default it to center, but you can shift it to align to the top-left. If you do this, 0, 0 will be the top, left corner. display.actualContentHeight, display.actualContentWidth will be bottom, right. However it breaks display.contentCenterX, display.contentCenterY. Instead you would have to calculate your own center points by dividing display.actualContent* by two and using those values in your code. This keeps config.lua calculation free.
Rob