I've made small game in Xcode 4.2.
After I played all game level, the high-score-input window will appear. I want to add NSTextField to here, so the player could type his name by keyboard.
I added NSTextField
to OpenGlView, but I can't see it on the screen. What's the matter with this? I also try to add subview and add NSTextField
, but I get the same result.
Xcode4.2, simulator is My Mac - 32bit.
NSView *view = [[NSView alloc] initWithFrame:NSRectFromCGRect(CGRectMake(0, 0, 480, 320))];
[[[CCDirector sharedDirector] openGLView] addSubview:view];
[[view layer] setZPosition:1];
//
NSTextField *textField = [[NSTextField alloc] initWithFrame:NSRectFromCGRect(CGRectMake(0, 0, 100, 40))];
[view addSubview:textField];