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 parameter
  • assetLoader Object cc.loader.assetLoader was removed, assetLoader and md5Pipe were merged into transformPipeline
  • md5Pipe Object cc.loader.md5Pipe is deprecated, assetLoader and md5Pipe were merged into transformPipeline
  • downloader Object cc.loader.downloader is deprecated, please use downloader instead
  • loader Object cc.loader.loader is deprecated, please use parser instead
Methods
  • load cc.loader.load is deprecated, please use loadAny instead
  • getXMLHttpRequest cc.loader.getXMLHttpRequest is deprecated, please use XMLHttpRequest directly
  • getItem cc.loader.getItem is deprecated, please use cc.assetManager.asset.get instead
  • loadRes cc.loader.loadRes is deprecated, please use load instead
  • loadResArray cc.loader.loadResArray is deprecated, please use load instead
  • loadResDir cc.loader.loadResDir is deprecated, please use loadDir instead
  • getRes cc.loader.getRes is deprecated, please use get instead
  • getDependsRecursively cc.loader.getDependsRecursively is deprecated, please use use DependUtil/getDepsRecursively:method instead
  • addDownloadHandlers cc.loader.addDownloadHandlers is deprecated, please use cc.assetManager.downloader.register instead
  • addLoadHandlers cc.loader.addLoadHandlers is deprecated, please use cc.assetManager.parser.register instead
  • release cc.loader.release is deprecated, please use releaseAsset instead
  • releaseAsset cc.loader.releaseAsset is deprecated, please use releaseAsset instead
  • releaseRes cc.loader.releaseRes is deprecated, please use AssetManager/releaseRes:method instead
  • releaseResDir cc.loader.releaseResDir was removed, please use AssetManager/releaseRes:method instead
  • releaseAll cc.loader.releaseAll is deprecated, please use releaseAll instead
  • removeItem cc.loader.removeItem is deprecated, please use cc.assetManager.assets.remove instead
  • setAutoRelease cc.loader.setAutoRelease is deprecated, if you want to prevent some asset from auto releasing, please use addRef instead
  • setAutoReleaseRecursively cc.loader.setAutoReleaseRecursively is deprecated, if you want to prevent some asset from auto releasing, please use addRef instead
  • isAutoRelease 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 array
  • progressCallback Function Callback invoked when progression change
    • completedCount Number The number of the items that are already completed
    • totalCount Number The total number of the items
    • item Object The latest item which flow out the pipeline
  • completeCallback 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.
    • completedCount Number The number of the items that are already completed.
    • totalCount Number The total number of the items.
    • item Object The latest item which flow out the pipeline.
  • completeCallback Function Callback invoked when the resource loaded.
    • error Error The error info or null if loaded successfully.
    • resource Object The loaded resource if it can be found otherwise returns null.
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.
    • completedCount Number The number of the items that are already completed.
    • totalCount Number The total number of the items.
    • item Object The latest item which flow out the pipeline.
  • 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 called
                                    with 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.
      
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.
    • completedCount Number The number of the items that are already completed.
    • totalCount Number The total number of the items.
    • item Object The latest item which flow out the pipeline.
  • 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 called
                                    with 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
  • url String
  • type Function Only asset of type will be returned if this argument is supplied.
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
  • owner Asset | String The owner asset or the resource url or the asset's uuid
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
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
  • url String
  • type Function Only asset of type will be released if this argument is supplied.
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 uuid
  • autoRelease 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 uuid
  • autoRelease 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
Parameters
  • assetOrUrl Asset | String asset object or the raw asset's url

results matching ""

    No results matching ""