Skip to content

Class: LeaferCanvas โ€‹

Hierarchy โ€‹

Table of contents โ€‹

Constructors โ€‹

Properties โ€‹

Accessors โ€‹

Methods โ€‹

Constructors โ€‹

constructor โ€‹

โ€ข new LeaferCanvas(config?, manager?): LeaferCanvas

Parameters โ€‹

NameType
config?ILeaferCanvasConfig
manager?ICanvasManager

Returns โ€‹

LeaferCanvas

Inherited from โ€‹

LeaferCanvasBase.constructor

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:51

Properties โ€‹

view โ€‹

โ€ข view: HTMLCanvasElement

Overrides โ€‹

LeaferCanvasBase.view

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:9


parentView โ€‹

โ€ข parentView: HTMLElement

Overrides โ€‹

LeaferCanvasBase.parentView

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:10


resizeObserver โ€‹

โ€ข Protected resizeObserver: ResizeObserver

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:31


autoBounds โ€‹

โ€ข Protected autoBounds: IAutoBounds

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:32


resizeListener โ€‹

โ€ข Protected resizeListener: IResizeEventListener

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:33


context โ€‹

โ€ข context: ICanvasContext2D

Inherited from โ€‹

LeaferCanvasBase.context

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:27


smooth โ€‹

โ€ข smooth: boolean

Inherited from โ€‹

LeaferCanvasBase.smooth

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:32


smoothLevel โ€‹

โ€ข smoothLevel: ImageSmoothingQuality

Inherited from โ€‹

LeaferCanvasBase.smoothLevel

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:35


opacity โ€‹

โ€ข opacity: number

Inherited from โ€‹

LeaferCanvasBase.opacity

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:38


fillStyle โ€‹

โ€ข fillStyle: string | object

Inherited from โ€‹

LeaferCanvasBase.fillStyle

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:50


strokeStyle โ€‹

โ€ข strokeStyle: string | object

Inherited from โ€‹

LeaferCanvasBase.strokeStyle

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:53


strokeWidth โ€‹

โ€ข strokeWidth: number

Inherited from โ€‹

LeaferCanvasBase.strokeWidth

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:57


strokeCap โ€‹

โ€ข strokeCap: string

Inherited from โ€‹

LeaferCanvasBase.strokeCap

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:60


strokeJoin โ€‹

โ€ข strokeJoin: string

Inherited from โ€‹

LeaferCanvasBase.strokeJoin

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:63


dashOffset โ€‹

โ€ข dashOffset: number

Inherited from โ€‹

LeaferCanvasBase.dashOffset

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:73


miterLimit โ€‹

โ€ข miterLimit: number

Inherited from โ€‹

LeaferCanvasBase.miterLimit

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:76


shadowBlur โ€‹

โ€ข shadowBlur: number

Inherited from โ€‹

LeaferCanvasBase.shadowBlur

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:80


shadowColor โ€‹

โ€ข shadowColor: string

Inherited from โ€‹

LeaferCanvasBase.shadowColor

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:83


shadowOffsetX โ€‹

โ€ข shadowOffsetX: number

Inherited from โ€‹

LeaferCanvasBase.shadowOffsetX

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:86


shadowOffsetY โ€‹

โ€ข shadowOffsetY: number

Inherited from โ€‹

LeaferCanvasBase.shadowOffsetY

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:89


filter โ€‹

โ€ข filter: string

Inherited from โ€‹

LeaferCanvasBase.filter

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:92


font โ€‹

โ€ข font: string

Inherited from โ€‹

LeaferCanvasBase.font

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:96


fontKerning โ€‹

โ€ข fontKerning: string

Inherited from โ€‹

LeaferCanvasBase.fontKerning

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:99


fontStretch โ€‹

โ€ข fontStretch: string

Inherited from โ€‹

LeaferCanvasBase.fontStretch

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:102


fontVariantCaps โ€‹

โ€ข fontVariantCaps: string

Inherited from โ€‹

LeaferCanvasBase.fontVariantCaps

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:105


textAlign โ€‹

โ€ข textAlign: string

Inherited from โ€‹

LeaferCanvasBase.textAlign

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:109


textBaseline โ€‹

โ€ข textBaseline: string

Inherited from โ€‹

LeaferCanvasBase.textBaseline

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:112


textRendering โ€‹

โ€ข textRendering: string

Inherited from โ€‹

LeaferCanvasBase.textRendering

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:115


wordSpacing โ€‹

โ€ข wordSpacing: string

Inherited from โ€‹

LeaferCanvasBase.wordSpacing

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:118


letterSpacing โ€‹

โ€ข letterSpacing: string

Inherited from โ€‹

LeaferCanvasBase.letterSpacing

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:121


direction โ€‹

โ€ข direction: string

Inherited from โ€‹

LeaferCanvasBase.direction

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:125


innerId โ€‹

โ€ข Readonly innerId: number

Inherited from โ€‹

LeaferCanvasBase.innerId

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:16


name โ€‹

โ€ข name: string

Inherited from โ€‹

LeaferCanvasBase.name

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:18


manager โ€‹

โ€ข manager: ICanvasManager

Inherited from โ€‹

LeaferCanvasBase.manager

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:20


size โ€‹

โ€ข size: IScreenSizeData

Inherited from โ€‹

LeaferCanvasBase.size

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:22


bounds โ€‹

โ€ข bounds: IBounds

Inherited from โ€‹

LeaferCanvasBase.bounds

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:33


clientBounds โ€‹

โ€ข clientBounds: IBoundsData

Inherited from โ€‹

LeaferCanvasBase.clientBounds

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:34


config โ€‹

โ€ข config: ILeaferCanvasConfig

Inherited from โ€‹

LeaferCanvasBase.config

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:36


autoLayout โ€‹

โ€ข autoLayout: boolean

Inherited from โ€‹

LeaferCanvasBase.autoLayout

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:38


unreal โ€‹

โ€ข Optional unreal: boolean

Inherited from โ€‹

LeaferCanvasBase.unreal

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:43


recycled โ€‹

โ€ข Optional recycled: boolean

Inherited from โ€‹

LeaferCanvasBase.recycled

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:45


worldTransform โ€‹

โ€ข worldTransform: IMatrixData

Inherited from โ€‹

LeaferCanvasBase.worldTransform

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:47


savedBlendMode โ€‹

โ€ข Protected savedBlendMode: IBlendMode

Inherited from โ€‹

LeaferCanvasBase.savedBlendMode

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:49

Accessors โ€‹

zIndex โ€‹

โ€ข set zIndex(zIndex): void

Parameters โ€‹

NameType
zIndexnumber

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:12


childIndex โ€‹

โ€ข set childIndex(index): void

Parameters โ€‹

NameType
indexnumber

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:18


backgroundColor โ€‹

โ€ข get backgroundColor(): string

Returns โ€‹

string

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:60

โ€ข set backgroundColor(color): void

Parameters โ€‹

NameType
colorstring

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:59


hittable โ€‹

โ€ข get hittable(): boolean

Returns โ€‹

boolean

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:63

โ€ข set hittable(hittable): void

Parameters โ€‹

NameType
hittableboolean

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:62


blendMode โ€‹

โ€ข get blendMode(): IBlendMode

Returns โ€‹

IBlendMode

Inherited from โ€‹

LeaferCanvasBase.blendMode

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:45

โ€ข set blendMode(value): void

Parameters โ€‹

NameType
valueIBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.blendMode

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:40


dashPattern โ€‹

โ€ข get dashPattern(): number[]

Returns โ€‹

number[]

Inherited from โ€‹

LeaferCanvasBase.dashPattern

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:68

โ€ข set dashPattern(value): void

Parameters โ€‹

NameType
valuenumber[]

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.dashPattern

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:65


width โ€‹

โ€ข get width(): number

Returns โ€‹

number

Inherited from โ€‹

LeaferCanvasBase.width

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:24


height โ€‹

โ€ข get height(): number

Returns โ€‹

number

Inherited from โ€‹

LeaferCanvasBase.height

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:25


pixelRatio โ€‹

โ€ข get pixelRatio(): number

Returns โ€‹

number

Inherited from โ€‹

LeaferCanvasBase.pixelRatio

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:27


pixelWidth โ€‹

โ€ข get pixelWidth(): number

Returns โ€‹

number

Inherited from โ€‹

LeaferCanvasBase.pixelWidth

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:28


pixelHeight โ€‹

โ€ข get pixelHeight(): number

Returns โ€‹

number

Inherited from โ€‹

LeaferCanvasBase.pixelHeight

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:29


allowBackgroundColor โ€‹

โ€ข get allowBackgroundColor(): boolean

Returns โ€‹

boolean

Inherited from โ€‹

LeaferCanvasBase.allowBackgroundColor

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:31

Methods โ€‹

init โ€‹

โ–ธ init(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.init

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:35


__createView โ€‹

โ–ธ __createView(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:65


__createViewFrom โ€‹

โ–ธ __createViewFrom(inputView): void

Parameters โ€‹

NameType
inputViewstring | object

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:69


setAbsolute โ€‹

โ–ธ setAbsolute(view): void

Parameters โ€‹

NameType
viewHTMLCanvasElement

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:104


updateViewSize โ€‹

โ–ธ updateViewSize(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.updateViewSize

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:110


updateClientBounds โ€‹

โ–ธ updateClientBounds(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.updateClientBounds

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:121


startAutoLayout โ€‹

โ–ธ startAutoLayout(autoBounds, listener): void

Parameters โ€‹

NameType
autoBoundsIAutoBounds
listenerIResizeEventListener

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.startAutoLayout

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:125


imitateResizeObserver โ€‹

โ–ธ imitateResizeObserver(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:169


checkAutoBounds โ€‹

โ–ธ checkAutoBounds(parentSize): void

Parameters โ€‹

NameType
parentSizeISizeData

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:176


stopAutoLayout โ€‹

โ–ธ stopAutoLayout(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.stopAutoLayout

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:188


emitResize โ€‹

โ–ธ emitResize(size): void

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

void

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:197


unrealCanvas โ€‹

โ–ธ unrealCanvas(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.unrealCanvas

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:205


destroy โ€‹

โ–ธ destroy(): void

Returns โ€‹

void

Overrides โ€‹

LeaferCanvasBase.destroy

Defined in โ€‹

leafer/packages/canvas/canvas-web/src/LeaferCanvas.ts:215


__bindContext โ€‹

โ–ธ __bindContext(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.__bindContext

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:129


setTransform โ€‹

โ–ธ setTransform(_a, _b?, _c?, _d?, _e?, _f?): void

Parameters โ€‹

NameType
_anumber | IMatrixData
_b?number
_c?number
_d?number
_e?number
_f?number

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setTransform

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:141


resetTransform โ€‹

โ–ธ resetTransform(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.resetTransform

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:144


getTransform โ€‹

โ–ธ getTransform(): IMatrixData

Returns โ€‹

IMatrixData

Inherited from โ€‹

LeaferCanvasBase.getTransform

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:147


save โ€‹

โ–ธ save(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.save

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:150


restore โ€‹

โ–ธ restore(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.restore

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:153


transform โ€‹

โ–ธ transform(a, b?, c?, d?, e?, f?): void

Parameters โ€‹

NameType
anumber | IMatrixData
b?number
c?number
d?number
e?number
f?number

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.transform

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:155


translate โ€‹

โ–ธ translate(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.translate

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:164


scale โ€‹

โ–ธ scale(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.scale

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:167


rotate โ€‹

โ–ธ rotate(_angle): void

Parameters โ€‹

NameType
_anglenumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.rotate

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:170


fill โ€‹

โ–ธ fill(_path2d?, _rule?): void

Parameters โ€‹

NameType
_path2d?IWindingRule | IPath2D
_rule?IWindingRule

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.fill

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:173


stroke โ€‹

โ–ธ stroke(_path2d?): void

Parameters โ€‹

NameType
_path2d?IPath2D

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.stroke

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:176


clip โ€‹

โ–ธ clip(_path2d?, _rule?): void

Parameters โ€‹

NameType
_path2d?IWindingRule | IPath2D
_rule?IWindingRule

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.clip

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:179


fillRect โ€‹

โ–ธ fillRect(_x, _y, _width, _height): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_widthnumber
_heightnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.fillRect

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:182


strokeRect โ€‹

โ–ธ strokeRect(_x, _y, _width, _height): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_widthnumber
_heightnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.strokeRect

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:185


clearRect โ€‹

โ–ธ clearRect(_x, _y, _width, _height): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_widthnumber
_heightnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.clearRect

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:188


drawImage โ€‹

โ–ธ drawImage(image, sx, sy, sw?, sh?, dx?, dy?, dw?, dh?): void

Parameters โ€‹

NameType
imageCanvasImageSource
sxnumber
synumber
sw?number
sh?number
dx?number
dy?number
dw?number
dh?number

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.drawImage

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:190


beginPath โ€‹

โ–ธ beginPath(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.beginPath

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:224


moveTo โ€‹

โ–ธ moveTo(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.moveTo

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:227


lineTo โ€‹

โ–ธ lineTo(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.lineTo

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:230


bezierCurveTo โ€‹

โ–ธ bezierCurveTo(_cp1x, _cp1y, _cp2x, _cp2y, _x, _y): void

Parameters โ€‹

NameType
_cp1xnumber
_cp1ynumber
_cp2xnumber
_cp2ynumber
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.bezierCurveTo

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:233


quadraticCurveTo โ€‹

โ–ธ quadraticCurveTo(_cpx, _cpy, _x, _y): void

Parameters โ€‹

NameType
_cpxnumber
_cpynumber
_xnumber
_ynumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.quadraticCurveTo

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:236


closePath โ€‹

โ–ธ closePath(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.closePath

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:239


arc โ€‹

โ–ธ arc(_x, _y, _radius, _startAngle, _endAngle, _anticlockwise?): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_radiusnumber
_startAnglenumber
_endAnglenumber
_anticlockwise?boolean

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.arc

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:242


arcTo โ€‹

โ–ธ arcTo(_x1, _y1, _x2, _y2, _radius): void

Parameters โ€‹

NameType
_x1number
_y1number
_x2number
_y2number
_radiusnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.arcTo

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:245


ellipse โ€‹

โ–ธ ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise?): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_radiusXnumber
_radiusYnumber
_rotationnumber
_startAnglenumber
_endAnglenumber
_anticlockwise?boolean

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.ellipse

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:248


rect โ€‹

โ–ธ rect(_x, _y, _width, _height): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_widthnumber
_heightnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.rect

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:251


roundRect โ€‹

โ–ธ roundRect(_x, _y, _width, _height, _radius?): void

Parameters โ€‹

NameType
_xnumber
_ynumber
_widthnumber
_heightnumber
_radius?number | number[]

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.roundRect

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:254


createConicGradient โ€‹

โ–ธ createConicGradient(_startAngle, _x, _y): CanvasGradient

Parameters โ€‹

NameType
_startAnglenumber
_xnumber
_ynumber

Returns โ€‹

CanvasGradient

Inherited from โ€‹

LeaferCanvasBase.createConicGradient

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:261


createLinearGradient โ€‹

โ–ธ createLinearGradient(_x0, _y0, _x1, _y1): CanvasGradient

Parameters โ€‹

NameType
_x0number
_y0number
_x1number
_y1number

Returns โ€‹

CanvasGradient

Inherited from โ€‹

LeaferCanvasBase.createLinearGradient

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:264


createPattern โ€‹

โ–ธ createPattern(_image, _repetition): CanvasPattern

Parameters โ€‹

NameType
_imageCanvasImageSource
_repetitionstring

Returns โ€‹

CanvasPattern

Inherited from โ€‹

LeaferCanvasBase.createPattern

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:267


createRadialGradient โ€‹

โ–ธ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1): CanvasGradient

Parameters โ€‹

NameType
_x0number
_y0number
_r0number
_x1number
_y1number
_r1number

Returns โ€‹

CanvasGradient

Inherited from โ€‹

LeaferCanvasBase.createRadialGradient

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:270


fillText โ€‹

โ–ธ fillText(_text, _x, _y, _maxWidth?): void

Parameters โ€‹

NameType
_textstring
_xnumber
_ynumber
_maxWidth?number

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.fillText

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:274


measureText โ€‹

โ–ธ measureText(_text): ITextMetrics

Parameters โ€‹

NameType
_textstring

Returns โ€‹

ITextMetrics

Inherited from โ€‹

LeaferCanvasBase.measureText

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:277


strokeText โ€‹

โ–ธ strokeText(_text, _x, _y, _maxWidth?): void

Parameters โ€‹

NameType
_textstring
_xnumber
_ynumber
_maxWidth?number

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.strokeText

Defined in โ€‹

leafer/packages/canvas/canvas/src/Canvas.ts:280


__createContext โ€‹

โ–ธ __createContext(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.__createContext

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:70


export โ€‹

โ–ธ export(_filename, _options?): string | Promise<any>

Parameters โ€‹

NameType
_filenamestring
_options?number | boolean | IExportOptions

Returns โ€‹

string | Promise<any>

Inherited from โ€‹

LeaferCanvasBase.export

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:79


toBlob โ€‹

โ–ธ toBlob(_type?, _quality?): Promise<any>

Parameters โ€‹

NameType
_type?IExportFileType
_quality?number

Returns โ€‹

Promise<any>

Inherited from โ€‹

LeaferCanvasBase.toBlob

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:81


toDataURL โ€‹

โ–ธ toDataURL(_type?, _quality?): string | Promise<string>

Parameters โ€‹

NameType
_type?IExportImageType
_quality?number

Returns โ€‹

string | Promise<string>

Inherited from โ€‹

LeaferCanvasBase.toDataURL

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:83


saveAs โ€‹

โ–ธ saveAs(_filename, _quality?): Promise<boolean>

Parameters โ€‹

NameType
_filenamestring
_quality?number

Returns โ€‹

Promise<boolean>

Inherited from โ€‹

LeaferCanvasBase.saveAs

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:85


resize โ€‹

โ–ธ resize(size): void

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.resize

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:89


getClientBounds โ€‹

โ–ธ getClientBounds(update?): IBoundsData

Parameters โ€‹

NameType
update?boolean

Returns โ€‹

IBoundsData

Inherited from โ€‹

LeaferCanvasBase.getClientBounds

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:119


setCursor โ€‹

โ–ธ setCursor(_cursor): void

Parameters โ€‹

NameType
_cursorICursorType | ICursorType[]

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setCursor

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:127


setWorld โ€‹

โ–ธ setWorld(matrix, parentMatrix?): void

Parameters โ€‹

NameType
matrixIMatrixData
parentMatrix?IMatrixData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:129


useWorldTransform โ€‹

โ–ธ useWorldTransform(worldTransform?): void

Parameters โ€‹

NameType
worldTransform?IMatrixData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.useWorldTransform

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:157


setStroke โ€‹

โ–ธ setStroke(color, strokeWidth, options?): void

Parameters โ€‹

NameType
colorstring | object
strokeWidthnumber
options?ICanvasStrokeOptions

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setStroke

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:163


setStrokeOptions โ€‹

โ–ธ setStrokeOptions(options): void

Parameters โ€‹

NameType
optionsICanvasStrokeOptions

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setStrokeOptions

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:169


saveBlendMode โ€‹

โ–ธ saveBlendMode(blendMode): void

Parameters โ€‹

NameType
blendModeIBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.saveBlendMode

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:177


restoreBlendMode โ€‹

โ–ธ restoreBlendMode(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.restoreBlendMode

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:182


hitFill โ€‹

โ–ธ hitFill(_point, _fillRule?): boolean

Parameters โ€‹

NameType
_pointIPointData
_fillRule?IWindingRule

Returns โ€‹

boolean

Inherited from โ€‹

LeaferCanvasBase.hitFill

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:188


hitStroke โ€‹

โ–ธ hitStroke(_point, _strokeWidth?): boolean

Parameters โ€‹

NameType
_pointIPointData
_strokeWidth?number

Returns โ€‹

boolean

Inherited from โ€‹

LeaferCanvasBase.hitStroke

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:190


hitPixel โ€‹

โ–ธ hitPixel(_radiusPoint, _offset?, _scale?): boolean

Parameters โ€‹

NameTypeDefault value
_radiusPointIRadiusPointDataundefined
_offset?IPointDataundefined
_scalenumber1

Returns โ€‹

boolean

Inherited from โ€‹

LeaferCanvasBase.hitPixel

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:192


setWorldShadow โ€‹

โ–ธ setWorldShadow(x, y, blur, color?): void

Parameters โ€‹

NameType
xnumber
ynumber
blurnumber
color?string

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setWorldShadow

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:196


setWorldBlur โ€‹

โ–ธ setWorldBlur(blur): void

Parameters โ€‹

NameType
blurnumber

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.setWorldBlur

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:204


copyWorld โ€‹

โ–ธ copyWorld(canvas, from?, to?, blendMode?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
from?IBoundsData
to?IBoundsData
blendMode?IBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.copyWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:210


copyWorldToInner โ€‹

โ–ธ copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
fromWorldIMatrixWithBoundsData
toInnerBoundsIBoundsData
blendMode?IBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.copyWorldToInner

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:222


copyWorldByReset โ€‹

โ–ธ copyWorldByReset(canvas, from?, to?, blendMode?, onlyResetTransform?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
from?IBoundsData
to?IBoundsData
blendMode?IBlendMode
onlyResetTransform?boolean

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.copyWorldByReset

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:236


useMask โ€‹

โ–ธ useMask(maskCanvas, fromBounds?, toBounds?): void

Parameters โ€‹

NameType
maskCanvasILeaferCanvas
fromBounds?IBoundsData
toBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.useMask

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:242


useEraser โ€‹

โ–ธ useEraser(eraserCanvas, fromBounds?, toBounds?): void

Parameters โ€‹

NameType
eraserCanvasILeaferCanvas
fromBounds?IBoundsData
toBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.useEraser

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:246


fillWorld โ€‹

โ–ธ fillWorld(bounds, color, blendMode?): void

Parameters โ€‹

NameType
boundsIBoundsData
colorstring | object
blendMode?IBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.fillWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:250


strokeWorld โ€‹

โ–ธ strokeWorld(bounds, color, blendMode?): void

Parameters โ€‹

NameType
boundsIBoundsData
colorstring | object
blendMode?IBlendMode

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.strokeWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:258


clearWorld โ€‹

โ–ธ clearWorld(bounds, ceilPixel?): void

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.clearWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:266


clipWorld โ€‹

โ–ธ clipWorld(bounds, ceilPixel?): void

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.clipWorld

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:272


clear โ€‹

โ–ธ clear(): void

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.clear

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:281


isSameSize โ€‹

โ–ธ isSameSize(size): boolean

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

boolean

Inherited from โ€‹

LeaferCanvasBase.isSameSize

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:289


getSameCanvas โ€‹

โ–ธ getSameCanvas(useSameWorldTransform?, useSameSmooth?): ILeaferCanvas

Parameters โ€‹

NameType
useSameWorldTransform?boolean
useSameSmooth?boolean

Returns โ€‹

ILeaferCanvas

Inherited from โ€‹

LeaferCanvasBase.getSameCanvas

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:294


recycle โ€‹

โ–ธ recycle(clearBounds?): void

Parameters โ€‹

NameType
clearBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.recycle

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:305


updateRender โ€‹

โ–ธ updateRender(_bounds?): void

Parameters โ€‹

NameType
_bounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

LeaferCanvasBase.updateRender

Defined in โ€‹

leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:313

Released under the MIT License.