コード例 #1
0
 public InstructionsScreen()
 {
     textBox = new Rectangle();
     OkButton = new Button();
     Hand = new HandCursor();
     WrapTexter = false;
 }
コード例 #2
0
 public PhotographsScreen(List<byte[]> colorDataList, int score)
 {
     this.colorDataList = colorDataList;
     saveButton = new Button();
     nextButton = new Button();
     hand = new HandCursor();
     playerScore = score;
 }
コード例 #3
0
 public override void Initialize()
 {
     showAvatar = true;
     button = new Button();
     hand = new HandCursor();
     hand.Initialize(ScreenManager.Kinect);
     button.Initialize("Buttons/OK", this.ScreenManager.Kinect, new Vector2(620, 500));
     button.Clicked += new Button.ClickedEventHandler(button_Clicked);
     avatars = new Texture2D[4];
     base.Initialize();
 }
コード例 #4
0
        public override void Initialize()
        {
            showAvatar = true;
            newGame = new Button();
            instructions = new Button();
            highscores = new Button();
            exit = new Button();
            Hand = new HandCursor();
            kinect = ScreenManager.Kinect;
            Hand.Initialize(ScreenManager.Kinect);
            newGame.Clicked += new Button.ClickedEventHandler(newGame_Clicked);
            instructions.Clicked += new Button.ClickedEventHandler(instructions_Clicked);
            highscores.Clicked += new Button.ClickedEventHandler(highscores_Clicked);
            exit.Clicked += new Button.ClickedEventHandler(exit_Clicked);

            base.Initialize();
        }
コード例 #5
0
 public override void Initialize()
 {
     showAvatar = true;
     virusBar = new Bar(100, 950, 15, 270, 30);
     rightSwordBounds = new Rectangle(0, 400, 80, 80);
     leftSwordBounds = new Rectangle(1350, 400, 80, 80);
     shields = new Texture2D[4];
     shieldBounds = new Rectangle[4];
     shieldBounds[0] = new Rectangle(590, -80, 80, 80);
     shieldBounds[2] = new Rectangle(590, 720, 80, 80);
     shieldBounds[1] = new Rectangle(-90, 500, 80, 80);
     shieldBounds[3] = new Rectangle(1304, 500, 80, 80);
     cam = new Camera2D(ScreenManager);
     cam.Initialize();
     cam.Focus = new Vector2(640, 360);
     cam.Position = new Vector2(500.0f, 200.0f);
     button = new Button();
     hand = new HandCursor();
     hand.Initialize(ScreenManager.Kinect);
     button.Initialize("Buttons/OK", this.ScreenManager.Kinect, new Vector2(820, 100));
     button.Clicked += new Button.ClickedEventHandler(button_Clicked);
     base.Initialize();
 }
コード例 #6
0
        public override void Initialize()
        {
            scores.AddRange(System.IO.File.ReadAllLines("Text/HighScores.txt"));

            OKButton = new Button();
            OKButton.Initialize("Buttons/OK", this.ScreenManager.Kinect, new Vector2(1050, 330));
            buttons.Add(OKButton);
            OKButton.Clicked += new Button.ClickedEventHandler(OKButton_Clicked);

            if (CheckScore(score))
            {
                InitializeButtons();

                text = "                          CONGRATULATIONS ! \n YOU MADE IT INTO TOP 10 ! PLEASE ENTER YOUR NAME :\n\n" +
                    "                         YOUR SCORE IS: " + score;
            }
            else
            {
                text = "                                SORRY ! \n           YOU DID NOT MAKE IT INTO THE TOP 10 \n\n" +
                    "                        YOUR SCORE IS: " + score;
            }

            hand.Initialize(ScreenManager.Kinect);
            base.Initialize();
        }
コード例 #7
0
        public void InitializeButtons()
        {
            #region Letter Buttons
            Kinect.Kinect Kinect = this.ScreenManager.Kinect;

            A = new Button();
            B = new Button();
            C = new Button();
            D = new Button();
            E = new Button();
            F = new Button();
            G = new Button();
            H = new Button();
            I = new Button();
            J = new Button();
            K = new Button();
            L = new Button();
            M = new Button();
            N = new Button();
            O = new Button();
            P = new Button();
            Q = new Button();
            R = new Button();
            S = new Button();
            T = new Button();
            U = new Button();
            V = new Button();
            W = new Button();
            X = new Button();
            Y = new Button();
            Z = new Button();

            buttons.Add(A);
            buttons.Add(B);
            buttons.Add(C);
            buttons.Add(D);
            buttons.Add(E);
            buttons.Add(F);
            buttons.Add(G);
            buttons.Add(H);
            buttons.Add(I);
            buttons.Add(J);
            buttons.Add(K);
            buttons.Add(L);
            buttons.Add(M);
            buttons.Add(N);
            buttons.Add(O);
            buttons.Add(P);
            buttons.Add(Q);
            buttons.Add(R);
            buttons.Add(S);
            buttons.Add(T);
            buttons.Add(U);
            buttons.Add(V);
            buttons.Add(W);
            buttons.Add(X);
            buttons.Add(Y);
            buttons.Add(Z);

            A.Clicked += new Button.ClickedEventHandler(A_Clicked);
            B.Clicked += new Button.ClickedEventHandler(B_Clicked);
            C.Clicked += new Button.ClickedEventHandler(C_Clicked);
            D.Clicked += new Button.ClickedEventHandler(D_Clicked);
            E.Clicked += new Button.ClickedEventHandler(E_Clicked);
            F.Clicked += new Button.ClickedEventHandler(F_Clicked);
            G.Clicked += new Button.ClickedEventHandler(G_Clicked);
            H.Clicked += new Button.ClickedEventHandler(H_Clicked);
            I.Clicked += new Button.ClickedEventHandler(I_Clicked);
            J.Clicked += new Button.ClickedEventHandler(J_Clicked);
            K.Clicked += new Button.ClickedEventHandler(K_Clicked);
            L.Clicked += new Button.ClickedEventHandler(L_Clicked);
            M.Clicked += new Button.ClickedEventHandler(M_Clicked);
            N.Clicked += new Button.ClickedEventHandler(N_Clicked);
            O.Clicked += new Button.ClickedEventHandler(O_Clicked);
            P.Clicked += new Button.ClickedEventHandler(P_Clicked);
            Q.Clicked += new Button.ClickedEventHandler(Q_Clicked);
            R.Clicked += new Button.ClickedEventHandler(R_Clicked);
            S.Clicked += new Button.ClickedEventHandler(S_Clicked);
            T.Clicked += new Button.ClickedEventHandler(T_Clicked);
            U.Clicked += new Button.ClickedEventHandler(U_Clicked);
            V.Clicked += new Button.ClickedEventHandler(V_Clicked);
            W.Clicked += new Button.ClickedEventHandler(W_Clicked);
            X.Clicked += new Button.ClickedEventHandler(X_Clicked);
            Y.Clicked += new Button.ClickedEventHandler(Y_Clicked);
            Z.Clicked += new Button.ClickedEventHandler(Z_Clicked);

            A.Initialize("Buttons/A", Kinect, new Vector2(317, 270));
            B.Initialize("Buttons/B", Kinect, new Vector2(A.Position.X + 80, A.Position.Y));
            C.Initialize("Buttons/C", Kinect, new Vector2(B.Position.X + 80, A.Position.Y));
            D.Initialize("Buttons/D", Kinect, new Vector2(C.Position.X + 80, A.Position.Y));
            E.Initialize("Buttons/E", Kinect, new Vector2(D.Position.X + 80, A.Position.Y));
            F.Initialize("Buttons/F", Kinect, new Vector2(E.Position.X + 80, A.Position.Y));
            G.Initialize("Buttons/G", Kinect, new Vector2(F.Position.X + 80, A.Position.Y));
            H.Initialize("Buttons/H", Kinect, new Vector2(G.Position.X + 80, A.Position.Y));
            I.Initialize("Buttons/I", Kinect, new Vector2(H.Position.X + 80, A.Position.Y));

            J.Initialize("Buttons/J", Kinect, new Vector2(A.Position.X, A.Position.Y + 100));
            K.Initialize("Buttons/K", Kinect, new Vector2(A.Position.X + 80, J.Position.Y));
            L.Initialize("Buttons/L", Kinect, new Vector2(B.Position.X + 80, J.Position.Y));
            M.Initialize("Buttons/M", Kinect, new Vector2(C.Position.X + 80, J.Position.Y));
            N.Initialize("Buttons/N", Kinect, new Vector2(D.Position.X + 80, J.Position.Y));
            O.Initialize("Buttons/O", Kinect, new Vector2(E.Position.X + 80, J.Position.Y));
            P.Initialize("Buttons/P", Kinect, new Vector2(F.Position.X + 80, J.Position.Y));
            Q.Initialize("Buttons/Q", Kinect, new Vector2(G.Position.X + 80, J.Position.Y));
            R.Initialize("Buttons/R", Kinect, new Vector2(H.Position.X + 80, J.Position.Y));

            S.Initialize("Buttons/S", Kinect, new Vector2(J.Position.X + 40, J.Position.Y + 100));
            T.Initialize("Buttons/T", Kinect, new Vector2(S.Position.X + 80, S.Position.Y));
            U.Initialize("Buttons/U", Kinect, new Vector2(T.Position.X + 80, S.Position.Y));
            V.Initialize("Buttons/V", Kinect, new Vector2(U.Position.X + 80, S.Position.Y));
            W.Initialize("Buttons/W", Kinect, new Vector2(V.Position.X + 80, S.Position.Y));
            X.Initialize("Buttons/X", Kinect, new Vector2(W.Position.X + 80, S.Position.Y));
            Y.Initialize("Buttons/Y", Kinect, new Vector2(X.Position.X + 80, S.Position.Y));
            Z.Initialize("Buttons/Z", Kinect, new Vector2(Y.Position.X + 80, S.Position.Y));

            #endregion
        }
コード例 #8
0
        private void f(GCore.Sprite parent, XmlNode node)
        {
            //Console.WriteLine("Function f " + node.Name);
            foreach (XmlNode table in node.ChildNodes)
            {
                float x      = rf(table.Attributes["x"]);
                float y      = rf(table.Attributes["y"]);
                float width  = rf(table.Attributes["width"]);
                float height = rf(table.Attributes["height"]);
                switch (table.Name)
                {
                case "img":
                {
                    GCore.Bitmap b = new GCore.Bitmap();
                    b.load(rs(table.Attributes["src"]));
                    b.x     = x;
                    b.y     = y;
                    b.ratio = rb(table.Attributes["ratio"], true);
                    if (width != 0 && height != 0)
                    {
                        b.width  = width;
                        b.height = height;
                    }
                    keeper.add(parent, b);
                } break;

                case "button":
                {
                    UI.Button b = new UI.Button();
                    b.x  = x;
                    b.y  = y;
                    b.id = rs(table.Attributes["id"]);
                    List <string> imgs = new List <string>();
                    foreach (XmlNode img in table.ChildNodes)
                    {
                        imgs.Add(img.Attributes["src"].Value);
                    }
                    b.load(imgs.ToArray());
                    keeper.add(b, GCore.MouseEvent.CLICK, onClick);
                    keeper.add(parent, b);
                } break;

                case "movieclip":
                {
                    GCore.MovieClip m = new GCore.MovieClip();
                    m.x         = x;
                    m.y         = y;
                    m.frameRate = 1;        // ri(table.Attributes["frameRate"], 20);
                    List <string> imgs = new List <string>();
                    foreach (XmlNode img in table.ChildNodes)
                    {
                        imgs.Add(img.Attributes["src"].Value);
                    }
                    m.load(imgs.ToArray());
                    keeper.add(parent, m);
                } break;

                case "textfield":
                {
                    String          value = table.Attributes["value"].Value;
                    GCore.TextField tf    = new GCore.TextField(value);
                    tf.x = x;
                    tf.y = y;
                    if (table.Attributes["size"] != null)
                    {
                        int size = Int32.Parse(table.Attributes["size"].Value);
                        tf.size = size;
                    }
                    keeper.add(parent, tf);
                } break;

                case "plane":
                {
                    GCore.Sprite sp = new GCore.Sprite();
                    sp.x = x;
                    sp.y = y;
                    keeper.add(parent, sp);
                    f(sp, table);
                } break;
                }
            }
        }