new Textures()
Provides support for loading and unloading of textures (images)
- Source:
Methods
(static) _processLoadedImage(textureName, image) → {void}
This converts an image to the webGL texture format.
This should only be called once the texture is loaded.
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | name of the texture to be stored |
image |
String | Image file path |
- Source:
Returns:
- Type
- void
(static) activateNormalMap(textureName) → {void}
Activate gl.LINEAR_MIPMAP_LINEAR for texture
texture 1 is always normal map for this game engine
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Name of Texture |
Returns:
- Type
- void
(static) activateTexture(textureName) → {void}
Activate gl.LINEAR_MIPMAP_LINEAR for texture
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Name of Texture |
Returns:
- Type
- void
(static) deactivateTexture() → {void}
Deactivate the Textures and remove them from the GPU
Returns:
- Type
- void
(static) getColorArray(textureName) → {Array.<Float>}
Return the Color Array of a texture
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Name of Texture to get Color Array |
Returns:
- Type
- Array.<Float>
(static) getTextureInfo(textureName) → {TextureInfo}
Return the TextureInfo of Texture
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Name of Texture |
Returns:
TextureInto of Texture to get TexttureInfo
- Type
- TextureInfo
(static) loadTexture(textureName) → {void}
Loads an texture so that it can be drawn.
If already in the map, will do nothing.
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Texture to load from ResourceMap |
- Source:
Returns:
- Type
- void
(static) unloadTexture(textureName) → {void}
Remove the reference to allow associated memory
be available for subsequent garbage collection
Parameters:
Name | Type | Description |
---|---|---|
textureName |
String | Texture to unload from ResourceMap |
Returns:
- Type
- void