当前位置: 首页>>代码示例>>C#>>正文


C# InputState.MouseLeftClickUp方法代码示例

本文整理汇总了C#中InputState.MouseLeftClickUp方法的典型用法代码示例。如果您正苦于以下问题:C# InputState.MouseLeftClickUp方法的具体用法?C# InputState.MouseLeftClickUp怎么用?C# InputState.MouseLeftClickUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InputState的用法示例。


在下文中一共展示了InputState.MouseLeftClickUp方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleInput

 public override void HandleInput(InputState inputState)
 {
     if (inputState.MouseLeftClickUp())
     {
         var lCurrentMouseState = inputState.CurrentMouseState;
         if (this.HitTest(lCurrentMouseState.X, lCurrentMouseState.Y))
         {
             var lClickHandler = this.Click;
             if (lClickHandler != null) lClickHandler(this);
             inputState.MouseLeftClickUpHandled = true;
         }
     }
 }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:13,代码来源:ShopSectionComponent.cs

示例2: HandleInput

        public override void HandleInput(InputState inputState)
        {
            if (!this.IsVisible || !this.IsEnabled) return;

            if (inputState.MouseLeftClickUp())
            {
                var lCurrentMouseState = inputState.CurrentMouseState;
                if (this.HitTest(lCurrentMouseState.X, lCurrentMouseState.Y))
                {
                    var lClickHandler = this.Click;
                    if (lClickHandler != null)
                    {
                        lClickHandler(this);
                    }
                    inputState.MouseLeftClickUpHandled = true;
                }
            }
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:18,代码来源:Button.cs

示例3: HandleInput

        public override void HandleInput(InputState inputState)
        {
            if (inputState.MouseLeftClickUp())
            {
                if (!this.mBeeYard.IsUnlocked) return;

                var lCurrentMouseState = inputState.CurrentMouseState;

                var lNameIsClicked = VectorUtilities.HitTest(
                    this.mWorldYardInfo.NamePosition,
                    this.mWorldYardInfo.NameSize,
                    lCurrentMouseState.X, lCurrentMouseState.Y);

                if (lNameIsClicked)
                {
                    this.TravelToYard(this);
                }

                inputState.MouseLeftClickUpHandled = true;
            }
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:21,代码来源:BeeWorldYardComponent.cs

示例4: HandleInput

        public override void HandleInput(InputState inputState)
        {
            if (!this.Visible) return;

            if (inputState.MouseLeftClickUp())
            {
                var lCurrentMouseState = inputState.CurrentMouseState;
                if (VectorUtilities.HitTest(Vector2.Zero, this.ScreenSize, lCurrentMouseState.X, lCurrentMouseState.Y)
                    && !VectorUtilities.HitTest(this.mPosition, this.mSize, lCurrentMouseState.X, lCurrentMouseState.Y))
                {
                    this.Close();
                    inputState.MouseLeftClickUpHandled = true;
                }
                else
                {
                    for (int lIndex = 0; lIndex < sItemsPerPage; lIndex++)
                    {
                        if (VectorUtilities.HitTest(this.mItemPositions[lIndex], this.mItemSize, lCurrentMouseState.X, lCurrentMouseState.Y))
                        {
                            this.mSelectedIndexOffset = lIndex;
                            this.mInfoRecalculationNeeded = true;
                            inputState.MouseLeftClickUpHandled = true;
                            break;
                        }
                    }
                }
            }

            this.mButtonClose.HandleInput(inputState);
            this.mButtonPrevious.HandleInput(inputState);
            this.mButtonNext.HandleInput(inputState);
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:32,代码来源:InventoryItemListComponent.cs

示例5: HandleInput

 public override void HandleInput(InputState inputState)
 {
     if (inputState.MouseLeftClickUp())
     {
         var lCurrentMouseState = inputState.CurrentMouseState;
         if (VectorUtilities.HitTest(this.mHivePosition, this.mHiveSize, lCurrentMouseState.X, lCurrentMouseState.Y))
         {
             this.TravelToHive(this);
             inputState.MouseLeftClickUpHandled = true;
         }
     }
 }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:12,代码来源:BeeYardHiveComponent.cs

示例6: HandleInput

        public override void HandleInput(InputState inputState)
        {
            base.HandleInput(inputState);

            this.mInventorySelectorComponent.HandleInput(inputState);

            // Must handle input backwards to make the topmost component
            // the first to have a change to handle the input.
            for (int lIndex = this.mComponents.Count - 1; lIndex >= 0; lIndex--)
            {
                var lComponent = this.mComponents[lIndex];
                lComponent.HandleInput(inputState);
            }

            if (this.mIsSelectionModeActive && inputState.MouseLeftClickUp())
            {
                var lCurrentMouseState = inputState.CurrentMouseState;
                for (int lIndex = 0; lIndex < this.mSuperComponents.Count; lIndex++)
                {
                    var lSuperComponent = this.mSuperComponents[lIndex];
                    if (VectorUtilities.HitTest(lSuperComponent.Position, lSuperComponent.Size, lCurrentMouseState.X, lCurrentMouseState.Y))
                    {
                        lSuperComponent.IsSelected = true;
                        if (this.mSelectedSuper != null) this.mSelectedSuper.IsSelected = false;
                        this.mSelectedSuper = lSuperComponent;
                        break;
                    }
                }
            }

            if (!this.mInventorySelectorComponent.Visible)
            {
                var lCurrentMouseState = inputState.CurrentMouseState;
                if (this.mVerticalScrollUpBounds.Contains(lCurrentMouseState.X, lCurrentMouseState.Y))
                {
                    this.mVerticalScrollPosition = Math.Min(
                        this.mVerticalScrollPosition + this.mVerticalScrollAmount,
                        this.mVerticalScrollHeight);
                }
                else if (this.mVerticalScrollDownBounds.Contains(lCurrentMouseState.X, lCurrentMouseState.Y))
                {
                    this.mVerticalScrollPosition = Math.Max(
                        this.mVerticalScrollPosition - this.mVerticalScrollAmount, 0);
                }
            }
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:46,代码来源:BeeHiveScreen.cs

示例7: HandleInput

        public override void HandleInput(InputState inputState)
        {
            if (!this.IsVisible) return;

            if (inputState.MouseLeftClickUp())
            {
                var lCurrentMouseState = inputState.CurrentMouseState;
                if (this.HitTest(lCurrentMouseState.X, lCurrentMouseState.Y))
                {
                    if (this.ParentMenuButton != null)
                    {
                        foreach (var lMenuButton in this.ParentMenuButton.ChildMenuButtons)
                        {
                            lMenuButton.CloseAllChildMenuButtons();
                        }
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(this.ButtonMenuComponent != null);
                        this.ButtonMenuComponent.CloseAllMenuButtons();
                    }

                    if (this.ChildMenuButtons.Count == 0)
                    {
                        System.Diagnostics.Debug.Assert(this.ButtonMenuComponent != null);
                        this.ButtonMenuComponent.CloseAllMenuButtons();
                    }
                    else
                    {
                        this.AreChildMenuButtonsVisible = true;
                    }

                    var lClickHandler = this.Click;
                    if (lClickHandler != null) lClickHandler(this);
                    inputState.MouseLeftClickUpHandled = true;
                }
            }

            foreach (var lMenuButton in this.ChildMenuButtons)
            {
                lMenuButton.HandleInput(inputState);
            }
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:43,代码来源:MenuButton.cs

示例8: HandleInput

        public override void HandleInput(InputState inputState)
        {
            if (!this.IsVisible) return;

            foreach (var lMenuButton in this.MenuButtons)
            {
                lMenuButton.HandleInput(inputState);
            }

            if (inputState.MouseLeftClickUp())
            {
                this.CloseAllMenuButtons();
            }
        }
开发者ID:cmprog,项目名称:BusyBeekeeper,代码行数:14,代码来源:ButtonMenuComponent.cs


注:本文中的InputState.MouseLeftClickUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。