Codea 2.6.1 (119) (120)

@piinthesky Sure, I’ll see what’s going on there

@Simeon if supportOrientations is depreciated, how are we meant to restrict to a landscape or portrait view nowadays?

@piinthesky y - I calculate the aspect ratio and check each draw function. If not in the correct ratio fire up a message on the screen, if correct aspect ratio proceed with app content.

Maybe the intent is that you write your code to run in either orientation. That way the user can run the code in whichever orientation they like the best.

@piinthesky - if you check in the in-app reference in Codea there is a function for detecting orientation change in project. Trap that, check aspect ratio and act accordingly. Either scale your graphics to orientation or lock orientation for the project.

You don’t need to check aspect ratio. Just use CurrentOrientation. That returns a value from 0 to 3 depending on how the iPad is turned and where the home button is. Try the code below while rotating the iPad.

displayMode(FULLSCREEN)

function setup() 
    tab={"Portrait","Portrait Upside down","Landscape Left","Landscape Right"}
end

function draw()
    background(0)
    fill(255)
    text(tab[CurrentOrientation+1],WIDTH/2,HEIGHT/2)
end

ok will do. Although sometimes i think one might want to restrict to a particular orientation.

@piinthesky Using CurrentOrientation you can restrict to a particular orientation. You can display a black screen with the words telling the user to rotate the iPad. Once it reaches the orientation you want, you then run your code as usual.

@dave1707 well, if the image was displayed the wrong way around it would be obvious they should just rotate the ipad!

@piinthesky Why would the image be displayed the wrong way. If you can’t lock the screen in a certain orientation, the image will be displayed in the correct orientation. It’s the screen that won’t be the way you want it, either portrait or landscape.

@dave1707 now that supportedOrientation has gone, i’m not really sure what it did anymore! For my app I was toying with the idea to somehow lock the display so it always displayed in landscape independent of the ipad orientation, i thought perhaps supportedOrientation would have done that for me.

Anyway i took the plunge and have put everything relative to width and height so it works any which way; although landscape would be the best choice to use.

@Simeon, supportedOrientation still appears in the reference documentation in the related section of the orientation overview.

@piinthesky supportedOrientations was a way to lock the display in whatever iPad position you wanted. If you picked landscape, then your program would stay in landscape mode no matter how you rotated the iPad. If you rotated your iPad to the portrait position, your display would be sideways because it was still in landscape position. By programming everything based on width and height then it doesn’t matter too much how the iPad is rotated. I think that’s what TLL wants everyone to do anyways. But using CurrentOrientation, you could have the user rotate the iPad in the position that you want them to run your program in. In your case, you could display a screen with a message telling the user to rotate the iPad to landscape position if they started in portrait position.

@Simeon changedOrientation seems to be called twice for every orientation change. At startup even more times.

Is there a trello for Codea bug reports?

@Simeon Received a TestFlight notification that Codea 2.6.1 (120) is available for testing. Is this a mistake or are you releasing another 2.6.1 (120).

@dave1707 - is that because you are flipping between (118) and (120)?

@Bri_G I’m not flipping between the 2 versions. I have ver 118 on one iPad and ver 120 on the other. I received a TestFlight notice on both of them. Did you receive a notice.

@dave1707 - only when (120) was posted. My other iPad is a version 2 which can only use iOS 9 limiting it to certain applcation versions. Hence my switching back and forth.

@Bri_G I received an update for TestFlight yesterday and did that on both iPads. I wonder if the TestFlight update caused the message.

@dave1707 - wonder if testflight scans your pad for installed version and acts accordingly.

@Bri_G I doubt if TestFlight does anything like that. Anyways, I already had 2.6.1 (120) on one of the iPads. I’ll just ignore it since no one else mentioned getting an update message.