Search This Blog

2012-10-19

Stage Orientation, iOS 6, and AIR 3.3+

Good stuff to be aware of if you're developing with the latest from Apple and Adobe:

This post on Varun Bhatia's AIR-o-Dynamics blog explains how iOS 6 doesn't send auto-orientation callbacks anymore, which means AS3's StageOrientationEvent listeners are worthless on the iPhone 5 and preventDefault() no longer works for ORIENTATION_CHANGING events.

Anyway, let's say you've designed your app with a landscape aspect ratio in mind, and let's also say you want your user to be able to hold the device in either the ROTATED_RIGHT or the ROTATED_LEFT position.

Previously you may have written an entire class full of listeners and preventDefault() handlers... but since iOS 6, that class doesn't work anymore. Turns out that since AIR 3.3 there's a much better easier way to do it.

In the application descriptor .xml, set the following:

<aspectRatio>landscape<aspectRatio>
<autoOrients>true</autoOrients>

Then, in your AS3 code, call:

stage.setAspectRatio(StageAspectRatio.LANDSCAPE);

Piece of cake! Works like a charm on my iPhone 4 with iOS 6 and AIR 3.5 (beta)... please comment if your mileage varies. Here are those links again, which I highly recommend for further explanation:

StageAspectRatio Enhancements in AIR 3.3
Orientation Changes in AIR 3.5

2012-10-05

Remembering the Atari Lynx

Dear Jeff Gerstmann (c/o Giant Bombcast):
"The Atari Lynx is awesome -- I will not hear otherwise."
Thank you for the Lynx love in the latest bombcast.

I grew up in a Lynx family and credit her as the system primarily responsible for me becoming a game developer. The Lynx was the first 16-bit handheld (video and audio!); she was the first handheld to feature a backlit color monitor; she drew on Atari's impressive catalog of immortal games, and originated several brilliant IPs of her own; you could network her with like 17 other Lynxes (HA!); and she was designed to function not only in "portrait" mode (as with Gauntlet), but could even be turned upside-down and played left-handed!

Of course, she also GUZZLED batteries, and her AC/DC input jack (especially on the first model, the larger one, my personal favorite) was woefully flimsy and unreliable.

I truly loved the Lynx... sadly, the Big Guys with deeper pockets and better marketing won out in the end, and she died in humble obscurity.

Her passing broke my heart and I didn't touch another console until the Xbox came out.

It makes me very glad to hear her remembered fondly and with the respect she deserves. Thank you.

Best,
Matt Duffy