Skip to main content

Class: HorizonCanvasLayerCanvasInstanceClass

An implementation of MapCanvasLayerCanvasInstance.

Implements

Constructors

constructor

new HorizonCanvasLayerCanvasInstanceClass(canvas, context, isDisplayed): HorizonCanvasLayerCanvasInstanceClass

Creates a new canvas instance.

Parameters

NameTypeDescription
canvasHTMLCanvasElementThe canvas element.
contextCanvasRenderingContext2DThe canvas 2D rendering context.
isDisplayedbooleanWhether the canvas is displayed.

Returns

HorizonCanvasLayerCanvasInstanceClass

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:49

Properties

canvas

Readonly canvas: HTMLCanvasElement

The canvas element.

Implementation of

HorizonCanvasLayerCanvasInstance.canvas

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:50


context

Readonly context: CanvasRenderingContext2D

The canvas 2D rendering context.

Implementation of

HorizonCanvasLayerCanvasInstance.context

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:51


isDisplayed

Readonly isDisplayed: boolean

Whether the canvas is displayed.

Implementation of

HorizonCanvasLayerCanvasInstance.isDisplayed

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:52

Methods

clear

clear(): void

Clears this canvas.

Returns

void

Implementation of

HorizonCanvasLayerCanvasInstance.clear

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:57


reset

reset(): void

Resets this instance's canvas. This will erase the canvas of all drawn pixels, reset its state (including all styles, transformations, and cached paths), and clear the Coherent GT command buffer associated with it.

Returns

void

Implementation of

HorizonCanvasLayerCanvasInstance.reset

Defined in

src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:62