Skip to content

InputAPI reference

Class TouchDPad

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.Touch.dll
Guide: Input

A d-pad: discrete directions with no analog value, for games where a precise press matters more than a smooth one (platformers, grid movement, menus). The thumb anywhere around its centre presses the direction it points to.

C#
public sealed record TouchDPad : TouchControl, IEquatable<TouchControl>, IEquatable<TouchDPad>

Inheritance

object ← TouchControl ← TouchDPad

Implements

IEquatable<TouchControl>, IEquatable<TouchDPad>

Inherited Members

TouchControl.ToString(), TouchControl.GetHashCode(), TouchControl.Equals(object?), TouchControl.Equals(TouchControl?), TouchControl.<Clone>$(), TouchControl.Deconstruct(out string), TouchControl.Id, TouchControl.Anchor, TouchControl.Offset, TouchControl.Radius, TouchControl.Visible, TouchControl.Style, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

TouchDPad(string, string, string, string, string)

A d-pad: discrete directions with no analog value, for games where a precise press matters more than a smooth one (platformers, grid movement, menus). The thumb anywhere around its centre presses the direction it points to.

C#
public TouchDPad(string Id = "dpad", string Left = "left", string Right = "right", string Up = "up", string Down = "down")

Parameters

Id string

Left string

Right string

Up string

Down string

Properties

DeadZone

Centre area, as a fraction of the radius, where no direction is pressed.

C#
public float DeadZone { get; init; }

Property Value

float

Diagonals

True: eight sectors (diagonals press two directions). False: four, only the dominant direction.

C#
public bool Diagonals { get; init; }

Property Value

bool

Down

C#
public string Down { get; init; }

Property Value

string

EqualityContract

C#
protected override Type EqualityContract { get; }

Property Value

Type

Left

C#
public string Left { get; init; }

Property Value

string

Right

C#
public string Right { get; init; }

Property Value

string

Up

C#
public string Up { get; init; }

Property Value

string

Methods

<Clone>$()

C#
public override TouchDPad <Clone>$()

Returns

TouchDPad

Deconstruct(out string, out string, out string, out string, out string)

C#
public void Deconstruct(out string Id, out string Left, out string Right, out string Up, out string Down)

Parameters

Id string

Left string

Right string

Up string

Down string

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(TouchControl?)

C#
public override sealed bool Equals(TouchControl? other)

Parameters

other TouchControl?

Returns

bool

Equals(TouchDPad?)

C#
public bool Equals(TouchDPad? other)

Parameters

other TouchDPad?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

C#
protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(TouchDPad?, TouchDPad?)

C#
public static bool operator ==(TouchDPad? left, TouchDPad? right)

Parameters

left TouchDPad?

right TouchDPad?

Returns

bool

operator !=(TouchDPad?, TouchDPad?)

C#
public static bool operator !=(TouchDPad? left, TouchDPad? right)

Parameters

left TouchDPad?

right TouchDPad?

Returns

bool