静态 只读ANIMATIONCLIP静态 只读asset静态 只读ATLAS静态 只读BUFFER静态downloader静态 只读ext静态 只读FONT静态group静态 只读HIERARCHY静态 只读hot静态 只读IMAGE静态 只读JSON静态loaded静态 只读MATERIAL静态 只读MESH静态pre静态 只读SOUND静态 只读SPINE静态 只读TERRAINHEIGHTDATA静态 只读TERRAINRES静态 只读TEXT静态 只读TEXTURE2D静态 只读TEXTURE2DARRAY静态 只读TEXTURECUBE静态 只读TTF静态 只读type静态 只读VIDEO静态 只读XMLThe URL of the atlas or texture, e.g., "res/atlas/comp.atlas" or "hall/bg.jpg".
Destroy the image resource used by a Texture, keeping the texture shell. If the texture's image resource is found to be missing during the next render, it will be automatically restored. Compared to clearRes, clearTextureRes only clears the image resource used in the texture without destroying the texture itself. The image resource will be automatically restored when used again. While clearRes completely destroys the texture, making it unusable, clearTextureRes ensures immediate destruction of the image resource without worrying about incorrect destruction.
The type of event.
可选data: any(Optional) Data to pass to the callback. If multiple parameters p1, p2, p3, ... need to be passed, use an array structure such as [p1, p2, p3, ...]. If a single parameter p needs to be passed and p is an array, use a structure such as [p]. For other single parameters p, you can directly pass parameter p. If data is Event.EMPTY, it means passing an Event object to the callback function. Note that it is not passing Event.TEMP, but an independent Event object.
True if there are listeners for this event type, false otherwise.
The URL to download from.
The expected content type of the resource.
可选onProgress: ProgressCallbackOptional callback for progress updates.
可选options: Readonly<ILoadOptions>Optional loading options.
A promise that resolves with the downloaded content. If the download fails, the promise resolves with null.
The URL or array of URLs of the resource(s) to load.
可选type: stringThe type of resource. For example: Loader.IMAGE.
可选onProgress: ProgressCallbackThe progress callback function.
A Promise that resolves with the loaded resource(s). If url is a single resource, it returns the loaded resource or null if failed. If url is an array, it returns an array of loaded resources or null for each failed load.
The URL or array of URLs of the resource(s) to load.
可选options: Readonly<ILoadOptions>The loading options.
可选onProgress: ProgressCallbackThe progress callback function.
A Promise that resolves with the loaded resource(s). If url is a single resource, it returns the loaded resource or null if failed. If url is an array, it returns an array of loaded resources or null for each failed load.
The URL or array of URLs of the resource(s) to load. Can be a simple array ["a.png", "b.png"] or a complex array [{url:"a.png",type:Loader.IMAGE,size:100,priority:1},{url:"b.json",type:Loader.JSON,size:50,priority:1}].
可选complete: HandlerThe completion callback. Returns the loaded resource if url is a string, or an array of loaded resources (or null for failed loads) if url is an array.
可选progress: HandlerThe progress callback. The callback parameter is the current resource loading progress (0-1).
可选type: stringThe resource type. For example: Loader.IMAGE.
可选priority: numberThe loading priority. Higher numbers indicate higher priority. Default is 0.
可选cache: booleanWhether to cache the resource. Default is true.
可选group: stringThe group name for resource management.
可选ignoreCache: booleanWhether to ignore the cache. Default is false.
可选useWorkerLoader: booleanWhether to use worker loading (only for IMAGE types, and when browser supports it). Default is false.
A Promise object.
The path of the sub-package in mini-game.
可选onProgress: ProgressCallbackThe callback for loading progress.
A Promise that resolves when the package is loaded.
The path of the sub-package.
可选remoteUrl: stringIf the package is a remote package, provide the remote resource server address, e.g., "http://cdn.com/"
可选onProgress: ProgressCallbackThe callback for loading progress.
A Promise that resolves when the package is loaded.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
可选listener: FunctionThe listener function.
可选args: any[]This EventDispatcher object.
可选type: string(Optional) The type of event. If the value is null, all types of listeners on this object are removed.
This EventDispatcher object.
The target caller object.
This EventDispatcher object.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
The listener function.
可选args: any[](Optional) The callback parameters of the event listener function.
This EventDispatcher object.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
The listener function.
可选args: any[](Optional) The callback parameters of the event listener function.
This EventDispatcher object.
静态cache静态clear静态clear静态create静态getThe URL of the atlas.
Return the set of addresses.
静态getThe URL of the BaseTexture resource.
The BaseTexture resource.
静态get静态get静态getURLInfo静态registerExtensions
Loader class
可选type: stringType identifier. If this kind of resource needs to support identification without extension, or if one extension corresponds to multiple resource types, specifying the type parameter is the best practice.
可选hotReloadable: booleanWhether to support hot reload
静态set静态warn静态warn
En
The
Loaderclass can be used to load resources such as text, JSON, XML, binary, images, etc.Zh
Loader类可用来加载文本、JSON、XML、二进制、图像等资源。