示例#1
0
        public override void Update(GameTime gameTime)
        {
            KeyboardManager.GetInstance().Update(gameTime);
            mouseState = Mouse.GetState();

            if (lastState != mouseState)
            {
                if (lastState.LeftButton != mouseState.LeftButton || lastState.RightButton != mouseState.RightButton)
                {
                    if (mouseState.LeftButton == ButtonState.Pressed || mouseState.RightButton == ButtonState.Pressed)
                    {
                        handleMouseDown();
                    }
                    else if (mouseState.LeftButton == ButtonState.Released || mouseState.RightButton == ButtonState.Released)
                    {
                        handleMouseUp();
                    }
                }
                else
                {
                    handleMouseMove();
                }

                lastState = mouseState;
            }

            foreach (Window w in windows)
            {
                w.Update(gameTime);
            }

            foreach (Control c in children)
            {
                c.Update(gameTime);
            }
            // UpdateChildren(mouseDelta);
        }