Class: AssetLoader

Carrot.AssetLoader(game)

Carrot.AssetLoader

Constructor

new AssetLoader(game)

A very basic asset loader without progess functions. Yet.
Parameters:
Name Type Description
game Carrot.Game The core game object.
Source:

Methods

csv(key, path)

Loads a CSV file.
Parameters:
Name Type Description
key string The key (name) for the CSV file.
path string The path (url) to the CSV file.
Source:

image(key, path)

Loads a simple image.
Parameters:
Name Type Description
key string The path (url) to the image.
path string The key (name) for the image.
Source:

json(key, path)

Loads a JSON file.
Parameters:
Name Type Description
key string The key (name) for the JSON file.
path string The path (url) to the JSON file.
Source:

sound(key, path)

Loads a sound.
Parameters:
Name Type Description
key string The key (name) for the sound.
path string The path (url) to the sound.
Source:

spritesheet(key, path, frameWidthopt, frameHeightopt, frameIndexesopt)

Loads a spritesheet.
Parameters:
Name Type Attributes Default Description
key string The key (name) to the image.
path string The path (url) to the image.
frameWidth integer <optional>
32 The width of the spritesheet's frames.
frameHeight integer <optional>
32 The height of the spritesheet's frames.
frameIndexes integer <optional>
Infinity The frames indexes.
Source: