
Untitled
By: a guest on
Jun 14th, 2012 | syntax:
None | size: 0.49 KB | hits: 30 | expires: Never
Use NSScrollView together with Cocos2d-mac (NSOpenGLView)
appDelegate = [[NSApplication sharedApplication] delegate];
// Set up NSScrollView with dummy empty view as big as the layer
NSRect rect = NSMakeRect(0, 0, myLayer.width, myLayer.height);
NSView *view = [[NSView alloc] initWithFrame:rect];
appDelegate.scrollView.documentView = view;
[view release];
// Push OpenGLView back to front
[appDelegate.glView removeFromSuperview];
[appDelegate.splitLeftView addSubview:appDelegate.glView];