Skip to content

treihadwyl/resource-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Treihadwyl Resource Manager

Responsible for loading and getting resources, will cache where possible.

Installation

The Resource Manager is self-registering so just require it to get access to it.

var rm = require( 'resource-manager' );

Options

Options can be set via a function after the manager has been required.

rm.setOptions({
  caching: false
});

Caching

type: Boolean

Controls whether the memory cache will be used to store get requests. When disabled a request will go out but the browser cache should handle it.

API

Texture Atlas

rm.get.atlas( 'path/to/file.json' )
  .then( someFunction )
  .catch( handleError );

Uses PIXI.JsonLoader to fetch the json file representing the texture atlas and returns it inside a promise all ready to use. There is some inbuild error handling so the .catch block is optional.

About

Responsible for loading and getting resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published