本文整理汇总了C#中InputHandler.MousePressed方法的典型用法代码示例。如果您正苦于以下问题:C# InputHandler.MousePressed方法的具体用法?C# InputHandler.MousePressed怎么用?C# InputHandler.MousePressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputHandler
的用法示例。
在下文中一共展示了InputHandler.MousePressed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleInput
public override void HandleInput(InputHandler input)
{
if (input.MousePressed(1))
{
if (closeButton.Contains(input.MouseLoc()))
{
Exit();
}
}
base.HandleInput(input);
}
示例2: HandleInput
public override void HandleInput(InputHandler input)
{
if (hasFocus)
{
if (input.MousePressed(1))
{
Point mouseLoc = input.MouseLoc();
if (rectangles[0].Contains(mouseLoc) && numShown > 0)
{
OnSelectItem(0);
}
else if (rectangles[1].Contains(mouseLoc) && numShown > 1)
{
OnSelectItem(1);
}
else if (rectangles[2].Contains(mouseLoc) && numShown > 2)
{
OnSelectItem(2);
}
else if (rectangles[3].Contains(mouseLoc) && numShown > 3)
{
OnSelectItem(3);
}
else if (arrowRectangles[0].Contains(mouseLoc) && drawTopArrow)
{
topIndex -= 2;
numShown = Math.Min(numItems - topIndex, 4);
}
else if (arrowRectangles[1].Contains(mouseLoc) && drawBottomArrow)
{
topIndex += 2;
numShown = Math.Min(numItems - topIndex, 4);
}
else if (arrowRectangles[2].Contains(mouseLoc))
{
OnCancel(this, new EventArgs());
}
}
if (input.MouseMoved())
{
Point mouseLoc = input.MouseLoc();
if (rectangles[0].Contains(mouseLoc) && numShown > 0)
{
selectedIndex = 0 + topIndex;
}
else if (rectangles[1].Contains(mouseLoc) && numShown > 1)
{
selectedIndex = 1 + topIndex;
}
else if (rectangles[2].Contains(mouseLoc) && numShown > 2)
{
selectedIndex = 2 + topIndex;
}
else if (rectangles[3].Contains(mouseLoc) && numShown > 3)
{
selectedIndex = 3 + topIndex;
}
}
}
}
示例3: HandleInput
public override void HandleInput(InputHandler input)
{
if (hasFocus && battle.Turn == 1)
{
if (input.MousePressed(1))
{
Point mouseLoc = input.MouseLoc();
if (attackRec.Contains(mouseLoc))
{
OnSelectItem(0);
}
else if (fleeRec.Contains(mouseLoc))
{
OnSelectItem(1);
}
else if (magicRec.Contains(mouseLoc))
{
OnSelectItem(2);
}
else if (itemRec.Contains(mouseLoc))
{
OnSelectItem(3);
}
else if (endTurnRec.Contains(mouseLoc))
{
battle.EndTurn();
}
}
if (input.MouseMoved())
{
Point mouseLoc = input.MouseLoc();
if (attackRec.Contains(mouseLoc))
{
selectedIndex = 0;
}
else if (fleeRec.Contains(mouseLoc))
{
selectedIndex = 1;
}
else if (magicRec.Contains(mouseLoc))
{
selectedIndex = 2;
}
else if (itemRec.Contains(mouseLoc))
{
selectedIndex = 3;
}
}
base.HandleInput(input);
}
}