At a complete lose with content sizes and scaling

Hi guys,

I’m in the process of making a game for tablet devices.  Only been focusing on iPads at the moment but though it was time to look and Android now I have a bit of a grasp of Corona.  I’ve read a number of forum posts and blogs and I’ve been swept out to sea with all the different posts about the config.lua setting etc…

My aim is to have the game as full screen as possible on all devices with as big as possible safe playing area. But I’m confused about what settings should be in the config file and what starting scales all my assets should be at.

If anyone can help get me out of this hell please do :smiley:

Cheers

First you need to make sure to read this:http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/Now that said, basically you need to decide what your screen scale is going to be. Some devices are low resolution, like 320 pixels wide. Most modern phones are In the 640px wide range and tablets are in the 800px wide or larger range. Trying to code for all of these would be an impossible task. The purpose of the config.lua file is for you to set a baseline that you will use. Most people use 320 as that value. To keep pixels from getting confusing, this number is technically called “Points”, but you will still see px or pixel used way too often. Our base being 320 points, if we want a graphic that is say 64px by 64px to be right size on 320px screens, you will need a 128px x 128px image to be the right size on 640px sized screens. The config.lua has code in it so that Corona SDK will let you have both size images and it will pick the one you need based on the device In use. This is all of that @2x and @4x stuff. You proved player.png at 64x64, player@2x.png at 128x128 and at 256x256 named player@4x.png. You tell Corona to load player.png at a 64x64 size and if needed it will load the higher res image. It also converts the points to pixels for you. player.x = player.x + 1 On a 320px device will move the player 1 pixel, but on a 640px device, it will move it 2 pixels, the right amount for the higher density screen. The config.lua in the blog post takes care of configuring most devices. It bases everything on a 320px base and will work with most devices picking the right image for the best quality for that device. The trick is that positioning can be a bit tricky because the right edge and bottom edge and the center change depending on the device. So you have to get used to positioning relative to display.contentCenterX and display.contentCenterY and using relative distances from display.contentWidth and display.contentHeight

First you need to make sure to read this:http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/Now that said, basically you need to decide what your screen scale is going to be. Some devices are low resolution, like 320 pixels wide. Most modern phones are In the 640px wide range and tablets are in the 800px wide or larger range. Trying to code for all of these would be an impossible task. The purpose of the config.lua file is for you to set a baseline that you will use. Most people use 320 as that value. To keep pixels from getting confusing, this number is technically called “Points”, but you will still see px or pixel used way too often. Our base being 320 points, if we want a graphic that is say 64px by 64px to be right size on 320px screens, you will need a 128px x 128px image to be the right size on 640px sized screens. The config.lua has code in it so that Corona SDK will let you have both size images and it will pick the one you need based on the device In use. This is all of that @2x and @4x stuff. You proved player.png at 64x64, player@2x.png at 128x128 and at 256x256 named player@4x.png. You tell Corona to load player.png at a 64x64 size and if needed it will load the higher res image. It also converts the points to pixels for you. player.x = player.x + 1 On a 320px device will move the player 1 pixel, but on a 640px device, it will move it 2 pixels, the right amount for the higher density screen. The config.lua in the blog post takes care of configuring most devices. It bases everything on a 320px base and will work with most devices picking the right image for the best quality for that device. The trick is that positioning can be a bit tricky because the right edge and bottom edge and the center change depending on the device. So you have to get used to positioning relative to display.contentCenterX and display.contentCenterY and using relative distances from display.contentWidth and display.contentHeight