Skip to content

Instantly share code, notes, and snippets.

@OutlawGameTools
Created January 4, 2016 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OutlawGameTools/d4f7350e7b8886e5e6f0 to your computer and use it in GitHub Desktop.
Save OutlawGameTools/d4f7350e7b8886e5e6f0 to your computer and use it in GitHub Desktop.
Corona SDK. Local vars that hold the most commonly used screen coordinates.
-- most commonly used screen coordinates
local centerX = display.contentCenterX
local centerY = display.contentCenterY
local screenLeft = display.screenOriginX
local screenWidth = display.viewableContentWidth - screenLeft * 2
local screenRight = screenLeft + screenWidth
local screenTop = display.screenOriginY
local screenHeight = display.viewableContentHeight - screenTop * 2
local screenBottom = screenTop + screenHeight
local screenTopSB = screenTop + display.topStatusBarContentHeight -- when status bar is showing
local screenHeightSB = display.viewableContentHeight - screenTopSB
local screenBottomSB = screenTopSB + screenHeightSB
local screenBottomSBwithMenuBar = screenTopSB + screenHeightSB - 52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment