示例#1
0
        private void updateMouseInput()
        {
            var ms = Game1.getMousePosition();

            if (ms.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    if (mCurrentSelectableCharacter != null)
                    {
                        if (mCurrentSelectableCharacter == mSelectableCharacterRed)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.RED));
                        }
                        else
                        if (mCurrentSelectableCharacter == mSelectableCharacterGreen)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.GREEN));
                        }
                        else
                        if (mCurrentSelectableCharacter == mSelectableCharacterBlue)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.BLUE));
                        }

                        mCurrentSelectableCharacter.changeState(SelectableCharacter.sSTATE_SELECTED);
                        mReduceAlpha = true;

                        mTimerAfterSelection = new MTimer(true);
                    }
                }
            }

            oldStateMouse = ms;
        }
示例#2
0
        public static ProxyMouseState getMousePosition()
        {
            MouseState      state      = Mouse.GetState();
            ProxyMouseState proxyState = new ProxyMouseState();

            if (displayTransform != null)
            {
                proxyState.X = (int)(state.X / displayTransform.Item1.X);
                proxyState.Y = (int)(state.Y / displayTransform.Item1.Y);
            }
            proxyState.LeftButton  = state.LeftButton;
            proxyState.RightButton = state.RightButton;
            return(proxyState);
        }
示例#3
0
        private void updateMouseInput()
        {
            var mouseState = Game1.getMousePosition();

            if (mouseState.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    Skip();
                }
            }

            oldStateMouse = mouseState;
            //dispara evento
        }
示例#4
0
        private void updateMouseInput()
        {
            var mouseState = Game1.getMousePosition();

            if (mouseState.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    mFade    = new Fade(this, "fades\\blackfade", Fade.SPEED.FAST);
                    mClicked = true;
                    executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                }
            }

            oldStateMouse = mouseState;
        }
示例#5
0
        private void updateMouseInput()
        {
            var ms = Game1.getMousePosition();

            if (ms.LeftButton == ButtonState.Pressed)
            {
                mMousePressing = true;
            }
            else
            {
                if (mCurrentHighlightButton != null)
                {
                    if (mMousePressing)
                    {
                        processButtonAction(mCurrentHighlightButton);
                    }
                }

                mMousePressing = false;
            }


            if (ms.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    if (mCollidingMouseWithSoundIcon)
                    {
                        if (mSoundIcon.getState() == SoundIcon.sSTATE_SHAKING)
                        {
                            mSoundIcon.changeState(SoundIcon.sSTATE_OFF);
                            SoundManager.setSound(false);
                        }
                        else
                        if (mSoundIcon.getState() == SoundIcon.sSTATE_OFF)
                        {
                            mSoundIcon.changeState(SoundIcon.sSTATE_NORMAL);
                            SoundManager.setSound(true);
                        }
                    }
                }
            }

            oldStateMouse = ms;
        }
示例#6
0
        private void updateMouseInput()
        {
            var ms = Game1.getMousePosition();

            if (ms.LeftButton == ButtonState.Pressed)
            {
                mMousePressing = true;
            }
            else
            {
                /*if (mCurrentHighlightButton != null)
                 * {
                 *
                 *  if (mMousePressing)
                 *  {
                 *      processButtonAction(mCurrentHighlightButton);
                 *  }
                 *
                 * }*/

                mMousePressing = false;
            }


            var mouseState = Game1.getMousePosition();


            if (mouseState.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    mFade    = new Fade(this, "fades\\blackfade", Fade.SPEED.SLOW);
                    mClicked = true;
                    executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                }
            }

            oldStateMouse = mouseState;
            //dispara evento
        }