Hi guys.
I have a small problem that is driving me away a bit of time. I created a library that through
system.getPreference ("Local", "language")
lets me know the user of language.
Thanks to it I will change the words in the game.
But the problem is this:
I would put the word to 'inside of a rectangle of size not variable.
so I would like to know what size to give
display.newText
instead will vary in size strings.
I do not find the right calculations and I also tried with diagonal and with different proportions.
I would get a result like this but very much less expensive:
local rect = display.newRect( 100, 100, 400, 100 )rect:setFillColor( 1, 0, 0 )local text = display.newText( "variable text", rect.x, rect.y, "gameFont", 1 )while( (text.width \< rect.width) and ( text.height \< rect.height) )do text.size = text.size + 1end
can you help me?