Skip to content

PlatformAPI reference

Class RaylibTouchScreen

Namespace: MicroEngine.Raylib
Assembly: MicroEngine.Raylib.dll
Guide: Backends and platforms

Touches for the raylib platform. raylib’s own touch state is a per-frame list of points indexed by position (no cancel, no reliable identity across frames), so it is not used: a raylib window reports no touches; its controls still lay out for scripted touches.

C#
public sealed class RaylibTouchScreen : ITouchScreen

Inheritance

object ← RaylibTouchScreen

Implements

ITouchScreen

Constructors

RaylibTouchScreen()

A touch screen with no page feeding it (a desktop window): no touches, default insets and density.

C#
public RaylibTouchScreen()

Properties

CanVibrate

Whether Vibrate can do anything here.

C#
public bool CanVibrate { get; }

Property Value

bool

Overlay

Drawn over the letterboxed game in screen pixels after every frame (never in captures).

C#
public ITouchOverlay? Overlay { get; set; }

Property Value

ITouchOverlay?

PixelsPerDp

Pixels per density-independent pixel (1/160 inch): 1 on a classic desktop display, 2-4 on phones.

C#
public float PixelsPerDp { get; }

Property Value

float

SafeArea

The part of Size no notch, rounded corner or system bar covers.

C#
public RectF SafeArea { get; }

Property Value

RectF

Size

Drawable size in pixels.

C#
public Vector2 Size { get; }

Property Value

Vector2

TouchFirst

Whether touch is the main way to play here (a phone, a tablet, a touch-only browser).

C#
public bool TouchFirst { get; }

Property Value

bool

Methods

ReadTouches(List<TouchEvent>)

Moves every touch event since the previous call into events, oldest first.

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

C#
public bool Vibrate(float strength, int milliseconds)

Parameters

strength float

milliseconds int

Returns

bool