PORTRAIT and Landscape Orientation

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: PORTRAIT and Landscape Orientation

Post by Dixie » Sun Jul 28, 2013 9:35 pm

maxs..

Attached a stack that will rotate a image when you rotate the device...

Code: Select all

on openStack
   if environment() = "mobile" then
      iphoneSetAllowedOrientations("portrait", "portrait upsidedown","landscape left", "landscape right")
   end if
end openStack

on resizeStack
   if "portrait" is among the words of iphoneDeviceOrientation() then
      set the rect of group "pic" to 0,0,320,480
      set the loc of image 1 of group "pic" to the loc of this card
   end if
   if "landscape" is among the words of iphoneDeviceOrientation() then
      set the rect of group "pic" to 0,0,480,320
      set the loc of image 1 of group "pic" to the loc of this card
   end if
end resizeStack
Attachments
rotatePic.livecode.zip
(122.8 KiB) Downloaded 211 times

Post Reply