Skip to content

InputAPI reference

Class TouchStick

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

An analog joystick: a 2D value with intensity (Vector) and, beyond Threshold, the four direction actions as well, so digital code keeps working.

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

Inheritance

object ← TouchControl ← TouchStick

Implements

IEquatable<TouchControl>, IEquatable<TouchStick>

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

TouchStick(string, string, string, string, string)

An analog joystick: a 2D value with intensity (Vector) and, beyond Threshold, the four direction actions as well, so digital code keeps working.

C#
public TouchStick(string Id = "stick", 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

Radial dead zone as a fraction of the radius.

C#
public float DeadZone { get; init; }

Property Value

float

Directions

Whether the stick presses directions in eight sectors (the default) or four.

C#
public StickDirections Directions { get; init; }

Property Value

StickDirections

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

Placement

Whether the stick stays at its anchored position or appears under the thumb (floating, the default).

C#
public StickPlacement Placement { get; init; }

Property Value

StickPlacement

Right

C#
public string Right { get; init; }

Property Value

string

Threshold

Deflection beyond the dead zone at which direction actions go down.

C#
public float Threshold { get; init; }

Property Value

float

Up

C#
public string Up { get; init; }

Property Value

string

Zone

For a floating stick, where a thumb may start it, as fractions (0..1) of the safe area. Default: the lower left.

C#
public RectF Zone { get; init; }

Property Value

RectF

Methods

<Clone>$()

C#
public override TouchStick <Clone>$()

Returns

TouchStick

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(TouchStick?)

C#
public bool Equals(TouchStick? other)

Parameters

other TouchStick?

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

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

Parameters

left TouchStick?

right TouchStick?

Returns

bool

operator !=(TouchStick?, TouchStick?)

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

Parameters

left TouchStick?

right TouchStick?

Returns

bool