properties

loader

Properties

The downloader in cc.loader's pipeline, it's by default the first pipe.
It's used to download files with several handlers: pure text, image, script, audio, font, uuid.
You can add your own download function with addDownloadHandlers

The downloader in cc.loader's pipeline, it's by default the second pipe.
It's used to parse downloaded content with several handlers: JSON, image, plist, fnt, uuid.
You can add your own download function with addLoadHandlers

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

addLoadHandlers

(

extMap

)

examples:

cc.loader.addLoadHandlers({
// This will match all url with .scene extension or all url with scene type
'scene' : function (url, callback) {}
});

load

(

resources

[progressCallback
]

completeCallback

)

Load resources with a progression callback and a complete callback.
The progression callback is the same as Pipeline's onProgress
The complete callback is almost the same as Pipeline's onComplete
The only difference is when user pass a single url as resources, the complete callback will set its result directly as the second parameter.

releaseRes

(

url

)

releaseAll
( )

Pipeline

(

pipes

)

Constructor, pass an array of pipes to construct a new Pipeline,
the pipes will be chained in the given order.
A pipe is an object which must contain an id in string and a handle function,
the id must be unique in the pipeline.
It can also include async property to identify whether it's an asynchronous process.

flowIn

(

urlList

)

Let new items flow into the pipeline.
Each item can be a simple url string or an object,
if it's an object, it must contain id property.
You can specify its type by type property, by default, the type is the extension name in url.
By adding a skips property including pipe ids, you can skip these pipe.
The object can contain any supplementary property as you want.

examples:

flowInDeps

(

urlList

callback

)

Let new items flow into the pipeline and give a callback when the list of items are all completed.
This is for loading dependencies for an existing item in flow, usually used in a pipe logic.
For example, we have a loader for scene configuration file in JSON, the scene will only be fully loaded
after all its dependencies are loaded, then you will need to use function to flow in all dependencies
found in the configuration file, and finish the loader pipe only after all dependencies are loaded (in the callback).

returns:

copyItemStates

(

srcItem

dstItems

)

Copy the item states from one source item to all destination items.
It's quite useful when a pipe generate new items from one source item,
then you should flowIn these generated items into pipeline,
but you probably want them to skip all pipes the source item already go through,
you can achieve it with this API.
For example, an unzip pipe will generate more items, but you won't want them to pass unzip or download pipe again.