Aspect Ratio (SOLVED)

Hello,

I need help with aspect ratio for my game, I am working with 720x480 size for my game and I am using this example:

if I resize the window for example 1440x960 my game is not scaled but if resize the window to 360x240 my game is scaled, what is the problem? I need re size my game to the height window size x 1.5 (720x480)

Sorry for my english.

PS: I edited this line

local zoom_factor = math.min(math.min(current_width / original_width, current_height / original_height), 1)

to:

local zoom_factor = math.max(math.min(current_width / original_width, current_height / original_height), 1)

and work very fine, but I need a background size estimated to cover all the resolutions?

This is a good question. I’m looking forward to see what people have to say.

Ok, so you want to resize the rendered view both when the window gets larger and smaller than the default size and also maintain aspect ratio?

The default render script will always scale the content but it doesn’t maintain aspect ratio.

Yes, I add more background image and edit your script with max and work very good, for some resolution I see black bars but are very weird resolution hehe.