本文整理汇总了C#中InputState.IsNewRightMouseClick方法的典型用法代码示例。如果您正苦于以下问题:C# InputState.IsNewRightMouseClick方法的具体用法?C# InputState.IsNewRightMouseClick怎么用?C# InputState.IsNewRightMouseClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputState
的用法示例。
在下文中一共展示了InputState.IsNewRightMouseClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleInput
public override void HandleInput(InputState input)
{
Vector2 mouse = new Vector2(input.CurrentMouseState.X, input.CurrentMouseState.Y);
Rectangle mouseRec = new Rectangle((int)mouse.X, (int)mouse.Y, 1, 1);
Rectangle bounds = new Rectangle((int)Position.X, (int)Position.Y,
Texture.Width, Texture.Height);
if (IsEnabled) {
IsMouseOver = bounds.Contains(mouseRec);
if (IsMouseOver && input.IsNewLeftMouseClick()) {
IsSelected = true;
}
if (IsSelected && !IsMouseOver) {
if (input.IsNewRightMouseClick()) {
IsSelected = false;
}
}
}
}
示例2: HandleWayPoint
public void HandleWayPoint(InputState input, Vector2 worldMouse)
{
if ((Keyboard.GetState().IsKeyDown(Keys.LeftShift) ||
Keyboard.GetState().IsKeyDown(Keys.RightShift))
&& input.IsNewRightMouseClick())
{
//unit.Waypoints.EnqueueWithCollisionChecking(unit.Position, Mouse, Sprites);
Waypoints.Enqueue(worldMouse);
}
else if (input.IsNewRightMouseClick())
{
Waypoints.Clear();
Waypoints.Enqueue(worldMouse);
}
}