Options
All
  • Public
  • Public/Protected
  • All
Menu

External module loader

加载相关模块

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

LoadCompleteCallback

LoadCompleteCallback: function

Type declaration

    • (error: Error | null | undefined, asset?: T): void
    • Parameters

      • error: Error | null | undefined
      • Optional asset: T

      Returns void

LoadProgressCallback

LoadProgressCallback: function

Type declaration

    • (completedCount: number, totalCount: number, item: any): void
    • Parameters

      • completedCount: number
      • totalCount: number
      • item: any

      Returns void

Variables

Const ETC1_RGB_NO_MIPMAPS

ETC1_RGB_NO_MIPMAPS: 0 = 0

Const ETC2_RGBA_NO_MIPMAPS

ETC2_RGBA_NO_MIPMAPS: 3 = 3

Const ETC2_RGB_NO_MIPMAPS

ETC2_RGB_NO_MIPMAPS: 1 = 1

Const ETC_PKM_ENCODED_HEIGHT_OFFSET

ETC_PKM_ENCODED_HEIGHT_OFFSET: 10 = 10

Const ETC_PKM_ENCODED_WIDTH_OFFSET

ETC_PKM_ENCODED_WIDTH_OFFSET: 8 = 8

Const ETC_PKM_FORMAT_OFFSET

ETC_PKM_FORMAT_OFFSET: 6 = 6

Const ETC_PKM_HEADER_SIZE

ETC_PKM_HEADER_SIZE: 16 = 16

Const ETC_PKM_HEIGHT_OFFSET

ETC_PKM_HEIGHT_OFFSET: 14 = 14

Const ETC_PKM_WIDTH_OFFSET

ETC_PKM_WIDTH_OFFSET: 12 = 12

Const ExtnameRegex

ExtnameRegex: RegExp = /(\.[^.\n\\/]*)$/

Const ID

ID: "MD5Pipe" = "MD5Pipe"

Let ID

ID: string = "Loader"

Const ID

ID: "AssetLoader" = "AssetLoader"

Const ID

ID: "Downloader" = "Downloader"

Const ItemState

ItemState: any = LoadingItems.ItemState

Let MissingClass

MissingClass: any

Const PVR_HEADER_FORMAT

PVR_HEADER_FORMAT: 2 = 2

Const PVR_HEADER_HEIGHT

PVR_HEADER_HEIGHT: 6 = 6

Const PVR_HEADER_LENGTH

PVR_HEADER_LENGTH: 13 = 13

Const PVR_HEADER_MAGIC

PVR_HEADER_MAGIC: 0 = 0

Const PVR_HEADER_METADATA

PVR_HEADER_METADATA: 12 = 12

Const PVR_HEADER_MIPMAPCOUNT

PVR_HEADER_MIPMAPCOUNT: 11 = 11

Const PVR_HEADER_WIDTH

PVR_HEADER_WIDTH: 7 = 7

Const PVR_MAGIC

PVR_MAGIC: 55727696 = 55727696

Const UuidRegex

UuidRegex: RegExp = /.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-@]{8,}).*/

Const _POOL_MAX_LENGTH

_POOL_MAX_LENGTH: 10 = 10

Const __audioSupport

__audioSupport: any = sys.__audioSupport

Let _canvasContext

_canvasContext: CanvasRenderingContext2D | null = null

Let _checkedIds

_checkedIds: Array<string> = []

Let fontFaces

fontFaces: object

Type declaration

Let _intervalId

_intervalId: number = -1

Let _loadingFonts

_loadingFonts: Array<IFontLoadHandle> = []

Let _noCacheRex

_noCacheRex: RegExp = /\?/

Let _pool

_pool: Array<LoadingItems> = []

Let _qid

_qid: number = (0|(Math.random()*998))

Let _queueDeps

_queueDeps: any = createMap(true)

Let _queues

_queues: any = createMap(true)

Const _sharedList

_sharedList: any = []

Const _sharedResources

_sharedResources: any = []

Const _testString

_testString: "BES bswy:->@" = "BES bswy:->@"

Let _timeout

_timeout: number = 60000

Let _tmpInfo

_tmpInfo: any = null

Const assetTables

assetTables: any = Object.create(null)

Const formatSupport

formatSupport: any = __audioSupport.format

Let globalUnpackers

globalUnpackers: object

Type declaration

Const loader

loader: CCLoader = cc.loader = new CCLoader()

Let packIndices

packIndices: object

Type declaration

Let plistParser

plistParser: PlistParser = new PlistParser()
type

{PlistParser}

name

plistParser A Plist Parser

Let reusedArray

reusedArray: Array<any> = []

Let uuidToPack

uuidToPack: object

Type declaration

Functions

checkFontLoaded

  • _checkFontLoaded(): void
  • Returns void

doLoadNewPack

  • doLoadNewPack(uuid: any, packUuid: any, packedJson: any): any
  • Parameters

    • uuid: any
    • packUuid: any
    • packedJson: any

    Returns any

doPreload

  • doPreload(packUuid: any, packJson: any): void
  • Parameters

    • packUuid: any
    • packJson: any

    Returns void

getFontFamily

  • getFontFamily(fontHandle: any): any
  • Parameters

    • fontHandle: any

    Returns any

loadNewPack

  • loadNewPack(uuid: any, packUuid: any, callback: any): void
  • Parameters

    • uuid: any
    • packUuid: any
    • callback: any

    Returns void

parseUrlParam

  • parseUrlParam(url: any): undefined | object
  • Parameters

    • url: any

    Returns undefined | object

selectLoadedPack

  • selectLoadedPack(packUuids: any): any
  • Parameters

    • packUuids: any

    Returns any

autoRelease

  • autoRelease(oldSceneAssets: any, nextSceneAssets: any, persistNodes: any): void
  • Parameters

    • oldSceneAssets: any
    • nextSceneAssets: any
    • persistNodes: any

    Returns void

canDeferredLoad

  • canDeferredLoad(asset: any, item: any, isScene: any): any
  • Parameters

    • asset: any
    • item: any
    • isScene: any

    Returns any

checkCircleReference

  • checkCircleReference(owner: any, item: IItem, recursiveCall?: any): boolean
  • Parameters

    • owner: any
    • item: IItem
    • Optional recursiveCall: any

    Returns boolean

createItem

  • createItem(id: any, queueId: any): object
  • Parameters

    • id: any
    • queueId: any

    Returns object

    • complete: boolean
    • content: null
    • deps: null
    • error: null
    • id: any
    • isScene: any
    • queueId: any
    • rawUrl: undefined
    • states: object
    • type: string
    • url: any
    • urlParam: undefined | object

decompressJson

  • decompressJson(data: any, keys: any): null
  • Parameters

    • data: any
    • keys: any

    Returns null

default

  • default(item: any, callback: any): void
  • Parameters

    • item: any
    • callback: any

    Returns void

doCheckCouldRelease

  • doCheckCouldRelease(releasedKey: any, refOwnerItem: any, caches: any): void
  • Parameters

    • releasedKey: any
    • refOwnerItem: any
    • caches: any

    Returns void

downloadAudio

  • downloadAudio(item: any, callback: any): undefined | Error
  • Parameters

    • item: any
    • callback: any

    Returns undefined | Error

downloadBinary

  • downloadBinary(item: any, callback: any): void
  • category

    loader

    Parameters

    • item: any
    • callback: any

    Returns void

downloadImage

  • downloadImage(item: any, callback: any, isCrossOrigin: any, img: any): any
  • Parameters

    • item: any
    • callback: any
    • isCrossOrigin: any
    • img: any

    Returns any

downloadScript

  • downloadScript(item: any, callback: any, isAsync?: any): void
  • Parameters

    • item: any
    • callback: any
    • Optional isAsync: any

    Returns void

downloadUuid

  • downloadUuid(item: any, callback: any): any
  • Parameters

    • item: any
    • callback: any

    Returns any

error

  • error(uuid: any, packUuid: any): Error
  • Parameters

    • uuid: any
    • packUuid: any

    Returns Error

flow

  • flow(pipe: any, item: any): void
  • Parameters

    • pipe: any
    • item: any

    Returns void

getDependsRecursively

  • getDependsRecursively(key: any): string[]
  • Parameters

    • key: any

    Returns string[]

getItemDesc

  • getItemDesc(item: any): string
  • Parameters

    • item: any

    Returns string

getResWithUrl

  • getResWithUrl(res: any): any
  • 通过使用 uuid 查找资源的真实 url 来转换资源,否则将使用 uuid 或原始 url 作为其 url
    所以可以保证结果中会有 url

    Parameters

    • res: any

    Returns any

getUuidFromURL

  • getUuidFromURL(url: any): any
  • Parameters

    • url: any

    Returns any

getXMLHttpRequest

  • getXMLHttpRequest(): any
  • Returns any

initPacks

  • initPacks(packs: any): void
  • Parameters

    • packs: any

    Returns void

isIdValid

  • isIdValid(id: any): boolean
  • Parameters

    • id: any

    Returns boolean

isMatchByWord

  • isMatchByWord(path: any, test: any): boolean
  • Parameters

    • path: any
    • test: any

    Returns boolean

isSceneObj

  • isSceneObj(json: any): boolean
  • Parameters

    • json: any

    Returns boolean

load

  • load(item: any, callback: any): any
  • Parameters

    • item: any
    • callback: any

    Returns any

    When returns undefined, the requested item is not in any pack, when returns null, the item is in a loading pack, when item json exists, it will return the result directly.

loadAudioAsAsset

  • loadAudioAsAsset(item: any, callback: any): any
  • Parameters

    • item: any
    • callback: any

    Returns any

loadBinary

  • loadBinary(item: any): any
  • Parameters

    • item: any

    Returns any

loadDepends

  • loadDepends(pipeline: any, item: any, asset: any, depends: any, callback: any): void
  • Parameters

    • pipeline: any
    • item: any
    • asset: any
    • depends: any
    • callback: any

    Returns void

loadDomAudio

  • loadDomAudio(item: any, callback: any): void
  • Parameters

    • item: any
    • callback: any

    Returns void

loadFont

  • loadFont(item: any, callback: any): any
  • Parameters

    • item: any
    • callback: any

    Returns any

loadImage

  • loadImage(item: any): any
  • Parameters

    • item: any

    Returns any

loadJSON

  • loadJSON(item: any): any
  • Parameters

    • item: any

    Returns any

loadNothing

  • loadNothing(): null
  • Returns null

loadPKMTex

  • loadPKMTex(item: any): Error | object
  • Parameters

    • item: any

    Returns Error | object

loadPVRTex

  • loadPVRTex(item: any): Error | object
  • Parameters

    • item: any

    Returns Error | object

loadPlist

  • loadPlist(item: any): any
  • Parameters

    • item: any

    Returns any

loadUuid

  • loadUuid(item: any, callback: any): void | Error
  • Parameters

    • item: any
    • callback: any

    Returns void | Error

loadWebAudio

  • loadWebAudio(item: any, callback: any): void
  • Parameters

    • item: any
    • callback: any

    Returns void

parseDepends

  • parseDepends(item: any, asset: any, tdInfo: any, deferredLoadRawAssetsInRuntime: any): any
  • Parameters

    • item: any
    • asset: any
    • tdInfo: any
    • deferredLoadRawAssetsInRuntime: any

    Returns any

parseDepends

  • parseDepends(key: any, parsed: any): void
  • Parameters

    • key: any
    • parsed: any

    Returns void

readBEUint16

  • readBEUint16(header: any, offset: any): number
  • Parameters

    • header: any
    • offset: any

    Returns number

skip

  • skip(): null
  • Returns null

urlAppendTimestamp

  • urlAppendTimestamp(url: any): any
  • Parameters

    • url: any

    Returns any

visitAsset

  • visitAsset(asset: any, excludeMap: any): void
  • Parameters

    • asset: any
    • excludeMap: any

    Returns void

visitComponent

  • visitComponent(comp: any, excludeMap: any): void
  • Parameters

    • comp: any
    • excludeMap: any

    Returns void

visitNode

  • visitNode(node: any, excludeMap: any): void
  • Parameters

    • node: any
    • excludeMap: any

    Returns void

Object literals

Const info

info: object

raw

raw: boolean = false

url

url: null = null

Let defaultMap

defaultMap: object

ExportJson

ExportJson: loadJSON = loadJSON

bin

bin: loadBinary = loadBinary

binary

binary: loadBinary = loadBinary

bmp

bmp: loadImage = loadImage

default

default: loadNothing = loadNothing

eot

eot: loadFont = loadFont

fire

fire: loadUuid = loadUuid

font

font: loadFont = loadFont

gif

gif: loadImage = loadImage

ico

ico: loadImage = loadImage

image

image: loadImage = loadImage

jpeg

jpeg: loadImage = loadImage

jpg

jpg: loadImage = loadImage

json

json: loadJSON = loadJSON

m4a

m4a: loadAudioAsAsset = loadAudioAsAsset

mp3

mp3: loadAudioAsAsset = loadAudioAsAsset

ogg

ogg: loadAudioAsAsset = loadAudioAsAsset

pkm

pkm: loadPKMTex = loadPKMTex

plist

plist: loadPlist = loadPlist

png

png: loadImage = loadImage

prefab

prefab: loadUuid = loadUuid

pvr

pvr: loadPVRTex = loadPVRTex

scene

scene: loadUuid = loadUuid

svg

svg: loadFont = loadFont

tiff

tiff: loadImage = loadImage

ttc

ttc: loadFont = loadFont

ttf

ttf: loadFont = loadFont

uuid

uuid: loadUuid = loadUuid

wav

wav: loadAudioAsAsset = loadAudioAsAsset

webp

webp: loadImage = loadImage

woff

woff: loadFont = loadFont

Let defaultMap

defaultMap: object

ExportJson

ExportJson: default = downloadText

atlas

atlas: default = downloadText

bin

bin: downloadBinary = downloadBinary

binary

binary: downloadBinary = downloadBinary

bmp

bmp: downloadImage = downloadImage

default

default: default = downloadText

eot

eot: skip = skip

fnt

fnt: default = downloadText

font

font: skip = skip

fsh

fsh: default = downloadText

gif

gif: downloadImage = downloadImage

ico

ico: downloadImage = downloadImage

image

image: downloadImage = downloadImage

jpeg

jpeg: downloadImage = downloadImage

jpg

jpg: downloadImage = downloadImage

js

js: downloadScript = downloadScript

json

json: default = downloadText

m4a

m4a: downloadAudio = downloadAudio

mp3

mp3: downloadAudio = downloadAudio

ogg

ogg: downloadAudio = downloadAudio

pkm

pkm: downloadBinary = downloadBinary

plist

plist: default = downloadText

png

png: downloadImage = downloadImage

pvr

pvr: downloadBinary = downloadBinary

svg

svg: skip = skip

tiff

tiff: downloadImage = downloadImage

tmx

tmx: default = downloadText

tsx

tsx: default = downloadText

ttc

ttc: skip = skip

ttf

ttf: skip = skip

txt

txt: default = downloadText

uuid

uuid: downloadUuid = downloadUuid

vsh

vsh: default = downloadText

wav

wav: downloadAudio = downloadAudio

webp

webp: downloadImage = downloadImage

woff

woff: skip = skip

xml

xml: default = downloadText

Let url

url: object
class

url

static

Private _rawAssets

_rawAssets: string = ""

The base url of raw assets.

property

{Object} _rawAssets

readonly

init

  • init(assets: any): void
  • Parameters

    • assets: any

    Returns void

normalize

  • normalize(url: any): any
  • Parameters

    • url: any

    Returns any

raw

  • raw(url: any): any
  • Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.

    Parameters

    • url: any

    Returns any

Generated using TypeDoc