Skip to content

Commit

Permalink
minor adjustments to removing gl-matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Squeakrats committed Feb 29, 2016
1 parent c17bb14 commit f76dea5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/cruft/net/Cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

[cruft/net/Cache.js](https://github.com/mjneil/CruftEngine/blob/master/cruft/net/Cache.js)
This class defines a Cache.

## Importing
```javascript
import Cache from "cruft/net/Cache";
```

##Methods


### register( [name](/primitives#string), [Loader](Loader.md) )
Register Cache loader to the given name.
```javascript
import ObjLoader from "cruft/net/loaders/ObjLoader";
cache.register("obj", new ObjLoader());
cache.get("obj!assets/models/CruftModel.obj").then((asset) => {
//asset is the parsed obj model
});
```

### get( [path](/primitives.md#string) )
Path to the asset to load. Optionaly prefixed with pluginname! to specify which loader to use.
```javascript
cache.get("json!assets/data/data.json").then((data) => {
console.log(data.pasword)//data is an obect.
});
```


### load( ...[paths](/primitives.md#string) )
load all of the specified paths.

```javascript
cache.load("json!assets/data/data.json", "json!assets/data/data2.json").then((paths) => {
console.log(paths["json!assets/data.txt"]); // contents of data.json
})
```
Empty file added docs/cruft/net/Loader.md
Empty file.
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ pages:
- ActorFactory : 'cruft/core/ActorFactory.md'
- Scheduler : 'cruft/core/Scheduler.md'
- Emitter : 'cruft/core/Emitter.md'
- Net :
- Cache : 'cruft/net/Cache.md'
- Loader : 'cruft/net/Loader.md'
- Math :
- vec2 : 'cruft/math/vec2.md'
- vec3 : 'cruft/math/vec3.md'
Expand Down

0 comments on commit f76dea5

Please sign in to comment.