Utilisation

Track raw touch movement over a drawing surface.

Ce type est utilisé par 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" />;
}

Déclaration du type

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

Membres 9

NomTypeRequisDescription
xlecture seuleGestureSourceOuiWhere the finger is in the view.
ylecture seuleGestureSourceOui—
typelecture seuleGestureTypeOui—
kindlecture seuleGestureKindOui—
configlecture seuleReadonly<Record<string, unknown>>Oui—
callbackslecture seuleReadonly<Callbacks<never, never>>Oui—
releasinglecture seuleAnimation<unknown>NonHow the motion values following it let go when it ends.
release(animation: Animation<unknown>) => TouchesGestureOuiThe 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.
activelecture seuleGestureSourceOui1 while it is active, 0 otherwise.
release — signatures de méthode

Signatures

ts
(animation: Animation<unknown>): TouchesGesture

Paramètres

NomTypeRequisDescription
animationAnimation<unknown>Oui—

Retourne

TouchesGesture

Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.