One Rect For All specificaiton

Colin Holgate colinholgate at gmail.com
Wed Jan 27 22:25:46 CET 2016


It’s the ratio of the device screen you need, not the ratio of the card.


> On Jan 27, 2016, at 9:17 PM, Sannyasin Brahmanathaswami <brahma at hindu.org> wrote:
> 
> Colin wrote:
> 
> In showAll to position controls in the corners you need to know the ratio of the device screen. You then multiply that by the width or height, to work out the position.
> 
> OK I tried this and failed.   FYI you need all splash screens installed in standAlone config to get iOS screen rects properly registered by LC… but this did not help.
> 
> Suffice to say that my implementation of the “use the ratio) idea fails when driving a 16 X 9 stack out to iPad in the simulator
> 
> function  getAltCardHeight tScreenRect
> 
> # e.g. 0,0,736,414 OR 0,0,1024,768 etc.
> 
> 
>   # get ratio for landscape height
>   # attempt to determine height of card on any device:
> 
> 
>   put ( item 4 of tScreenRect/item 3 of tScreenRect) into tRatioForVertical
>   put ( (the width of this card) * tRatioForVertical) into tNewCardHeight
>   return tNewCardheight
> 
> # use the above to set the bottom of a control
> 
> # to the bottom of the screen on any device
> 
> end getAltCardHeight
> 
> If anyone has a “real” algorithm (used and tested on multiple devices with different ratios, screen densities and pixel dimensions) that allows us to dynamically set a control to the bottom or right edge of the screen using showAll, please share. Either I am incredibly dense and missing something simple or we really have no method/algorithm to accomplish this...
> 
> for details  see:
> 
> http://quality.livecode.com/show_bug.cgi?id=16763
> 
> Demo with new methods here:
> 
> 
> go stack url "http://dev.himalayanacademy.com/stacks/safe-zone-002.livecode”
> 
> 
> at least the “safe zone” for elements is clarified…
> 
> BR
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list