/// <summary>
 /// Populate values from the base palette.
 /// </summary>
 public void PopulateFromBase()
 {
     // Populate only the designated styles
     Generic.PopulateFromBase(PaletteButtonSpecStyle.Generic);
     Close.PopulateFromBase(PaletteButtonSpecStyle.Close);
     Context.PopulateFromBase(PaletteButtonSpecStyle.Context);
     Next.PopulateFromBase(PaletteButtonSpecStyle.Next);
     Previous.PopulateFromBase(PaletteButtonSpecStyle.Previous);
     ArrowLeft.PopulateFromBase(PaletteButtonSpecStyle.ArrowLeft);
     ArrowRight.PopulateFromBase(PaletteButtonSpecStyle.ArrowRight);
     ArrowUp.PopulateFromBase(PaletteButtonSpecStyle.ArrowUp);
     ArrowDown.PopulateFromBase(PaletteButtonSpecStyle.ArrowDown);
     DropDown.PopulateFromBase(PaletteButtonSpecStyle.DropDown);
     PinVertical.PopulateFromBase(PaletteButtonSpecStyle.PinVertical);
     PinHorizontal.PopulateFromBase(PaletteButtonSpecStyle.PinHorizontal);
     FormClose.PopulateFromBase(PaletteButtonSpecStyle.FormClose);
     FormMax.PopulateFromBase(PaletteButtonSpecStyle.FormMax);
     FormMin.PopulateFromBase(PaletteButtonSpecStyle.FormMin);
     FormRestore.PopulateFromBase(PaletteButtonSpecStyle.FormRestore);
     PendantClose.PopulateFromBase(PaletteButtonSpecStyle.PendantClose);
     PendantRestore.PopulateFromBase(PaletteButtonSpecStyle.PendantRestore);
     PendantMin.PopulateFromBase(PaletteButtonSpecStyle.PendantMin);
     PendantRestore.PopulateFromBase(PaletteButtonSpecStyle.PendantRestore);
     WorkspaceMaximize.PopulateFromBase(PaletteButtonSpecStyle.WorkspaceMaximize);
     WorkspaceRestore.PopulateFromBase(PaletteButtonSpecStyle.WorkspaceRestore);
     RibbonMinimize.PopulateFromBase(PaletteButtonSpecStyle.RibbonMinimize);
     RibbonExpand.PopulateFromBase(PaletteButtonSpecStyle.RibbonExpand);
 }
コード例 #2
0
 private void ImageArrowRight_Tapped(object sender, EventArgs e)
 {
     if (((View)sender).IsVisible && !((ArrowLeft.AnimationIsRunning("ScaleTo") || ArrowRight.AnimationIsRunning("ScaleTo"))))
     {
         OnLeftSwipe();
     }
 }
コード例 #3
0
        public override void Update(GameTime gameTime)
        {
            if (MenuIndex == 1 && TheLastSliceGame.InputManager.IsInputPressed(Keys.Up))
            {
                MenuIndex           = 0;
                ArrowLeft.Position  = new Vector2(ArrowLeftX0, ArrowY0);
                ArrowRight.Position = new Vector2(ArrowRightX0, ArrowY0);
            }
            else if (MenuIndex == 0 && TheLastSliceGame.InputManager.IsInputPressed(Keys.Down))
            {
                MenuIndex           = 1;
                ArrowLeft.Position  = new Vector2(ArrowLeftX1, ArrowY1);
                ArrowRight.Position = new Vector2(ArrowRightX1, ArrowY1);
            }
            else if (TheLastSliceGame.InputManager.IsInputPressed(Keys.Enter))
            {
                if (MenuIndex == 0)
                {
                    TheLastSliceGame.Instance.ChangeState(GameState.NewGame);
                }
                else if (MenuIndex == 1)
                {
                    TheLastSliceGame.Instance.ChangeState(GameState.Menu, UIType.MainMenu);
                }
            }

            Frog.Update(gameTime);
            ArrowLeft.Update(gameTime);
            ArrowRight.Update(gameTime);
            Menu.Update(gameTime);
        }
コード例 #4
0
ファイル: Textures.cs プロジェクト: ununian/WPFLight
 public static void Dispose()
 {
     Background.Dispose();
     ArrowUp.Dispose();
     ArrowDown.Dispose();
     ArrowLeft.Dispose();
     ArrowRight.Dispose();
 }
コード例 #5
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Background, new Vector2(0, 0), Color.White);

            ArrowLeft.Draw(spriteBatch);
            ArrowRight.Draw(spriteBatch);
            Menu.Draw(spriteBatch);
        }
コード例 #6
0
        public override void Update(GameTime gameTime)
        {
            //"Chief, let's see if we can find a way to open this door." - Cortana
            if (!HasInputScore)
            {
                if (TheLastSliceGame.Instance.IsUserLoggedIn() && !HasLoggedOut)
                {
                    TheLastSliceGame.Instance.GameService.Logout();
                    HasLoggedOut = true;
                }

                if (gameTime.TotalGameTime.TotalMilliseconds > CursorTimerMS.TotalMilliseconds)
                {
                    ShowCursor    = !ShowCursor;
                    CursorTimerMS = TimeSpan.FromMilliseconds(gameTime.TotalGameTime.TotalMilliseconds + 500);
                }

                if (!String.IsNullOrEmpty(Initials) && Initials.Count() <= 3 && TheLastSliceGame.InputManager.IsInputPressed(Keys.Back))
                {
                    Initials = Initials.Remove(Initials.Length - 1);
                }

                if (Initials.Count() < 3)
                {
                    Vector2 vector = Name.MeasureString(Initials);
                    foreach (Keys key in ValidKeys)
                    {
                        if (TheLastSliceGame.InputManager.IsInputPressed(key))
                        {
                            Initials += key.ToString();
                            break;
                        }
                    }
                }
                else
                {
                    if (CustomWinStrings.Count() == 0 && TheLastSliceGame.InputManager.IsInputPressed(Keys.Enter))
                    {
                        TheLastSliceGame.Instance.GameWinAsync();
                        HasInputScore = true;
                    }
                }
            }
            else
            {
                if (TheLastSliceGame.Instance.IsUserLoggedIn() && !Posted)
                {
                    TheLastSliceGame.Instance.PostScoreAsync(LastPlayerScore.ToString(), Initials);
                    Posted = true;
                    TheLastSliceGame.Instance.AppInsights.PostScoreSuccess();
                }
            }

            ArrowLeft.Update(gameTime);
            ArrowRight.Update(gameTime);
            Menu.Update(gameTime);
        }
コード例 #7
0
 public void Draw()
 {
     spriteBatch.Draw(TraceCardList[index], new Vector2(0, 0), null, Color.White, 0,
                      new Vector2(0, 0), 1f, SpriteEffects.None, 0);
     HomeButton.Draw();
     ArrowRight.Draw();
     ArrowLeft.Draw();
     ClearButton.Draw();
     Drawable.Draw();
 }
コード例 #8
0
        public override void Update(GameTime time)
        {
            if (TheLastSliceGame.InputManager.IsInputPressed(Keys.Enter))
            {
                TheLastSliceGame.Instance.ChangeState(GameState.Menu, UIType.MainMenu);
            }

            SnakeInTheBox.Update(time);
            ArrowLeft.Update(time);
            ArrowRight.Update(time);
        }
コード例 #9
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            TheLastSliceGame.Instance.IsMouseVisible = false;
            if (CustomWinStrings.Count > 0)
            {
                if (TheLastSliceGame.Instance.GameService.IsSuccessStatusCode)
                {
                    DrawStrings(spriteBatch, CustomWinStrings.ToArray(), YouWin, 150, 40);
                }
                else
                {
                    YouWinString[0]  = CustomWinStrings[0].Replace("\"", "") + "#" + TryAgain;
                    Posted           = false;
                    Initials         = "";
                    HasInputScore    = false;
                    CustomWinStrings = new List <String>();
                }
            }
            else
            {
                DrawStrings(spriteBatch, YouWinString, YouWin, 50, 40);

                // spriteBatch.DrawString(Text, "Score: " + LastPlayerScore, new Vector2(TheLastSliceGame.GameWidth / 2 - 60, 140), ColorYellow);

                DrawStrings(spriteBatch, EnterNameString, YouWin, 200, 40);
                if (!HasInputScore && Initials.Count() >= 3)
                {
                    ArrowLeft.Draw(spriteBatch);
                    ArrowRight.Draw(spriteBatch);
                    Menu.Draw(spriteBatch);
                }
                if (HasInputScore && !TheLastSliceGame.Instance.IsUserLoggedIn())
                {
                    DrawStrings(spriteBatch, LoginString, YouWin, 500, 40);
                }

                int xPos = TheLastSliceGame.Instance.GameWidth / 2 - 110;
                for (int i = 0; i < Initials.Count(); i++)
                {
                    spriteBatch.DrawString(Name, Initials.ElementAt(i).ToString(), new Vector2(xPos, 340), Color.White);
                    if (i < 2)
                    {
                        xPos += 88;
                    }
                }

                if (ShowCursor)
                {
                    spriteBatch.DrawString(Name, "_", new Vector2(xPos, 350), Color.White);
                }
            }
        }
コード例 #10
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            //All your base are belong to us - H.E.%
            TheLastSliceGame.Instance.IsMouseVisible = true;

            spriteBatch.Draw(Background, new Vector2(0, 0), Color.White);
            spriteBatch.DrawString(GameOver, GameOverText, new Vector2(GameOverX, GameOverY), Color.White);
            spriteBatch.DrawString(Text, NoTipForYouText, new Vector2(NoTipForYouX, NoTipForYouY), Color.White);
            spriteBatch.Draw(Bubble, new Vector2(BubbleX, BubbleY), Color.White);

            if (GameOverReason == GameOverReason.WrongDelivery || GameOverReason == GameOverReason.Win || GameOverReason == GameOverReason.WrongDeliveryFrog)
            {
                DrawBubbleText(WrongDeliveryMessages[WrongDeliveryMessageNumber], spriteBatch);
            }
            else if (GameOverReason == GameOverReason.DeathByPaperBoy)
            {
                DrawBubbleText(PaperMessages[PaperMessageNumber], spriteBatch);
            }
            else if (GameOverReason == GameOverReason.Death)
            {
                DrawBubbleText(DeathMessages[DeathMessageNumber], spriteBatch);
            }
            else if (GameOverReason == GameOverReason.Gas)
            {
                DrawBubbleText(OutOfGasMessages[OutOfGasMessageNumber], spriteBatch);
            }

            ArrowLeft.Draw(spriteBatch);
            ArrowRight.Draw(spriteBatch);

            if (Frog.AnimationManager.Animation.CurrentFrame == 3)
            {
                Vector2 newFrogPos = new Vector2(Frog.Position.X - 5, Frog.Position.Y);
                Frog.Position = newFrogPos;
                Frog.AnimationManager.Position = newFrogPos;
            }

            int scoreXPos = MenuXCenter - (5 * Score.ToString().Length - 1);

            spriteBatch.DrawString(Text, "Score: " + Score.ToString(), new Vector2(scoreXPos - 40, 325), Color.White);

            if (Frog.Position.X < 0)
            {
                Frog.Position = new Vector2(TheLastSliceGame.Instance.GameWidth, 375);
            }

            Frog.Draw(spriteBatch);
            Menu.Draw(spriteBatch);
        }
コード例 #11
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Background, new Vector2(0, 0), Color.White);
            spriteBatch.Draw(Leaderboard, new Vector2(TheLastSliceGame.Instance.GameWidth / 2 - Leaderboard.Width / 2, 25), Color.White);

            int yPos             = 100;
            int numEntriesToShow = (LeaderboardList.Count <= 10) ? LeaderboardList.Count : 10;
            int yOffset          = 10;

            for (int i = 0; i < numEntriesToShow; i++)
            {
                LeaderboardEntry entry = LeaderboardList[i];
                spriteBatch.DrawString(Text, entry.Initials, new Vector2(200, yPos), ColorYellow);
                if (entry.Challenge1 != null)
                {
                    spriteBatch.Draw(entry.Challenge1, new Vector2(300, yPos - yOffset), Color.White);
                }

                if (entry.Challenge2 != null)
                {
                    spriteBatch.Draw(entry.Challenge2, new Vector2(400, yPos - yOffset), Color.White);
                }

                if (entry.Challenge3 != null)
                {
                    spriteBatch.Draw(entry.Challenge3, new Vector2(500, yPos - yOffset), Color.White);
                }
                yPos += 40;
            }

            if (SnakeInTheBox.AnimationManager.Animation.CurrentFrame % 2 == 0)
            {
                Vector2 newSnakePos = new Vector2(SnakeInTheBox.Position.X + 1, SnakeInTheBox.Position.Y);
                SnakeInTheBox.Position = newSnakePos;
                SnakeInTheBox.AnimationManager.Position = newSnakePos;
            }

            if (SnakeInTheBox.Position.X < TheLastSliceGame.Instance.GameWidth)
            {
                SnakeInTheBox.Draw(spriteBatch);
            }

            ArrowLeft.Draw(spriteBatch);
            ArrowRight.Draw(spriteBatch);
            spriteBatch.Draw(Exit, new Vector2(TheLastSliceGame.Instance.GameWidth / 2 - Exit.Width / 2, 525), Color.White);
        }
コード例 #12
0
        // Изменяем инфу в соответствии с выбранной записью
        private void picker_entries_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!(sender is Picker picker))
            {
                return;
            }
            _currentPosition = picker.SelectedIndex;

            foreach (var child in Root.Children)
            {
                if (!(child is Grid))
                {
                    continue;
                }
                var grid = child as Grid;
                for (var i = 0; i < grid.RowDefinitions.Count; i++)
                {
                    var definiton      = ((Label)((StackLayout)grid.Children.Where(x => Grid.GetRow(x) == i && Grid.GetColumn(x) == 0).ToList()[0]).Children.ToList()[0]).Text;
                    var columnProperty = _columnProperties.Find(x => x.DESCRIPTION == definiton);
                    ChangeInfo(((StackLayout)grid.Children.Where(x => Grid.GetRow(x) == i && Grid.GetColumn(x) == 1).ToList()[0]).Children.ToList()[0],
                               _columnProperties.IndexOf(columnProperty), columnProperty);
                }
            }
            if (_currentPosition == 0)
            {
                ArrowRight.FadeTo(1, 0);
                ArrowLeft.FadeTo(0, 0);
            }
            else if (_currentPosition == _tableRows.Count - 1)
            {
                ArrowRight.FadeTo(0, 0);
                ArrowLeft.FadeTo(1, 0);
            }
            else
            {
                ArrowRight.FadeTo(1, 0);
                ArrowLeft.FadeTo(1, 0);
            }
        }
コード例 #13
0
ファイル: VisualTabRenderers.cs プロジェクト: nlhans/Triton
        public void DrawScrollButtons(Graphics g, Rectangle bounds, Point Mouselocation, Point MouseClicking, bool Cross, bool Enabled)
        {
            Rectangle Arrows = GenerateArrowBounds(bounds, Cross);

            Arrows = new Rectangle(Arrows.X, Arrows.Y, Arrows.Width, bounds.Height);
            g.FillRectangle(SystemBrushes.Control, Arrows);

            PushButtonState state_left  = PushButtonState.Normal;
            PushButtonState state_right = PushButtonState.Normal;

            if (ArrowLeft.Contains(Mouselocation))
            {
                state_left = PushButtonState.Hot;
            }
            if (ArrowRight.Contains(Mouselocation))
            {
                state_right = PushButtonState.Hot;
            }
            if (ArrowLeft.Contains(MouseClicking))
            {
                state_left = PushButtonState.Pressed;
            }
            if (ArrowRight.Contains(MouseClicking))
            {
                state_right = PushButtonState.Pressed;
            }
            if (!Enabled)
            {
                state_left  = PushButtonState.Disabled;
                state_right = PushButtonState.Disabled;
            }
            ButtonRenderer.DrawButton(g, ArrowLeft, state_left);
            ButtonRenderer.DrawButton(g, ArrowRight, state_right);
            g.DrawString("<", SystemFonts.DialogFont, SystemBrushes.ControlText, new Point(arrow_left.X + 3, arrow_left.Y + 3));
            g.DrawString(">", SystemFonts.DialogFont, SystemBrushes.ControlText, new Point(arrow_right.X + 3, arrow_right.Y + 3));
        }
コード例 #14
0
        public override void Update(GameTime time)
        {
            if (TransitionTimer != TimeSpan.Zero)
            {
                if (time.TotalGameTime.TotalMilliseconds > TransitionTimer.TotalMilliseconds)
                {
                    if (MenuIndex == 0)
                    {
                        TheLastSliceGame.Instance.ChangeState(GameState.NewGame);
                    }
                    else if (MenuIndex == 1)
                    {
                        TheLastSliceGame.Instance.ChangeState(GameState.Menu, UIType.Leaderboard);
                    }
                    TransitionTimer = TimeSpan.Zero;
                }
            }
            else
            {
                KeyboardState keyboardState = Keyboard.GetState();
                if (TheLastSliceGame.InputManager.IsInputPressed(Keys.Up))
                {
                    if (MenuIndex == 1)
                    {
                        MenuIndex           = 0;
                        ArrowLeft.Position  = new Vector2(ArrowLeftX0, ArrowY0);
                        ArrowRight.Position = new Vector2(ArrowRightX0, ArrowY0);
                    }
                    else if (MenuIndex == 2)
                    {
                        MenuIndex           = 1;
                        ArrowLeft.Position  = new Vector2(ArrowLeftX1, ArrowY1);
                        ArrowRight.Position = new Vector2(ArrowRightX1, ArrowY1);
                    }
                }
                else if (TheLastSliceGame.InputManager.IsInputPressed(Keys.Down))
                {
                    if (MenuIndex == 0)
                    {
                        MenuIndex           = 1;
                        ArrowLeft.Position  = new Vector2(ArrowLeftX1, ArrowY1);
                        ArrowRight.Position = new Vector2(ArrowRightX1, ArrowY1);
                    }
                    else if (MenuIndex == 1)
                    {
                        MenuIndex           = 2;
                        ArrowLeft.Position  = new Vector2(ArrowLeftX2, ArrowY2);
                        ArrowRight.Position = new Vector2(ArrowRightX2, ArrowY2);
                    }
                }
                else if (TheLastSliceGame.InputManager.IsInputPressed(Keys.Enter))
                {
                    if (MenuIndex == 0)
                    {
                        TheLastSliceGame.Instance.PauseMusic();
                        StartGame.Play();
                        TransitionTimer = TimeSpan.FromMilliseconds(time.TotalGameTime.TotalMilliseconds + 3000);
                    }
                    else if (MenuIndex == 1)
                    {
                        TheLastSliceGame.Instance.PauseMusic();
                        Leaderboard.Play();
                        TransitionTimer = TimeSpan.FromMilliseconds(time.TotalGameTime.TotalMilliseconds + 3000);
                    }
                    else if (MenuIndex == 2)
                    {
                        Application.Current.Exit();
                    }
                }
            }

            ArrowLeft.Update(time);
            ArrowRight.Update(time);
            Menu.Update(time);
        }