ZJsSurfaceView

JavaScript implementation of ZSurfaceView for WebGPU rendering.

This class provides a surface view that automatically handles canvas resizing using ResizeObserver and maintains proper aspect ratio and device pixel ratio.

Parameters

canvas

The HTML canvas element to render to

See also

Constructors

Link copied to clipboard
constructor(canvas: HTMLCanvasElement)

Properties

Link copied to clipboard
Link copied to clipboard

Event handler for surface view events (ready, resize, render). When set, automatically calls onReady() to initialize the surface.

Link copied to clipboard
open override var eventQueue: ZEventQueue?

Event queue that accumulates user input events for synchronous processing during the game loop frame update phase. When set, the manager will enqueue all input events to this queue.

Link copied to clipboard
open override val surfaceHeight: Int

Current surface height in pixels

Link copied to clipboard
open override val surfaceWidth: Int

Current surface width in pixels

Functions

Link copied to clipboard
open override fun dispose()

Disposes the surface view and releases all associated resources.