fumo:events
fumo:events owns persistent callbacks. Callbacks execute on FumoEngine’s
serialized script lane: createMove is pumped by the command hook and
render is pumped by the view-render frame-start hook, never from Present.
import { events } from "fumo:events";
const unsubscribe = events.on("render", ({ displaySize, deltaTime }) => {
console.log(displaySize.width, deltaTime);
});
events.once("mapLoad", ({ map }) => {
console.log("Loaded", map);
});
events.on() and events.once() return an unsubscribe function. events.off
accepts a numeric subscription ID for low-level integrations, although normal
scripts should retain and call the returned function.
Implemented host events:
| Event | Payload |
|---|---|
load | undefined |
shutdown | undefined |
createMove | { displaySize, deltaTime } |
render | { displaySize, deltaTime } |
mapLoad | { map, value } |
mapUnload | { map, value } |
menuOpenChanged | { value: "true" | "false" } |
configLoaded | { value } |
frameStage, gameEvent, and input are reserved subscription names. Their
native bridges are not emitted yet.
Each callback has an 8 ms hard execution deadline. Exceptions are written to the JavaScript console and do not unwind through the game hook.