TouchesGesture
A touches() gesture, a pan from the first touch, whose x and y are where the finger is in the view.
Usage
Track raw touch movement over a drawing surface.
This type is used by touches
// 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
export interface TouchesGesture extends Gesture {
/** Where the finger is in the view. */
readonly x: GestureSource;
readonly y: GestureSource;
}Members 9
| Name | Type | Required | Description |
|---|---|---|---|
xreadonly | GestureSource | Yes | Where the finger is in the view. |
yreadonly | GestureSource | Yes | — |
typereadonly | GestureType | Yes | — |
kindreadonly | GestureKind | Yes | — |
configreadonly | Readonly<Record<string, unknown>> | Yes | — |
callbacksreadonly | Readonly<Callbacks<never, never>> | Yes | — |
releasingreadonly | Animation<unknown> | No | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => TouchesGesture | Yes | The 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. |
activereadonly | GestureSource | Yes | 1 while it is active, 0 otherwise. |
release — method signatures
Signatures
(animation: Animation<unknown>): TouchesGestureParameters
| Name | Type | Required | Description |
|---|---|---|---|
animation | Animation<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.