Why the fuss with config.lua and variable aspect ratios? (Alternative code inside)

Well, did you set the width and height in the config.lua to what you want as your ‘minimum’? I think most people nowadays assume a larger ‘default’ resolution but I still work at old iphone resolution and let content scaling take care of the rest.

Basically what my code will do is give you a resolution that is 0,0 in the top left, and extends to _W, _H, which will be the resolution closest to what you specify in the config.lua, while filling the entire screen and without distortion of aspect ratios.

What it does mean is you need to make your app position stuff relative to the _W, _H screen size, but my understanding of the ultimate config.lua file is that you end up with different resolutions depending on the device anyway - so using it your code must already handle variable resolutions.

If you set up the code as I have it above, then say you want to position something at the top right, it would be x, y = _W, 0. Bottom right would be x, y = _W, _H etc, which I figure most people are already doing (or some variant thereof), unless they are strictly using letterbox with borders.

I’ve never touched these config files, as they just seem too complicated for what they are trying to achieve, but I believe if your code already works on variable resolutions, then you’d just have to replace display.contentWidth with _W and display.contentHeight with _H throughout the project and it should just work.

If you had a simple example of a project using a complex config file you don’t mind me looking at, I’d happily see what was required to make the change, so we could determine if it was actually worth it or not in general.