TextureManager
Manage textures.
This manager is accessible on the engine instance using textures.
Usage:
.allocatedCount: number
Number of textures allocated in the manager.
.count: number
Number of textures in the manager.
Note: For performance reasons, avoid calling this method when possible.
.get(id: number) ⇒ null | Texture
Retrieve the texture with the given id.
Returns: The Texture if found, null
otherwise.
Param | Type | Description |
---|---|---|
id | number | The texture identifier. |
.load(filename: string, crossOrigin: string) ⇒ Promise<Texture>
Load an image from URL as Texture.
Returns: Loaded texture.
Param | Type | Description |
---|---|---|
filename | string | URL to load from. |
crossOrigin | string | Cross origin flag for the image object. |
.wrap(id: number) ⇒ Texture
Wrap a texture ID using Texture.
Note: This method performs caching and will return the same instance on subsequent calls.
Returns: The texture.
Param | Type | Description |
---|---|---|
id | number | ID of the texture to create. |