跳转到内容

KineticScroll

此内容尚不支持你的语言。

Defined in: ui/collection/kinetic-scroll.ts:20

new KineticScroll(opts?): KineticScroll

Defined in: ui/collection/kinetic-scroll.ts:27

KineticScrollOptions = {}

KineticScroll

beginDrag(): void

Defined in: ui/collection/kinetic-scroll.ts:34

A finger/pointer grabbed the content: cancel any coast, start sampling.

void


endDrag(): void

Defined in: ui/collection/kinetic-scroll.ts:49

Release: the sampled velocity carries over into coasting.

void


getVelocity(): Vec2

Defined in: ui/collection/kinetic-scroll.ts:75

Vec2


isCoasting(): boolean

Defined in: ui/collection/kinetic-scroll.ts:69

Coasting = released with speed above the rest floor.

boolean


isDragging(): boolean

Defined in: ui/collection/kinetic-scroll.ts:64

boolean


killAxis(axis): void

Defined in: ui/collection/kinetic-scroll.ts:60

Kill one axis of the coast (that axis hit its clamp edge).

"x" | "y"

void


sample(delta, dt): void

Defined in: ui/collection/kinetic-scroll.ts:40

Feed one frame’s offset delta (px) while the drag is held.

Vec2

number

void


stop(): void

Defined in: ui/collection/kinetic-scroll.ts:54

Hard stop (new grab, wheel input, or hitting a clamp edge).

void


tick(dt): Vec2

Defined in: ui/collection/kinetic-scroll.ts:83

Advance one coast frame: returns the offset delta to apply and decays the velocity. Zero vector when not coasting.

number

Vec2