Hi. I tried posting this question in the cocos2d forums, but I've had no luck getting an answer. I managed to place a UITextView in my cocos2d view, however I cannot get events to properly work with it.
Code:
CGRect frame = [[[Director sharedDirector] openGLView] frame];
UITextView * nameView = [[UITextView alloc] initWithFrame:frame];
[nameView setReturnKeyType:UIReturnKeyDone];
[[[Director sharedDirector] openGLView] addSubview:nameView];
I tried adding this in my .h file:
Code:
@interface EndGameLayer : Layer <UITextViewDelegate> {
I would like to use these events:
Code:
- (void)textViewDidBeginEditing:(UITextView *)textView {
- (bool)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
If anyone can even point me in the right direction, any help would be greatly appreciated! Thanks!