diff options
Diffstat (limited to 'platform/iphone/view_controller.mm')
-rw-r--r-- | platform/iphone/view_controller.mm | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index fb25041779..7e44d30851 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -29,19 +29,22 @@ /*************************************************************************/ #import "view_controller.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "display_server_iphone.h" #import "godot_view.h" #import "godot_view_renderer.h" +#import "keyboard_input_view.h" #import "native_video_view.h" #include "os_iphone.h" +#import <AVFoundation/AVFoundation.h> #import <GameController/GameController.h> @interface ViewController () @property(strong, nonatomic) GodotViewRenderer *renderer; @property(strong, nonatomic) GodotNativeVideoView *videoView; +@property(strong, nonatomic) GodotKeyboardInputView *keyboardView; @end @@ -101,6 +104,10 @@ } - (void)observeKeyboard { + printf("******** setting up keyboard input view\n"); + self.keyboardView = [GodotKeyboardInputView new]; + [self.view addSubview:self.keyboardView]; + printf("******** adding observer for keyboard show/hide\n"); [[NSNotificationCenter defaultCenter] addObserver:self @@ -118,6 +125,9 @@ [self.videoView stopVideo]; self.videoView = nil; + + self.keyboardView = nil; + self.renderer = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -208,20 +218,13 @@ } else { // Create autoresizing view for video playback. GodotNativeVideoView *videoView = [[GodotNativeVideoView alloc] initWithFrame:self.view.bounds]; - videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth & UIViewAutoresizingFlexibleHeight; + videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:videoView]; - return [self.videoView playVideoAtPath:filePath volume:videoVolume audio:audioTrack subtitle:subtitleTrack]; - } -} -// MARK: Delegates + self.videoView = videoView; -#ifdef GAME_CENTER_ENABLED -- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController { - //[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone - GameCenter::get_singleton()->game_center_closed(); - [gameCenterViewController dismissViewControllerAnimated:YES completion:nil]; + return [self.videoView playVideoAtPath:filePath volume:videoVolume audio:audioTrack subtitle:subtitleTrack]; + } } -#endif @end |