loader
类型
模块: cc
废弃: 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
索引
属性(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
方法
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 |
---|---|
类型 | Unknown |
定义于 | 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 |
---|---|
类型 | Object |
定义于 | 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 |
---|---|
类型 | Object |
定义于 | 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 |
---|---|
类型 | Object |
定义于 | 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 |
---|---|
类型 | Object |
定义于 | cocos2d/core/asset-manager/deprecated.js:390 |
废弃(Deprecated) | cc.loader.loader is deprecated, please use cc.assetManager.parser instead |
方法
load
cc.loader.load
is deprecated, please use loadAny instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:98 |
废弃(Deprecated) | cc.loader.load is deprecated, please use cc.assetManager.loadAny instead |
参数列表
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 |
---|---|
返回 | XMLHttpRequest |
定义于 | 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 |
---|---|
返回 | Object |
定义于 | cocos2d/core/asset-manager/deprecated.js:200 |
废弃(Deprecated) | cc.loader.getItem is deprecated, please use cc.assetManager.assets.get instead |
参数列表
id
Object The id of the item
loadRes
cc.loader.loadRes
is deprecated, please use load instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:212 |
废弃(Deprecated) | cc.loader.loadRes is deprecated, please use cc.resources.load instead |
参数列表
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 |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:246 |
废弃(Deprecated) | cc.loader.loadResArray is deprecated, please use cc.resources.load instead |
参数列表
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 |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:284 |
废弃(Deprecated) | cc.loader.loadResDir is deprecated, please use cc.resources.loadDir instead |
参数列表
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 |
---|---|
返回 | Any |
定义于 | cocos2d/core/asset-manager/deprecated.js:325 |
废弃(Deprecated) | cc.loader.getRes is deprecated, please use cc.resources.get instead |
参数列表
getDependsRecursively
cc.loader.getDependsRecursively
is deprecated, please use use DependUtil/getDepsRecursively:method instead
meta | description |
---|---|
返回 | Array |
定义于 | cocos2d/core/asset-manager/deprecated.js:342 |
废弃(Deprecated) | cc.loader.getDependsRecursively is deprecated, please use use cc.assetManager.dependUtil.getDepsRecursively instead |
参数列表
addDownloadHandlers
cc.loader.addDownloadHandlers
is deprecated, please use cc.assetManager.downloader.register
instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:401 |
废弃(Deprecated) | cc.loader.addDownloadHandlers is deprecated, please use cc.assetManager.downloader.register instead |
参数列表
extMap
Object Custom supported types with corresponded handler
addLoadHandlers
cc.loader.addLoadHandlers
is deprecated, please use cc.assetManager.parser.register
instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:422 |
废弃(Deprecated) | cc.loader.addLoadHandlers is deprecated, please use cc.assetManager.parser.register instead |
参数列表
extMap
Object Custom supported types with corresponded handler
release
cc.loader.release
is deprecated, please use releaseAsset instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:449 |
废弃(Deprecated) | cc.loader.release is deprecated, please use cc.assetManager.releaseAsset instead |
参数列表
releaseAsset
cc.loader.releaseAsset
is deprecated, please use releaseAsset instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:478 |
废弃(Deprecated) | cc.loader.releaseAsset is deprecated, please use cc.assetManager.releaseAsset instead |
参数列表
asset
Asset
releaseRes
cc.loader.releaseRes
is deprecated, please use AssetManager/releaseRes:method instead
meta | description |
---|---|
定义于 | cocos2d/core/asset-manager/deprecated.js:489 |
废弃(Deprecated) | cc.loader.releaseRes is deprecated, please use cc.assetManager.releaseRes instead |
参数列表
releaseResDir
cc.loader.releaseResDir
was removed, please use AssetManager/releaseRes:method instead
meta | description |
---|---|
定义于 | 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 |
---|---|
定义于 | 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 |
---|---|
返回 | Boolean |
定义于 | cocos2d/core/asset-manager/deprecated.js:524 |
废弃(Deprecated) | cc.loader.removeItem is deprecated, please use cc.assetManager.assets.remove instead |
参数列表
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 |
---|---|
定义于 | 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 |
参数列表
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 |
---|---|
定义于 | 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 |
参数列表
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 |
---|---|
返回 | Boolean |
定义于 | cocos2d/core/asset-manager/deprecated.js:568 |
废弃(Deprecated) | cc.loader.isAutoRelease is deprecated |