Home Reference Source
public class | source

LoaderImpl

You can directly use an instance of this class. Loader

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

app: *

public

rawImages: *[]

public
public

Method Summary

Public Methods
public

Returns a regular sprite from the cache

public

Returns an atlas sprite from the cache

public

Fetches a given sprite from the cache

public

internalParseAtlas(atlas: import("./atlas_definitions").AtlasDefinition, loadedImage: HTMLImageElement)

public

internalPreloadImage(key: string): Promise<HTMLImageElement|null>

public

linkAppAfterBoot(app: import("../application").Application)

public

Makes the canvas which shows the question mark, shown when a sprite was not found

public

preloadAtlas(atlas: import("./atlas_definitions").AtlasDefinition): Promise<void>

Preloads an atlas

public

Preloads a sprite

Public Constructors

public constructor() source

Public Members

public app: * source

public rawImages: *[] source

public spriteNotFoundSprite: * source

public sprites: Map<string, BaseSprite> source

Public Methods

public getRegularSprite(key: string): RegularSprite source

Returns a regular sprite from the cache

Params:

NameTypeAttributeDescription
key string

Return:

RegularSprite

public getSprite(key: string): AtlasSprite source

Returns an atlas sprite from the cache

Params:

NameTypeAttributeDescription
key string

Return:

AtlasSprite

public getSpriteInternal(key: string): BaseSprite source

Fetches a given sprite from the cache

Params:

NameTypeAttributeDescription
key string

Return:

BaseSprite

public internalParseAtlas(atlas: import("./atlas_definitions").AtlasDefinition, loadedImage: HTMLImageElement) source

Params:

NameTypeAttributeDescription
atlas import("./atlas_definitions").AtlasDefinition
loadedImage HTMLImageElement

public internalPreloadImage(key: string): Promise<HTMLImageElement|null> source

Params:

NameTypeAttributeDescription
key string

Return:

Promise<HTMLImageElement|null>

public linkAppAfterBoot(app: import("../application").Application) source

Params:

NameTypeAttributeDescription
app import("../application").Application

public makeSpriteNotFoundCanvas() source

Makes the canvas which shows the question mark, shown when a sprite was not found

public preloadAtlas(atlas: import("./atlas_definitions").AtlasDefinition): Promise<void> source

Preloads an atlas

Params:

NameTypeAttributeDescription
atlas import("./atlas_definitions").AtlasDefinition

Return:

Promise<void>

public preloadCSSSprite(key: string): Promise<void> source

Preloads a sprite

Params:

NameTypeAttributeDescription
key string

Return:

Promise<void>