InputAPI reference
Struct TouchControlView
Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.Touch.dll
Guide: Input
Everything a skin needs to draw one control as it is this frame, in screen pixels.
public readonly struct TouchControlView : IEquatable<TouchControlView>Implements
Constructors
TouchControlView(TouchControl, TouchStyle, Vector2, float, float, float, float, bool, bool, bool, Vector2, Vector2, Vector2, IReadOnlySet<StickDirection>, TouchLayout)
Everything a skin needs to draw one control as it is this frame, in screen pixels.
public TouchControlView(TouchControl Control, TouchStyle Style, Vector2 Center, float Radius, float PixelsPerDp, float Opacity, float Glow, bool Pressed, bool Toggled, bool Held, Vector2 Origin, Vector2 Deflection, Vector2 Value, IReadOnlySet<InputMap.StickDirection> Directions, TouchLayout Layout)Parameters
Control TouchControl
The control as declared in the layout.
Style TouchStyle
The style that applies (the control’s own, else its kind’s from the layout, else the default).
Center Vector2
The control’s centre.
Radius float
Its drawn radius.
PixelsPerDp float
The layout’s scale, for line widths in dp.
Opacity float
Opacity of the idle control, 0..1.
Glow float
1 while pressed, fading to 0 shortly after release (press feedback).
Pressed bool
Whether the control is pressed (held, toggled on, pushed).
Toggled bool
For toggle buttons: whether it is on.
Held bool
Whether a finger is on it.
Origin Vector2
Where a joystick’s base is (it moves with a floating stick); the centre for other controls.
Deflection Vector2
The thumb’s offset from the base, each axis -1..1 (sticks and d-pads).
Value Vector2
A joystick’s value after its dead zone, or a d-pad’s direction.
Directions IReadOnlySet<InputMap.StickDirection>
The direction actions pressed now (sticks and d-pads).
Layout TouchLayout
The layout, for its tints.
Properties
Center
The control’s centre.
public Vector2 Center { get; init; }Property Value
Control
The control as declared in the layout.
public TouchControl Control { get; init; }Property Value
Deflection
The thumb’s offset from the base, each axis -1..1 (sticks and d-pads).
public Vector2 Deflection { get; init; }Property Value
Directions
The direction actions pressed now (sticks and d-pads).
public IReadOnlySet<InputMap.StickDirection> Directions { get; init; }Property Value
IReadOnlySet<InputMap.StickDirection>
Glow
1 while pressed, fading to 0 shortly after release (press feedback).
public float Glow { get; init; }Property Value
Held
Whether a finger is on it.
public bool Held { get; init; }Property Value
Layout
The layout, for its tints.
public TouchLayout Layout { get; init; }Property Value
Opacity
Opacity of the idle control, 0..1.
public float Opacity { get; init; }Property Value
Origin
Where a joystick’s base is (it moves with a floating stick); the centre for other controls.
public Vector2 Origin { get; init; }Property Value
PixelsPerDp
The layout’s scale, for line widths in dp.
public float PixelsPerDp { get; init; }Property Value
Pressed
Whether the control is pressed (held, toggled on, pushed).
public bool Pressed { get; init; }Property Value
Radius
Its drawn radius.
public float Radius { get; init; }Property Value
Style
The style that applies (the control’s own, else its kind’s from the layout, else the default).
public TouchStyle Style { get; init; }Property Value
Toggled
For toggle buttons: whether it is on.
public bool Toggled { get; init; }Property Value
Value
A joystick’s value after its dead zone, or a d-pad’s direction.
public Vector2 Value { get; init; }Property Value
Methods
Deconstruct(out TouchControl, out TouchStyle, out Vector2, out float, out float, out float, out float, out bool, out bool, out bool, out Vector2, out Vector2, out Vector2, out IReadOnlySet<StickDirection>, out TouchLayout)
public void Deconstruct(out TouchControl Control, out TouchStyle Style, out Vector2 Center, out float Radius, out float PixelsPerDp, out float Opacity, out float Glow, out bool Pressed, out bool Toggled, out bool Held, out Vector2 Origin, out Vector2 Deflection, out Vector2 Value, out IReadOnlySet<InputMap.StickDirection> Directions, out TouchLayout Layout)Parameters
Control TouchControl
Style TouchStyle
Center Vector2
Radius float
PixelsPerDp float
Opacity float
Glow float
Pressed bool
Toggled bool
Held bool
Origin Vector2
Deflection Vector2
Value Vector2
Directions IReadOnlySet<InputMap.StickDirection>
Layout TouchLayout
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(TouchControlView)
public bool Equals(TouchControlView other)Parameters
other TouchControlView
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(TouchControlView, TouchControlView)
public static bool operator ==(TouchControlView left, TouchControlView right)Parameters
left TouchControlView
right TouchControlView
Returns
operator !=(TouchControlView, TouchControlView)
public static bool operator !=(TouchControlView left, TouchControlView right)Parameters
left TouchControlView
right TouchControlView