本文整理汇总了C#中MouseButton.GetMappedState方法的典型用法代码示例。如果您正苦于以下问题:C# MouseButton.GetMappedState方法的具体用法?C# MouseButton.GetMappedState怎么用?C# MouseButton.GetMappedState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MouseButton
的用法示例。
在下文中一共展示了MouseButton.GetMappedState方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsButtonReleased
/// <summary>
/// Gets if the mouse button was released in this frame.
/// </summary>
/// <param name="b">The MouseButton to check.</param>
/// <returns>`true` if the mouse button was released, `false` otherwise.</returns>
public bool IsButtonReleased(MouseButton b)
{
return b.GetMappedState(CurrentMouseState) == ButtonState.Released && b.GetMappedState(PreviousMouseState) == ButtonState.Pressed;
}
示例2: IsButtonUp
/// <summary>
/// Gets if the mouse button is up.
/// </summary>
/// <param name="b">The MouseButton to check.</param>
/// <returns>`true` if the mouse button is up, `false` otherwise.</returns>
public bool IsButtonUp(MouseButton b)
{
return b.GetMappedState(CurrentMouseState) == ButtonState.Released;
}
示例3: IsButtonPreviouslyUp
/// <summary>
/// Gets if the mouse button was up in the previous frame.
/// </summary>
/// <param name="b">The MouseButton to check.</param>
/// <returns>`true` if the mouse button was up, `false` otherwise.</returns>
public bool IsButtonPreviouslyUp(MouseButton b)
{
return b.GetMappedState(PreviousMouseState) == ButtonState.Released;
}
示例4: IsButtonPreviouslyDown
/// <summary>
/// Gets if the mouse button was down in the previous frame.
/// </summary>
/// <param name="b">The MouseButton to check.</param>
/// <returns>`true` if the mouse button was down, `false` otherwise.</returns>
public bool IsButtonPreviouslyDown(MouseButton b)
{
return b.GetMappedState(PreviousMouseState) == ButtonState.Pressed;
}
示例5: IsButtonDown
/// <summary>
/// Gets if the mouse button is down.
/// </summary>
/// <param name="b">The MouseButton to check.</param>
/// <returns>`true` if the mouse button is down, `false` otherwise.</returns>
public bool IsButtonDown(MouseButton b)
{
return b.GetMappedState(CurrentMouseState) == ButtonState.Pressed;
}
示例6: GetPreviousButtonState
/// <summary>
/// Gets the state for the passed mouse button in the last frame.
/// </summary>
/// <param name="b">The mouse button to check.</param>
/// <returns>The ButtonState for the mouse in the last frame.</returns>
public ButtonState GetPreviousButtonState(MouseButton b)
{
return b.GetMappedState(PreviousMouseState);
}
示例7: GetButtonState
/// <summary>
/// Gets the state for the passed mouse button.
/// </summary>
/// <param name="b">The mouse button to check.</param>
/// <returns>The ButtonState for the mouse in this frame.</returns>
public ButtonState GetButtonState(MouseButton b)
{
return b.GetMappedState(CurrentMouseState);
}