OptionalgameThe attached game instance (set via attachTo).
Current canvas-space pointer X coordinate.
Current canvas-space pointer Y coordinate.
ProtectedpointerPointer related event-emitter
Whether the renderer is currently running (RAF loop active).
The target canvas element.
The 2D rendering context.
The logical viewport width (game coordinate space).
Center X of the viewport (viewportWidth / 2).
Center Y of the viewport (viewportHeight / 2).
The logical viewport height (game coordinate space).
The camera/pixel resolution width (canvas backing resolution).
The camera/pixel resolution height (canvas backing resolution).
Current measured FPS (updated every second).
ProtectedpointerProtectedonTransforms canvas-space coordinates to world-space coordinates.
Mouse X in canvas pixels
Mouse Y in canvas pixels
World-space position
Returns the current pointer position in world coordinates.
Requires listenPointerUpdates() to have been called.
World-space position
Registers a draw callback that receives a normalized KaylaEvent.
Paint handler
Unsubscribe function
Attaches this renderer to a game.
Sets renderer.game and adds it to game.#renderers.
The game to attach to
Detaches this renderer from its game (if attached).
Registers a listener for the specified event.
Event name
This emitter for chaining
Registers a one-time listener for the specified event.
The listener is automatically removed after the first invocation.
Event name
This emitter for chaining
Removes a listener for the specified event.
Event name
This emitter for chaining
Emits an event, invoking all registered listeners with the provided arguments.
If the event is "error" and no listeners are registered, the first argument (the error)
will be thrown.
Event name
true if any listeners were invoked, false otherwise
Removes all listeners for the specified event, or all listeners if no event is provided.
Event name
Optionalevent: KOptional event name to clear listeners for
This emitter for chaining
Returns the number of listeners registered for the specified event.
Event name
The event to count listeners for
The number of registered listeners
Update canvas resolution to match camera Units remain the same
Apply viewport → canvas transform Scale computed dynamically each frame
Renderer wrapper that extends LEA renderer with game integration and pointer utilities.