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

    Variable useCurrentRendererConst

    useCurrentRenderer: () => KaylaInternals.KaylaRenderer = ...

    Returns the main (usually first) renderer attached to the current game.

    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.

    Handy for pointer → world coordinate conversion or canvas measurements.

    const renderer = useCurrentRenderer();
    useTick(() => {
    const mouseWorld = renderer.getMousePos();
    rect.pos.copy(mouseWorld);
    });