Skip to main content

AssetsManager.js

AssetsManager

Kind: global class

new AssetsManager()

A class to manage the assets.

AssetsManager.load(assets) ⇒ void

Load the assets

Kind: static method of AssetsManager

ParamTypeDescription
assetsObject

The assets to load

Example

load({
sprites: { MySprite: "./MySprite.png", },
fonts: { "MyFont": "MyFont.ttf", },
audios: { "MyAudio": "MyAudio.mp3", }
});

AssetsManager.loadSprite(name, path) ⇒ void

Load a sprite

Kind: static method of AssetsManager

ParamTypeDescription
namestring

The name of the sprite

pathstring

The path of the sprite

AssetsManager.loadFont(name, path) ⇒ void

Load a font

Kind: static method of AssetsManager

ParamTypeDescription
namestring

The name of the font

pathstring

The path of the font

AssetsManager.loadAudios(name, path) ⇒ void

Load a sound

Kind: static method of AssetsManager

ParamTypeDescription
namestring

The name of the sound

pathstring

The path of the sound

AssetsManager.getSprite(name) ⇒ Object

Return the sprite based on the name

Kind: static method of AssetsManager
Returns: Object -

The sprite

ParamTypeDescription
namestring

The name of the sprite

AssetsManager.getFont(name) ⇒ string

Return the font based on the name

Kind: static method of AssetsManager
Returns: string -

The font

ParamTypeDescription
namestring

The name of the font

AssetsManager.getAudio(name) ⇒ Object

Return the audio based on the name

Kind: static method of AssetsManager
Returns: Object -

The audio

ParamTypeDescription
namestring

The name of the audio

AssetsManager.getSpriteSize(name) ⇒ Object

Return the size of the sprite

Kind: static method of AssetsManager
Returns: Object -

The size of the sprite

ParamTypeDescription
namestring

The name of the sprite