Class: Sprite

PhotoEditorSDK.Engine. Sprite

A drawable rectangle with a texture

new PhotoEditorSDK.Engine.Sprite(texture)

sdk/engine/sprites/sprite.js, line 25

Creates a Sprite

Name Type Description
texture PhotoEditorSDK.Engine.Texture

Extends

Methods

dispose(texture, baseTexture)

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

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/engine/sprites/sprite.js, line 296

Returns the anchor

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getBounds(){PhotoEditorSDK.Math.Rectangle}

sdk/engine/sprites/sprite.js, line 177

Returns the bounds for this DisplayObject

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getDimensions(){PhotoEditor.Math.Vector2}

sdk/engine/sprites/sprite.js, line 288

Returns the current width and height of this sprite

Returns:
Type Description
PhotoEditor.Math.Vector2

getHeight(){Number}

sdk/engine/sprites/sprite.js, line 271

Returns the height

Returns:
Type Description
Number

getLocalBounds(){PhotoEditorSDK.Math.Rectangle}

sdk/engine/sprites/sprite.js, line 158

Returns the non-global bounds of this DisplayObject

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getShader(){PhotoEditorSDK.Engine.Shader}

sdk/engine/sprites/sprite.js, line 242

Returns the shader

Returns:
Type Description
PhotoEditorSDK.Engine.Shader

getTexture(){PhotoEditorSDK.Engine.Texture}

sdk/engine/sprites/sprite.js, line 216

Returns the current texture

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

getWidth(){Number}

sdk/engine/sprites/sprite.js, line 254

Returns the width

Returns:
Type Description
Number

isAtPosition(position){Boolean}

sdk/engine/sprites/sprite.js, line 136

Checks if this sprite is located at the given position

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

isSmoothDownscaling(){Boolean}

sdk/engine/sprites/sprite.js, line 316

Returns whether smooth downscaling is enabled

Returns:
Type Description
Boolean

setAnchor(anchor)

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

Sets the anchor

Name Type Description
anchor PhotoEditorSDK.Math.Vector2

setHeight(height)

sdk/engine/sprites/sprite.js, line 277

Sets the height

Name Type Description
height Number

setShader(shader)

sdk/engine/sprites/sprite.js, line 248

Sets the shader

Name Type Description
shader PhotoEditorSDK.Engine.Shader

setSmoothDownscaling(smoothDownscaling)

sdk/engine/sprites/sprite.js, line 324

Sets the smooth downscaling flag

Name Type Description
smoothDownscaling Boolean

setTexture(texture)

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

Sets the texture

Name Type Description
texture PhotoEditorSDK.Engine.Texture

setWidth(width)

sdk/engine/sprites/sprite.js, line 260

Sets the width

Name Type Description
width Number