示例#1
0
        public virtual void Update(GameTime gameTime, Vector2i pos)
        {
            position  = pos;
            this.view = new Rectangle(position.X + scrolled.X, position.Y + scrolled.Y, scrollSize.X, scrollSize.Y);

            var mouseState = Mouse.GetState();
            var mousePoint = new Point(mouseState.X, mouseState.Y);

            if (view.Contains(mousePoint))
            {
                if (mouseState.ScrollWheelValue != scrollWheelPrevValue)
                {
                    int change = scrollWheelPrevValue - mouseState.ScrollWheelValue;
                    if (change > 0)
                    {
                        SetScrolled(scrolled + new Vector2i(scrollSpace.X * 0.16f, scrollSpace.Y * 0.16f));
                    }
                    else
                    {
                        SetScrolled(scrolled - new Vector2i(scrollSpace.X * 0.16f, scrollSpace.Y * 0.16f));
                    }
                }
            }
            scrollWheelPrevValue = mouseState.ScrollWheelValue;

            btnTop.Update(gameTime);
            btnBottom.Update(gameTime);
            backgroundScroller.Update(gameTime);

            backgrnd.Update(gameTime);
        }
示例#2
0
        public virtual void Update(GameTime gameTime)
        {
            position += move();

            bottomBackground.resize(size.X - (bottomLeftEdge.dimensions.X * 2), size.Y - headerHeight - edgeBottom.dimensions.Y);
            bottomBackground.Update(gameTime);

            leftCornerTop.Update(gameTime);
            rightCornerTop.Update(gameTime);

            edgeTop.resize(size.X - (leftCornerTop.dimensions.X * 2) + 2, headerHeight);
            edgeTop.Update(gameTime);

            topLeftEdge.resize(topLeftEdge.dimensions.X, headerHeight - leftCornerTop.dimensions.Y);
            topLeftEdge.Update(gameTime);

            topRightEdge.resize(topLeftEdge.dimensions.X, headerHeight - leftCornerTop.dimensions.Y);
            topRightEdge.Update(gameTime);

            leftCornerBottom.Update(gameTime);
            rightCornerBottom.Update(gameTime);

            edgeBottom.resize(size.X - (leftCornerBottom.dimensions.X * 2) + 2, edgeBottom.dimensions.Y);
            edgeBottom.Update(gameTime);

            bottomLeftEdge.resize(bottomLeftEdge.dimensions.X, size.Y - headerHeight - leftCornerBottom.dimensions.Y);
            bottomLeftEdge.Update(gameTime);

            bottomRightEdge.resize(bottomLeftEdge.dimensions.X, size.Y - headerHeight - leftCornerBottom.dimensions.Y);
            bottomRightEdge.Update(gameTime);

            CloseB.Update(gameTime);

            title.Update(gameTime);
        }
示例#3
0
        public void Update(GameTime gameTime, Vector2i size, int headerHeight, int offsetY)
        {
            backdrop.resize(size.X - 6, size.Y - headerHeight - 33 - offsetY);
            backdrop.Update(gameTime);

            hiddenLine.resize(size.X - 6, hiddenLine.dimensions.Y);
            hiddenLine.Update(gameTime);

            try
            {
                foreach (InMenuButton menuButton in menuButtons)
                {
                    menuButton.Update(gameTime);
                }
            } catch (Exception ex)
            {
                Logger.Error("Could not update menuButtons");
            }
        }