fullscreenmode and rect of a substack on mobile device ?

Richard Gaskin ambassador at fourthworld.com
Sat Aug 18 14:32:19 EDT 2018


Ludovic THEBAULT wrote:

 > I’ve a stack for phone and a substack for tablet (with iPad ratio,
 > 1024*768). i use the fullscreenmode to « show all »
 >
 > On android tablet, the ratio height/width is sometimes very different
 > from iPad.
 > I tried to change the height of the substack before open it but with 
no luck :
 >
 > // in the openstack handler of the mainstack
 > put item 3 of the screenrect into theight
 > put item 4 of the screenrect into twidth
 > put theight/twidth into tratio
 > set the height of stack "substackTablet" to round(1024*tratio)
 > mobileSetAllowedOrientations("portrait")
 > open stack "substackTablet"
 > set the fullscreenmode of stack  "substackTablet" to "showall"
 > set the height of  grp "grpbackground"  of stack  "substackTablet" to 
round(1000*tratio)
 >
 >
 > => as result, the top of the stack and the bottom of the stack aren’t
 > the top and the bottom of the screen. If i want my background group
 > cover all the screen i need to set this top to -200 for example.
 >
 > How get the « real » rect of the stack ?

Without fullScreenMode it's as simple as:

     get the rect of this stack

FullScreenMode makes handling dynamic layout details complex.

It's well suited for certain types of games or multimedia presentations, 
such as Monument Valley.

In those types of layouts everything is stretched to fit, without 
needing dynamic placement of individual controls.

But consider the apps on your phone.  The ones I use the most are 
gMmail, Firefox, YouTube, Twitter, Instagram, LinkedIn, Skype, 
SimpleNote, Play Music, Nextcloud, Hangouts, Telegram, Maps, Calculator, 
Ingres, and a few others.

Every one of them uses dynamic positioning of the sort we've been doing 
in LiveCode for decades by responding to the resizeStack message.

I don't know what you're working on so I can't have an opinion of 
whether fullScreenMode is a good fit.

But in practice I so rarely see other apps use that sort of scaling that 
I don't think about fullScreenMode much at all.

Now that we've had several years since the LC team did a great job of 
delivering resolution independence, handling layouts in mobile is a 
breeze compared to the complex workarounds needed before.

With LC's logical pixels, have total control over our layouts to make 
optimal use of every precious pixel on small screens, all with no more 
work than we've already become accustomed to after years of scripting 
for resizable windows.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list