Example #1
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;
 }
Example #2
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;
 }
Example #3
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;
 }
Example #4
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;
 }
Example #5
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;
 }
Example #6
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;
        }
Example #7
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 ();
            }
        }
Example #8
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;
        }
Example #9
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;
    }
Example #10
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;
		}
Example #11
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;
		}