コード例 #1
0
        protected void HandleMajorMenuEntryInput(InputState input)
        {
            // Move to the previous menu entry?
            if (input.IsKeyUp() || input.IsKeyLeft())
            {
                selectedMajorMenuEntry--;
                AudioManager.PlaySound("beep");

                if (selectedMajorMenuEntry < 0)
                    selectedMajorMenuEntry = menuEntries.Count - 1;
            }

            // Move to the next menu entry?
            if (input.IsKeyDown() || input.IsKeyRight())
            {
                selectedMajorMenuEntry++;
                AudioManager.PlaySound("beep");

                if (selectedMajorMenuEntry >= menuEntries.Count)
                    selectedMajorMenuEntry = 0;
            }

            // Handle selecting menu entries to proceed to next screen, or exiting from this screen.
            if (input.IsMenuSelect())
            {
                OnSelectMajorMenuEntry(selectedMajorMenuEntry);
            }
            else if (input.IsMenuCancel())
            {
                OnCancel();
            }
        }
コード例 #2
0
        public override void HandleInput(InputState input, GameTime gameTime)
        {
            // Move to the previous menu entry?
            if (input.IsKeyUp() || input.IsKeyRight())
            {
                selectedMajorMenuEntry--;
                screenManager.MenuItemSound.Play(0.5f, 0.0f, 0.0f);
                if (selectedMajorMenuEntry < 0) { selectedMajorMenuEntry++; }
                else if (selectedMajorMenuEntry < topDisplayedEntryIndex) { topDisplayedEntryIndex--; botDisplayedEntryIndex--; }
            }

            // Move to the next menu entry?
            if (input.IsKeyDown() || input.IsKeyLeft())
            {
                selectedMajorMenuEntry++;
                screenManager.MenuItemSound.Play(0.5f, 0.0f, 0.0f);
                if (selectedMajorMenuEntry > MenuEntries.Count - 1) { selectedMajorMenuEntry--; }
                else if (selectedMajorMenuEntry > botDisplayedEntryIndex) { topDisplayedEntryIndex++; botDisplayedEntryIndex++; }
            }

            // Handle selecting menu entries to proceed to next screen, or exiting from this screen.
            if (input.IsMenuSelect())
            {
            }
            else if (input.IsMenuCancel())
            {
                ExitScreen();
            }
        }
コード例 #3
0
        public override void HandleInput(InputState input, GameTime gameTime)
        {
            // Move to the previous menu entry?
            if (input.IsKeyUp() || input.IsKeyRight())
            {
                selectedMajorMenuEntry--;
                AudioManager.PlaySound("beep");

                if (selectedMajorMenuEntry < 0)
                    selectedMajorMenuEntry = MenuEntries.Count - 1;
            }

            // Move to the next menu entry?
            if (input.IsKeyDown() || input.IsKeyLeft())
            {
                selectedMajorMenuEntry++;
                AudioManager.PlaySound("beep");

                if (selectedMajorMenuEntry >= MenuEntries.Count)
                    selectedMajorMenuEntry = 0;
            }

            // Handle selecting menu entries to proceed to next screen, or exiting from this screen.
            if (input.IsMenuSelect())
            {
            }
            else if (input.IsMenuCancel())
            {
                ExitScreen();
            }
        }