Class: Texture

PhotoEditorSDK.Engine~ Texture

A texture that can be applied to a PhotoEditorSDK.Engine.Sprite

new Texture()

sdk/core/engine/textures/texture.js, line 27

Extends

  • EventEmitter

Methods

staticPhotoEditorSDK.Engine.Texture.fromCanvas(canvas)

sdk/core/engine/textures/texture.js, line 62

Creates a texture from the given canvas

Name Type Description
canvas HTMLCanvasElement

staticPhotoEditorSDK.Engine.Texture.fromImage(image)

sdk/core/engine/textures/texture.js, line 53

Creates a texture from the given image

Name Type Description
image Image

dispose(baseTexture)

sdk/core/engine/textures/texture.js, line 169

Disposes this texture

Name Type Default Description
baseTexture Boolean true

getBaseTexture(){PhotoEditorSDK.Engine.BaseTexture}

sdk/core/engine/textures/texture.js, line 106

Returns the base texture

Returns:
Type Description
PhotoEditorSDK.Engine.BaseTexture

getDimensions(){PhotoEditorSDK.Math.Vector2}

sdk/core/engine/textures/texture.js, line 163

Returns the dimensions of this texture

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getFrame(){PhotoEditorSDK.Math.Rectangle}

sdk/core/engine/textures/texture.js, line 130

Returns the frame

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getHeight(){Number}

sdk/core/engine/textures/texture.js, line 151

Returns the height

Returns:
Type Description
Number

getUVs(){PhotoEditorSDK.Engine.TextureUVs}

sdk/core/engine/textures/texture.js, line 157

Returns the texture UVs

Returns:
Type Description
PhotoEditorSDK.Engine.TextureUVs

getWidth(){Number}

sdk/core/engine/textures/texture.js, line 145

Returns the width

Returns:
Type Description
Number

setBaseTexture(baseTexture)

sdk/core/engine/textures/texture.js, line 112

Sets the base texture

Name Type Description
baseTexture PhotoEditorSDK.Engine.BaseTexture

setFrame(frame)

sdk/core/engine/textures/texture.js, line 136

Sets the frame

Name Type Description
frame PhotoEditorSDK.Math.Rectangle