Class: Texture

PhotoEditorSDK.Engine. Texture

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

new PhotoEditorSDK.Engine.Texture()

sdk/engine/textures/texture.js, line 25

Extends

  • EventEmitter

Methods

staticPhotoEditorSDK.Engine.Texture.fromCanvas(canvas)

sdk/engine/textures/texture.js, line 61

Creates a texture from the given canvas

Name Type Description
canvas HTMLCanvasElement

staticPhotoEditorSDK.Engine.Texture.fromImage(image)

sdk/engine/textures/texture.js, line 52

Creates a texture from the given image

Name Type Description
image Image

dispose(baseTexture)

sdk/engine/textures/texture.js, line 168

Disposes this texture

Name Type Default Description
baseTexture Boolean true

getBaseTexture(){PhotoEditorSDK.Engine.BaseTexture}

sdk/engine/textures/texture.js, line 105

Returns the base texture

Returns:
Type Description
PhotoEditorSDK.Engine.BaseTexture

getDimensions(){PhotoEditorSDK.Math.Vector2}

sdk/engine/textures/texture.js, line 162

Returns the dimensions of this texture

Returns:
Type Description
PhotoEditorSDK.Math.Vector2

getFrame(){PhotoEditorSDK.Math.Rectangle}

sdk/engine/textures/texture.js, line 129

Returns the frame

Returns:
Type Description
PhotoEditorSDK.Math.Rectangle

getHeight(){Number}

sdk/engine/textures/texture.js, line 150

Returns the height

Returns:
Type Description
Number

getUVs(){PhotoEditorSDK.Engine.TextureUVs}

sdk/engine/textures/texture.js, line 156

Returns the texture UVs

Returns:
Type Description
PhotoEditorSDK.Engine.TextureUVs

getWidth(){Number}

sdk/engine/textures/texture.js, line 144

Returns the width

Returns:
Type Description
Number

setBaseTexture(baseTexture)

sdk/engine/textures/texture.js, line 111

Sets the base texture

Name Type Description
baseTexture PhotoEditorSDK.Engine.BaseTexture

setFrame(frame)

sdk/engine/textures/texture.js, line 135

Sets the frame

Name Type Description
frame PhotoEditorSDK.Math.Rectangle