fullscreenmode and rect of a substack on mobile device ?

Terry Judd terry.judd at unimelb.edu.au
Mon Aug 20 01:57:52 EDT 2018


On 20/08/2018 2:45 pm, "use-livecode on behalf of Richard Gaskin via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    Most of the lengthier discussions I've seen about layout handling here 
    and on the forums stem from attempting to get precise control from FSM. 
    In some cases it may be possible to mix FSM with scripted placement, but 
    as you suggest it's often murkier than just having precise control over 
    everything without bringing FSM into it at all.

Yeah, I've used FSM in combination with scripting in the android versions a couple of apps (admittedly they were only designed to work in portrait mode) and it seemed to work well enough. In those cases I developed the app using fairly squat stack aspect ratio and set the fullscreenmode to letterbox in my preopenstack handler. Then in each opencard handler (and this was pre navbar etc. widgets) used something like the following as the basis for sizing/placing elements on the screen (relative to tB). Seemed to work fine for a range of actual device aspect ratios (that all equivalent to or larger than my original stack).

if environment() = "mobile" then
      put the working screenrect into tWR
      put (item 4 of tWR)/(item 3 of tWR) into tAspectRatio
      put (item 3 of tWR)/320 into tScaleFactor
      put 10*(trunc (tAspectRatio*320/10)) into tB
      set the height of this stack to tB
 else
      put the height of this card into tB
 end if

Terry...



More information about the use-livecode mailing list