I am coming from other game engines and used to handle resolution scaling once and not worrying it for ever again. My implementation includes to stretch the set resolution (for example 320x180) by hole factor for given display space and cover remaining area with black bars.
This implementation works perfectly for most of the times but I do not know how to implement it in Defold in default ways. Is there a way or a custom implementation out there that can be done easily. I must also mention that it must work with camera component.
You can use the built-in camera and check the Orthographic Projection checkbox and set a fixed Orthographic Zoom:
You can also calculate the zoom on the fly based on the display width and height set in game.project and the actual window width:
-- get the display size set in game.project
local display_width = sys.get_config_int("display.width")
local display_height = sys.get_config_int("display.height")
-- get the actual display size
local current_width, current_height = window.get_size()
How will ı use this data to implement my desired outcome? Even if ı use the correct level of zooming, it will not produce black bars according to the original resolution, will it?