RotateOptions
Sets a rotate() gesture's callbacks, and when and where it takes touches.
Utilisation
Set a value from a rotation gesture.
Ce type est utilisé par rotate
// Set a value from a rotation gesture.
import { Box, motion, rotate, spring, type RotationEvent } from 'kuito';
function Dial(props: { onSet: (degrees: number) => void }) {
const turn = rotate().release(spring());
const angle = motion(0).follows(turn.rotation);
const settle = (event: RotationEvent) => props.onSet(Math.round(event.rotation / 15) * 15);
return (
<Box rotate={angle} gestures={[rotate({ onEnd: settle }), turn]} width={120} height={120} />
);
}Déclaration du type
export type RotateOptions = Common & Callbacks<RotationEvent, RotationChangeEvent>;Membres 5
| Nom | Type | Requis | Description |
|---|---|---|---|
disabled | boolean | Non | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | Non | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: RotationEvent) => void | Non | It activated. |
onChange | (event: RotationChangeEvent) => void | Non | It moved, with the change since the last move. |
onEnd | (event: RotationEvent, success: boolean) => void | Non | It ended after activating: success is false when it was cancelled. |
onStart — signatures de méthode
Signatures
onChange — signatures de méthode
Signatures
(event: RotationChangeEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | RotationChangeEvent | Oui | — |
Retourne
void
onEnd — signatures de méthode
Signatures
(event: RotationEvent, success: boolean): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | RotationEvent | Oui | — |
success | boolean | Oui | — |
Retourne
void
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.