API Docs for: 0.5.5
Show:

kick.texture.MovieTexture Class

A movie texture associated with a video element (or canvas tag) will update the content every frame (when it is bound).

Constructor

kick.texture.MovieTexture

(
  • [config]
)

Parameters:

  • [config] Object optional

Methods

bind

()

Bind the current texture And update the texture from the video element (unless it has already been updated in this frame)

destroy

()

Deallocates the texture from memory

init

(
  • config
  • [resourceTracker]
)

Configures the object using the configuration data.

Parameters:

  • config Object

    configuration data in JSON format

  • [resourceTracker] ResourceTracker optional

setTemporaryTexture

()

Creates a 2x2 temporary image (checkerboard)

toJSON

() Object

Serializes the data into a JSON object (that can be used as a config parameter in the constructor)
Note that the texture data is not serialized in the json format.
This means that either setImage() or setImageData() must be called before the texture can be bound

Returns:

Object:

config element

Properties

generateMipmaps

Boolean

Autogenerate mipmap levels
Note that enabling auto mipmap on movie textures uses a lot of resources.

Default: false

internalFormat

Number deprecated

Specifies the internal format of the image (format on GPU)
Must be one of the following: GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, GL_LUMINANCE_ALPHA

Default: GL_RGBA

magFilter

Object

Texture.magFilter should be either GL_NEAREST or GL_LINEAR.

Default: GL_LINEAR

minFilter

Object

Texture.minFilter should be either GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST,
GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_LINEAR

Default: GL_LINEAR

name

String

skipFrames

Number

0 means update movie texture every frame. 1 skip one frame update, 2 skips two frames etc.

Default: 0

textureId

Number protected

videoElement

VideoElement

wrapS

Object

Texture.wrapS should be either GL_CLAMP_TO_EDGE or GL_REPEAT

Default: GL_REPEAT

wrapT

Object

Texture.wrapT should be either GL_CLAMP_TO_EDGE or GL_REPEAT

Default: GL_REPEAT