ResourceManager Class
Resource manager is used to manage available resources used by objects
The resource manager is used to extend Object3D elements and is not meant to be used as a standalone.
For standalone resource management use the resource container.
Item Index
Methods
- addAudio
- addFont
- addMaterial
- addResource
- addTexture
- copyResources
- dispose
- getAudioByName
- getFontByName
- getImageByName
- getMaterialByName
- getResourceByName
- getTextureByName
- getVideoByName
- removeAudio
- removeFont
- removeGeometry
- removeImage
- removeMaterial
- removeResource
- removeTexture
- removeVideo
- ResourceContainer
Methods
addMaterial
-
material
Add material to materials list.
Parameters:
-
material
MaterialMaterial to be added
copyResources
()
Copy resources from another resource container into this one.
dispose
()
Dispose all the resources present in the resource manager.
getAudioByName
-
name
Get audio by name.
Parameters:
-
name
String
Returns:
Audio if found, else null
getFontByName
-
name
Get font by name.
Parameters:
-
name
String
Returns:
Font if found, else null
getImageByName
-
name
Get image by name.
Parameters:
-
name
StringImage name
Returns:
Image if found else null
getMaterialByName
-
name
Get material by its name.
Parameters:
-
name
StringMaterial name
Returns:
Material if found else null
getResourceByName
-
name
Get resource by name.
Parameters:
-
name
StringResource name
Returns:
Resource if found else null
getTextureByName
-
name
Get texture by name.
Parameters:
-
name
StringTexture name.
Returns:
Texture is found else null.
getVideoByName
-
name
Get video by name.
Parameters:
-
name
StringVideo name
Returns:
Video if found else null
removeAudio
-
audio
-
defaultAudio
Remove audio resource from the manager, replace on objects that are using it with another resource.
removeGeometry
-
geometry
Remove geometry from the list and replace by other.
Parameters:
-
geometry
Resource
removeMaterial
-
material
-
defaultMeshMaterial
-
defaultSpriteMaterial
Remove material from materials list, also receives default material used to replace.
removeTexture
-
texture
-
defaultTexture
Remove texture from textures list (also receives default used to replace).
Returns:
Texture if found, else null
ResourceContainer
()
Resource container contains resource of multiple types.
Properties
audio
Array
Audio resources.
fonts
Array
Fonts resources.
geometries
Array
Geometries resources.
images
Array
Image resources.
materials
Array
Materials resources.
resources
Array
Generic resources, can be program data, code files etc.
shapes
Array
Shapes resources, may be used to generate geometry data.
skeletons
Array
Skeletons resources, use for the meshes to store their skeleton data.
Skeletons can be shared between meshes.
textures
Array
Textures resources.
videos
Array
Video resources.