Skip to content

@orillusion/core


Class: PrefabTextureParser

Defined in: src/loader/parser/prefab/PrefabTextureParser.ts:16

Parses the texture section of an Orillusion prefab binary stream. It resolves each texture URL (optionally rewriting to the webp variant), loads the bitmap textures, and registers them with the engine resource host.

Constructors

Constructor

new PrefabTextureParser(): PrefabTextureParser

Returns

PrefabTextureParser

Inherited from

ParserBase.constructor

Properties

format

static format: ParserFormat = ParserFormat.TEXT

Defined in: src/loader/parser/prefab/PrefabTextureParser.ts:17

Overrides

ParserBase.format


baseUrl

baseUrl: string

Defined in: src/loader/parser/ParserBase.ts:12

Inherited from

ParserBase.baseUrl


initUrl

initUrl: string

Defined in: src/loader/parser/ParserBase.ts:13

Inherited from

ParserBase.initUrl


loaderFunctions?

optional loaderFunctions?: LoaderFunctions

Defined in: src/loader/parser/ParserBase.ts:14

Inherited from

ParserBase.loaderFunctions


userData?

optional userData?: any

Defined in: src/loader/parser/ParserBase.ts:15

Inherited from

ParserBase.userData


data

data: any

Defined in: src/loader/parser/ParserBase.ts:16

Inherited from

ParserBase.data


ctx?

optional ctx?: Context3D

Defined in: src/loader/parser/ParserBase.ts:20

Context3D this parser is operating under. Populated by FileLoader so default-texture lookups (Engine3D.resFor(this.ctx)) resolve against the owning engine's device rather than the global shim.

Inherited from

ParserBase.ctx

Methods

parserTexture()

static parserTexture(bytesStream, prefabParser, loaderFunctions): Promise<void>

Defined in: src/loader/parser/prefab/PrefabTextureParser.ts:26

Read every texture reference from the stream, load the bitmap textures, and register them on the resource host keyed by texture name.

Parameters

bytesStream

BytesArray

the prefab binary stream positioned at the texture section.

prefabParser

PrefabParser

the owning prefab parser, used for base URL and context.

loaderFunctions

LoaderFunctions

optional loader hooks (progress, URL transform, etc.).

Returns

Promise<void>


parseString()

parseString(str): void

Defined in: src/loader/parser/ParserBase.ts:22

Parameters

str

string

Returns

void

Inherited from

ParserBase.parseString


parseJson()

parseJson(obj): void

Defined in: src/loader/parser/ParserBase.ts:24

Parameters

obj

object

Returns

void

Inherited from

ParserBase.parseJson


parseBuffer()

parseBuffer(buffer): void

Defined in: src/loader/parser/ParserBase.ts:26

Parameters

buffer

ArrayBuffer

Returns

void

Inherited from

ParserBase.parseBuffer


parseTexture()

parseTexture(buffer): Texture

Defined in: src/loader/parser/ParserBase.ts:28

Parameters

buffer

ArrayBuffer

Returns

Texture

Inherited from

ParserBase.parseTexture


parse()

parse(data): void

Defined in: src/loader/parser/ParserBase.ts:32

Parameters

data

any

Returns

void

Inherited from

ParserBase.parse


verification()

verification(): boolean

Defined in: src/loader/parser/prefab/PrefabTextureParser.ts:53

Verify that parsing produced valid data.

Returns

boolean

true when data is present; throws otherwise.

Overrides

ParserBase.verification