OBJFile

Phaser.Loader.FileTypes.OBJFile

A single Wavefront OBJ File suitable for loading by the Loader.

These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly.

For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj.

Constructor

new OBJFile(loader, key, [objURL], [matURL], [flipUV], [xhrSettings])

Parameters

name

type

optional

description

loader

Phaser.Loader.LoaderPlugin

No

A reference to the Loader that is responsible for this file.

key

string | Phaser.Types.Loader.FileTypes.OBJFileConfig

No

The key to use for this file, or a file configuration object.

objURL

string

Yes

The absolute or relative URL to load the obj file from. If undefined or null it will be set to <key>.obj, i.e. if key was "alien" then the URL will be "alien.obj".

matURL

string

Yes

The absolute or relative URL to load the material file from. If undefined or null it will be set to <key>.mat, i.e. if key was "alien" then the URL will be "alien.mat".

flipUV

boolean

Yes

Flip the UV coordinates stored in the model data?

xhrSettings

Phaser.Types.Loader.XHRSettingsObject

Yes

Extra XHR Settings specifically for these files.


Scope: static

Extends

Phaser.Loader.MultiFile

Source: src/loader/filetypes/OBJFile.js#L16
Since: 3.50.0

Public Methods

addToCache

<instance> addToCache()

Description:

Adds this file to its target cache upon successful loading and processing.

Source: src/loader/filetypes/OBJFile.js#L112
Since: 3.50.0


addToMultiFile

<instance> addToMultiFile(files)

Description:

Adds another child to this MultiFile, increases the pending count and resets the completion status.

Parameters:

name

type

optional

description

files

Phaser.Loader.File

No

The File to add to this MultiFile.

Returns: Phaser.Loader.MultiFile - This MultiFile instance.

Inherits: Phaser.Loader.MultiFile#addToMultiFile

Source: src/loader/MultiFile.js#L196
Since: 3.7.0


destroy

<instance> destroy()

Description:

Destroy this Multi File and any references it holds.

Inherits: Phaser.Loader.MultiFile#destroy

Source: src/loader/MultiFile.js#L292
Since: 3.60.0


isReadyToProcess

<instance> isReadyToProcess()

Description:

Checks if this MultiFile is ready to process its children or not.

Returns: boolean - true if all children of this MultiFile have loaded, otherwise false.

Inherits: Phaser.Loader.MultiFile#isReadyToProcess

Source: src/loader/MultiFile.js#L183
Since: 3.7.0


onFileComplete

<instance> onFileComplete(file)

Description:

Called by each File when it finishes loading.

Parameters:

name

type

optional

description

file

Phaser.Loader.File

No

The File that has completed processing.

Inherits: Phaser.Loader.MultiFile#onFileComplete

Source: src/loader/MultiFile.js#L219
Since: 3.7.0


onFileFailed

<instance> onFileFailed(file)

Description:

Called by each File that fails to load.

Parameters:

name

type

optional

description

file

Phaser.Loader.File

No

The File that has failed to load.

Inherits: Phaser.Loader.MultiFile#onFileFailed

Source: src/loader/MultiFile.js#L237
Since: 3.7.0


pendingDestroy

<instance> pendingDestroy()

Description:

Called once all children of this multi file have been added to their caches and is now ready for deletion from the Loader.

It will emit a filecomplete event from the LoaderPlugin.

Fires: Phaser.Loader.Events#event:FILE_COMPLETE, Phaser.Loader.Events#event:FILE_KEY_COMPLETE

Inherits: Phaser.Loader.MultiFile#pendingDestroy

Source: src/loader/MultiFile.js#L258
Since: 3.60.0


Public Members

baseURL

baseURL: string

Description:

A reference to the Loaders baseURL at the time this MultiFile was created. Used to populate child-files.

Inherits: Phaser.Loader.MultiFile#baseURL

Source: src/loader/MultiFile.js#L146
Since: 3.20.0


complete

complete: boolean

Description:

The completion status of this MultiFile.

Inherits: Phaser.Loader.MultiFile#complete

Source: src/loader/MultiFile.js#L107
Since: 3.7.0


config

config: any

Description:

A storage container for transient data that the loading files need.

Inherits: Phaser.Loader.MultiFile#config

Source: src/loader/MultiFile.js#L137
Since: 3.7.0


failed

failed: number

Description:

The number of files that failed to load.

Inherits: Phaser.Loader.MultiFile#failed

Source: src/loader/MultiFile.js#L127
Since: 3.7.0


files

files: Array.<Phaser.Loader.File>

Description:

Array of files that make up this MultiFile.

Inherits: Phaser.Loader.MultiFile#files

Source: src/loader/MultiFile.js#L89
Since: 3.7.0


key

key: string

Description:

Unique cache key (unique within its file type)

Inherits: Phaser.Loader.MultiFile#key

Source: src/loader/MultiFile.js#L63
Since: 3.7.0


loader

loader: Phaser.Loader.LoaderPlugin

Description:

A reference to the Loader that is going to load this file.

Inherits: Phaser.Loader.MultiFile#loader

Source: src/loader/MultiFile.js#L45
Since: 3.7.0


path

path: string

Description:

A reference to the Loaders path at the time this MultiFile was created. Used to populate child-files.

Inherits: Phaser.Loader.MultiFile#path

Source: src/loader/MultiFile.js#L156
Since: 3.20.0


pending

pending: number

Description:

The number of files to load.

Inherits: Phaser.Loader.MultiFile#pending

Source: src/loader/MultiFile.js#L117
Since: 3.7.0


prefix

prefix: string

Description:

A reference to the Loaders prefix at the time this MultiFile was created. Used to populate child-files.

Inherits: Phaser.Loader.MultiFile#prefix

Source: src/loader/MultiFile.js#L166
Since: 3.20.0


state

state: number

Description:

The current state of the file. One of the FILE_CONST values.

Inherits: Phaser.Loader.MultiFile#state

Source: src/loader/MultiFile.js#L98
Since: 3.60.0


type

type: string

Description:

The file type string for sorting within the Loader.

Inherits: Phaser.Loader.MultiFile#type

Source: src/loader/MultiFile.js#L54
Since: 3.7.0


Private Members

multiKeyIndex

multiKeyIndex: number

Description:

The current index being used by multi-file loaders to avoid key clashes.

Access: private

Inherits: Phaser.Loader.MultiFile#multiKeyIndex

Source: src/loader/MultiFile.js#L79
Since: 3.20.0


Updated on