Hey guys.
I am adding auto rotation support to my app, which supports both landscape modes only.
This code works fine on the ipod touch (2nd gen), but doesn’t change orientation at all on my 3gs ??
I am using the director class.
Code :
mainGroup.xReference = display.contentWidth/2
mainGroup.yReference = display.contentHeight/2
mainGroup.rotation = currentRotation
local function onOrientationChange( event )
local direction = event.type
if system.orientation == "landscapeRight" then
currentRotation = 90 - event.delta
elseif system.orientation == "landscapeLeft" then
currentRotation = 90 - event.delta
end
if system.orientation ~= "landscapeRight" or system.orientation ~= "landscapeLeft" then
currentRotation = 0
end
transition.to(mainGroup, {time=0, rotation=currentRotation} )
-- print(system.orientation)
end
Runtime:addEventListener("orientation", onOrientationChange)
Build settings :
settings =
{
orientation =
{
default ="landscapeRight",
supported =
{
"landscapeRight", "landscapeLeft"
},
},
iphone =
{
plist =
{
UIStatusBarHidden = true
},
},
}
Help on this would be greatly appreciated.
Btw is this even needed ? Shame our apps can’t just support auto orientation by our build settings file. [import]uid: 6981 topic_id: 6770 reply_id: 306770[/import]
[import]uid: 6981 topic_id: 6770 reply_id: 23854[/import]