In most games, there are game objects where the distance between them is important, then there are objects that can move based on the shape of the screen these are typically buttons, joystick controls, scores, life bars, basic UI bits… Then there is the background which needs to be designed to fill the screen regardless of the device.
If your game objects need to be the same distance apart, you cannot use a dynamic config.lua but if you’re building a card game where the various stacks of cards can spread out or move closer together based on real estate a dynamic config.lua can help you. This needs to be the very first decision you make when deciding what to do. You of course, can make either one work, but you’re likely going to need to do more work to make a card game where it’s okay to spread the cards out with a fixed config.lua and it’s a pain in the rear to make a angry birds type game function with a dynamic config.lua.
Next, your non-game objects, i.e. your UI bits usually need to be positioned near edges of the screen. The dynamic config.lua guarantees that 0, 0 will be the top, left corner and that display.contentHeight, display.contentWidth is guaranteed to be the bottom, right corner. Lets day you have a fire button you want 50 px away from the bottom, right. You simply position it at: display.contentWidth - 50, display.contentHeight - 50. Want the life bar 50 px from the top, left, simply set them to 50, 50. Done. With a fixed config.lua, you have to use display.screenOriginX, display.screenOriginY and add those values to any object that needs to be near the edge of a screen and use display.actualContentWidth and display.actualContentHeight to get to the right and bottom of the screen. (you still need to add the screenOrigin* values to your right and bottom positioned items). Normally you want these items to move based on the shape of the screen.
Finally the background should be large enough to cover the full width of a 16:9 device understanding that on a tablet, part of the wide-side will be off screen. We call this “bleed” in developer terms. On the other size, the background has to be large enough to cover the full height of a tablet, understanding that some of the screen will be off screen when on a 16:9 phone. How do you accomplish this? If you’re using a recommended 1.5x to 1 (3:2 aspect ratio) content area, i.e. 320 x 480, 800x1200, etc. then you want to use a background such as 570x360 (landscape or 360x570 portrait). On a 16:9 your screen will be 320x568 to 570 depending on rounding. So by having the long side 570 on a 480 content area, your background should not black-bar in that direction. If you jump on an iPad then the virtual screen size will be 360x480. So those extra pixels on the short side will fill the iPad, preventing black bars, but 90 pixels (45 on each side, 44 with an iPhone 5), will be off screen. Simply don’t put anything on the background image in these bleed areas and you will never see black bars regardless of what config.lua you use. This is all about making your background big enough to fill the black areas. If you use an 800x1200 content area, the backgrounds should be 900x1425.
So to sum up, there is no perfect config.lua file. You just have to understand the limits of what you choose to do and understand out different aspect ratios fit on a canvas.
So to get to your question, if objects need to be a fixed distance from each other, you can easily use object2.x = object1.x + someDistance.
I like doing: object2.x = object1.x + 0.5 * object1.width + somePaddingAmount.
Rob