Beispiel #1
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            RectangleF rect = UIScreen.MainScreen.ApplicationFrame;

            window.BackgroundColor = UIColor.Black;

            //Create the OpenGL drawing view and add it to the window
            drawingView = new PaintingView(new RectangleF(rect.Location, rect.Size));
            window.AddSubview(drawingView);

            // Create a segmented control so that the user can choose the brush color.
            UISegmentedControl segmentedControl = new UISegmentedControl(new[] {
                UIImage.FromFile("Images/Red.png"),
                UIImage.FromFile("Images/Yellow.png"),
                UIImage.FromFile("Images/Green.png"),
                UIImage.FromFile("Images/Blue.png"),
                UIImage.FromFile("Images/Purple.png"),
            });

            // Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
            RectangleF frame = new RectangleF(rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
                                              rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);

            segmentedControl.Frame = frame;
            // When the user chooses a color, the method changeBrushColor: is called.
            segmentedControl.ValueChanged += ChangeBrushColor;
            segmentedControl.ControlStyle  = UISegmentedControlStyle.Bar;
            // Make sure the color of the color complements the black background
            segmentedControl.TintColor = UIColor.DarkGray;
            // Set the third color (index values start at 0)
            segmentedControl.SelectedSegment = 2;

            // Add the control to the window
            window.AddSubview(segmentedControl);
            // Now that the control is added, you can release it
            // [segmentedControl release];

            float r, g, b;

            // Define a starting color
            HslToRgb(2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
            // Set the color using OpenGL
            GL.Color4(r, g, b, PaintingView.BrushOpacity);


            // Look in the Info.plist file and you'll see the status bar is hidden
            // Set the style to black so it matches the background of the application
            app.SetStatusBarStyle(UIStatusBarStyle.BlackTranslucent, false);
            // Now show the status bar, but animate to the style.
            app.SetStatusBarHidden(false, true);

            //Configure and enable the accelerometer
            UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
            UIAccelerometer.SharedAccelerometer.Acceleration  += OnAccelerated;

            //Show the window
            window.MakeKeyAndVisible();

            return(true);
        }
Beispiel #2
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
       IOSPlatform.register(app, IOSPlatform.SupportedOrients.PORTRAITS);
       PlayN.run(new TrainBox());
       return true;
 }
Beispiel #3
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
     IOSPlatform.register(app, IOSPlatform.SupportedOrients.PORTRAITS);
     PlayN.run(new AlgebraGame());
     return(true);
 }
Beispiel #4
0
        // This method is invoked when the application has loaded its UI and is ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, false);

            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // load the appropriate UI, depending on whether the app is running on an iPhone or iPad
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                viewController = new OpenGLViewController("OpenGLViewController_iPhone", null);
            }
            else
            {
                viewController = new OpenGLViewController("OpenGLViewController_iPad", null);
            }
            window.RootViewController = viewController;

            ((EAGLView)(viewController.View)).Run(60.0);

            // make the window visible
            window.MakeKeyAndVisible();

            return(true);
        }
Beispiel #5
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, true);

            // configure our Flurry and SGAgent bits
            var flurryKey = "FLURRYKEY";
            // these can be useful if you have this info
            // FA.Flurry.SetAppVersion("app_version");
            // FA.Flurry.SetUserID("user_id");
            Flurry flurry = new IOSFlurry();

            try {
                Console.WriteLine("Initializing Flurry [vers=" + FA.Flurry.GetFlurryAgentVersion() + "]");
                FA.Flurry.StartSession(flurryKey);
            } catch (Exception e) {
                Console.WriteLine("Failed to init Flurry [key=" + flurryKey + "]");
                Console.WriteLine(e);
            }

            // initialize PlayN and start the game
            var pconfig = new IOSPlatform.Config();

            // use pconfig to customize iOS platform, if needed
            IOSPlatform.register(app, pconfig);
            PlayN.run(new FlurryExample(flurry));
            return(true);
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            PlatformServices.Init();

            // Code for starting up the Xamarin Test Cloud Agent
                        #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
                        #endif

            PlatformServices.UpdateVersionPreference();

                        #if DEBUG
            (null as IOnlineContextConfiguration).HttpClient(() => {
                var handler         = new HttpMessageHandlerWrapper();
                handler.RequestLog += Console.WriteLine;
                return(new HttpClient(handler));
            });
                        #endif

            LoadApplication(new App());

            app.SetStatusBarHidden(false, false);

            return(base.FinishedLaunching(app, options));
        }
Beispiel #7
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
       var pf = IOSPlatform.register(app, IOSPlatform.SupportedOrients.PORTRAITS);
       pf.assets().setPathPrefix("assets");
       PlayN.run(new MemoryGame());
       return true;
 }
Beispiel #8
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
     IOSPlatform.Config config = new IOSPlatform.Config();
     config.orients = IOSPlatform.SupportedOrients.PORTRAITS;
     IOSPlatform.register(app, config);
     PlayN.run(new PerfTest());
     return(true);
 }
Beispiel #9
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, true);
            var pf = IOSPlatform.register(app, IOSPlatform.SupportedOrients.PORTRAITS);

            pf.assets().setPathPrefix("assets");
            PlayN.run(new Box2DTest());
            return(true);
        }
Beispiel #10
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
       IOSPlatform.Config config = new IOSPlatform.Config();
       config.orients = IOSPlatform.SupportedOrients.PORTRAITS;
       IOSPlatform.register(app, config);
       PlayN.run(new PerfTest());
       return true;
 }
Beispiel #11
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
       var pconfig = new IOSPlatform.Config();
       // use pconfig to customize iOS platform, if needed
       IOSPlatform.register(app, pconfig);
       PlayN.run(new MyGame());
       return true;
 }
Beispiel #12
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, true);
            var pconfig = new IOSPlatform.Config();

            // use pconfig to customize iOS platform, if needed
            IOSPlatform.register(app, pconfig);
            PlayN.run(new Mygame());
            return(true);
        }
Beispiel #13
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     app.SetStatusBarHidden(true, true);
       IOSPlatform.Config config = new IOSPlatform.Config();
       config.orients = IOSPlatform.SupportedOrients.LANDSCAPES;
       IOSPlatform platform = IOSPlatform.register(app, config);
       IOSTPPlatform.register(platform);
       PlayN.run(new TripleDemo());
       return true;
 }
Beispiel #14
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, true);
            IOSPlatform.Config config = new IOSPlatform.Config();
            config.orients = IOSPlatform.SupportedOrients.LANDSCAPES;
            IOSPlatform platform = IOSPlatform.register(app, config);

            IOSTPPlatform.register(platform);
            PlayN.run(new TripleDemo());
            return(true);
        }
Beispiel #15
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            NSError audioError;
            AVAudioSession.SharedInstance().SetCategory (new NSString("AVAudioSessionCategoryAmbient"), out audioError);

            app.SetStatusBarHidden (true, UIStatusBarAnimation.Slide);

            _monogameGame = GetInstance ();
            _monogameGame.Run ();

            return true;
        }
Beispiel #16
0
        public override void FinishedLaunching(UIApplication app)
        {
            // Fun begins..
            game = new TestGame ();
            game.Run ();

            //[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
            //UIApplication.SharedApplication.SetStatusBarHidden (true, true);
            app.SetStatusBarHidden (true, true);
            var controller = UIApplication.SharedApplication.Windows[0].RootViewController;
            if (controller != null) {
                //controller.SetNeedsStatusBarAppearanceUpdate ();
            }
        }
Beispiel #17
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(false, true);

            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            var setup = new Setup(this, Window);

            setup.Initialize();

            var startup = Mvx.Resolve <IMvxAppStart>();

            startup.Start();

            Window.MakeKeyAndVisible();

            return(true);
        }
Beispiel #18
0
        // This method is invoked when the application has loaded its UI and is ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden (true, false);
            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // load the appropriate UI, depending on whether the app is running on an iPhone or iPad
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
                viewController = new OpenGLViewController ("OpenGLViewController_iPhone", null);
            } else {
                viewController = new OpenGLViewController ("OpenGLViewController_iPad", null);
            }
            window.RootViewController = viewController;

            ((EAGLView)(viewController.View)).Run (60.0);

            // make the window visible
            window.MakeKeyAndVisible ();

            return true;
        }
Beispiel #19
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.SetStatusBarHidden(true, false);

            m_Engine = new Engine(this);
            m_Engine.Start();

            ApplyGreenScreenStyle();

            if (window.Bounds.Width > 600)
            {
                // increase font size for iPad
                TxtMain.Font = UIFont.FromName(TxtMain.Font.Name, 18.0f);
            }

            TxtMain.OnTouchesEnded += HandleTxtMainOnTouchesEnded;

            // If you have defined a view, add it here:
            window.AddSubview(navigationController.View);

            window.MakeKeyAndVisible();

            return(true);
        }
Beispiel #20
0
    public override bool FinishedLaunching (UIApplication app, NSDictionary options) {
      app.SetStatusBarHidden(true, true);

      // configure our Flurry and SGAgent bits
      var flurryKey = "FLURRYKEY";
      // these can be useful if you have this info
      // FA.Flurry.SetAppVersion("app_version");
      // FA.Flurry.SetUserID("user_id");
      Flurry flurry = new IOSFlurry();
      try {
        Console.WriteLine("Initializing Flurry [vers=" + FA.Flurry.GetFlurryAgentVersion() + "]");
        FA.Flurry.StartSession(flurryKey);
      } catch (Exception e) {
        Console.WriteLine("Failed to init Flurry [key=" + flurryKey + "]");
        Console.WriteLine(e);
      }

      // initialize PlayN and start the game
      var pconfig = new IOSPlatform.Config();
      // use pconfig to customize iOS platform, if needed
      IOSPlatform.register(app, pconfig);
      PlayN.run(new FlurryExample(flurry));
      return true;
    }
Beispiel #21
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            //init NavigationController
            var myMoodViewController = new MyMoodViewController();

            this.navController = new UINavigationController(myMoodViewController);
            this.navController.SetNavigationBarHidden(true, false);

            if (app.RespondsToSelector(new Selector("setStatusBarHidden: withAnimation:")))
            {
                app.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);
            }
            else
            {
                app.SetStatusBarHidden(true, true);
            }

            //init db
            string version = NSBundle.MainBundle.ObjectForInfoDictionary("Version").ToString();

            db = new MyMoodViciDbContext(version, null);

            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("SyncDataAndNotifications"), "SyncDataAndNotifications", null);

            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            CheckForGoLive();

            this.ShowBadgeNumber();

            startBackgroundThread();
            var appState = ApplicationState.Current;

            if (version != appState.CurrentVersion && appState.ForceUpdate > 0)
            {
                UpdateRequiredViewController uc = new UpdateRequiredViewController();
                navController.PushViewController(uc, true);
            }
            else
            {
                if (options != null)
                {
                    NSString pId = new NSString("PromptId");
                    //Console.WriteLine("Launching with options - {0}", options);
                    var startupLocalNotification  = options.ValueForKey(UIApplication.LaunchOptionsLocalNotificationKey) as UILocalNotification;
                    var startupRemoteNotification = options.ValueForKey(UIApplication.LaunchOptionsRemoteNotificationKey);
                    if (startupLocalNotification != null && startupLocalNotification.UserInfo != null)
                    {
                        //Console.WriteLine("Local notification prompt recieved as option");
                        NSString promptId = (NSString)startupLocalNotification.UserInfo.ValueForKey(pId);
                        myMoodViewController.promptID = promptId.ToString();
                    }
                    else
                    {
                        //Console.WriteLine("Remote notification recieved as option");
                        myMoodViewController.EnteredViaRemoteNotification = true;
                    }
                }
            }
            window.RootViewController = this.navController;
            // make the window visible
            window.MakeKeyAndVisible();

            //Register for remote notifications
            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert
                                                                               | UIRemoteNotificationType.Badge
                                                                               | UIRemoteNotificationType.Sound);

            return(true);
        }
Beispiel #22
0
		public override void FinishedLaunching (UIApplication app)
		{
			RectangleF rect = UIScreen.MainScreen.ApplicationFrame;

			//Create a full-screen window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.BackgroundColor = UIColor.Black;

			//Create the OpenGL drawing view and add it to the window
			drawingView = new PaintingView (new RectangleF (rect.Location, rect.Size));
			window.AddSubview (drawingView);

			// Create a segmented control so that the user can choose the brush color.
			UISegmentedControl segmentedControl = new UISegmentedControl (new[]{
					UIImage.FromFile ("Red.png"),
					UIImage.FromFile ("Yellow.png"),
					UIImage.FromFile ("Green.png"),
					UIImage.FromFile ("Blue.png"),
					UIImage.FromFile ("Purple.png"),
			});

			// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
			RectangleF frame = new RectangleF (rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
				rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);
			segmentedControl.Frame = frame;
			// When the user chooses a color, the method changeBrushColor: is called.
			segmentedControl.ValueChanged += ChangeBrushColor;
			segmentedControl.ControlStyle = UISegmentedControlStyle.Bar;
			// Make sure the color of the color complements the black background
			segmentedControl.TintColor = UIColor.DarkGray;
			// Set the third color (index values start at 0)
			segmentedControl.SelectedSegment = 2;

			// Add the control to the window
			window.AddSubview (segmentedControl);
			// Now that the control is added, you can release it
			// [segmentedControl release];

			float r, g, b;
			// Define a starting color
			HslToRgb (2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
			// Set the color using OpenGL
			GL.Color4 (r, g, b, PaintingView.BrushOpacity);

			//Show the window
			window.MakeKeyAndVisible ();
			// Look in the Info.plist file and you'll see the status bar is hidden
			// Set the style to black so it matches the background of the application
			app.SetStatusBarStyle (UIStatusBarStyle.BlackTranslucent, false);
			// Now show the status bar, but animate to the style.
			app.SetStatusBarHidden (false, true);

			//Configure and enable the accelerometer
			UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
			UIAccelerometer.SharedAccelerometer.Acceleration += OnAccelerated;
		}
Beispiel #23
0
		// This method is invoked when the application has loaded its UI and its ready to run
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			RectangleF rect = UIScreen.MainScreen.ApplicationFrame;

			window.BackgroundColor = UIColor.Black;

			//Create the OpenGL drawing view and add it to the window
			drawingView = new PaintingView (new RectangleF (rect.Location, rect.Size));
			window.AddSubview (drawingView);

			// Create a segmented control so that the user can choose the brush color.
			var images = new[] {
				UIImage.FromFile ("Images/Red.png"),
				UIImage.FromFile ("Images/Yellow.png"),
				UIImage.FromFile ("Images/Green.png"),
				UIImage.FromFile ("Images/Blue.png"),
				UIImage.FromFile ("Images/Purple.png")
			};
			if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) {
				// we want the original colors, which is not the default iOS7 behaviour, so we need to
				// replace them with ones having the right UIImageRenderingMode
				for (int i = 0; i < images.Length; i++)
					images [i] = images [i].ImageWithRenderingMode (UIImageRenderingMode.AlwaysOriginal);
			}
			var segmentedControl = new UISegmentedControl (images);

			// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
			var frame = new RectangleF (rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
				rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);
			segmentedControl.Frame = frame;
			// When the user chooses a color, the method changeBrushColor: is called.
			segmentedControl.ValueChanged += ChangeBrushColor;
			// Make sure the color of the color complements the black background
			segmentedControl.TintColor = UIColor.DarkGray;
			// Set the third color (index values start at 0)
			segmentedControl.SelectedSegment = 2;

			// Add the control to the window
			window.AddSubview (segmentedControl);
			// Now that the control is added, you can release it
			// [segmentedControl release];

			float r, g, b;
			// Define a starting color
			HslToRgb (2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
			// Set the color using OpenGL
			GL.Color4 (r, g, b, PaintingView.BrushOpacity);

			
			// Look in the Info.plist file and you'll see the status bar is hidden
			// Set the style to black so it matches the background of the application
			app.SetStatusBarStyle (UIStatusBarStyle.Default, false);
			// Now show the status bar, but animate to the style.
			app.SetStatusBarHidden (false, true);

			//Configure and enable the accelerometer
			UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
			UIAccelerometer.SharedAccelerometer.Acceleration += OnAccelerated;
			
			//Show the window
			window.MakeKeyAndVisible ();
	
			return true;
		}
Beispiel #24
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            CGRect rect = UIScreen.MainScreen.ApplicationFrame;

            window.BackgroundColor = UIColor.Black;

            //Create the OpenGL drawing view and add it to the window
            drawingView = new PaintingView(new CGRect(rect.Location, rect.Size));
            window.AddSubview(drawingView);

            // Create a segmented control so that the user can choose the brush color.
            var images = new[] {
                UIImage.FromFile("Images/Red.png"),
                UIImage.FromFile("Images/Yellow.png"),
                UIImage.FromFile("Images/Green.png"),
                UIImage.FromFile("Images/Blue.png"),
                UIImage.FromFile("Images/Purple.png")
            };

            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                // we want the original colors, which is not the default iOS7 behaviour, so we need to
                // replace them with ones having the right UIImageRenderingMode
                for (int i = 0; i < images.Length; i++)
                {
                    images [i] = images [i].ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);
                }
            }
            var segmentedControl = new UISegmentedControl(images);

            // Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
            var frame = new CGRect(rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
                                   rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);

            segmentedControl.Frame = frame;
            // When the user chooses a color, the method changeBrushColor: is called.
            segmentedControl.ValueChanged += ChangeBrushColor;
            // Make sure the color of the color complements the black background
            segmentedControl.TintColor = UIColor.DarkGray;
            // Set the third color (index values start at 0)
            segmentedControl.SelectedSegment = 2;

            // Add the control to the window
            window.AddSubview(segmentedControl);
            // Now that the control is added, you can release it
            // [segmentedControl release];

            float r, g, b;

            // Define a starting color
            HslToRgb(2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
            // Set the color using OpenGL
            GL.Color4(r, g, b, PaintingView.BrushOpacity);

            // Look in the Info.plist file and you'll see the status bar is hidden
            // Set the style to black so it matches the background of the application
            app.SetStatusBarStyle(UIStatusBarStyle.Default, false);
            // Now show the status bar, but animate to the style.
            app.SetStatusBarHidden(false, true);

            //Configure and enable the accelerometer
            UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
            UIAccelerometer.SharedAccelerometer.Acceleration  += OnAccelerated;

            //Show the window
            window.MakeKeyAndVisible();

            return(true);
        }