Struct GamePadDPad
A struct that represents which directions on the directional pad of a controller are being pressed.
public struct GamePadDPad
- Inherited Members
Constructors
GamePadDPad(ButtonState, ButtonState, ButtonState, ButtonState)
Initializes a new instance of the GamePadDPad struct.
public GamePadDPad(ButtonState upValue, ButtonState downValue, ButtonState leftValue, ButtonState rightValue)
Parameters
upValue
ButtonStateCurrent state of directional pad up.
downValue
ButtonStateCurrent state of directional pad down.
leftValue
ButtonStateCurrent state of directional pad left.
rightValue
ButtonStateCurrent state of directional pad right.
Properties
Down
Gets a value indicating whether down is pressed on the directional pad.
public readonly ButtonState Down { get; }
Property Value
Left
Gets a value indicating whether left is pressed on the directional pad.
public readonly ButtonState Left { get; }
Property Value
Right
Gets a value indicating whether right is pressed on the directional pad.
public readonly ButtonState Right { get; }
Property Value
- ButtonState
Pressed if the right button is pressed; otherwise, Released.
Up
Gets a value indicating whether up is pressed on the directional pad.
public readonly ButtonState Up { get; }
Property Value
Methods
Equals(object)
Returns a value indicating whether this instance is equal to a specified object.
public override bool Equals(object obj)
Parameters
obj
objectAn object to compare to this instance.
Returns
- bool
true if
obj
is a GamePadDPad and has the same value as this instance; otherwise, false.
GetHashCode()
Serves as a hash function for a GamePadDPad object.
public override int GetHashCode()
Returns
- int
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
ToString()
Returns a string that represents the current GamePadDPad in a format of 0000 where each number represents a boolean value of each respecting object property: Left, Up, Right, Down.
public override string ToString()
Returns
- string
A string that represents the current GamePadDPad.
Operators
operator ==(GamePadDPad, GamePadDPad)
Determines whether two specified instances of GamePadDPad are equal.
public static bool operator ==(GamePadDPad left, GamePadDPad right)
Parameters
left
GamePadDPadThe first object to compare.
right
GamePadDPadThe second object to compare.
Returns
- bool
true if
left
andright
are equal; otherwise, false.
operator !=(GamePadDPad, GamePadDPad)
Determines whether two specified instances of GamePadDPad are not equal.
public static bool operator !=(GamePadDPad left, GamePadDPad right)
Parameters
left
GamePadDPadThe first object to compare.
right
GamePadDPadThe second object to compare.
Returns
- bool
true if
left
andright
are not equal; otherwise, false.