Created
May 4, 2012 03:12
-
-
Save marcin-maciukiewicz/2591680 to your computer and use it in GitHub Desktop.
Cocos2d init in RubyMotion
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
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
director=CCDirector.sharedDirector | |
viewController = RootViewController.alloc.initWithNibName(nil, bundle:nil) | |
viewController.wantsFullScreenLayout = true | |
glView=EAGLView.viewWithFrame(@window.bounds, pixelFormat:KEAGLColorFormatRGB565, depthFormat:0) | |
director.setOpenGLView(glView) | |
director.setDeviceOrientation(kCCDeviceOrientationPortrait) | |
director.setAnimationInterval(1.0/60) | |
director.setDisplayFPS(true) | |
viewController.view=glView | |
@window.addSubview(viewController.view) | |
@window.makeKeyAndVisible | |
true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment