RotationChangeEvent
A rotation's move, with how many degrees it turned since the last one.
Utilização
React to incremental rotation.
// React to incremental rotation.
import { Box, haptics, rotate, signal, type RotationChangeEvent } from 'kuito';
const turned = signal(0);
// A tick of haptic feedback every 30 degrees, like a dial's detents.
const tick = (event: RotationChangeEvent) => {
const before = Math.floor(turned.value / 30);
turned.value += event.rotationChange;
if (Math.floor(turned.value / 30) !== before) void haptics.selection();
};
<Box gestures={[rotate({ onChange: tick })]} width={120} height={120} />;Declaração do tipo
export interface RotationChangeEvent extends RotationEvent {
rotationChange: number;
}Membros 8
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
rotationChange | number | Sim | — |
rotation | number | Sim | Degrees, as the rotate prop takes them. |
anchorX | number | Sim | — |
anchorY | number | Sim | — |
velocity | 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.