Skip to content

Instantly share code, notes, and snippets.

@marcin-maciukiewicz
Created May 4, 2012 03:12
Show Gist options
  • Save marcin-maciukiewicz/2591680 to your computer and use it in GitHub Desktop.
Save marcin-maciukiewicz/2591680 to your computer and use it in GitHub Desktop.
Cocos2d init in RubyMotion
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