Draw. TextureInfo

Tile Info - Stores info about each texture

Constructor

new TextureInfo(image, useWebGLopt)

Create a TextureInfo, called automatically by the engine

Parameters:
NameTypeAttributesDefaultDescription
imageHTMLImageElement | OffscreenCanvas
useWebGLboolean<optional>
true

Should use WebGL if available?

Members

glTexture

Properties
TypeDescription
WebGLTexture

WebGL texture

image

Properties
TypeDescription
HTMLImageElement | OffscreenCanvas

image source

size

Properties
TypeDescription
Vector2

size of the image

sizeInverse

Properties
TypeDescription
Vector2

inverse of the size, cached for rendering

Methods

createWebGLTexture()

Creates the WebGL texture, updates if already created

destroyWebGLTexture()

Destroys the WebGL texture

hasWebGL() → {boolean}

Check if the texture is webgl enabled

Returns:
Type: 
boolean