Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

useDrawnFlight

useDrawnFlight(ball): () => DrawnFlight | null

A read of where this page draws ball, a flight body whose display names one, for a view’s frame callback: the tick drawn, its rate and its place, as the ball’s own model is drawn, or null for a ball drawn at the page’s own tick. A shadow, a trail or a landing mark reads it so it stays under the drawn ball.

Parameter Type
ball Entity

() => DrawnFlight | null

const readDrawn = useDrawnFlight(ball); useFrame(() => { const drawn = readDrawn(); if (drawn) shadow.current.position.x = drawn.position.x; });