TapEvent
Where a tap landed, in the view and on screen.
Utilização
Respond to a tap's coordinates.
// Respond to a tap's coordinates.
import { Box, motion, tap, timing, type TapEvent } from 'kuito';
function Ripple() {
const x = motion(0);
const y = motion(0);
const grow = motion(0);
// Start the ripple where the finger landed.
const startAt = (event: TapEvent) => {
x.value = event.x;
y.value = event.y;
grow.value = 0;
grow.value = timing(250).to(1);
};
return (
<Box gestures={[tap({ onEnd: startAt })]} width={200} height={56}>
<Box position="absolute" translateX={x} translateY={y} scale={grow} width={8} height={8} />
</Box>
);
}Declaração do tipo
export type TapEvent = PositionEvent;Membros 7
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
x | number | Sim | — |
y | number | Sim | — |
absoluteX | number | Sim | — |
absoluteY | number | Sim | — |
state | number | Sim | — |
numberOfPointers | number | Sim | — |
pointerType | number | Sim | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.