I have been testing my app on my Motorola Xoom, and there are two issues arising with my test application. Does anyone know a work around or know how I can fix this? Thanks!
main.lua
[lua]display.setStatusBar( display.HiddenStatusBar )
local bg = display.newRect ( 0, 0, display.contentWidth, display.contentHeight )
local text1 = display.newText ( “”, 0, 0, native.systemFont, 16 )
local text2 = display.newText ( “”, 0, 0, native.systemFont, 16 )
local text3 = display.newText ( “”, 0, 0, native.systemFont, 16 )
local text4 = display.newText ( “”, 0, 0, native.systemFont, 16 )
bg:setFillColor ( 0, 0, 80 )
local function onOrientation ( event )
bg.width = display.contentWidth
bg.height = display.contentHeight
bg.x = display.contentWidth / 2
bg.y = display.contentHeight / 2
text1.x = display.contentWidth / 2
text2.x = display.contentWidth / 2
text3.x = display.contentWidth / 2
text4.x = display.contentWidth / 2
text1.y = display.contentHeight / 2 - 60
text2.y = display.contentHeight / 2 - 20
text3.y = display.contentHeight / 2 + 20
text4.y = display.contentHeight / 2 + 60
text1.text = "screenOriginX: " … tostring ( display.screenOriginX ) … " display.contentWidth: " … tostring ( display.contentWidth )
text2.text = "screenOriginY: " … tostring ( display.screenOriginY ) … " display.contentHeight: " … tostring ( display.contentHeight )
text3.text = "viewableContentWidth: " … tostring ( display.viewableContentWidth ) … " display.viewableContentHeight: " … tostring ( display.viewableContentHeight )
text4.text = "display.statusBarHeight: " … tostring ( display.statusBarHeight )
end
onOrientation ()
Runtime:addEventListener ( “orientation”, onOrientation )[/lua]
build.settings
[lua]settings =
{
content =
{
antialias = true,
launchPad = false,
scale = “letterbox”,
width = 640,
height = 960,
imageSuffix =
{
["@2"] = 2,
},
},
orientation =
{
default = “portrait”,
supported =
{
“portrait”, “landscapeRight”, “landscapeLeft”,
}
},
}[/lua]
And here are my two problems:
-
Android still rotates to portraitUpsideDown.
-
Program starts just fine in either rotation. But when I am in the program and rotate my device, I get a gap on the right hand side.
Note: Full resolution is 1280 x 800. But it either limits me to 1280x752 or 800x1232 depending which orientation I start the application. [import]uid: 7721 topic_id: 31510 reply_id: 331510[/import]
