Use fullscreenmode and set the height/width of the stack ?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Use fullscreenmode and set the height/width of the stack ?

Post by ludo » Tue Feb 11, 2014 7:52 am

Hello,

The fullscreenmode "letterbox" is really great to scale the stack, but on some screens there are "blank" zones.
It is possible to change the rect of the stack (after have set the fullscreenmode) to adapt the loc of all objects with the geometry function ?

I tried this, with a "640x1136" stack on a "iphone 3 device (320x480)" :
on preopenstack
set the fullscreenmode of this stack to "letterbox" --> the stack fit on the screen but do not occupy full width of the screen
if the environment <> "development" then
put the screenrect into trect
put mobilePixelDensity() into theScaleFactor
-- set the fullscreenmode of this stack to empty -- have no effects
set the width of this stack to (item 3 of trect * theScaleFactor) --> the width is now ok, but the stack is also too high
end if
end preopenstack
Any ideas ?

Thanks

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Use fullscreenmode and set the height/width of the stack

Post by jacque » Tue Feb 11, 2014 6:59 pm

Letterbox always scales proportionally, it keeps the same ratio. If you increase the width only, letterbox mode will scale the height to the same ratio.

Letterbox mode probably isn't what you want. Instead, create your stack with generous blank areas at the sides and try noBorder. That will scale the stack proportionally. The edges can be off screen in some cases but if you place all the controls to fit at smaller screen resolutions it won't matter.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Re: Use fullscreenmode and set the height/width of the stack

Post by ludo » Sat Feb 15, 2014 5:19 pm

Thanks,

So, if i understand, the "fullscreenmode" stay active always the stack is opened (even if i set to "empty" later) ?

I tried also to change the ratio of the stack before set the fullscreenmode in the preopenstack script, but it doesn't work :

Code: Select all

on preopenstack
   put  the screenrect into trect
   put round( (item 4 of trect / item 3 of trect) * 100) into trect
   switch (trect)
      case 133 ### ipad
         
         break
      case  67 ### iphone 3
         set the rect of this stack to 0, 0,1136, 757 ## same ratio as 960x480 screen
         break
      default ### iphone 5
         
         
   end switch
   set the fullscreenmode of this stack to "letterbox"
end preopenstack
   
the result is a 480x320 stack....

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Use fullscreenmode and set the height/width of the stack

Post by endernafi » Sat Feb 15, 2014 7:32 pm

I didn't test this thoroughly,
but as far as I know you cannot set the rect of stack on mobile.
Stack is always fullscreen, so it's rect is always the rect of the screen.

EDIT:
I tried and yes, you can't set the rect or width, height of the stack.
get the rect of this stack will return same result as get the screenRect.
set the width of this stack, set the height of this stack, set the rect of this stack, etc.
don't have any effect.

You have to find a way to adjust your controls' sizes and locations.

~ Ender
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Post Reply