Understanding Orientation and possibly resize

hi,

I’m working on an app that requires resizing and both portrait and landscape orientation, not a graphics heavy app. so to try and understand how corona SDK handles orientation, I added all the orientation stuff I could find into one spot. you can download the zip file attached so you don’t have to enter the code.

you can change your config.lua as desired, rerun and use <ctl><arrow> to change orientation, haven’t found the shake indicators yet.

[lua]

width = 320,

height = 480, 

–scale = “zoomEven”,

scale = “letterBox”,

fps = 30,

[/lua]

and the build settings you can change the default orientation. if you are newer to corona, this may help you understand the orientation a little better along with reading the docs, of course…

[lua]

orientation =

{

– Supported values for orientation:

– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “landscapeRight”,

supported = { “portrait”,“landscapeRight”, “landscapeLeft” },

},

[/lua]

I’ll try and update it when I get to the shake function and/or when I figure out the zoom idiosyncrasies…

enjoy!

daveC

The shake event is just handled with the accelerometer listener:

local function accel( event ) if (event.isShake) then print("shaken") end return true end Runtime:addEventListener( "accelerometer", accel )

Is there something you are asking, or are you just posting for general knowledge?

hi horacebury,

yes, just general knowledge…  trying to make it easier on the next guy.

here is the update which includes ‘shaken not stirred’ which you so generously offered… hmm I can’t find an upload option in this post… ahh found it.

thanks,

daveC

Rather than uploading multiple binaries here, have you thought of a GitHub account and uploading gists or simply creating a public repo?

The shake event is just handled with the accelerometer listener:

local function accel( event ) if (event.isShake) then print("shaken") end return true end Runtime:addEventListener( "accelerometer", accel )

Is there something you are asking, or are you just posting for general knowledge?

hi horacebury,

yes, just general knowledge…  trying to make it easier on the next guy.

here is the update which includes ‘shaken not stirred’ which you so generously offered… hmm I can’t find an upload option in this post… ahh found it.

thanks,

daveC

Rather than uploading multiple binaries here, have you thought of a GitHub account and uploading gists or simply creating a public repo?