本文整理汇总了C#中MouseAxis类的典型用法代码示例。如果您正苦于以下问题:C# MouseAxis类的具体用法?C# MouseAxis怎么用?C# MouseAxis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseAxis类属于命名空间,在下文中一共展示了MouseAxis类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseInput
/// <summary>
/// Create a new instance of <see cref="MouseInput"/> that handles specified mouse button.
/// </summary>
/// <param name="button">Mouse button.</param>
public MouseInput(MouseButton button)
{
if (button==MouseButton.None)
{
Debug.LogError("button can't be MouseButton.None");
}
mAxis = MouseAxis.None;
mButton = button;
}
示例2: GetName
public string GetName(MouseAxis.Axis axis)
{
switch (axis)
{
case MouseAxis.Axis.ScrollWheel: return "ScrollWheel";
case MouseAxis.Axis.MouseX: return "Mouse X";
case MouseAxis.Axis.MouseY: return "Mouse Y";
}
return "None";
}
示例3: MouseInput
/// <summary>
/// Create a new instance of <see cref="MouseInput"/> that handles specified mouse axis.
/// </summary>
/// <param name="axis">Mouse axis.</param>
/// <param name="modifiers">Key modifiers.</param>
public MouseInput(MouseAxis axis, KeyModifier modifiers = KeyModifier.NoModifier)
{
if (axis == MouseAxis.None)
{
Debug.LogError("axis can't be MouseAxis.None");
}
mAxis = axis;
mButton = MouseButton.None;
mModifiers = modifiers;
mCachedToString = null;
}
示例4: MouseMovementInputAction
/// <summary>
/// Constructs an InputAction which tracks relative mouse movement.
/// </summary>
/// <param name="playerIndex">The index of the player using this input.</param>
/// <param name="buttonAction">What state the button should be in to activate.</param>
/// <param name="axis">The axis of movement to be tracked.</param>
/// <param name="sensitivity">
/// How sensitive the mouse is.
/// A sensitivity of 4.0 and movement of 2 pixels will have a Degree of 0.5.</param>
/// <param name="deadZoneMin">The minimum Degree which will not be sensed.</param>
/// <param name="deadZoneMax">The maximum Degree which will not be sensed.</param>
public MouseMovementInputAction(
PlayerIndex playerIndex,
ButtonAction buttonAction,
MouseAxis axis,
float sensitivity,
float deadZoneMin,
float deadZoneMax)
: base(playerIndex, buttonAction)
{
mMouseAxis = axis;
mSensitivity = sensitivity;
mDeadZoneMax = deadZoneMax;
mDeadZoneMin = deadZoneMin;
previousX = Microsoft.Xna.Framework.Input.Mouse.GetState().X;
previousY = Microsoft.Xna.Framework.Input.Mouse.GetState().Y;
}
示例5: MouseAxisSource
public MouseAxisSource(MouseAxis axis)
{
this.axis = axis;
switch (axis)
{
case MouseAxis.Horizontal:
axisName = "Mouse X";
description = "Mouse Horizontal";
break;
case MouseAxis.Vertical:
axisName = "Mouse Y";
description = "Mouse Vertical";
break;
default:
throw new Exception("Unexpected axis value.");
}
}
示例6: SetKey
/// <summary>
/// Create new <see cref="KeyMapping"/> with specified name and inputs.
/// </summary>
/// <returns>Created KeyMapping.</returns>
/// <param name="name">KeyMapping name.</param>
/// <param name="primary">Primary input.</param>
/// <param name="secondary">Secondary input.</param>
/// <param name="third">Third input.</param>
public static KeyMapping SetKey(string name, MouseAxis primary, KeyCode secondary, KeyCode third)
{
return SetKey(name, ArgToInput(primary), ArgToInput(secondary), ArgToInput(third));
}
示例7: AbsoluteMousePositionOutput
public AbsoluteMousePositionOutput(MouseAxis axis = MouseAxis.X)
{
this.Axis = axis;
}
示例8: setKey
/// <summary>
/// Create new <see cref="KeyMapping"/> with specified name and inputs.
/// </summary>
/// <returns>Created KeyMapping.</returns>
/// <param name="name">KeyMapping name.</param>
/// <param name="primary">Primary input.</param>
/// <param name="secondary">Secondary input.</param>
/// <param name="third">Third input.</param>
public static KeyMapping setKey(string name, CustomInput primary, KeyCode secondary, MouseAxis third)
{
return setKey(name, argToInput(primary), argToInput(secondary), argToInput(third));
}
示例9: SetUp
protected void SetUp()
{
mouse = new FakeMouse();
instance = new MouseAxis(mouse);
}
示例10: ArgToInput
/// <summary>
/// Convert argument to <see cref="CustomInput"/>.
/// </summary>
/// <returns>Converted CustomInput.</returns>
/// <param name="arg">Some kind of argument.</param>
private static CustomInput ArgToInput(MouseAxis arg)
{
return new MouseInput(arg);
}
示例11: RelateMapWithMouseAxis
protected void RelateMapWithMouseAxis(Maps map, Dictionary<MouseAxis, HashSet<Maps>> mapsPerMouseAxis, MouseAxis axis)
{
if (!mapsPerMouseAxis.ContainsKey(axis))
mapsPerMouseAxis.Add(axis, new HashSet<Maps>());
mapsPerMouseAxis[axis].Add(map);
}