Skip to content

UniversalCanvas

Defined in: src/renderers/UniversalCanvas.ts:23

Implements

  • CanvasInterface

Constructors

new UniversalCanvas()

new UniversalCanvas(parent, width, height, options): UniversalCanvas

Defined in: src/renderers/UniversalCanvas.ts:92

Parameters

ParameterTypeDefault value
parentElementundefined
widthnumber640
heightnumber480
optionsPartial<UniversalCanvasOptions>{}

Returns

UniversalCanvas

Properties

renderer

renderer: CanvasInterface

Defined in: src/renderers/UniversalCanvas.ts:28


note

note: BaseParser

Defined in: src/renderers/UniversalCanvas.ts:32

Implementation of

CanvasInterface.note


width

width: number

Defined in: src/renderers/UniversalCanvas.ts:36

View width (CSS pixels)

Implementation of

CanvasInterface.width


height

height: number

Defined in: src/renderers/UniversalCanvas.ts:40

View height (CSS pixels)

Implementation of

CanvasInterface.height


dstWidth

dstWidth: number

Defined in: src/renderers/UniversalCanvas.ts:45

Backing canvas width (real pixels) Note that this factors in device pixel ratio, so it may not reflect the size of the canvas in CSS pixels

Implementation of

CanvasInterface.dstWidth


dstHeight

dstHeight: number

Defined in: src/renderers/UniversalCanvas.ts:50

Backing canvas height (real pixels) Note that this factors in device pixel ratio, so it may not reflect the size of the canvas in CSS pixels

Implementation of

CanvasInterface.dstHeight


srcWidth

srcWidth: number

Defined in: src/renderers/UniversalCanvas.ts:54

Implementation of

CanvasInterface.srcWidth


srcHeight

srcHeight: number

Defined in: src/renderers/UniversalCanvas.ts:58

Implementation of

CanvasInterface.srcHeight


frameIndex

frameIndex: number

Defined in: src/renderers/UniversalCanvas.ts:62

Implementation of

CanvasInterface.frameIndex


isReady

isReady: boolean = false

Defined in: src/renderers/UniversalCanvas.ts:66


isHtml5

isHtml5: boolean = false

Defined in: src/renderers/UniversalCanvas.ts:70


supportedStereoscopeModes

supportedStereoscopeModes: CanvasStereoscopicMode[] = []

Defined in: src/renderers/UniversalCanvas.ts:74

Implementation of

CanvasInterface.supportedStereoscopeModes


stereoscopeMode

stereoscopeMode: CanvasStereoscopicMode = CanvasStereoscopicMode.None

Defined in: src/renderers/UniversalCanvas.ts:78

Implementation of

CanvasInterface.stereoscopeMode


stereoscopeStrength

stereoscopeStrength: number = 1

Defined in: src/renderers/UniversalCanvas.ts:82

Implementation of

CanvasInterface.stereoscopeStrength

Methods

fallbackIfPossible()

fallbackIfPossible(): void

Defined in: src/renderers/UniversalCanvas.ts:133

Returns

void


switchToHtml5()

switchToHtml5(): void

Defined in: src/renderers/UniversalCanvas.ts:142

Returns

void


setCanvasSize()

setCanvasSize(width, height): void

Defined in: src/renderers/UniversalCanvas.ts:146

Parameters

ParameterType
widthnumber
heightnumber

Returns

void

Implementation of

CanvasInterface.setCanvasSize


setNote()

setNote(note): void

Defined in: src/renderers/UniversalCanvas.ts:155

Parameters

ParameterType
noteBaseParser

Returns

void

Implementation of

CanvasInterface.setNote


clear()

clear(color?): void

Defined in: src/renderers/UniversalCanvas.ts:163

Parameters

ParameterType
color?[number, number, number, number]

Returns

void

Implementation of

CanvasInterface.clear


drawFrame()

drawFrame(frameIndex): void

Defined in: src/renderers/UniversalCanvas.ts:167

Parameters

ParameterType
frameIndexnumber

Returns

void

Implementation of

CanvasInterface.drawFrame


forceUpdate()

forceUpdate(): void

Defined in: src/renderers/UniversalCanvas.ts:172

Returns

void

Implementation of

CanvasInterface.forceUpdate


requestStereoScopeMode()

requestStereoScopeMode(mode): void

Defined in: src/renderers/UniversalCanvas.ts:176

Parameters

ParameterType
modeCanvasStereoscopicMode

Returns

void

Implementation of

CanvasInterface.requestStereoScopeMode


getDataUrl()

getDataUrl(type?, quality?): string

Defined in: src/renderers/UniversalCanvas.ts:181

Parameters

ParameterType
type?string
quality?any

Returns

string

Implementation of

CanvasInterface.getDataUrl


getBlob()

getBlob(type?, quality?): Promise<Blob>

Defined in: src/renderers/UniversalCanvas.ts:185

Parameters

ParameterType
type?string
quality?any

Returns

Promise<Blob>

Implementation of

CanvasInterface.getBlob


destroy()

destroy(): void

Defined in: src/renderers/UniversalCanvas.ts:189

Returns

void

Implementation of

CanvasInterface.destroy