public static UIWindow 作る(Vector2 場所, bool tickedUp = false, bool visible = true) { HorizontalGroupBox gb = new HorizontalGroupBox(5, 8); gb.Add(new UIText("the fox says:")); gb.Add(new Textbox(50)); gb.Add(new KeyInputBox(Keys.ImeNoConvert)); gb.Add(new Textbox(50)); gb.Add(new Button("button in horizontal box")); gb.Add(new Itembox(new Item(1), true)); uint windowButtons = (uint)windowTopButtons.titlebar | (uint)windowTopButtons.tickDown | (uint)windowTopButtons.removeToParent | (uint)windowTopButtons.close; var window = new UIWindow(場所, "test", 5, 8, windowButtons) { new KeyInputBox(Input.arrange.jump, delegate(object key) { Input.arrange.jump = (Keys)key; }), new Textbox(150, "ナデシコ", "お名前は"), new Textbox(150, "ナデシコ", "お名前は"), new Button("Button", delegate { Console.WriteLine("button pressed"); }), gb, new Itembox(new Item(0)), }; window.Add(new Button("toggle window titlebar", delegate { window.windowButtons ^= windowButtons; })); window.Visible = visible; window.tickedUp = tickedUp; return(window); }
public Game(UIViewController viewController = null) { // Initialize collections _services = new GameServiceContainer(); _gameComponentCollection = new GameComponentCollection(); _gameComponentCollection.ComponentAdded += Handle_gameComponentCollectionComponentAdded; _mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); if (viewController != null) { _mainWindow.RootViewController = viewController; } FixupRotationIos7(); // important to get proper _mainWindow bounds right now. _view = new GameWindow(_mainWindow.Bounds, UIScreen.MainScreen.Scale); GameWindow.game = this; _mainWindow.Add(_view); // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); }
/// <summary> /// Shows guide view controllers, e.g., Game Center view controllers. /// In iOS 5 and older, the guide is presented using GuideViewController. /// In iOS 6+, the guide is presented using the root view controller. /// (The iOS 5 method generates runtime warnings.) /// </summary> /// <param name="viewController">The view controller to be shown, e.g., Game Center view controllers</param> private static void ShowViewController(UIViewController viewController) { if (_window != null && viewController != null) { prevGestures = TouchPanel.EnabledGestures; TouchPanel.EnabledGestures = GestureType.None; if (osVersion < 6.0d) { // Show view controller the old way for iOS 5 and older if (guideViewController == null) { guideViewController = new GuideViewController(_gameViewController); _window.Add(guideViewController.View); guideViewController.View.Hidden = true; } #pragma warning disable 618 // Disable PresentModalViewController warning, still need to support iOS 5 and older guideViewController.PresentModalViewController(viewController, true); #pragma warning restore 618 } else { // Show view controller the new way for iOS 6+ _window.RootViewController.PresentViewController(viewController, true, delegate {}); } IsVisible = true; } }
public iOSGamePlatform(Game game) : base(game) { game.Services.AddService(typeof(iOSGamePlatform), this); // Setup our OpenALSoundController to handle our SoundBuffer pools soundControllerInstance = OpenALSoundController.GetInstance; Directory.SetCurrentDirectory(NSBundle.MainBundle.ResourcePath); _applicationObservers = new List <NSObject>(); UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade); // Create a full-screen window _mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); //_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; game.Services.AddService(typeof(UIWindow), _mainWindow); _viewController = new iOSGameViewController(this); game.Services.AddService(typeof(UIViewController), _viewController); Window = new iOSGameWindow(_viewController); _mainWindow.RootViewController = _viewController; _mainWindow.Add(_viewController.View); _viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged; Guide.Initialise(game); }
// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching(UIApplication app, NSDictionary options) { MonoMobileApplication.NavigationController = new UINavigationController(); _Window = new UIWindow(UIScreen.MainScreen.Bounds); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) _DefaultImage = UIImage.FromBundle("DefaultiPad.png"); else _DefaultImage = UIImage.FromBundle("Default.png"); if (_DefaultImage != null) { var imageView = new UIImageView(_Window.Bounds); imageView.Image = _DefaultImage; _Window.Add(imageView); _Window.BackgroundColor = UIColor.Clear; } MonoMobileApplication.NavigationController.View.Alpha = 0.0f; _Window.AddSubview(MonoMobileApplication.NavigationController.View); _Window.MakeKeyAndVisible(); MonoMobileApplication.Window = _Window; BeginInvokeOnMainThread(()=> { Startup(); }); return true; }
public iOSGamePlatform(Game game) : base(game) { game.Services.AddService(typeof(iOSGamePlatform), this); // Setup our OpenALSoundController to handle our SoundBuffer pools soundControllerInstance = OpenALSoundController.GetInstance; //This also runs the TitleContainer static constructor, ensuring it is done on the main thread Directory.SetCurrentDirectory(TitleContainer.Location); _applicationObservers = new List <NSObject>(); #if !TVOS UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade); #endif // Create a full-screen window _mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); //_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; game.Services.AddService(typeof(UIWindow), _mainWindow); _viewController = new iOSGameViewController(this); game.Services.AddService(typeof(UIViewController), _viewController); Window = new iOSGameWindow(_viewController); _mainWindow.Add(_viewController.View); _viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged; //(SJ) Why is this called here when it's not in any other project //Guide.Initialise(game); }
void Start() { UIPanel panel = NGUITools.FindInParents <UIPanel>(gameObject); if (panel != null) { UIWindow.Add(panel); } }
public static void ShowLeaderboard() { AssertInitialised(); if ((Gamer.SignedInGamers.Count > 0) && (Gamer.SignedInGamers[0].IsSignedInToLive)) { // Lazy load it if (leaderboardController == null) { leaderboardController = new GKLeaderboardViewController(); } if (leaderboardController != null) { leaderboardController.DidFinish += delegate(object sender, EventArgs e) { leaderboardController.DismissModalViewControllerAnimated(true); IsVisible = false; TouchPanel.EnabledGestures = prevGestures; }; if (_window != null) { if (viewController == null) { viewController = new GuideViewController(_gameViewController); _window.Add(viewController.View); viewController.View.Hidden = true; } prevGestures = TouchPanel.EnabledGestures; TouchPanel.EnabledGestures = GestureType.None; viewController.PresentModalViewController(leaderboardController, true); IsVisible = true; } } } else { UIAlertView alert = new UIAlertView("Error", "You need to be logged into Game Center to view the Leaderboard.", null, "Ok"); alert.Show(); ShowSignIn(1, true); } }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { _mainCtr = new MainViewController(); _navCtr = new UINavigationController(_mainCtr); _window = new UIWindow(UIScreen.MainScreen.Bounds); _window.Add(_navCtr.View); _window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { _mainCtr = new MainViewController(); _navCtr = new UINavigationController(_mainCtr); _window = new UIWindow(UIScreen.MainScreen.Bounds); _window.Add(_navCtr.View); _window.MakeKeyAndVisible(); return(true); }
/// <summary> /// Add this window to the list. /// </summary> void OnEnable() { if (!mIgnoreEnable && mInst != this) { UIPanel panel = GetComponent <UIPanel>(); if (panel != null) { UIWindow.Add(panel); } } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { _window = new UIWindow(UIScreen.MainScreen.Bounds); // Add the the splash controller _splashScreenController = new SplashScreenController(); _window.BackgroundColor = UIColor.FromRGBA(0x36, 0x36, 0x36, 1); _window.Add(_splashScreenController.View); _window.MakeKeyAndVisible(); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { _window = new UIWindow(UIScreen.MainScreen.Bounds); // Add the the splash controller _splashScreenController = new SplashScreenController(); _window.BackgroundColor = UIColor.FromRGBA(0x36, 0x36, 0x36, 1); _window.Add(_splashScreenController.View); _window.MakeKeyAndVisible(); return(true); }
private void ShowView() { if (_firstView) { foreach (var view in _window.Subviews) { view.RemoveFromSuperview(); } _firstView = false; _window.Add(_touchNavigation.View); _window.MakeKeyAndVisible(); } }
public override void FinishedLaunching(UIApplication app) { NSError err; AVAudioSession.SharedInstance().SetCategory(AVAudioSession.CategoryAmbient, out err); var image = new UIImage(@"splash.png"); UIImageView view = new UIImageView(image); startWindow = new UIWindow(UIScreen.MainScreen.Bounds); startWindow.RootViewController = new LaunchController(); startWindow.Add(view); startWindow.MakeKeyAndVisible(); splashStart = DateTime.UtcNow; }
public Game() { // Initialize collections _services = new GameServiceContainer(); _gameComponentCollection = new GameComponentCollection(); //Create a full-screen window _mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); _view = new GameWindow(); _view.game = this; _mainWindow.Add(_view); // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // Set the repository type _sqliteRepository = new SqliteRepository(); Repository.SetInstance(_sqliteRepository); Repository.Default.CreateDatabase(); // Get the settings Settings.Read(); _rootController = new RootController(); _window = new UIWindow(UIScreen.MainScreen.Bounds); _window.Add(_rootController.View); _window.MakeKeyAndVisible(); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // Set the repository type _sqliteRepository = new SqliteRepository(); Repository.SetInstance(_sqliteRepository); Repository.Default.CreateDatabase(); // Get the settings Settings.Read(); _rootController = new RootController(); _window = new UIWindow(UIScreen.MainScreen.Bounds); _window.Add(_rootController.View); _window.MakeKeyAndVisible(); return(true); }
public static UIWindow 作る(Vector2 場所, bool tickedUp = false, bool visible = true) { UIWindow window = new UIWindow(場所, "inventory", 5, 8, (uint)windowTopButtons.titlebar | (uint)windowTopButtons.tickDown); const int inventoryRows = 5; const int slotsInRow = Player.inventorySlots / inventoryRows; for (int i = 0; i < inventoryRows; i++) { HorizontalGroupBox row = new HorizontalGroupBox(8, 0); for (int j = 0; j < slotsInRow; j++) { Itembox box = new Itembox((Item)null, true); int loc = slotsInRow * i + j; Main.refmain.localPlayerLoaded += delegate { box.itemHolder = Main.currentPlayer.inventory[loc]; }; row.Add(box); } window.Add(row); } window.Visible = visible; window.tickedUp = tickedUp; return(window); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); txtConsole.BackgroundColor = UIColor.Black; txtConsole.TextColor = UIColor.LightGray; txtConsole.Font = UIFont.FromName ("Courier New",11); txtConsole.Text = "SharpSSH for iPhone\r\n"; window.Add (txtConsole); ConsoleReader = new System.Threading.Thread(ReadConsole); ConsoleReader.Start (); T = NSTimer.CreateRepeatingScheduledTimer(1, delegate() { InvokeOnMainThread (delegate { string x = ssh.ReadResponse (); txtConsole.Text += x+"\r\n"; }); }); window.MakeKeyAndVisible (); return true; }
internal void StartGame() { // Note: If the handling of the graphics device gets more complicated, // this may have to be split into functions around what needs to be done before, // during and after graphics device creation: ApplyChanges(); // Create the game's window and view: mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); gameViewController = new ExEnEmTouchGameViewController(game, this); gameView = (ExEnEmTouchGameView)gameViewController.View; // Start the game gameView.StartGame(); // Calling StartGame does this: // - creates the frame buffer // - Calls InternalCreateDevice on this (creating the graphics device and calling DoDeviceCreated) // - calls Initialize and then Update/Draw on Game (to fill backbuffer before becoming visible) // Now that Game has started, make the window visible: mainWindow.Add(gameView); mainWindow.MakeKeyAndVisible(); }
/// <summary> /// Finished launching. /// </summary> /// <returns><c>true</c>, if launching was finisheded, <c>false</c> otherwise.</returns> /// <param name="application">Application.</param> /// <param name="launchOptions">Launch options.</param> public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { //create the initial view controller var rootController = new JVMenuRootViewController(); //build the shared menu JVMenuPopoverConfig.SharedInstance.MenuItems = new List <JVMenuItem>() { new JVMenuViewControllerItem() { //View exisiting view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"home-48"), Title = @"Home", ViewController = rootController, }, new JVMenuViewControllerItem() { //New view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"about-48"), Title = @"About Us", ViewController = new JVMenuSecondController(), }, new JVMenuViewControllerItem() { //New view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"settings-48"), Title = @"Our Service", ViewController = new JVMenuThirdController(), }, new JVMenuViewControllerItem() { //New view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"business_contact-48"), Title = @"Contact Us", ViewController = new JVMenuFourthController(), }, new JVMenuViewControllerItem <JVMenuFifthController>() { //New view controller, will be recreated afresh everytime the item is selected Icon = UIImage.FromBundle(@"ask_question-48"), Title = @"Help?", AlwaysNew = true, }, new JVMenuActionItem() { //Action is called, on the UI thread, everytime the item is selected Icon = UIImage.FromBundle(@"ask_question-48"), Title = @"Logout", Command = () => { var uiAlert = new UIAlertView("Logout", "Are you sure you want to log out?", null, "No", "Yes"); uiAlert.Show(); }, }, }; //create a Nav controller an set the root controller NavigationController = new UINavigationController(rootController); //setup the window Window = new UIWindow(UIScreen.MainScreen.Bounds); Window.RootViewController = NavigationController; Window.ContentMode = UIViewContentMode.ScaleAspectFill; Window.BackgroundColor = UIColor.FromPatternImage(JVMenuHelper.ImageWithImage(UIImage.FromBundle("app_bg1.jpg"), this.Window.Frame.Width)); Window.Add(NavigationController.View); Window.MakeKeyAndVisible(); return(true); }
public Game() { // Initialize collections _services = new GameServiceContainer(); _gameComponentCollection = new GameComponentCollection(); //Create a full-screen window _mainWindow = new UIWindow (UIScreen.MainScreen.Bounds); _view = new GameWindow(); _view.game = this; _mainWindow.Add(_view); // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); }
public Game(UIViewController viewController = null) { // Initialize collections _services = new GameServiceContainer(); _gameComponentCollection = new GameComponentCollection(); _gameComponentCollection.ComponentAdded += Handle_gameComponentCollectionComponentAdded; _mainWindow = new UIWindow ( UIScreen.MainScreen.Bounds); if(viewController != null) { _mainWindow.RootViewController = viewController; } FixupRotationIos7 (); // important to get proper _mainWindow bounds right now. _view = new GameWindow(_mainWindow.Bounds, UIScreen.MainScreen.Scale); GameWindow.game = this; _mainWindow.Add(_view); // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); }
public iOSGamePlatform(Game game) : base(game) { game.Services.AddService(typeof(iOSGamePlatform), this); // Setup our OpenALSoundController to handle our SoundBuffer pools soundControllerInstance = OpenALSoundController.GetInstance; //This also runs the TitleContainer static constructor, ensuring it is done on the main thread Directory.SetCurrentDirectory(TitleContainer.Location); _applicationObservers = new List<NSObject>(); UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade); // Create a full-screen window _mainWindow = new UIWindow (UIScreen.MainScreen.Bounds); //_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; game.Services.AddService (typeof(UIWindow), _mainWindow); _viewController = new iOSGameViewController(this); game.Services.AddService (typeof(UIViewController), _viewController); Window = new iOSGameWindow (_viewController); _mainWindow.RootViewController = _viewController; _mainWindow.Add (_viewController.View); _viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged; //(SJ) Why is this called here when it's not in any other project //Guide.Initialise(game); }
public iOSGamePlatform(Game game) : base(game) { game.Services.AddService(typeof(iOSGamePlatform), this); // Setup our OpenALSoundController to handle our SoundBuffer pools soundControllerInstance = OpenALSoundController.GetInstance; Directory.SetCurrentDirectory(NSBundle.MainBundle.ResourcePath); _applicationObservers = new List<NSObject>(); UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade); // Create a full-screen window _mainWindow = new UIWindow (UIScreen.MainScreen.Bounds); //_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; game.Services.AddService (typeof(UIWindow), _mainWindow); _viewController = new iOSGameViewController(this); game.Services.AddService (typeof(UIViewController), _viewController); Window = new iOSGameWindow (_viewController); _mainWindow.RootViewController = _viewController; _mainWindow.Add (_viewController.View); _viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged; Guide.Initialise(game); }
private void ConfigNavMenu() { //create the initial view controller //var rootController = (UIViewController)board.InstantiateViewController ("HomeViewController"); var rootController = new HomeViewController(); ProfileController = new ProfileViewController (); //build the shared menu JVMenuPopoverConfig.SharedInstance.MenuItems = new List<JVMenuItem>() { new JVMenuViewControllerItem() { //View exisiting view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"HomeIcon"), Title = "Home_Menu".Localize(), ViewController = rootController, }, new JVMenuViewControllerItem() { //New view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"ProfileIcon"), Title = "Profile_Menu".Localize(), ViewController = ProfileController }, new JVMenuViewControllerItem() { //New view controller, will be reused everytime the item is selected Icon = UIImage.FromBundle(@"SettingsIcon"), Title = "Settings_Menu".Localize(), ViewController = new SettingsViewController() }, new JVMenuViewControllerItem() { Icon = UIImage.FromBundle(@"AboutIcon"), Title = "About_Menu".Localize(), ViewController = new AboutViewController() }, }; //create a Nav controller an set the root controller NavigationController = new UINavigationController(rootController); //setup the window Window = new UIWindow(UIScreen.MainScreen.Bounds); Window.RootViewController = NavigationController; Window.ContentMode = UIViewContentMode.ScaleAspectFill; Window.BackgroundColor = UIColor.FromPatternImage(JVMenuHelper.ImageWithImage(UIImage.FromBundle("app_bg1.jpg"),this.Window.Frame.Width)); Window.Add(NavigationController.View); Window.MakeKeyAndVisible(); }