Skip to content

InputAPI reference

Class TouchButton

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

A button that presses an action (and optionally more, as one key may: Also = [“confirm”] on a jump button).

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

Inheritance

object ← TouchControl ← TouchButton

Implements

IEquatable<TouchControl>, IEquatable<TouchButton>

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

TouchButton(string, string, string?)

A button that presses an action (and optionally more, as one key may: Also = [“confirm”] on a jump button).

C#
public TouchButton(string Id, string Action, string? Label = null)

Parameters

Id string

Action string

Label string?

Short text drawn on it (“A”, “JUMP”); null draws none.

Properties

Action

C#
public string Action { get; init; }

Property Value

string

Also

Further actions the button presses with Action, like a key bound to several actions.

C#
public IReadOnlyList<string> Also { get; init; }

Property Value

IReadOnlyList<string>

EqualityContract

C#
protected override Type EqualityContract { get; }

Property Value

Type

Label

Short text drawn on it (“A”, “JUMP”); null draws none.

C#
public string? Label { get; init; }

Property Value

string?

Mode

Whether the action is down while held (the default) or toggled by each tap.

C#
public TouchButtonMode Mode { get; init; }

Property Value

TouchButtonMode

Methods

<Clone>$()

C#
public override TouchButton <Clone>$()

Returns

TouchButton

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

C#
public void Deconstruct(out string Id, out string Action, out string? Label)

Parameters

Id string

Action string

Label 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(TouchButton?)

C#
public bool Equals(TouchButton? other)

Parameters

other TouchButton?

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 ==(TouchButton?, TouchButton?)

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

Parameters

left TouchButton?

right TouchButton?

Returns

bool

operator !=(TouchButton?, TouchButton?)

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

Parameters

left TouchButton?

right TouchButton?

Returns

bool