Apple’s TOS requires orientation on all iPad apps, so now our entire UI needs to be redone and I am in the process of making a large number of objects compatible. I am currently trying to figure out how to set the orientation of a group to the center of the screen. The following code is centering it vertically, but not horizontally… Setting the reference point to null puts it in the same place, so that line of code might not be working the way I hope it should.
MainScreenGroup = display.newGroup()
MainScreenGroup:insert(MainMenuBackground)
MainScreenGroup:setReferencePoint(display.CenterReferencePoint);
local function onMainMenuOrientationChange( event )
local direction = event.type
local newAngle = MainScreenGroup.rotation - event.delta * 2
if(event.type == “portrait” or event.type == “portraitUpsideDown”) then
transition.to( MainScreenGroup, { time=150, rotation=newAngle } )
end [import]uid: 4871 topic_id: 788 reply_id: 300788[/import]