InputAPI reference
Interface ITouchScreen
Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.Touch.dll
Guide: Input
A screen that may be touched, a capability a backend offers (TryGetCapability``1): its drawable size, the
area free of notches, rounded corners and system bars, its density, the touches since the last frame, and a layer
drawn over the game for on-screen controls. Coordinates are drawable pixels with the origin at the top left.
SDL reports phones and touch screens, the browser host reports Pointer Events, the headless platform lets tests
touch it (HeadlessTouchScreen).
public interface ITouchScreenProperties
CanVibrate
Whether Vibrate can do anything here.
bool CanVibrate { get; }Property Value
Overlay
Drawn over the letterboxed game in screen pixels after every frame (never in captures).
ITouchOverlay? Overlay { get; set; }Property Value
PixelsPerDp
Pixels per density-independent pixel (1/160 inch): 1 on a classic desktop display, 2-4 on phones.
float PixelsPerDp { get; }Property Value
SafeArea
The part of Size no notch, rounded corner or system bar covers.
RectF SafeArea { get; }Property Value
Size
Drawable size in pixels.
Vector2 Size { get; }Property Value
TouchFirst
Whether touch is the main way to play here (a phone, a tablet, a touch-only browser).
bool TouchFirst { get; }Property Value
Methods
ReadTouches(List<TouchEvent>)
Moves every touch event since the previous call into events, oldest first.
void ReadTouches(List<TouchEvent> events)Parameters
events List<TouchEvent>
Vibrate(float, int)
A short vibration (strength 0..1). Returns false when the device cannot vibrate.
bool Vibrate(float strength, int milliseconds)Parameters
strength float
milliseconds int