interface ILoadOptions {
    blob?: ArrayBuffer;
    cache?: boolean;
    constructParams?: [width: number, height: number, format: TextureFormat, mipmap: boolean, canRead: boolean, sRGB: boolean, premultiplyAlpha: boolean];
    group?: string;
    ignoreCache?: boolean;
    initiator?: ILoadTask;
    maybeType?: string;
    noRetry?: boolean;
    priority?: number;
    propertyParams?: TexturePropertyParams;
    silent?: boolean;
    type?: string;
    useWorkerLoader?: boolean;
    [key: string]: any;
}

层级 (查看完整内容)

可索引

  • [key: string]: any

    Custom data that can be used to pass additional information or parameters to the loader.

    自定义数据,可以用于向加载器传递额外的信息或参数。

属性

blob?: ArrayBuffer

Create an image bitmap from the array buffer.

从数组缓冲区创建图像位图。

cache?: boolean

Whether to cache the resource after loading. Default is true.

加载后是否缓存资源。默认为 true。

constructParams?: [width: number, height: number, format: TextureFormat, mipmap: boolean, canRead: boolean, sRGB: boolean, premultiplyAlpha: boolean]

Parameters for constructing a Texture. This is only effective for TEXTURE2D, TEXTURECUBE, and TEXTURE2DARRAY types.

用于构造 Texture 的参数。仅对 TEXTURE2D、TEXTURECUBE 和 TEXTURE2DARRAY 类型有效。

group?: string

The group name for resource management. Resources in the same group can be loaded together or managed collectively.

资源分组名称,用于资源管理。同一组中的资源可以一起加载或进行集体管理。

ignoreCache?: boolean

Whether to ignore the cache and always load the resource from the network. Default is false.

是否忽略缓存,始终从网络加载资源。默认为 false。

initiator?: ILoadTask

The initiator of the loading task. This can be used to track which task initiated the load, or to pass additional context information.

加载任务的发起者。可以用于跟踪哪个任务发起了加载,或传递其他上下文信息。

maybeType?: string

Only used when the resource type cannot be determined from the extension.

只有当无法从扩展名获取资源类型时,才使用这里指定的类型。

noRetry?: boolean

Whether to retry loading if it fails. Default is true.

加载失败时是否重试。默认为 true。

priority?: number

The priority of the loading task. Higher numbers indicate higher priority. Default is 0.

加载任务的优先级。数字越大,优先级越高。默认为 0。

propertyParams?: TexturePropertyParams

Parameters for setting texture properties. This is only effective for TEXTURE2D, TEXTURECUBE, and TEXTURE2DARRAY types.

用于设置纹理属性的参数。仅对 TEXTURE2D、TEXTURECUBE 和 TEXTURE2DARRAY 类型有效。

silent?: boolean

Whether not to display error messages in the console if loading fails. Default is false.

加载失败时是否不在控制台显示错误信息。默认为 false。

type?: string

The type of resource to load. If not specified, it will be determined based on the file extension.

要加载的资源类型。如果未指定,将根据文件扩展名确定。

useWorkerLoader?: boolean

Whether to use a worker for loading. This is only effective for IMAGE types, and only if the browser supports it. Default is false.

是否使用 worker 进行加载。仅对 IMAGE 类型有效,且浏览器支持时生效。默认为 false。