Constructor
new TextureInfo(image, useWebGLopt, wrapopt)
Create a TextureInfo, called automatically by the engine
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
image | HTMLImageElement | | |||
useWebGL | boolean | <optional> | true | Should use WebGL if available? |
wrap | boolean | <optional> | false | Should the texture wrap (REPEAT) or clamp (CLAMP_TO_EDGE)? |
- Source
Members
glTexture
Properties| Type | Description |
|---|---|
| WebGLTexture | WebGL texture |
- Source
image
Properties| Type | Description |
|---|---|
| HTMLImageElement | | image source |
- Source
size
Properties| Type | Description |
|---|---|
| Vector2 | size of the image |
- Source
sizeInverse
Properties| Type | Description |
|---|---|
| Vector2 | inverse of the size, cached for rendering |
- Source
wrap
Properties| Type | Description |
|---|---|
| boolean | true for REPEAT wrap mode, false for CLAMP_TO_EDGE |
- Source
Methods
createWebGLTexture()
Creates the WebGL texture, updates if already created
- Source
destroyWebGLTexture()
Destroys the WebGL texture
- Source
hasWebGL() → {boolean}
Check if the texture is webgl enabled
- Source
Returns:
- Type:
- boolean
setWrap(wrapopt)
Set the wrap mode for this texture
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
wrap | boolean | <optional> | true | true for REPEAT, false for CLAMP_TO_EDGE |
- Source