Beispiel #1
0
        private void AuthenticationForm()
        {
            var frm = new Form("authentication");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480)
                          {BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies)};
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Authentication is Required", _fntHuge, frm.Width / 2 - 175, frm.Height/2 - 5) { Color = Gadgeteer.Color.Red };
            pnl.AddControl(title);

            rfid.CardIDRecieved += (sender, id) =>
                                       {
                                           title.Text = "Welcome back, Mr. Lee.";
                                           Thread.Sleep(2000);
                                           ZombieCannonRemoteForm();
                                       };
            TinkrCore.ActiveContainer = frm;
        }
Beispiel #2
0
        private void ZombieTwitForm()
        {
            var tweets = new[]{
                                    @"@zombieHunter Zombies are coming!"
                                    , @"@zombieHunter Zombies are getting closer!"
                                    , @"@zombieHunter THEY'RE HERE!!!"
                                    , @"@zombieHunter Send the Gadgets!!!"
                                    , @"@zombieHunter Tell my wife and kids..."
                                    , @"@zombieHunter ...I'll eat them later!"
                                };

            var frm = new Form("zombie twit");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480);
            pnl.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies);
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Zombie Twit", _fntHuge, frm.Width / 2 - 100, 50) { Color = Gadgeteer.Color.Yellow };
            pnl.AddControl(title);

            // Add a listbox
            var lb = new Listbox("lb1", _fntArialBold11, frm.Width / 2 - 200, frm.Height / 2 - 100, 400, 200, null);
            pnl.AddControl(lb);

            TinkrCore.ActiveContainer = frm;

            byte lastTweet = 0;
            var timer = new GT.Timer(2000);
            timer.Tick += timer1 =>
                              {
                                  if(lastTweet >= tweets.Length)
                                  {
                                      timer.Stop();
                                      return;
                                  }
                                  //lb.InsertAt(tweets[lastTweet++], 1);
                                  lb.AddItem(tweets[lastTweet++]);
                              };
            timer.Start();
        }
Beispiel #3
0
        private void ZombieDistractorForm()
        {
            const int gameWidth = 320;
            const int gameHeight = 240;

            var frm = new Form("zombie distractor");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480);
            pnl.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies);
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Zombie Distractor", _fntHuge, frm.Width / 2 - 140, 30) { Color = Gadgeteer.Color.Yellow };
            pnl.AddControl(title);

            TinkrCore.ActiveContainer = frm;

            // Add Pacman.
            var surface = TinkrCore.Screen;
            _pacmanGame = new PacmanGame(surface, frm.Width/2 - gameWidth/2, frm.Height/2 - gameHeight/2);
            _pacmanGame.InputManager.AddInputProvider(new GhiJoystickInputProvider(joystick));
            _pacmanGame.Initialize();
        }
Beispiel #4
0
        private void ZombieHealthMonitorForm()
        {
            var frm = new Form("zombie health monitor");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480);
            pnl.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies);
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Zombie Health Monitor", _fntHuge, frm.Width / 2 - 140, 30) { Color = Gadgeteer.Color.Yellow };
            pnl.AddControl(title);

            // Add Heart Rate Graph.
            var graph = new Picturebox("heartRateGraph", null, 100, 200, 600, 200);
               pnl.AddControl(graph);

            TinkrCore.ActiveContainer = frm;
        }
Beispiel #5
0
        private void ZombieCannonRemoteForm()
        {
            var frm = new Form("zombie cannon remote");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480);
            pnl.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies);
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Zombie Cannon Remote", _fntHuge, frm.Width/2 - 175, 30)
                            {Color = Gadgeteer.Color.Yellow};
            pnl.AddControl(title);

            // Add a fire button.
            //var pic1 = new Picturebox("launchBtn", Resources.GetBitmap(Resources.BitmapResources.LaunchButton), frm.Width / 2 - 150, frm.Height/2 - 150, 300, 300);
            //pic1.ButtonPressed += (sender, id) => Debug.Print("FIRE!");
            //pnl.AddControl(pic1);
            var pic1 = new Skewworks.Tinkr.Controls.Panel("launchBtn",frm.Width / 2 - 150, frm.Height/2 - 150, 300, 300);
            pic1.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.LaunchButton);
            pic1.Tap += (sender, id) => Debug.Print("FIRE!");
            pnl.AddControl(pic1);

            TinkrCore.ActiveContainer = frm;
        }