Skip to content

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.

C#
public readonly struct TouchControlView : IEquatable<TouchControlView>

Implements

IEquatable<TouchControlView>

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.

C#
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.

C#
public Vector2 Center { get; init; }

Property Value

Vector2

Control

The control as declared in the layout.

C#
public TouchControl Control { get; init; }

Property Value

TouchControl

Deflection

The thumb’s offset from the base, each axis -1..1 (sticks and d-pads).

C#
public Vector2 Deflection { get; init; }

Property Value

Vector2

Directions

The direction actions pressed now (sticks and d-pads).

C#
public IReadOnlySet<InputMap.StickDirection> Directions { get; init; }

Property Value

IReadOnlySet<InputMap.StickDirection>

Glow

1 while pressed, fading to 0 shortly after release (press feedback).

C#
public float Glow { get; init; }

Property Value

float

Held

Whether a finger is on it.

C#
public bool Held { get; init; }

Property Value

bool

Layout

The layout, for its tints.

C#
public TouchLayout Layout { get; init; }

Property Value

TouchLayout

Opacity

Opacity of the idle control, 0..1.

C#
public float Opacity { get; init; }

Property Value

float

Origin

Where a joystick’s base is (it moves with a floating stick); the centre for other controls.

C#
public Vector2 Origin { get; init; }

Property Value

Vector2

PixelsPerDp

The layout’s scale, for line widths in dp.

C#
public float PixelsPerDp { get; init; }

Property Value

float

Pressed

Whether the control is pressed (held, toggled on, pushed).

C#
public bool Pressed { get; init; }

Property Value

bool

Radius

Its drawn radius.

C#
public float Radius { get; init; }

Property Value

float

Style

The style that applies (the control’s own, else its kind’s from the layout, else the default).

C#
public TouchStyle Style { get; init; }

Property Value

TouchStyle

Toggled

For toggle buttons: whether it is on.

C#
public bool Toggled { get; init; }

Property Value

bool

Value

A joystick’s value after its dead zone, or a d-pad’s direction.

C#
public Vector2 Value { get; init; }

Property Value

Vector2

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)

C#
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)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(TouchControlView)

C#
public bool Equals(TouchControlView other)

Parameters

other TouchControlView

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(TouchControlView, TouchControlView)

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

Parameters

left TouchControlView

right TouchControlView

Returns

bool

operator !=(TouchControlView, TouchControlView)

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

Parameters

left TouchControlView

right TouchControlView

Returns

bool