Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    VirtualButtonTwoWay Class

    Namespace: Stride.Input
    Assembly: Stride.Input.dll

    Describes a IVirtualButton using the sum of a negative and positive button.

    System.Object → VirtualButtonTwoWay
    Derived from VirtualButtonTwoWay:

    public class VirtualButtonTwoWay : IVirtualButton
    Remarks

    This virtual button is for example useful to bind a key to a negative value (key 'left') and another key to a positive value (key 'right') thus simulating an axis button. The result of this virtual

    Result = PositiveButton.GetValue - NegativeButton.GetValue;
    Name Description
    Constructors
    VirtualButtonTwoWay()

    Initializes a new instance of the VirtualButtonTwoWay class.

    VirtualButtonTwoWay(IVirtualButton, IVirtualButton)

    Initializes a new instance of the VirtualButtonTwoWay class.

    Properties
    NegativeButton

    Gets or sets the negative button that will generate a 'negative' value if it is pressed.

    PositiveButton

    Gets or sets the positive button that will generate a 'positive' value if it is pressed.

    Methods
    GetValue(InputManager)
    IsDown(InputManager)
    IsPressed(InputManager)
    IsReleased(InputManager)
    ToString()
    | Improve this Doc View Source

    Constructors


    VirtualButtonTwoWay()

    Initializes a new instance of the VirtualButtonTwoWay class.

    public VirtualButtonTwoWay()

    VirtualButtonTwoWay(IVirtualButton, IVirtualButton)

    Initializes a new instance of the VirtualButtonTwoWay class.

    public VirtualButtonTwoWay(IVirtualButton negativeButton, IVirtualButton positiveButton)
    Parameters
    Type Name Description
    IVirtualButton negativeButton

    The negative button.

    IVirtualButton positiveButton

    The positive button.

    | Improve this Doc View Source

    Properties


    NegativeButton

    Gets or sets the negative button that will generate a 'negative' value if it is pressed.

    public IVirtualButton NegativeButton { get; set; }
    Property Value
    Type Description
    IVirtualButton

    The negative button.


    PositiveButton

    Gets or sets the positive button that will generate a 'positive' value if it is pressed.

    public IVirtualButton PositiveButton { get; set; }
    Property Value
    Type Description
    IVirtualButton

    The positive button.

    | Improve this Doc View Source

    Methods


    GetValue(InputManager)

    public virtual float GetValue(InputManager manager)
    Parameters
    Type Name Description
    InputManager manager
    Returns
    Type Description
    System.Single

    IsDown(InputManager)

    public bool IsDown(InputManager manager)
    Parameters
    Type Name Description
    InputManager manager
    Returns
    Type Description
    System.Boolean

    IsPressed(InputManager)

    public bool IsPressed(InputManager manager)
    Parameters
    Type Name Description
    InputManager manager
    Returns
    Type Description
    System.Boolean

    IsReleased(InputManager)

    public bool IsReleased(InputManager manager)
    Parameters
    Type Name Description
    InputManager manager
    Returns
    Type Description
    System.Boolean

    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation