Portrait App - Add Landscape Rotation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Portrait App - Add Landscape Rotation
I have an iPhone app that I have developed and put up on the App Store.
The app as is only supports a Portrait orientation.
I am looking to add the ability for the user to rotate the device and change the orientation to Landscape.
What is the easiest way to go about doing this? (What functions to use in scripts...when to use them, etc)
Thanks bunches!
-Tester2
The app as is only supports a Portrait orientation.
I am looking to add the ability for the user to rotate the device and change the orientation to Landscape.
What is the easiest way to go about doing this? (What functions to use in scripts...when to use them, etc)
Thanks bunches!
-Tester2
Re: Portrait App - Add Landscape Rotation
This seems like a pretty basic question. Is no one able to answer it? This is something I would like to be able to do.
As a side note, why would the following code be rejected with the message ( Can't find handler error near "mobileSetAllowedOrientations, char 1) in the OpenStack event.
I even tried it without the landscapes left and right just as the dictionary example and it was rejected. Also tried it in the OpenCard event with no luck.
Thanks,
Larry
As a side note, why would the following code be rejected with the message ( Can't find handler error near "mobileSetAllowedOrientations, char 1) in the OpenStack event.
Code: Select all
on openStack
mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
end openStack
Thanks,
Larry
Re: Portrait App - Add Landscape Rotation
Here is a simple example of 'orientation' ...
The handlers are in the stack script..
The handlers are in the stack script..

- Attachments
-
- orientate.livecode.zip
- (9 KiB) Downloaded 207 times
Re: Portrait App - Add Landscape Rotation
Hi Larry,
mobileSetAllowedOrientations is for mobile only... won't run on the desktop so you'll have to check the environment before you run it.
Simon
mobileSetAllowedOrientations is for mobile only... won't run on the desktop so you'll have to check the environment before you run it.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Portrait App - Add Landscape Rotation
Thanks Dixie and Simon.
Regards,
Larry
Regards,
Larry
Re: Portrait App - Add Landscape Rotation
Very nice and very simple Dixie. My idea is to construct a set of flash cards where in portrait mode the problem will be displayed as:
7 (7 should be above the 9)
+ 9
---------
while in the landscape mode it will be
7 + 9 =
If I were to make two separate stacks (Stack1 and Stack2) where the first is played out in portrait order and the second in landscape order and made them so that they both contained the same numbers at any given time. Could I get away with using a 'resizeStack' like the one shown below:
That would seem a lot simpler than trying to put all the objects in the proper loc.
Larry
7 (7 should be above the 9)
+ 9
---------
while in the landscape mode it will be
7 + 9 =
If I were to make two separate stacks (Stack1 and Stack2) where the first is played out in portrait order and the second in landscape order and made them so that they both contained the same numbers at any given time. Could I get away with using a 'resizeStack' like the one shown below:
Code: Select all
on resizeStack
iphoneShowStatusBar
if "portrait" is among the words of iphoneDeviceOrientation() then
go to stack "Stack1"
exit resizeStack
end if
if "landscape" is among the words of iphoneDeviceOrientation() then
go to "Stack2"
exit resizeStack
end if
end resizeStack
Larry
Re: Portrait App - Add Landscape Rotation
Larry...
I would just use the one card... have a look at the attached stack...
As it is set up, the numbers and the operator change each time the card is opened, but you could set it so that new numbers are provided after your 'student' has answered each question...
I would just use the one card... have a look at the attached stack...
As it is set up, the numbers and the operator change each time the card is opened, but you could set it so that new numbers are provided after your 'student' has answered each question...

- Attachments
-
- orientate2.livecode.zip
- (9.46 KiB) Downloaded 183 times
Re: Portrait App - Add Landscape Rotation
Dixie,
If it is not too much trouble, I would sure like to know why the attached stack will not go to Landscape correctly. As you can see from the commented out lines I have tried the guts of the rotation in both resizeStack and orientationChanged. Also, the only functioning operation is addition.
Thanks,
Larry
If it is not too much trouble, I would sure like to know why the attached stack will not go to Landscape correctly. As you can see from the commented out lines I have tried the guts of the rotation in both resizeStack and orientationChanged. Also, the only functioning operation is addition.
Thanks,
Larry
Re: Portrait App - Add Landscape Rotation
Well, I finally got it to work. I started with Dixie's orientate2 stack and slowly modified it by adding more buttons and objects to get it the way I wanted. It was a slow process because I tested and saved at regular intervals so as not to have to go back to the original in case I had problems. I still have yet to work out the details for the other operations and adjust the 'levels'.
Larry
Larry