コード例 #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            _controller.Update(gameTime);
            _clickController.Update(gameTime);
            var mouseState = Mouse.GetState();

            for (var i = 0; i < MenuItems.Count; i++)
            {
                var isHovered = MenuItems[i].BoundingRectangle.Contains(mouseState.X, mouseState.Y);
                if (isHovered)
                {
                    MenuItems[i].Color = Color.Yellow;
                    Selected           = i;
                }
                else
                {
                    MenuItems[i].Color = Color.White;
                }
            }
            MenuItems[Selected].Color = Color.Yellow;
        }
コード例 #2
0
 private void Update()
 {
     _clickController.Update();
 }