Skip to content

Instantly share code, notes, and snippets.

@phpedinei
Forked from pkoperek/config.lua
Created May 7, 2016 04:25
Show Gist options
  • Select an option

  • Save phpedinei/3d8fc272a7674a296a15924738ef2bfc to your computer and use it in GitHub Desktop.

Select an option

Save phpedinei/3d8fc272a7674a296a15924738ef2bfc to your computer and use it in GitHub Desktop.
ultimate config.lua for corona sdk
-- http://coronalabs.com/blog/2013/09/10/modernizing-the-config-lua/
-- calculate the aspect ratio of the device:
local aspectRatio = display.pixelHeight / display.pixelWidth
application = {
content = {
width = aspectRatio > 1.5 and 320 or math.ceil( 480 / aspectRatio ),
height = aspectRatio < 1.5 and 480 or math.ceil( 320 * aspectRatio ),
scale = "letterBox",
fps = 30,
imageSuffix = {
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment