I am learning and want to create a game for android phone.
For my first game as learning, I am taking reference from one of existing game.
For now I am creating screen to look like this:
I would set the width and height to a common enough size for mobile phones such that the game area fits inside this width and height and then leaves empty space above and below when playing on a taller screen or on the sides when playing on a wider screen (less common on mobile).
You could design them with the size of what is needed for a 640x1136 screen. When the game is played on a larger screen they’ll be scaled up which probably looks ok at least.
Another option is to design for the highest possible resolution so that graphics look crisp there and then if played on a different size screen the fixed fit projection will scale down the screen. Your icons will probably then still look good.
Using fixed fit projection is causing black background on above and below, what can I do so that the background which I am showing for the game appears on this black area too.
This background may have some animated components too.
Thanks
You can also get the size in the render script if you wish to create the gradient using a shader:
local w = render.get_window_width()
local h = render.get_window_height()
-- create a constant buffer and pass these to your shader program
local constants = render.constant_buffer()
constants.width = w
constants.height = h
render.draw(my_gradient_shader, constants)