Skip to content

Class: LeaferCanvasBase โ€‹

Hierarchy โ€‹

  • Canvas

    โ†ณ LeaferCanvasBase

    โ†ณโ†ณ LeaferCanvas

Implements โ€‹

Table of contents โ€‹

Constructors โ€‹

Properties โ€‹

Accessors โ€‹

Methods โ€‹

Constructors โ€‹

constructor โ€‹

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

Parameters โ€‹

NameType
config?ILeaferCanvasConfig
manager?ICanvasManager

Returns โ€‹

LeaferCanvasBase

Overrides โ€‹

Canvas.constructor

Defined in โ€‹

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

Properties โ€‹

context โ€‹

โ€ข context: ICanvasContext2D

Implementation of โ€‹

ILeaferCanvas.context

Inherited from โ€‹

Canvas.context

Defined in โ€‹

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


smooth โ€‹

โ€ข smooth: boolean

Implementation of โ€‹

ILeaferCanvas.smooth

Inherited from โ€‹

Canvas.smooth

Defined in โ€‹

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


smoothLevel โ€‹

โ€ข smoothLevel: ImageSmoothingQuality

Implementation of โ€‹

ILeaferCanvas.smoothLevel

Inherited from โ€‹

Canvas.smoothLevel

Defined in โ€‹

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


opacity โ€‹

โ€ข opacity: number

Implementation of โ€‹

ILeaferCanvas.opacity

Inherited from โ€‹

Canvas.opacity

Defined in โ€‹

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


fillStyle โ€‹

โ€ข fillStyle: string | object

Implementation of โ€‹

ILeaferCanvas.fillStyle

Inherited from โ€‹

Canvas.fillStyle

Defined in โ€‹

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


strokeStyle โ€‹

โ€ข strokeStyle: string | object

Implementation of โ€‹

ILeaferCanvas.strokeStyle

Inherited from โ€‹

Canvas.strokeStyle

Defined in โ€‹

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


strokeWidth โ€‹

โ€ข strokeWidth: number

Implementation of โ€‹

ILeaferCanvas.strokeWidth

Inherited from โ€‹

Canvas.strokeWidth

Defined in โ€‹

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


strokeCap โ€‹

โ€ข strokeCap: string

Implementation of โ€‹

ILeaferCanvas.strokeCap

Inherited from โ€‹

Canvas.strokeCap

Defined in โ€‹

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


strokeJoin โ€‹

โ€ข strokeJoin: string

Implementation of โ€‹

ILeaferCanvas.strokeJoin

Inherited from โ€‹

Canvas.strokeJoin

Defined in โ€‹

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


dashOffset โ€‹

โ€ข dashOffset: number

Implementation of โ€‹

ILeaferCanvas.dashOffset

Inherited from โ€‹

Canvas.dashOffset

Defined in โ€‹

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


miterLimit โ€‹

โ€ข miterLimit: number

Implementation of โ€‹

ILeaferCanvas.miterLimit

Inherited from โ€‹

Canvas.miterLimit

Defined in โ€‹

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


shadowBlur โ€‹

โ€ข shadowBlur: number

Implementation of โ€‹

ILeaferCanvas.shadowBlur

Inherited from โ€‹

Canvas.shadowBlur

Defined in โ€‹

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


shadowColor โ€‹

โ€ข shadowColor: string

Implementation of โ€‹

ILeaferCanvas.shadowColor

Inherited from โ€‹

Canvas.shadowColor

Defined in โ€‹

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


shadowOffsetX โ€‹

โ€ข shadowOffsetX: number

Implementation of โ€‹

ILeaferCanvas.shadowOffsetX

Inherited from โ€‹

Canvas.shadowOffsetX

Defined in โ€‹

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


shadowOffsetY โ€‹

โ€ข shadowOffsetY: number

Implementation of โ€‹

ILeaferCanvas.shadowOffsetY

Inherited from โ€‹

Canvas.shadowOffsetY

Defined in โ€‹

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


filter โ€‹

โ€ข filter: string

Implementation of โ€‹

ILeaferCanvas.filter

Inherited from โ€‹

Canvas.filter

Defined in โ€‹

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


font โ€‹

โ€ข font: string

Implementation of โ€‹

ILeaferCanvas.font

Inherited from โ€‹

Canvas.font

Defined in โ€‹

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


fontKerning โ€‹

โ€ข fontKerning: string

Implementation of โ€‹

ILeaferCanvas.fontKerning

Inherited from โ€‹

Canvas.fontKerning

Defined in โ€‹

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


fontStretch โ€‹

โ€ข fontStretch: string

Implementation of โ€‹

ILeaferCanvas.fontStretch

Inherited from โ€‹

Canvas.fontStretch

Defined in โ€‹

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


fontVariantCaps โ€‹

โ€ข fontVariantCaps: string

Implementation of โ€‹

ILeaferCanvas.fontVariantCaps

Inherited from โ€‹

Canvas.fontVariantCaps

Defined in โ€‹

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


textAlign โ€‹

โ€ข textAlign: string

Implementation of โ€‹

ILeaferCanvas.textAlign

Inherited from โ€‹

Canvas.textAlign

Defined in โ€‹

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


textBaseline โ€‹

โ€ข textBaseline: string

Implementation of โ€‹

ILeaferCanvas.textBaseline

Inherited from โ€‹

Canvas.textBaseline

Defined in โ€‹

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


textRendering โ€‹

โ€ข textRendering: string

Implementation of โ€‹

ILeaferCanvas.textRendering

Inherited from โ€‹

Canvas.textRendering

Defined in โ€‹

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


wordSpacing โ€‹

โ€ข wordSpacing: string

Implementation of โ€‹

ILeaferCanvas.wordSpacing

Inherited from โ€‹

Canvas.wordSpacing

Defined in โ€‹

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


letterSpacing โ€‹

โ€ข letterSpacing: string

Implementation of โ€‹

ILeaferCanvas.letterSpacing

Inherited from โ€‹

Canvas.letterSpacing

Defined in โ€‹

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


direction โ€‹

โ€ข direction: string

Implementation of โ€‹

ILeaferCanvas.direction

Inherited from โ€‹

Canvas.direction

Defined in โ€‹

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


innerId โ€‹

โ€ข Readonly innerId: number

Implementation of โ€‹

ILeaferCanvas.innerId

Overrides โ€‹

Canvas.innerId

Defined in โ€‹

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


name โ€‹

โ€ข name: string

Implementation of โ€‹

ILeaferCanvas.name

Defined in โ€‹

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


manager โ€‹

โ€ข manager: ICanvasManager

Implementation of โ€‹

ILeaferCanvas.manager

Defined in โ€‹

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


size โ€‹

โ€ข size: IScreenSizeData

Defined in โ€‹

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


bounds โ€‹

โ€ข bounds: IBounds

Implementation of โ€‹

ILeaferCanvas.bounds

Defined in โ€‹

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


clientBounds โ€‹

โ€ข clientBounds: IBoundsData

Implementation of โ€‹

ILeaferCanvas.clientBounds

Defined in โ€‹

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


config โ€‹

โ€ข config: ILeaferCanvasConfig

Implementation of โ€‹

ILeaferCanvas.config

Defined in โ€‹

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


autoLayout โ€‹

โ€ข autoLayout: boolean

Implementation of โ€‹

ILeaferCanvas.autoLayout

Defined in โ€‹

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


view โ€‹

โ€ข view: any

Implementation of โ€‹

ILeaferCanvas.view

Defined in โ€‹

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


parentView โ€‹

โ€ข parentView: any

Implementation of โ€‹

ILeaferCanvas.parentView

Defined in โ€‹

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


unreal โ€‹

โ€ข Optional unreal: boolean

Implementation of โ€‹

ILeaferCanvas.unreal

Defined in โ€‹

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


recycled โ€‹

โ€ข Optional recycled: boolean

Implementation of โ€‹

ILeaferCanvas.recycled

Defined in โ€‹

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


worldTransform โ€‹

โ€ข worldTransform: IMatrixData

Implementation of โ€‹

ILeaferCanvas.worldTransform

Defined in โ€‹

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


savedBlendMode โ€‹

โ€ข Protected savedBlendMode: IBlendMode

Defined in โ€‹

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

Accessors โ€‹

blendMode โ€‹

โ€ข get blendMode(): IBlendMode

Returns โ€‹

IBlendMode

Implementation of โ€‹

ILeaferCanvas.blendMode

Inherited from โ€‹

Canvas.blendMode

Defined in โ€‹

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

โ€ข set blendMode(value): void

Parameters โ€‹

NameType
valueIBlendMode

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.blendMode

Inherited from โ€‹

Canvas.blendMode

Defined in โ€‹

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


dashPattern โ€‹

โ€ข get dashPattern(): number[]

Returns โ€‹

number[]

Implementation of โ€‹

ILeaferCanvas.dashPattern

Inherited from โ€‹

Canvas.dashPattern

Defined in โ€‹

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

โ€ข set dashPattern(value): void

Parameters โ€‹

NameType
valuenumber[]

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.dashPattern

Inherited from โ€‹

Canvas.dashPattern

Defined in โ€‹

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


width โ€‹

โ€ข get width(): number

Returns โ€‹

number

Implementation of โ€‹

ILeaferCanvas.width

Defined in โ€‹

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


height โ€‹

โ€ข get height(): number

Returns โ€‹

number

Implementation of โ€‹

ILeaferCanvas.height

Defined in โ€‹

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


pixelRatio โ€‹

โ€ข get pixelRatio(): number

Returns โ€‹

number

Implementation of โ€‹

ILeaferCanvas.pixelRatio

Defined in โ€‹

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


pixelWidth โ€‹

โ€ข get pixelWidth(): number

Returns โ€‹

number

Implementation of โ€‹

ILeaferCanvas.pixelWidth

Defined in โ€‹

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


pixelHeight โ€‹

โ€ข get pixelHeight(): number

Returns โ€‹

number

Implementation of โ€‹

ILeaferCanvas.pixelHeight

Defined in โ€‹

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


allowBackgroundColor โ€‹

โ€ข get allowBackgroundColor(): boolean

Returns โ€‹

boolean

Implementation of โ€‹

ILeaferCanvas.allowBackgroundColor

Defined in โ€‹

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

Methods โ€‹

__bindContext โ€‹

โ–ธ __bindContext(): void

Returns โ€‹

void

Inherited from โ€‹

Canvas.__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

Implementation of โ€‹

ILeaferCanvas.setTransform

Inherited from โ€‹

Canvas.setTransform

Defined in โ€‹

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


resetTransform โ€‹

โ–ธ resetTransform(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.resetTransform

Inherited from โ€‹

Canvas.resetTransform

Defined in โ€‹

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


getTransform โ€‹

โ–ธ getTransform(): IMatrixData

Returns โ€‹

IMatrixData

Implementation of โ€‹

ILeaferCanvas.getTransform

Inherited from โ€‹

Canvas.getTransform

Defined in โ€‹

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


save โ€‹

โ–ธ save(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.save

Inherited from โ€‹

Canvas.save

Defined in โ€‹

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


restore โ€‹

โ–ธ restore(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.restore

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.transform

Inherited from โ€‹

Canvas.transform

Defined in โ€‹

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


translate โ€‹

โ–ธ translate(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.translate

Inherited from โ€‹

Canvas.translate

Defined in โ€‹

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


scale โ€‹

โ–ธ scale(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.scale

Inherited from โ€‹

Canvas.scale

Defined in โ€‹

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


rotate โ€‹

โ–ธ rotate(_angle): void

Parameters โ€‹

NameType
_anglenumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.rotate

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.fill

Inherited from โ€‹

Canvas.fill

Defined in โ€‹

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


stroke โ€‹

โ–ธ stroke(_path2d?): void

Parameters โ€‹

NameType
_path2d?IPath2D

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.stroke

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.clip

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.fillRect

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.strokeRect

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.clearRect

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.drawImage

Inherited from โ€‹

Canvas.drawImage

Defined in โ€‹

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


beginPath โ€‹

โ–ธ beginPath(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.beginPath

Inherited from โ€‹

Canvas.beginPath

Defined in โ€‹

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


moveTo โ€‹

โ–ธ moveTo(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.moveTo

Inherited from โ€‹

Canvas.moveTo

Defined in โ€‹

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


lineTo โ€‹

โ–ธ lineTo(_x, _y): void

Parameters โ€‹

NameType
_xnumber
_ynumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.lineTo

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.bezierCurveTo

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.quadraticCurveTo

Inherited from โ€‹

Canvas.quadraticCurveTo

Defined in โ€‹

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


closePath โ€‹

โ–ธ closePath(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.closePath

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.arc

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.arcTo

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.ellipse

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.rect

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.roundRect

Inherited from โ€‹

Canvas.roundRect

Defined in โ€‹

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


createConicGradient โ€‹

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

Parameters โ€‹

NameType
_startAnglenumber
_xnumber
_ynumber

Returns โ€‹

CanvasGradient

Implementation of โ€‹

ILeaferCanvas.createConicGradient

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.createLinearGradient

Inherited from โ€‹

Canvas.createLinearGradient

Defined in โ€‹

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


createPattern โ€‹

โ–ธ createPattern(_image, _repetition): CanvasPattern

Parameters โ€‹

NameType
_imageCanvasImageSource
_repetitionstring

Returns โ€‹

CanvasPattern

Implementation of โ€‹

ILeaferCanvas.createPattern

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.createRadialGradient

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.fillText

Inherited from โ€‹

Canvas.fillText

Defined in โ€‹

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


measureText โ€‹

โ–ธ measureText(_text): ITextMetrics

Parameters โ€‹

NameType
_textstring

Returns โ€‹

ITextMetrics

Implementation of โ€‹

ILeaferCanvas.measureText

Inherited from โ€‹

Canvas.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

Implementation of โ€‹

ILeaferCanvas.strokeText

Inherited from โ€‹

Canvas.strokeText

Defined in โ€‹

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


init โ€‹

โ–ธ init(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.init

Defined in โ€‹

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


__createContext โ€‹

โ–ธ __createContext(): void

Returns โ€‹

void

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>

Implementation of โ€‹

ILeaferCanvas.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>

Implementation of โ€‹

ILeaferCanvas.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>

Implementation of โ€‹

ILeaferCanvas.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>

Implementation of โ€‹

ILeaferCanvas.saveAs

Defined in โ€‹

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


resize โ€‹

โ–ธ resize(size): void

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.resize

Defined in โ€‹

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


updateViewSize โ€‹

โ–ธ updateViewSize(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.updateViewSize

Defined in โ€‹

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


updateClientBounds โ€‹

โ–ธ updateClientBounds(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.updateClientBounds

Defined in โ€‹

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


getClientBounds โ€‹

โ–ธ getClientBounds(update?): IBoundsData

Parameters โ€‹

NameType
update?boolean

Returns โ€‹

IBoundsData

Implementation of โ€‹

ILeaferCanvas.getClientBounds

Defined in โ€‹

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


startAutoLayout โ€‹

โ–ธ startAutoLayout(_autoBounds, _listener): void

Parameters โ€‹

NameType
_autoBoundsIAutoBounds
_listenerIResizeEventListener

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.startAutoLayout

Defined in โ€‹

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


stopAutoLayout โ€‹

โ–ธ stopAutoLayout(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.stopAutoLayout

Defined in โ€‹

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


setCursor โ€‹

โ–ธ setCursor(_cursor): void

Parameters โ€‹

NameType
_cursorICursorType | ICursorType[]

Returns โ€‹

void

Defined in โ€‹

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


setWorld โ€‹

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

Parameters โ€‹

NameType
matrixIMatrixData
parentMatrix?IMatrixData

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.setWorld

Defined in โ€‹

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


useWorldTransform โ€‹

โ–ธ useWorldTransform(worldTransform?): void

Parameters โ€‹

NameType
worldTransform?IMatrixData

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.setStroke

Defined in โ€‹

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


setStrokeOptions โ€‹

โ–ธ setStrokeOptions(options): void

Parameters โ€‹

NameType
optionsICanvasStrokeOptions

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.setStrokeOptions

Defined in โ€‹

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


saveBlendMode โ€‹

โ–ธ saveBlendMode(blendMode): void

Parameters โ€‹

NameType
blendModeIBlendMode

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.saveBlendMode

Defined in โ€‹

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


restoreBlendMode โ€‹

โ–ธ restoreBlendMode(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.restoreBlendMode

Defined in โ€‹

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


hitFill โ€‹

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

Parameters โ€‹

NameType
_pointIPointData
_fillRule?IWindingRule

Returns โ€‹

boolean

Implementation of โ€‹

ILeaferCanvas.hitFill

Defined in โ€‹

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


hitStroke โ€‹

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

Parameters โ€‹

NameType
_pointIPointData
_strokeWidth?number

Returns โ€‹

boolean

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.setWorldShadow

Defined in โ€‹

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


setWorldBlur โ€‹

โ–ธ setWorldBlur(blur): void

Parameters โ€‹

NameType
blurnumber

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.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

Implementation of โ€‹

ILeaferCanvas.strokeWorld

Defined in โ€‹

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


clearWorld โ€‹

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

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.clearWorld

Defined in โ€‹

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


clipWorld โ€‹

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

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.clipWorld

Defined in โ€‹

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


clear โ€‹

โ–ธ clear(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.clear

Defined in โ€‹

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


isSameSize โ€‹

โ–ธ isSameSize(size): boolean

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

boolean

Implementation of โ€‹

ILeaferCanvas.isSameSize

Defined in โ€‹

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


getSameCanvas โ€‹

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

Parameters โ€‹

NameType
useSameWorldTransform?boolean
useSameSmooth?boolean

Returns โ€‹

ILeaferCanvas

Implementation of โ€‹

ILeaferCanvas.getSameCanvas

Defined in โ€‹

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


recycle โ€‹

โ–ธ recycle(clearBounds?): void

Parameters โ€‹

NameType
clearBounds?IBoundsData

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.recycle

Defined in โ€‹

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


updateRender โ€‹

โ–ธ updateRender(_bounds?): void

Parameters โ€‹

NameType
_bounds?IBoundsData

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.updateRender

Defined in โ€‹

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


unrealCanvas โ€‹

โ–ธ unrealCanvas(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.unrealCanvas

Defined in โ€‹

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


destroy โ€‹

โ–ธ destroy(): void

Returns โ€‹

void

Implementation of โ€‹

ILeaferCanvas.destroy

Overrides โ€‹

Canvas.destroy

Defined in โ€‹

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

Released under the MIT License.