How can set the font Size for different screen resolution

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kvamalraj
Posts: 2
Joined: Thu May 09, 2013 6:28 pm

How can set the font Size for different screen resolution

Post by kvamalraj » Fri May 10, 2013 9:33 am

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 ?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

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

Post by Mark » Fri May 10, 2013 10:32 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply