Texture
Texture
Wrapper around a native texture data
Kind: global class
new Texture (param)
Param | Type | Description |
---|---|---|
param | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | number | HTML media element to create texture from or texture id to wrap. |
.valid ⇒ boolean
Kind: instance property of Texture
Returns: boolean - Whether this texture is valid
.update ()
Update the texture to match the HTML element (e.g. reflect the current frame of a video)
Kind: instance method of Texture
.updateSubImage (x, y, w, h)
Update a subrange on the texture to match the HTML element (e.g. reflect the current frame of a video)
Kind: instance method of Texture
Param | Type | Description |
---|---|---|
x | number | x offset |
y | number | y offset |
w | number | width |
h | number | height |