-- Project: Simple device detection flags -- -- File name: main.lua -- -- Author: Corona Labs -- -- Abstract: Sets up some simple boolean flags that lets us do various device tests. -- -- -- Target devices: simulator, device -- -- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license -- Copyright (C) 2012 Corona Labs Inc. All Rights Reserved. --------------------------------------------------------------------------------------- local M = {} -- -- Set up some defaults -- M.isApple = false M.isAndroid = false M.isGoogle = false M.isKindleFire = false M.isNook = false M.is\_iPad = false M.is\_Windows = false M.is\_OSX = false M.is\_iOS = false M.isTall = false M.isSimulator = false local model = system.getInfo("model") local platform = system.getInfo("platformName") print("model", model) print("platform", platform) -- Are we on the simulator? if "simulator" == system.getInfo("environment") then M.isSimulator = true end -- lets see if we are a tall device M.isTall = false if (display.pixelHeight/display.pixelWidth) \> 1.5 then M.isTall = true end -- first, look to see if we are on some Apple platform. -- All models start with iP, so we can check that. if string.sub(model,1,2) == "iP" then -- We are an iOS device of some sort M.isApple = true M.is\_iOS = true if string.sub(model, 1, 4) == "iPad" then M.is\_iPad = true end elseif string.sub(model, 1, 3) == "Mac" then M.isOSX = true elseif platform == "Win" then M.isWindows = true else -- Not Apple, then we must be one of the Android devices M.isAndroid = true -- lets assume we are Google for the moment M.isGoogle = true -- All the Kindles start with K, though Corona SDK before build 976's Kindle Fire 9 returned "WFJWI" instead of "KFJWI" if model == "Kindle Fire" or model == "WFJWI" or string.sub(model,1,2) == "KF" then M.isKindleFire = true M.isGoogle = false end -- Are we a nook? if string.sub(model,1,4) == "Nook" or string.sub(model,1,4) == "BNRV" or string.sub(model,1,4) == "BNTV" then M.isNook = true M.isGoogle = false end end return M
I don’t know how good this is though, but it should detect OS-X.
Anyway, my build.settings doesn’t have a windows table like yours (for my tmp app!). For the app I posted to the store, I used this:
window = { defaultViewWidth = 580, defaultViewHeight = 720, resizable = false, minViewWidth = 360, minViewHeight = 480, enableCloseButton = true, enableMinimizeButton = true, enableMaximizeButton = false, }
My game is a portrait app and it honored the settings.
Rob