@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Variable useTickConst

    useTick: (
        onTick: (deltaS: number, event: KaylaEvent) => void,
        substepper?: KaylaInternals.KaylaSubstepper,
    ) => void = ...

    Registers a function that runs on every game tick (update phase).

    This hook MUST be called at the top level of a component function — never inside loops, conditions, nested functions, or callbacks. The call order of all hooks is strictly fixed across every refresh; reordering calls will corrupt internal state.

    Multiple useTick calls stack and run in declaration order. Call event.preventDefault() to skip remaining tick handlers (including default entity update).

    Type Declaration

    useTick((dt, event) => {
    rect.pos.x += 200 * dt;
    if (rect.right > 800) {
    rect.pos.x = 800 - rect.width;
    event.preventDefault(); // skip default update if desired
    }
    });