The type of the options the application in the sandbox will be constructed with.
Construct a new CanvasSandbox.
The window we're running inside.
The canvas node we're drawing to.
The canvas implementation you want to use in this sandbox. see Canvas2D and Canvas3D.
The application that is going to run in the sandbox.
The canvas that the application will receive.
The options that will be passed to the application.
The options that the application should be constructed with.
OptionalsandboxOptions: Partial<CanvasSandboxOptions>The options for the sandbox itself.
ReadonlyapplicationThe application running inside the sandbox.
ReadonlycanvasOur convenience canvas wrapper, which we provide to the application to render to.
ReadonlycanvasThe canvas node that we're drawing into.
ReadonlydocumentThe document the sandbox is interacting with.
ReadonlyrenderThe render loop we use to control frame rendering.
ReadonlysandboxThe options for this sandbox.
ReadonlyshakeOur handler for device shaking.
ReadonlywindowThe window the sandbox is running in.
The
CanvasSandboxprovides a scaffold to quickly perform experiments with aHTMLCanvasElementin a document. Common functionality for such experiments is implemented in the sandbox already.Example
main.tsindex.html