Created
January 4, 2016 11:56
-
-
Save OutlawGameTools/d4f7350e7b8886e5e6f0 to your computer and use it in GitHub Desktop.
Corona SDK. Local vars that hold the most commonly used screen coordinates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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