loader
Class
Module: cc
deprecated: cc.loader is deprecated, please backup your project and upgrade to cc.assetManager
cc.loader
is deprecated, please backup your project and upgrade to AssetManager
Index
Properties
onProgress
Unknown
cc.loader.onProgress
is deprecated, please transfer onProgress to API as a parameterassetLoader
Object
cc.loader.assetLoader
was removed, assetLoader and md5Pipe were merged into transformPipelinemd5Pipe
Object
cc.loader.md5Pipe
is deprecated, assetLoader and md5Pipe were merged into transformPipelinedownloader
Object
cc.loader.downloader
is deprecated, please use downloader insteadloader
Object
cc.loader.loader
is deprecated, please use parser instead
Methods
load
cc.loader.load
is deprecated, please use loadAny insteadgetXMLHttpRequest
cc.loader.getXMLHttpRequest
is deprecated, please useXMLHttpRequest
directlygetItem
cc.loader.getItem
is deprecated, please usecc.assetManager.asset.get
insteadloadRes
cc.loader.loadRes
is deprecated, please use load insteadloadResArray
cc.loader.loadResArray
is deprecated, please use load insteadloadResDir
cc.loader.loadResDir
is deprecated, please use loadDir insteadgetRes
cc.loader.getRes
is deprecated, please use get insteadgetDependsRecursively
cc.loader.getDependsRecursively
is deprecated, please use use DependUtil/getDepsRecursively:method insteadaddDownloadHandlers
cc.loader.addDownloadHandlers
is deprecated, please usecc.assetManager.downloader.register
insteadaddLoadHandlers
cc.loader.addLoadHandlers
is deprecated, please usecc.assetManager.parser.register
insteadrelease
cc.loader.release
is deprecated, please use releaseAsset insteadreleaseAsset
cc.loader.releaseAsset
is deprecated, please use releaseAsset insteadreleaseRes
cc.loader.releaseRes
is deprecated, please use AssetManager/releaseRes:method insteadreleaseResDir
cc.loader.releaseResDir
was removed, please use AssetManager/releaseRes:method insteadreleaseAll
cc.loader.releaseAll
is deprecated, please use releaseAll insteadremoveItem
cc.loader.removeItem
is deprecated, please usecc.assetManager.assets.remove
insteadsetAutoRelease
cc.loader.setAutoRelease
is deprecated, if you want to prevent some asset from auto releasing, please use addRef insteadsetAutoReleaseRecursively
cc.loader.setAutoReleaseRecursively
is deprecated, if you want to prevent some asset from auto releasing, please use addRef insteadisAutoRelease
cc.loader.isAutoRelease
is deprecated
Details
Properties
onProgress
cc.loader.onProgress
is deprecated, please transfer onProgress to API as a parameter
meta | description |
---|---|
Type | Unknown |
Defined in | cocos2d/core/asset-manager/deprecated.js:86 |
Deprecated | cc.loader.onProgress is deprecated, please transfer onProgress to API as a parameter |
assetLoader
cc.loader.assetLoader
was removed, assetLoader and md5Pipe were merged into transformPipeline
meta | description |
---|---|
Type | Object |
Defined in | cocos2d/core/asset-manager/deprecated.js:355 |
Deprecated | cc.loader.assetLoader was removed, assetLoader and md5Pipe were merged into cc.assetManager.transformPipeline |
md5Pipe
cc.loader.md5Pipe
is deprecated, assetLoader and md5Pipe were merged into transformPipeline
meta | description |
---|---|
Type | Object |
Defined in | cocos2d/core/asset-manager/deprecated.js:368 |
Deprecated | cc.loader.md5Pipe is deprecated, assetLoader and md5Pipe were merged into cc.assetManager.transformPipeline |
downloader
cc.loader.downloader
is deprecated, please use downloader instead
meta | description |
---|---|
Type | Object |
Defined in | cocos2d/core/asset-manager/deprecated.js:379 |
Deprecated | cc.loader.downloader is deprecated, please use cc.assetManager.downloader instead |
loader
cc.loader.loader
is deprecated, please use parser instead
meta | description |
---|---|
Type | Object |
Defined in | cocos2d/core/asset-manager/deprecated.js:390 |
Deprecated | cc.loader.loader is deprecated, please use cc.assetManager.parser instead |
Methods
load
cc.loader.load
is deprecated, please use loadAny instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:98 |
Deprecated | cc.loader.load is deprecated, please use cc.assetManager.loadAny instead |
Parameters
resources
String | String[] | Object Url list in an arrayprogressCallback
Function Callback invoked when progression changecompleteCallback
Function Callback invoked when all resources loaded
getXMLHttpRequest
cc.loader.getXMLHttpRequest
is deprecated, please use XMLHttpRequest
directly
meta | description |
---|---|
Returns | XMLHttpRequest |
Defined in | cocos2d/core/asset-manager/deprecated.js:187 |
Deprecated | cc.loader.getXMLHttpRequest is deprecated, please use XMLHttpRequest directly |
getItem
cc.loader.getItem
is deprecated, please use cc.assetManager.asset.get
instead
meta | description |
---|---|
Returns | Object |
Defined in | cocos2d/core/asset-manager/deprecated.js:200 |
Deprecated | cc.loader.getItem is deprecated, please use cc.assetManager.assets.get instead |
Parameters
id
Object The id of the item
loadRes
cc.loader.loadRes
is deprecated, please use load instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:212 |
Deprecated | cc.loader.loadRes is deprecated, please use cc.resources.load instead |
Parameters
url
String Url of the target resource.The url is relative to the "resources" folder, extensions must be omitted.
type
Function Only asset of type will be loaded if this argument is supplied.progressCallback
Function Callback invoked when progression change.completeCallback
Function Callback invoked when the resource loaded.
loadResArray
cc.loader.loadResArray
is deprecated, please use load instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:246 |
Deprecated | cc.loader.loadResArray is deprecated, please use cc.resources.load instead |
Parameters
urls
String[] Array of URLs of the target resource.The url is relative to the "resources" folder, extensions must be omitted.
type
Function Only asset of type will be loaded if this argument is supplied.progressCallback
Function Callback invoked when progression change.completeCallback
Function A callback which is called when all assets have been loaded, or an error occurs.
loadResDir
cc.loader.loadResDir
is deprecated, please use loadDir instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:284 |
Deprecated | cc.loader.loadResDir is deprecated, please use cc.resources.loadDir instead |
Parameters
url
String Url of the target folder.The url is relative to the "resources" folder, extensions must be omitted.
type
Function Only asset of type will be loaded if this argument is supplied.progressCallback
Function Callback invoked when progression change.completeCallback
Function A callback which is called when all assets have been loaded, or an error occurs.error
Error If one of the asset failed, the complete callback is immediately calledwith the error. If all assets are loaded successfully, error will be null.
assets
Asset[] | Array An array of all loaded assets.If nothing to load, assets will be an empty array.
urls
String[] An array that lists all the URLs of loaded assets.
getRes
cc.loader.getRes
is deprecated, please use get instead
meta | description |
---|---|
Returns | Any |
Defined in | cocos2d/core/asset-manager/deprecated.js:325 |
Deprecated | cc.loader.getRes is deprecated, please use cc.resources.get instead |
Parameters
getDependsRecursively
cc.loader.getDependsRecursively
is deprecated, please use use DependUtil/getDepsRecursively:method instead
meta | description |
---|---|
Returns | Array |
Defined in | cocos2d/core/asset-manager/deprecated.js:342 |
Deprecated | cc.loader.getDependsRecursively is deprecated, please use use cc.assetManager.dependUtil.getDepsRecursively instead |
Parameters
addDownloadHandlers
cc.loader.addDownloadHandlers
is deprecated, please use cc.assetManager.downloader.register
instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:401 |
Deprecated | cc.loader.addDownloadHandlers is deprecated, please use cc.assetManager.downloader.register instead |
Parameters
extMap
Object Custom supported types with corresponded handler
addLoadHandlers
cc.loader.addLoadHandlers
is deprecated, please use cc.assetManager.parser.register
instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:422 |
Deprecated | cc.loader.addLoadHandlers is deprecated, please use cc.assetManager.parser.register instead |
Parameters
extMap
Object Custom supported types with corresponded handler
release
cc.loader.release
is deprecated, please use releaseAsset instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:449 |
Deprecated | cc.loader.release is deprecated, please use cc.assetManager.releaseAsset instead |
Parameters
releaseAsset
cc.loader.releaseAsset
is deprecated, please use releaseAsset instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:478 |
Deprecated | cc.loader.releaseAsset is deprecated, please use cc.assetManager.releaseAsset instead |
Parameters
asset
Asset
releaseRes
cc.loader.releaseRes
is deprecated, please use AssetManager/releaseRes:method instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:489 |
Deprecated | cc.loader.releaseRes is deprecated, please use cc.assetManager.releaseRes instead |
Parameters
releaseResDir
cc.loader.releaseResDir
was removed, please use AssetManager/releaseRes:method instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:501 |
Deprecated | cc.loader.releaseResDir was removed, please use cc.assetManager.releaseRes instead |
releaseAll
cc.loader.releaseAll
is deprecated, please use releaseAll instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:513 |
Deprecated | cc.loader.releaseAll is deprecated, please use cc.assetManager.releaseAll instead |
removeItem
cc.loader.removeItem
is deprecated, please use cc.assetManager.assets.remove
instead
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/asset-manager/deprecated.js:524 |
Deprecated | cc.loader.removeItem is deprecated, please use cc.assetManager.assets.remove instead |
Parameters
id
Object The id of the item
setAutoRelease
cc.loader.setAutoRelease
is deprecated, if you want to prevent some asset from auto releasing, please use addRef instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:536 |
Deprecated | cc.loader.setAutoRelease is deprecated, if you want to prevent some asset from auto releasing, please use cc.Asset.addRef instead |
Parameters
assetOrUrlOrUuid
Asset | String asset object or the raw asset's url or uuidautoRelease
Boolean indicates whether should release automatically
setAutoReleaseRecursively
cc.loader.setAutoReleaseRecursively
is deprecated, if you want to prevent some asset from auto releasing, please use addRef instead
meta | description |
---|---|
Defined in | cocos2d/core/asset-manager/deprecated.js:549 |
Deprecated | cc.loader.setAutoReleaseRecursively is deprecated, if you want to prevent some asset from auto releasing, please use cc.Asset.addRef instead |
Parameters
assetOrUrlOrUuid
Asset | String asset object or the raw asset's url or uuidautoRelease
Boolean indicates whether should release automatically
isAutoRelease
cc.loader.isAutoRelease
is deprecated
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/asset-manager/deprecated.js:568 |
Deprecated | cc.loader.isAutoRelease is deprecated |