File

src/toolbox/filters/Shadow.ts

Extends

ToolBox

Index

Properties
Methods

Properties

Public autoClear
Default value : false
Inherited from ToolBox
Defined in ToolBox:9
Public history
Type : HistoryCallback[]
Default value : []
Inherited from ToolBox
Defined in ToolBox:8
Public Readonly layer
Type : Layer
Inherited from ToolBox
Defined in ToolBox:9

Methods

Public setBlur
setBlur(amount: number)
Parameters :
Name Type Optional
amount number No
Returns : this
Public setColor
setColor(color: string)
Parameters :
Name Type Optional
color string No
Returns : this
Public setOffsetX
setOffsetX(amount: number)
Parameters :
Name Type Optional
amount number No
Returns : this
Public setOffsetY
setOffsetY(amount: number)
Parameters :
Name Type Optional
amount number No
Returns : this
Public render
render()
Inherited from ToolBox
Defined in ToolBox:27
Returns : void
Public restore
restore()
Inherited from ToolBox
Defined in ToolBox:19
Returns : this
Public save
save()
Inherited from ToolBox
Defined in ToolBox:11
Returns : this
import { ToolBox } from "../base/ToolBox";

export class ShadowTool extends ToolBox {
    public setColor(color: string) {
        this.history.push((ctx) => {
            ctx.shadowColor = color;
        });

        return this;
    }

    public setBlur(amount: number) {
        this.history.push((ctx) => {
            ctx.shadowBlur = amount;
        });

        return this;
    }

    public setOffsetX(amount: number) {
        this.history.push((ctx) => {
            ctx.shadowOffsetX = amount;
        });

        return this;
    }

    public setOffsetY(amount: number) {
        this.history.push((ctx) => {
            ctx.shadowOffsetY = amount;
        });

        return this;
    }
}

results matching ""

    No results matching ""