Usage

Track raw touch movement over a drawing surface.

This type is used by touches

tsx
// Track raw touch movement over a drawing surface.
import { Box, touches } from 'kuito';

export function TouchSurface() {
  const input = touches({ onChange: (event) => console.log(event.changeX, event.changeY) });
  return <Box gestures={[input]} width={240} height={240} backgroundColor="#e2e8f0" />;
}

Type declaration

ts
export interface TouchesGesture extends Gesture {
  /** Where the finger is in the view. */
  readonly x: GestureSource;
  readonly y: GestureSource;
}

Members 9

NameTypeRequiredDescription
xreadonlyGestureSourceYesWhere the finger is in the view.
yreadonlyGestureSourceYes—
typereadonlyGestureTypeYes—
kindreadonlyGestureKindYes—
configreadonlyReadonly<Record<string, unknown>>Yes—
callbacksreadonlyReadonly<Callbacks<never, never>>Yes—
releasingreadonlyAnimation<unknown>NoHow the motion values following it let go when it ends.
release(animation: Animation<unknown>) => TouchesGestureYesThe same gesture, letting go with animation: each follower runs it with the gesture's velocity, toward its own home (its first value) unless the animation names a target.
activereadonlyGestureSourceYes1 while it is active, 0 otherwise.
release — method signatures

Signatures

ts
(animation: Animation<unknown>): TouchesGesture

Parameters

NameTypeRequiredDescription
animationAnimation<unknown>Yes—

Returns

TouchesGesture

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.