Examples
// DOMWindowPlugin calls this for the canvas registered for a Window.
setUpFileEvents(world, canvas)Function
setUpFileEvents(world: World, target: HTMLElement): voidBridges browser file drag-and-drop input into the engine’s typed window event resources. The DOMWindowPlugin integration uses this helper after registering a canvas.
The dragover listener constructs and writes a FileDrag event, then
calls event.preventDefault(). The drop listener constructs and writes a
FileDrop event, then also calls event.preventDefault(). No event
propagation is stopped. Each event is written through the matching typed
Events resource, resolved with typeidGeneric(Events, [FileDrag]) or
typeidGeneric(Events, [FileDrop]).
The target must provide addEventListener and accept browser drag events; the
DOM integration passes an HTMLCanvasElement. The world must already
contain the Events<FileDrag> and Events<FileDrop> resources, normally
supplied by the WindowPlugin required by the DOMWindowPlugin.
// DOMWindowPlugin calls this for the canvas registered for a Window.
setUpFileEvents(world, canvas)