Skip to content

AssetUtils

Asset Utilities

Constructors

new AssetUtils()

new AssetUtils(): AssetUtils

Returns

AssetUtils

Properties

FILEPATH_AUDIO

static readonly FILEPATH_AUDIO: string = 'assets/audio/'

Filepath for audio files

Source

src/utils/AssetUtils.ts:30


FILEPATH_FONT

static readonly FILEPATH_FONT: string = 'assets/fonts/'

Filepath for fonts

Source

src/utils/AssetUtils.ts:32


FILEPATH_IMAGE

static readonly FILEPATH_IMAGE: string = 'assets/images/static/'

Filepath to static images

Source

src/utils/AssetUtils.ts:26


FILEPATH_JSON

static readonly FILEPATH_JSON: string = 'assets/json/'

Filepath for json

Source

src/utils/AssetUtils.ts:36


FILEPATH_SPINE

static readonly FILEPATH_SPINE: string = 'assets/spine/'

Filepath for spine

Source

src/utils/AssetUtils.ts:34


FILEPATH_SPRITESHEET

static readonly FILEPATH_SPRITESHEET: string = 'assets/images/spritesheets/'

Filepath for spritesheets

Source

src/utils/AssetUtils.ts:28


FILE_EXTENSION_FONT

static readonly FILE_EXTENSION_FONT: string = '.fnt'

Source

src/utils/AssetUtils.ts:41


FILE_EXTENSION_JPG

static readonly FILE_EXTENSION_JPG: string = '.jpg'

Source

src/utils/AssetUtils.ts:40


FILE_EXTENSION_JSON

static readonly FILE_EXTENSION_JSON: string = '.json'

Source

src/utils/AssetUtils.ts:38


FILE_EXTENSION_PNG

static readonly FILE_EXTENSION_PNG: string = '.png'

Source

src/utils/AssetUtils.ts:39


FILE_EXTENSION_SPINE_ATLAS

static readonly FILE_EXTENSION_SPINE_ATLAS: string = '.atlas'

Source

src/utils/AssetUtils.ts:42


FILE_EXTENSION_SPINE_SKEL

static readonly FILE_EXTENSION_SPINE_SKEL: string = '.skel'

Source

src/utils/AssetUtils.ts:43

Accessors

resolutionSuffix

get static resolutionSuffix(): string

Gets resolution suffix

set static resolutionSuffix(pValue): void

Sets resolution suffix

Parameters

pValue: string

Returns

string

Source

src/utils/AssetUtils.ts:51

Methods

getPathToAsset()

getPathToAsset(pAssetName, pAssetType)

static getPathToAsset(pAssetName, pAssetType): string

Return an asset’s path based on it’s file extension.

Parameters

pAssetName: string

pAssetType: AssetType

Returns

string

The asset filepath, empty if no resolution

Source

src/utils/AssetUtils.ts:69

getPathToAsset(pAssetData)

static getPathToAsset(pAssetData): string

Parameters

pAssetData: AssetMapData

Returns

string

Source

src/utils/AssetUtils.ts:70


replaceResolutionToken()

static replaceResolutionToken(url, token): string

Parameters

url: string

token: string | RegExp= '@x'

Returns

string

Source

src/utils/AssetUtils.ts:103