VirtualButtonTwoWay Class
Namespace: Stride.InputAssembly: Stride.Input.dll
Describes a IVirtualButton using the sum of a negative and positive button.
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() |
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. |
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. |
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 |