Class: BrushSprite

PhotoEditorSDK.Operations~SpriteOperation~ BrushSprite

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

new BrushSprite(operation, options)

sdk/operations/shared/sprites/brush-sprite.js, line 35

Creates a new Sticker

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

Classes

ControlPoint
Path

Methods

applyFlip(direction)

sdk/operations/shared/sprites/brush-sprite.js, line 56

Applies a flip in the given direction

Name Type Description
direction String

applyRotation(degrees)

sdk/operations/shared/sprites/brush-sprite.js, line 80

Applies a rotation with the given degrees

Name Type Description
degrees Number

clearCanvas()

sdk/operations/shared/sprites/brush-sprite.js, line 130

Clears the canvas

clearPersistCanvas()

sdk/operations/shared/sprites/brush-sprite.js, line 146

Clears the persist canvas

createPath(brush){PhotoEditorSDK.Operations.SpriteOperation.BrushSprite.Path}

sdk/operations/shared/sprites/brush-sprite.js, line 188

Creates and adds a new path

Name Type Description
brush PhotoEditorSDK.Operations.SpriteOperation.BrushSprite.Brush
Returns:
Type Description
PhotoEditorSDK.Operations.SpriteOperation.BrushSprite.Path

dispose()

sdk/operations/shared/sprites/brush-sprite.js, line 350

Disposes this Brush

getBrush(){undefined}

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

getCanvas(){CanvasElement}

sdk/operations/shared/sprites/brush-sprite.js, line 341

Returns the canvas we're rendering brushes to

Returns:
Type Description
CanvasElement

getClosed(){undefined}

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

getControlPoints(){undefined}

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

getId(){undefined}

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

render(inputDimensions)

sdk/operations/shared/sprites/brush-sprite.js, line 261

Renders all paths to the canvas

Name Type Description
inputDimensions PhotoEditorSDK.Math.Vector2

serializeOption(optionName, toObject){*}

sdk/operations/shared/sprites/brush-sprite.js, line 175

Returns a serialized version of the given option

Name Type Default Description
optionName String
toObject Boolean false

= false

Returns:
Type Description
*

serializeOptions(keys, toObject){Object}

sdk/operations/shared/sprites/brush-sprite.js, line 163

Returns a serialized version of this configurable

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

= false

Returns:
Type Description
Object

setBrush(brush)

Sets the brush
Name Type Description
brush undefined

setClosed(closed)

Sets the closed
Name Type Description
closed undefined

setControlPoints(controlPoints)

Sets the controlPoints
Name Type Description
controlPoints undefined

setDirty(dirty, dimensionsChanged)

sdk/operations/shared/sprites/brush-sprite.js, line 251

Sets this brush to dirty

Name Type Default Description
dirty Boolean
dimensionsChanged Boolean false

= false

setDirtyForRenderer(dirty, renderer, dimensionsChanged)

sdk/operations/shared/sprites/brush-sprite.js, line 236

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

update(sdk, inputDimensions)

sdk/operations/shared/sprites/brush-sprite.js, line 300

Updates this sprite

Name Type Description
sdk PhotoEditorSDK
inputDimensions PhotoEditorSDK.Math.Vector2