Skip to content

@orillusion/core


Class: AtlasParser

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

Parser for texture atlas descriptor files. Loads the companion atlas image and builds a TextureAtlas whose regions are normalized from the pixel rectangles described in the JSON.

Constructors

Constructor

new AtlasParser(): AtlasParser

Returns

AtlasParser

Inherited from

ParserBase.constructor

Properties

format

static format: ParserFormat = ParserFormat.TEXT

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

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

parseString()

parseString(data): Promise<void>

Defined in: src/loader/parser/AtlasParser.ts:25

Parse the atlas JSON, load its sibling .png texture, and build the TextureAtlas.

Parameters

data

string

Raw atlas descriptor JSON string.

Returns

Promise<void>

Overrides

ParserBase.parseString


verification()

verification(): boolean

Defined in: src/loader/parser/AtlasParser.ts:37

Verify that parsing produced valid data.

Returns

boolean

true when data is present; throws otherwise.

Overrides

ParserBase.verification


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

Released under the MIT License