Class: SpriteOperation

PhotoEditorSDK.Operations~ SpriteOperation

An operation that can draw sprites (text and stickers) on the canvas

new SpriteOperation(sdk, options)

sdk/operations/sprite-operation/index.js, line 38

Creates a new SpriteOperation

Name Type Description
sdk PhotoEditorSDK
options Object optional

Extends

  • PhotoEditorSDK.Operation

Classes

BrushSprite
StickerSprite
TextDesignSprite
TextSprite

Members

staticPhotoEditorSDK.Operations.SpriteOperation.identifierString

A unique string that identifies this operation. Can be used to select operations.

Default Value:
  • sprite

Methods

_getOrientatedStageSize(){PhotoEditorSDK.Math.Vector2}

sdk/operations/sprite-operation/index.js, line 224

Returns the size of the stage, taking into account the current Exif rotation.

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

addSprite(sprite)

sdk/operations/sprite-operation/index.js, line 184

Gets called when a sprite has been added

Name Type Description
sprite PhotoEditorSDK.Sprite

createBrush(options){PhotoEditorSDK.Operations.SpriteOperation.BrushSprite}

sdk/operations/sprite-operation/index.js, line 167

Creates a brush object and returns it

Name Type Description
options Object
Returns:
Type Description
PhotoEditorSDK.Operations.SpriteOperation.BrushSprite

createSticker(options){PhotoEditorSDK.Operations.SpriteOperation.StickerSprite}

sdk/operations/sprite-operation/index.js, line 149

Creates a new sticker object and returns it

Name Type Description
options Object
Returns:
Type Description
PhotoEditorSDK.Operations.SpriteOperation.StickerSprite

createText(options){PhotoEditorSDK.Operations.SpriteOperation.TextSprite}

sdk/operations/sprite-operation/index.js, line 158

Creates a new sticker object and returns it

Name Type Description
options Object
Returns:
Type Description
PhotoEditorSDK.Operations.SpriteOperation.TextSprite

createTextDesign(options){PhotoEditorSDK.Operations.SpriteOperation.TextDesignSprite}

sdk/operations/sprite-operation/index.js, line 176

Creates a textdesign object and returns it

Name Type Description
options Object
Returns:
Type Description
PhotoEditorSDK.Operations.SpriteOperation.TextDesignSprite

dispose()

sdk/operations/sprite-operation/index.js, line 406

Disposes this operation

getAlignment(){undefined}

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

getAnchor(){undefined}

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

getBackgroundColor(){undefined}

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

getCharacterSpacing(){undefined}

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

getColor(){undefined}

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

getFontFamily(){undefined}

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

getFontIdentifier(){undefined}

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

getFontSize(){undefined}

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

getFontStyle(){undefined}

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

getFontWeight(){undefined}

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

getId(){undefined}

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

getLineHeight(){undefined}

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

getMaxHeight(){undefined}

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

getMaxWidth(){undefined}

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

getOutlineColor(){undefined}

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

getOutlineWidth(){undefined}

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

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

getSpritesAtPosition(position, inputDimensions){Array.<PhotoEditorSDK.Sprite>}

sdk/operations/sprite-operation/index.js, line 357

Returns the sprites at the given position on the canvas

Name Type Description
position PhotoEditorSDK.Math.Vector2
inputDimensions PhotoEditorSDK.Math.Vector2
Returns:
Type Description
Array.<PhotoEditorSDK.Sprite>

getSpritesOfType(Klass){Array.<PhotoEditorSDK.Sprite>}

sdk/operations/sprite-operation/index.js, line 59

Returns the sprites that are instances of the given class

Name Type Description
Klass Class
Returns:
Type Description
Array.<PhotoEditorSDK.Sprite>

getText(){undefined}

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

getTextMetrics(){undefined}

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

getVerticalAlignment(){undefined}

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

getVisible(){undefined}

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

removeSprite(sprite){Boolean}

sdk/operations/sprite-operation/index.js, line 204

Removes the given sprite from the list of sprites

Name Type Description
sprite PhotoEditorSDK.Sprite
Returns:
Type Description
Boolean

scale(scale)

sdk/operations/sprite-operation/index.js, line 121

Applies the given scale to all sprites

Name Type Description
scale PhotoEditorSDK.Math.Vector2

setAlignment(alignment)

Sets the alignment
Name Type Description
alignment undefined

setAnchor(anchor)

Sets the anchor
Name Type Description
anchor undefined

setBackgroundColor(backgroundColor)

Sets the backgroundColor
Name Type Description
backgroundColor undefined

setCharacterSpacing(characterSpacing)

Sets the characterSpacing
Name Type Description
characterSpacing undefined

setColor(color)

Sets the color
Name Type Description
color undefined

setDirtyForRenderer(dirty, renderer, dimensionsChanged)

sdk/operations/sprite-operation/index.js, line 396

Sets the dirtiness for the given renderer

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

= false

setFontFamily(fontFamily)

Sets the fontFamily
Name Type Description
fontFamily undefined

setFontIdentifier(fontIdentifier)

Sets the fontIdentifier
Name Type Description
fontIdentifier undefined

setFontSize(fontSize)

Sets the fontSize
Name Type Description
fontSize undefined

setFontStyle(fontStyle)

Sets the fontStyle
Name Type Description
fontStyle undefined

setFontWeight(fontWeight)

Sets the fontWeight
Name Type Description
fontWeight undefined

setId(id)

Sets the id
Name Type Description
id undefined

setLineHeight(lineHeight)

Sets the lineHeight
Name Type Description
lineHeight undefined

setMaxHeight(maxHeight)

Sets the maxHeight
Name Type Description
maxHeight undefined

setMaxWidth(maxWidth)

Sets the maxWidth
Name Type Description
maxWidth undefined

setOutlineColor(outlineColor)

Sets the outlineColor
Name Type Description
outlineColor undefined

setOutlineWidth(outlineWidth)

Sets the outlineWidth
Name Type Description
outlineWidth 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

setText(text)

Sets the text
Name Type Description
text undefined

setTextMetrics(textMetrics)

Sets the textMetrics
Name Type Description
textMetrics undefined

setVerticalAlignment(verticalAlignment)

Sets the verticalAlignment
Name Type Description
verticalAlignment undefined

setVisible(visible)

Sets the visible
Name Type Description
visible undefined

takeSpriteToFront(sprite)

sdk/operations/sprite-operation/index.js, line 337

Takes the given Sprite to front

Name Type Description
sprite PhotoEditorSDK.Operations.SpriteOperation.Sprite