AssetUtils
Asset Utilities
Constructors
new AssetUtils()
new AssetUtils():
AssetUtils
Returns
Properties
FILEPATH_AUDIO
static
readonly
FILEPATH_AUDIO:string
='assets/audio/'
Filepath for audio files
Source
FILEPATH_FONT
static
readonly
FILEPATH_FONT:string
='assets/fonts/'
Filepath for fonts
Source
FILEPATH_IMAGE
static
readonly
FILEPATH_IMAGE:string
='assets/images/static/'
Filepath to static images
Source
FILEPATH_JSON
static
readonly
FILEPATH_JSON:string
='assets/json/'
Filepath for json
Source
FILEPATH_SPINE
static
readonly
FILEPATH_SPINE:string
='assets/spine/'
Filepath for spine
Source
FILEPATH_SPRITESHEET
static
readonly
FILEPATH_SPRITESHEET:string
='assets/images/spritesheets/'
Filepath for spritesheets
Source
FILE_EXTENSION_FONT
static
readonly
FILE_EXTENSION_FONT:string
='.fnt'
Source
FILE_EXTENSION_JPG
static
readonly
FILE_EXTENSION_JPG:string
='.jpg'
Source
FILE_EXTENSION_JSON
static
readonly
FILE_EXTENSION_JSON:string
='.json'
Source
FILE_EXTENSION_PNG
static
readonly
FILE_EXTENSION_PNG:string
='.png'
Source
FILE_EXTENSION_SPINE_ATLAS
static
readonly
FILE_EXTENSION_SPINE_ATLAS:string
='.atlas'
Source
FILE_EXTENSION_SPINE_SKEL
static
readonly
FILE_EXTENSION_SPINE_SKEL:string
='.skel'
Source
Accessors
resolutionSuffix
get
static
resolutionSuffix():string
Gets resolution suffix
set
static
resolutionSuffix(pValue
):void
Sets resolution suffix
Parameters
• pValue: string
Returns
string
Source
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
getPathToAsset(pAssetData)
static
getPathToAsset(pAssetData
):string
Parameters
• pAssetData: AssetMapData
Returns
string
Source
replaceResolutionToken()
static
replaceResolutionToken(url
,token
):string
Parameters
• url: string
• token: string
| RegExp
= '@x'
Returns
string