本文整理汇总了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;
}
}
}
示例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;
}
}
}
示例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;
}
}
示例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);
}
示例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;
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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();
}
}