Pipeline.Downloader Class
Module: cc
The downloader pipe, it can download several types of files:
- Text
- Image
- Script
- Audio
- Assets All unknown type will be downloaded as plain text. You can pass custom supported types in the constructor.
Index
Methods
- constructorConstructor of Downloader, you can pass custom supported types.
- addHandlersAdd custom supported types handler or modify existing type handler.
- loadSubpackageLoad subpackage with name.
Details
Methods
constructor
Constructor of Downloader, you can pass custom supported types.
| meta | description | 
|---|---|
| Defined in | cocos2d/core/load-pipeline/downloader.js:270 | 
Parameters
- extMapObject Custom supported types with corresponded handler
Examples
var downloader = new Downloader({
     // This will match all url with `.scene` extension or all url with `scene` type
     'scene' : function (url, callback) {}
 });
addHandlers
Add custom supported types handler or modify existing type handler.
| meta | description | 
|---|---|
| Defined in | cocos2d/core/load-pipeline/downloader.js:295 | 
Parameters
- extMapObject Custom supported types with corresponded handler
loadSubpackage
Load subpackage with name.
| meta | description | 
|---|---|
| Defined in | cocos2d/core/load-pipeline/downloader.js:353 | 
