dialog size for multiple resolutions

My game is to be deployed to all mobile devices.
The dilemma is making content fit to the different resolutions and aspects.
Currently i am using screen percentages for x, y, height and width which works but is not perfect.
for example if i use 90% width for my textbox. on wide devices the text is huge and too high.
I am thinking of restricting the height for my objects.
Does anyone have a better solution?

What are your configs for the game?
I mean, are you using a dynamic content size?

I don’t know. but that sounds interesting.

– config.lua
application =
content =
width = 720,
height = 1280,
scale = “letterbox”, – zoom to fill screen, possibly cropping edges
fps = 60

Aah ok, using percentages looks like a web dev practice, maybe there is where you got the idea.

AFAIK it is not a common practice for mobile games, the display content is adjusted on launch, and you can “trick” that size one way or another depending of what kind of game are you making.

From your current configuration, some devices are going to have some extra space on the sides and some others at the top and bottom.

local aspectRatio = display.pixelHeight / display.pixelWidth
_G.application = {
	content = {
		width = math.floor( 1280 / aspectRatio ),
		height = 1280,

Something like this is going to keep the height all the same across all devices, and only the width will change. With this you don’t need to use text percentages, altought you could still multiply it by something just to cover a bit more of the empy space on wider devices.

something like…

local width = display.contentWidth
local delta = (width-600)/1200 +1

-- and then...
fontSize = 38*delta

If it is still not looking good for your game, you may probably need to create different layouts for different aspect ratios.

thanks mate. That looks like a good method.