Class: Brush

PhotoEditorSDK.Operations.SpriteOperation. Brush

A Brush that can be drawn by SpriteOperation. Should only be created via PhotoEditorSDK.Operations.SpriteOperation#createBrush

new PhotoEditorSDK.Operations.SpriteOperation.Brush(operation, options)

sdk/operations/sprites/brush.js, line 25

Creates a new Sticker

Name Type Description
operation PhotoEditorSDK.Operations.SpriteOperation
options Object optional

Methods

applyFlip(direction)

sdk/operations/sprites/brush.js, line 52

Applies a flip in the given direction

Name Type Description
direction String

applyRotation(degrees)

sdk/operations/sprites/brush.js, line 76

Applies a rotation with the given degrees

Name Type Description
degrees Number

clearCanvas()

sdk/operations/sprites/brush.js, line 166

Clears the canvas

clearPersistCanvas()

sdk/operations/sprites/brush.js, line 182

Clears the persist canvas

createPath(thickness, hardness, color){PhotoEditorSDK.Operations.BrushOperation.Path}

sdk/operations/sprites/brush.js, line 212

Creates and adds a new path

Name Type Description
thickness Number
hardness Number
color Color
Returns:
Type Description
PhotoEditorSDK.Operations.BrushOperation.Path

dispose()

sdk/operations/sprites/brush.js, line 376

Disposes this Brush

getAnchor(){undefined}

Returns the anchor
Returns:
Name Type Description
anchor undefined The anchor

getCanvas(){CanvasElement}

sdk/operations/sprites/brush.js, line 367

Returns the canvas we're rendering brushes to

Returns:
Type Description
CanvasElement

getId(){undefined}

Returns the id
Returns:
Name Type Description
id undefined The id

getPaths(){undefined}

Returns the paths
Returns:
Name Type Description
paths undefined The paths

getPivot(){undefined}

Returns the pivot
Returns:
Name Type Description
pivot undefined The pivot

getPosition(){undefined}

Returns the position
Returns:
Name Type Description
position undefined The position

getRotation(){undefined}

Returns the rotation
Returns:
Name Type Description
rotation undefined The rotation

getScale(){undefined}

Returns the scale
Returns:
Name Type Description
scale undefined The scale

render(inputDimensions)

sdk/operations/sprites/brush.js, line 285

Renders all paths to the canvas

Name Type Description
inputDimensions PhotoEditorSDK.Math.Vector2

serializeOptions(keys, toObject){Object}

sdk/operations/sprites/brush.js, line 199

Returns a serialized version of this configurable

Name Type Default Description
keys Array.<String>
toObject Boolean false

= false

Returns:
Type Description
Object

setAnchor(anchor)

Sets the anchor
Name Type Description
anchor undefined

setDirty(dirty, dimensionsChanged)

sdk/operations/sprites/brush.js, line 275

Sets this brush to dirty

Name Type Default Description
dirty Boolean
dimensionsChanged Boolean false

= false

setDirtyForRenderer(dirty, renderer, dimensionsChanged)

sdk/operations/sprites/brush.js, line 260

Sets the dirtiness for the given renderer

Name Type Default Description
dirty Boolean
renderer PhotoEditorSDK.Engine.BaseRenderer
dimensionsChanged Boolean false

= false

setId(id)

Sets the id
Name Type Description
id undefined

setPaths(paths)

Sets the paths
Name Type Description
paths undefined

setPivot(pivot)

Sets the pivot
Name Type Description
pivot undefined

setPosition(position)

Sets the position
Name Type Description
position undefined

setRotation(rotation)

Sets the rotation
Name Type Description
rotation undefined

setScale(scale)

Sets the scale
Name Type Description
scale undefined

update(sdk, inputDimensions){Promise}

sdk/operations/sprites/brush.js, line 325

Updates this sprite

Name Type Description
sdk PhotoEditorSDK
inputDimensions PhotoEditorSDK.Math.Vector2
Returns:
Type Description
Promise