Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Understanding Orientation and possibly resize
Started by davidjcantera Apr 17 2017 12:35 PM

4 replies to this topic
orientation resize tabbar composer
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

davidjcantera

[GLOBAL: userInfoPane.html]
davidjcantera
  • Observer

  • 18 posts
  • Corona SDK

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.

 

width = 320,
height = 480, 
--scale = "zoomEven",
scale = "letterBox",
fps = 30,

 

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...

 

 

orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
 
default = "landscapeRight",
supported = { "portrait","landscapeRight", "landscapeLeft" },
},
 

 

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

 

enjoy!

daveC

 

Attached Files



[TOPIC: post.html]
#2

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,763 posts
  • Corona SDK

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 )



[TOPIC: post.html]
#3

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,763 posts
  • Corona SDK

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



[TOPIC: post.html]
#4

davidjcantera

[GLOBAL: userInfoPane.html]
davidjcantera
  • Observer

  • 18 posts
  • Corona SDK

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

 

Attached Files



[TOPIC: post.html]
#5

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,763 posts
  • Corona SDK

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




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: orientation, resize, tabbar, composer