Table of Contents

Struct GamePadDPad

Namespace
Microsoft.Xna.Framework.Input
Assembly
MonoGame.Framework.dll

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 ButtonState

Current state of directional pad up.

downValue ButtonState

Current state of directional pad down.

leftValue ButtonState

Current state of directional pad left.

rightValue ButtonState

Current 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

ButtonState

Pressed if the down button is pressed; otherwise, Released.

Left

Gets a value indicating whether left is pressed on the directional pad.

public readonly ButtonState Left { get; }

Property Value

ButtonState

Pressed if the left button is pressed; otherwise, Released.

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

ButtonState

Pressed if the up button is pressed; otherwise, Released.

Methods

Equals(object)

Returns a value indicating whether this instance is equal to a specified object.

public override bool Equals(object obj)

Parameters

obj object

An 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 GamePadDPad

The first object to compare.

right GamePadDPad

The second object to compare.

Returns

bool

true if left and right 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 GamePadDPad

The first object to compare.

right GamePadDPad

The second object to compare.

Returns

bool

true if left and right are not equal; otherwise, false.