For android you will need to alter the manifest, change "sensorLandscape" or "sensorPortrait" to "fullSensor".
Or, even easier, in the export plugins, tick 'requires' then within that also tick 'Full Orientation'. (in the 2016.12 version of Gideros - see screenshot).
Then in your lua code have this:
local landscape,oldLandscape=true,true |
Then code your game init so that it uses landscape views...
and in an event that occurs regularly (eg an ENTER_FRAME attached to the stage) have this:
local device={application:getDeviceInfo()}
if device[1]=="Windows" or device[1]=="Mac OS" then
if application:getDeviceHeight()>application:getDeviceWidth() then landscape=true else landscape=false end
else
local orientation=application:getDeviceOrientation()
if orientation=="landscapeLeft" or orientation=="landscapeRight" then landscape=true else landscape=false end
end
if landscape~=oldLandscape then
oldLandscape=landscape
print("Reformat display, landscape=",landscape)
end |
Instead of printing the reformat message, you should reformat your layout for either portrait or landscape.
You can test on the Windows or OSX player by just resizing the screen to either something that looks landscape or portrait.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com