Orientations

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kararak95
Posts: 6
Joined: Sat Jun 21, 2014 8:01 am

Orientations

Post by kararak95 » Wed Jul 02, 2014 2:06 pm

Hello. the main stack of my app is portrait. and i have one substack and i want it to be landscape when opening a substack from app. can someone tell me how to do this?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Orientations

Post by Simon » Thu Jul 03, 2014 3:29 am

Hi kararak95,
I've been trying but it hasn't been reliable.
look-up mobileSetAllowedOrientations and orientationChanged. Using those two I could get it to sort of work but doubt you'd want to make a product with it.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: Orientations

Post by newtronsols » Mon Jul 07, 2014 5:56 pm

If you create a button 'test' , then stack script

on preOpenStack
mobileSetAllowedOrientations "landscape left,portrait,landscape right,portrait upside down"
end preOpenStack

and for the card script:

on orientationChanged
local theOrientation
put mobileDeviceOrientation() into theOrientation
set the label of button "test" to theOrientation
end orientationChanged

You should see the label of a button 'test' change to the orientation selected as you move your phone through 90 degrees.

You can also force the initial orientation in the standalone settings to landscape. So you start landscape.

Post Reply