InputAPI reference
Class TouchStyle
Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.Touch.dll
Guide: Input
How touch controls look: shape, colours of each state, outline, press feedback and optional images. Only the drawing changes: hit areas, finger tracking and actions stay those of the layout, so a restyled control behaves exactly as before. Colours left null follow Tint and PressedTint. Set one style for every control kind (ButtonStyle, DPadStyle, StickStyle) or for one control (Style).
public sealed record TouchStyle : IEquatable<TouchStyle>Inheritance
Implements
Constructors
TouchStyle()
public TouchStyle()Properties
Arrows
For d-pads: whether the four arrows are drawn (an image may already show them).
public bool Arrows { get; init; }Property Value
Corner
Corner radius of a rounded square, as a fraction of the control’s radius (0..1).
public float Corner { get; init; }Property Value
Fill
Fill of an idle control (null: the tint, faint).
public Color? Fill { get; init; }Property Value
Halo
Whether a dark ring is drawn around the outline, so controls stay visible over light scenes.
public bool Halo { get; init; }Property Value
Image
An image drawn over the control’s square (twice its radius) instead of fill and outline: a sprite button, a d-pad cross, a joystick base. Pixel art scales without blur.
public PixelImage? Image { get; init; }Property Value
KnobImage
For joysticks: the knob’s image (null: a disc).
public PixelImage? KnobImage { get; init; }Property Value
KnobSize
For joysticks: the knob’s radius as a fraction of the stick’s radius.
public float KnobSize { get; init; }Property Value
Label
Colour of a button’s label (null: the tint, white while pressed).
public Color? Label { get; init; }Property Value
Opacity
Opacity of idle controls with this style, 0..1 (null: Opacity).
public float? Opacity { get; init; }Property Value
Outline
Outline and arrows of an idle control (null: the tint).
public Color? Outline { get; init; }Property Value
OutlineWidth
Thickness of the outline in dp (0: none).
public float OutlineWidth { get; init; }Property Value
PressedFill
Fill of a pressed control (null: the pressed tint).
public Color? PressedFill { get; init; }Property Value
PressedImage
The image while pressed (null: Image, tinted with the pressed fill).
public PixelImage? PressedImage { get; init; }Property Value
PressedOutline
Outline, lit arrows and the joystick’s direction arrow while pressed (null: the tint, brighter, and the pressed tint for arrows).
public Color? PressedOutline { get; init; }Property Value
PressedScale
Size of a pressed button relative to an idle one (1: no shrink).
public float PressedScale { get; init; }Property Value
Shape
The outline: a disc or a rounded square.
public TouchShape Shape { get; init; }Property Value
Methods
<Clone>$()
public TouchStyle <Clone>$()Returns
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(TouchStyle?)
public bool Equals(TouchStyle? other)Parameters
other TouchStyle?
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(TouchStyle?, TouchStyle?)
public static bool operator ==(TouchStyle? left, TouchStyle? right)Parameters
left TouchStyle?
right TouchStyle?
Returns
operator !=(TouchStyle?, TouchStyle?)
public static bool operator !=(TouchStyle? left, TouchStyle? right)Parameters
left TouchStyle?
right TouchStyle?