Created
December 11, 2012 18:49
-
-
Save typeoneerror/4260987 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- handle special cases like iPad retina | |
| DPI_SCALE = 1 | |
| if Util.isIPadRetina () then | |
| print ( "Why, iPad Retina; what big pixels you have." ) | |
| DPI_SCALE = 2 | |
| DISPLAY_WIDTH = 1024 | |
| DISPLAY_HEIGHT = 768 | |
| end | |
| -- game window should be 1024 | |
| MOAISim.openWindow( GAME_NAME , DISPLAY_WIDTH, DISPLAY_HEIGHT ) | |
| -- while viewport should be @2x at 2048 | |
| VIEWPORT = MOAIViewport.new () | |
| VIEWPORT:setSize ( DISPLAY_WIDTH * DPI_SCALE, DISPLAY_HEIGHT * DPI_SCALE ) | |
| VIEWPORT:setScale ( GAME_SCREEN_X, -GAME_SCREEN_Y ) | |
| VIEWPORT:setOffset ( -1, 1 ) |
This file contains hidden or 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
| function Util.isIPadRetina () | |
| if MOAIEnvironment.osBrand == Util.OS_BRAND_IOS then | |
| if DISPLAY_WIDTH >= 2048 then | |
| return true | |
| end | |
| end | |
| return false | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment