Пример #1
0
        public void ViewNonIntersectTest()
        {
            View a = new View(new Rectangle(30, 60, 50, 50));
            View b = new View(new Rectangle(90, 90, 50, 50));

            Assert.Equal(false, a.Contains(b.drawRect));
        }
Пример #2
0
        public void ViewMoveTest()
        {
            View a = new View(new Rectangle(30, 60, 50, 50));

            a.MoveFrame(30, 40);

            Assert.Equal(true, a.drawRect.Left == 60);
        }
Пример #3
0
        public void ViewInflateTest()
        {
            View a = new View(new Rectangle(30, 60, 50, 50));

            a.ResizeFrame(30, 40);

            Assert.Equal(true, a.drawRect.Width == 80);
        }
Пример #4
0
        public PauseMenu()
        {
            SetDrawFrame(position);
            drawTex = pauseScreenTexture;

            mute = new Button(new Rectangle(0, 0, 0, 0), muteOffTexture);
            resume = new Button(new Rectangle(0, 0, 0, 0), resumeTexture);
            restart = new Button(new Rectangle(0, 0, 0, 0), restartTex);
            nextLevel = new Button(new Rectangle(0, 0, 0, 0), nextLevelTexture);
            toTitleScreen = new Button(new Rectangle(0, 0, 0, 0), titleScreenTexture);
            pauseLabel = new View(new Rectangle(0, 0, 0, 50), pauseLabelTexture);

            this.animatedExpand(new Rectangle(0, 0, 800, 480), 15, false);

            mute.animatedExpand(new Rectangle(500, 180, 64, 64), 15, false);
            resume.animatedExpand(new Rectangle(0, 280, 256, 50), 15, false);
            restart.animatedExpand(new Rectangle(0, 350, 286, 50), 15, false);
            nextLevel.animatedExpand(new Rectangle(400, 280, 200, 100), 15, false);
            toTitleScreen.animatedExpand(new Rectangle(0, 420, 500, 50), 15, false);
            pauseLabel.animatedExpand(new Rectangle(0, 0, 800, 50), 15, false);

            flag = GameMenuFlag.NoFlag;
        }
Пример #5
0
 /// <summary>
 /// Make this object no longer the first responder.
 /// </summary>
 protected void ResignFirstResponder()
 {
     if (RegisteredFirstResponder == this)
         RegisteredFirstResponder = null;
 }
Пример #6
0
        /// <summary>
        /// Make this object the first to have a shot at responding to a touch event.
        /// </summary>
        protected void BecomeFirstResponder()
        {
            if (RegisteredFirstResponder != null) return;

            RegisteredFirstResponder = this;
        }
Пример #7
0
 public void ViewMissTest()
 {
     View a = new View(new Rectangle(30, 60, 50, 50));
     Assert.Equal(false, a.Contains(new Point(85, 90)));
 }
Пример #8
0
 public void ViewHitTest()
 {
     View a = new View(new Rectangle(30, 60, 50, 50));
     Assert.Equal(true, a.Contains(new Point(55, 90)));
 }
Пример #9
0
        public void ViewConsistencyTest()
        {
            View a = new View(new Rectangle(30, 50, 50, 50));

            Assert.Equal(true, a.Center() == new Point(55, 75));
        }