LogoPixi’VN
coreClasses

Class: FileLoader

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4780

Experimental loader to load resources from uploaded files.

This loader relies on webkitRelativePath to recognize the file path.

Though named as a "Loader", this class has nothing to do with Live2DLoader, it only contains a middleware for the Live2DFactory.

Constructors

Constructor

> new FileLoader(): FileLoader

Returns

FileLoader

Properties

factory

> static factory: Middleware<Live2DFactoryContext>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4800

Middleware for Live2DFactory.


filesMap

> static filesMap: object

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4785

Stores all the object URLs of uploaded files.

Index Signature

[settingsFileURL: string]: object


live2dFactory?

> static optional live2dFactory?: typeof Live2DFactory

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4781

Methods

createSettings()

> static createSettings(files): Promise<ModelSettings>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4809

Creates a ModelSettings by given files.

Parameters

files

File[]

Returns

Promise<ModelSettings>

Promise that resolves with the created ModelSettings.


readText()

> static readText(file): Promise<string>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4813

Reads a file as text in UTF-8.

Parameters

file

File

Returns

Promise<string>


resolveURL()

> static resolveURL(settingsURL, filePath): string

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4796

Resolves the path of a resource file to the object URL.

Parameters

settingsURL

string

Object URL of the settings file.

filePath

string

Resource file path.

Returns

string

Resolved object URL.


upload()

> static upload(files, settings): void

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4804

Consumes the files by storing their object URLs. Files not defined in the settings will be ignored.

Parameters

files

File[]

settings

ModelSettings

Returns

void

On this page