Skip to content

ICanvas

Unofficial

Canvas interface for PixiJS rendering.

Import:

import type { ICanvas } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ICanvas extends Partial<EventTarget>

Extends: Partial<EventTarget>

Properties

PropertyTypeDescription
heightnumberCanvas height.
widthnumberCanvas width.

Methods

MethodReturnsDescription
getContext(contextId, options?)CanvasRenderingContext2D | nullReturns a 2D rendering context.
getContext(contextId, options?)null | WebGLRenderingContextReturns a WebGL rendering context.
getContext(contextId, options?)null | WebGL2RenderingContextReturns a WebGL2 rendering context.
toBlob(callback, type?, quality?)voidConverts the canvas to a blob.
toDataURL(type?, quality?)stringConverts the canvas to a data URL.