Table of Contents

Struct GamePadState

Namespace
Icy.Input.Devices
Assembly
IcyUI.dll

Describes the state of a typical gamepad.

public readonly struct GamePadState : IEquatable<GamePadState>, IEqualityOperators<GamePadState, GamePadState, bool>
Implements
Inherited Members
Extension Methods

Remarks

You can see the API docs of this struct on Official Stride3D website.

Constructors

GamePadState(GamePadButtons, Vector2, Vector2, float, float)

Initializes a new instance of the GamePadState struct.

public GamePadState(GamePadButtons buttons, Vector2 leftThumb, Vector2 rightThumb, float leftTrigger, float rightTrigger)

Parameters

buttons GamePadButtons

Set of pressed buttons.

leftThumb Vector2

Position of the left thumb.

rightThumb Vector2

Position of the right thumb.

leftTrigger float

Value of the left trigger.

rightTrigger float

Value of the right trigger.

Fields

Buttons

Bitmask of the gamepad buttons.

public readonly GamePadButtons Buttons

Field Value

GamePadButtons

LeftThumb

Left thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis.

public readonly Vector2 LeftThumb

Field Value

Vector2

LeftTrigger

The left trigger analog control in the range [0, 1.0f]. See remarks.

public readonly float LeftTrigger

Field Value

float

Remarks

Some controllers are not supporting the range of value and may act as a simple button returning only 0 or 1.

RightThumb

Right thumbstick x-axis/y-axis value. The value is in the range [-1.0f, 1.0f] for both axis.

public readonly Vector2 RightThumb

Field Value

Vector2

RightTrigger

The right trigger analog control in the range [0, 1.0f]. See remarks.

public readonly float RightTrigger

Field Value

float

Remarks

Some controllers are not supporting the range of value and may act as a simple button returning only 0 or 1.

Methods

Equals(GamePadState)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(GamePadState other)

Parameters

other GamePadState

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(GamePadState, GamePadState)

Compares two values to determine equality.

public static bool operator ==(GamePadState left, GamePadState right)

Parameters

left GamePadState

The value to compare with right.

right GamePadState

The value to compare with left.

Returns

bool

true if left is equal to right; otherwise, false.

operator !=(GamePadState, GamePadState)

Compares two values to determine inequality.

public static bool operator !=(GamePadState left, GamePadState right)

Parameters

left GamePadState

The value to compare with right.

right GamePadState

The value to compare with left.

Returns

bool

true if left is not equal to right; otherwise, false.