Class: Sprite

PhotoEditorSDK.Engine~ Sprite

A drawable rectangle with a texture

new Sprite(texture)

sdk/core/engine/sprites/sprite.js, line 31

Creates a Sprite

Name Type Description
texture PhotoEditorSDK.Engine.Texture

Extends

Methods

clearTexture(dispose)

sdk/core/engine/sprites/sprite.js, line 230

Clears the sprite's texture. If dispose is true, it disposes the underlying texture from the context.

Name Type Default Description
dispose boolean true

dispose(texture, baseTexture)

sdk/core/engine/sprites/sprite.js, line 364

Disposes this Sprite

Name Type Default Description
texture Boolean false

= false - Should the texture be disposed?

baseTexture Boolean false

= false - Should the base texture be disposed?

getAnchor(){PhotoEditorSDK.Math.Vector2}

sdk/core/engine/sprites/sprite.js, line 327

Returns the anchor

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getBounds(){PhotoEditorSDK.Math.Rectangle}

sdk/core/engine/sprites/sprite.js, line 183

Returns the bounds for this DisplayObject

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getDimensions(){PhotoEditor.Math.Vector2}

sdk/core/engine/sprites/sprite.js, line 319

Returns the current width and height of this sprite

Returns:
Type Description
PhotoEditor.Math.Vector2

getHeight(){Number}

sdk/core/engine/sprites/sprite.js, line 302

Returns the height

Returns:
Type Description
Number

getLocalBounds(){PhotoEditorSDK.Math.Rectangle}

sdk/core/engine/sprites/sprite.js, line 164

Returns the non-global bounds of this DisplayObject

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getShader(){PhotoEditorSDK.Engine.Shader}

sdk/core/engine/sprites/sprite.js, line 273

Returns the shader

Returns:
Type Description
PhotoEditorSDK.Engine.Shader

getTexture(){PhotoEditorSDK.Engine.Texture}

sdk/core/engine/sprites/sprite.js, line 222

Returns the current texture

Returns:
Type Description
PhotoEditorSDK.Engine.Texture [description]

getWidth(){Number}

sdk/core/engine/sprites/sprite.js, line 285

Returns the width

Returns:
Type Description
Number

isAtPosition(position){Boolean}

sdk/core/engine/sprites/sprite.js, line 142

Checks if this sprite is located at the given position

Name Type Description
position PhotoEditorSDK.Math.Vector2
Returns:
Type Description
Boolean

isSmoothDownscaling(){Boolean}

sdk/core/engine/sprites/sprite.js, line 347

Returns whether smooth downscaling is enabled

Returns:
Type Description
Boolean

setAnchor(anchor)

sdk/core/engine/sprites/sprite.js, line 333

Sets the anchor

Name Type Description
anchor PhotoEditorSDK.Math.Vector2

setHeight(height)

sdk/core/engine/sprites/sprite.js, line 308

Sets the height

Name Type Description
height Number

setShader(shader)

sdk/core/engine/sprites/sprite.js, line 279

Sets the shader

Name Type Description
shader PhotoEditorSDK.Engine.Shader

setSmoothDownscaling(smoothDownscaling)

sdk/core/engine/sprites/sprite.js, line 355

Sets the smooth downscaling flag

Name Type Description
smoothDownscaling Boolean

setTexture(texture)

sdk/core/engine/sprites/sprite.js, line 249

Sets the texture

Name Type Description
texture PhotoEditorSDK.Engine.Texture

setWidth(width)

sdk/core/engine/sprites/sprite.js, line 291

Sets the width

Name Type Description
width Number