F

getIdByName

Looks up an asset's id by its name and type, initializing the module that registers it if needed.

function getIdByName<T extends AssetType = "png">(name: AssetName<T>, type?: T): number | undefined

Parameters

NameTypeDescription
nameAssetName<T>

The asset name to match.

type?T

The asset type to match, png by default.

Returns

number | undefined

The matched asset's id, or undefined if none match.