Page 1 of 1

How can set the font Size for different screen resolution

Posted: Fri May 10, 2013 9:33 am
by kvamalraj
Hi , Live Code team and Friends

I am new to this forum & Live code development . I don't know how to set ' fontSize ' for label fields . I am targeting only Mobiles ( Iphone & Android ) .

Actually my problem is , I am not able to display text in Different Screen Resolution

For 240x320 --> the font size is 40 but in case if 1280*720 the fontSize 40 is to small ...

means i want to increase font size according to screen resolution ( automaticaly )

How can i solve this problem ?

Re: How can set the font Size for different screen resolutio

Posted: Fri May 10, 2013 10:32 am
by Mark
Hi,

The following is just an example. Try your own variation of this script.

Code: Select all

switch the screenRect
  case "240,320"
  case "320,240"
    set the textSize of this stack to 40
    set the textSize of field "Your Label Field" to 36 // just an example
    break
  case "1280,720"
    set the textSize of this stack to 72
    set the textSize of field "Your Label Field" to 68
  default
    set the textSize of this stack to 48
    set the textSize of field "Your Label Field" to 42
end switch
Kind regards,

Mark