Auto rotation

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Auto rotation

Post by MaxV » Mon Dec 23, 2013 11:29 am

How to set up auto rotation?
I tried on my stack:

Code: Select all

on orientationChanged   
  set the fullscreenmode of this stack to "exactFit"  
end orientationChanged
but is doesn't work... :(
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

williamdesmet
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 67
Joined: Tue Jun 26, 2012 7:07 pm

Re: Auto rotation

Post by williamdesmet » Mon Dec 23, 2013 2:56 pm

Hi MaxV,
You can use mobileSetAllowedOrientations.

Code: Select all

 if the environment is "mobile" then
      mobileSetAllowedOrientations "landscape left,landscape right"
end if

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Auto rotation

Post by MaxV » Mon Dec 23, 2013 3:24 pm

Thank you!!! :D
I added:

Code: Select all

if the environment is "mobile" then
      mobileSetAllowedOrientations    "portrait,portrait upside down,landscape left,landscape right"
end if
And works great!
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply