InputAPI reference
Class TouchControl
Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.Touch.dll
Guide: Input
One on-screen control of a TouchLayout. Positions and sizes are density-independent pixels (dp, 1/160 inch), so a control keeps its physical size on any screen; the layout shrinks everything when a screen is too small.
public abstract record TouchControl : IEquatable<TouchControl>Inheritance
Derived
TouchButton, TouchDPad, TouchStick
Implements
Constructors
TouchControl(string)
One on-screen control of a TouchLayout. Positions and sizes are density-independent pixels (dp, 1/160 inch), so a control keeps its physical size on any screen; the layout shrinks everything when a screen is too small.
protected TouchControl(string Id)Parameters
Id string
Names the control for SetVisible, scripts and tests.
TouchControl(TouchControl)
protected TouchControl(TouchControl original)Parameters
original TouchControl
Properties
Anchor
The corner or edge of the safe area the control is placed from.
public TouchAnchor Anchor { get; init; }Property Value
EqualityContract
protected virtual Type EqualityContract { get; }Property Value
Id
Names the control for SetVisible, scripts and tests.
public string Id { get; init; }Property Value
Offset
Centre of the control from its anchor, in dp, pointing into the screen (x from the anchored side, y from the anchored edge).
public Vector2 Offset { get; init; }Property Value
Radius
Radius of the drawn control in dp; 0 uses the kind’s default.
public float Radius { get; init; }Property Value
Style
How this control looks (null: its kind’s style in the layout). Changes the drawing only, never the hit area.
public TouchStyle? Style { get; init; }Property Value
Visible
Shown and touchable when the layout starts (see SetVisible).
public bool Visible { get; init; }Property Value
Methods
<Clone>$()
public abstract TouchControl <Clone>$()Returns
Deconstruct(out string)
public void Deconstruct(out string Id)Parameters
Id string
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(TouchControl?)
public virtual bool Equals(TouchControl? other)Parameters
other TouchControl?
Returns
GetHashCode()
public override int GetHashCode()Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)Parameters
builder StringBuilder
Returns
ToString()
public override string ToString()Returns
Operators
operator ==(TouchControl?, TouchControl?)
public static bool operator ==(TouchControl? left, TouchControl? right)Parameters
left TouchControl?
right TouchControl?
Returns
operator !=(TouchControl?, TouchControl?)
public static bool operator !=(TouchControl? left, TouchControl? right)Parameters
left TouchControl?
right TouchControl?