Skip to content

AssetFactory

AssetFactory(assetIndex, factory)

AssetFactory<T>(assetIndex, factory): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetIndex: number

index of asset: AssetFactory(1, i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by its id from the pattern and resolution suffix

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:13

AssetFactory(assetIndex, factory, resolutionSuffix)

AssetFactory<T>(assetIndex, factory, resolutionSuffix): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetIndex: number

index of asset: AssetFactory(1, i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

resolutionSuffix: string

resolution suffix of assets

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:21

AssetFactory(assetName, factory)

AssetFactory<T>(assetName, factory): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetName: string

name of asset: AssetFactory(“my-texture”, i => new TextureAsset(i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:28

AssetFactory(assetName, factory, resolutionSuffix)

AssetFactory<T>(assetName, factory, resolutionSuffix): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetName: string

name of asset: AssetFactory(“my-texture”, i => new TextureAsset(i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

resolutionSuffix: string

resolution suffix of assets

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:36

AssetFactory(minMax, factory)

AssetFactory<T>(minMax, factory): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

minMax: [number, number]

min and max index of asset: AssetFactory([1,3], i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:43

AssetFactory(minMax, factory, resolutionSuffix)

AssetFactory<T>(minMax, factory, resolutionSuffix): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

minMax: [number, number]

min and max index of asset: AssetFactory([1,3], i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

resolutionSuffix: string

resolution suffix of assets

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:51

AssetFactory(assetNames, factory)

AssetFactory<T>(assetNames, factory): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetNames: string[]

list of asset names: AssetFactory([“a”,“b”,“c”], i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:58

AssetFactory(assetNames, factory, resolutionSuffix)

AssetFactory<T>(assetNames, factory, resolutionSuffix): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

assetNames: string[]

list of asset names: AssetFactory([“a”,“b”,“c”], i => new TextureAsset(“my-texture-” + i))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

resolutionSuffix: string

resolution suffix of assets

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:66

AssetFactory(patternsByResolution, factory)

AssetFactory<T>(patternsByResolution, factory): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

patternsByResolution

asset name patterns grouped by resolution: AssetFactory({“@1x”: 1, “@2x”: [1,2]}, (i,r) => new TextureAsset(“my-texture-” + i, path/to/my-texture-${i}-${r}.png))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:74

AssetFactory(patternsByResolution, factory, resolutionSuffix)

AssetFactory<T>(patternsByResolution, factory, resolutionSuffix): IAsset<T>[]

Asset factory is used to generate list of assets based on pattern

Type parameters

T

Parameters

patternsByResolution

asset name patterns grouped by resolution: AssetFactory({“@1x”: 1, “@2x”: [1,2]}, (i,r) => new TextureAsset(“my-texture-” + i, path/to/my-texture-${i}-${r}.png))

factory: AssetFactoryFunction<T>

function that returns an asset by it’s id from the pattern and resolution suffix

resolutionSuffix: string

resolution suffix of assets

Returns

IAsset<T>[]

Source

src/load/assets/AssetFactory.ts:84