ResourceManager Class

Extends Object3D
Module: Resources

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.

Methods

addAudio

(
  • audio
)

Add audio to audio list.

Parameters:

addFont

(
  • font
)

Add font to fonts list.

Parameters:

addMaterial

(
  • material
)

Add material to materials list.

Parameters:

  • material Material

    Material to be added

addResource

(
  • Resource
)

Add resource to resources manager.

Parameters:

addTexture

(
  • texture
)

Add texture to texture list.

Parameters:

copyResources

()

Copy resources from another resource container into this one.

dispose

()

Dispose all the resources present in the resource manager.

getAudioByName

(
  • name
)
Audio

Get audio by name.

Parameters:

  • name String

Returns:

Audio:

Audio if found, else null

getFontByName

(
  • name
)
Font

Get font by name.

Parameters:

  • name String

Returns:

Font:

Font if found, else null

getImageByName

(
  • name
)
Image

Get image by name.

Parameters:

  • name String

    Image name

Returns:

Image:

Image if found else null

getMaterialByName

(
  • name
)
Material

Get material by its name.

Parameters:

  • name String

    Material name

Returns:

Material:

Material if found else null

getResourceByName

(
  • name
)
Resource

Get resource by name.

Parameters:

  • name String

    Resource name

Returns:

Resource:

Resource if found else null

getTextureByName

(
  • name
)
Texture

Get texture by name.

Parameters:

  • name String

    Texture name.

Returns:

Texture:

Texture is found else null.

getVideoByName

(
  • name
)
Video

Get video by name.

Parameters:

  • name String

    Video name

Returns:

Video:

Video if found else null

removeAudio

(
  • audio
  • defaultAudio
)

Remove audio resource from the manager, replace on objects that are using it with another resource.

Parameters:

removeFont

(
  • font
  • defaultFont
)

Remove font from font list.

Parameters:

removeGeometry

(
  • geometry
)

Remove geometry from the list and replace by other.

Parameters:

removeImage

(
  • image
)

Remove image.

Parameters:

removeMaterial

(
  • material
  • defaultMeshMaterial
  • defaultSpriteMaterial
)

Remove material from materials list, also receives default material used to replace.

Parameters:

  • material Material

    Material to be removed from manager.

  • defaultMeshMaterial Material

    Default mesh material to replace objects mesh materials.

  • defaultSpriteMaterial Material

    Defaul sprite material.

removeResource

(
  • resource
)

Remove resource from font list.

Parameters:

removeTexture

(
  • texture
  • defaultTexture
)
Texture

Remove texture from textures list (also receives default used to replace).

Parameters:

Returns:

Texture:

Texture if found, else null

removeVideo

(
  • video
)

Remove video.

Parameters:

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.