Provides methods to load images, sounds, and Tiled maps.
How much to scale image resources.
A web audio context.
Starts loading a canvas resource.
The ID to use when retrieving this resource.
The URL of the resource.
Starts loading an image resource.
The ID to use when retrieving this resource.
The URL of the resource.
If truthy, the pixel at (0, 0)
is made translucent, along with all other pixels of the same
color. The default value is false
.
Starts loading a JSON resource.
The ID to use when retrieving this resource.
Starts loading a sound resource.
The ID to use when retrieving this resource.
The URL of the resource.
Starts loading a sprite sheet resource.
The ID to use when retrieving this resource.
The URL of the resource.
The width of a cell.
The height of a cell.
The horizontal spacing between cells. Assumed to be 0 if not defined.
The vertical spacing between cells. Assumed to be 0 if not defined.
If truthy, the pixel at (0, 0) is made translucent, along with all other pixels of the same color.
Registers all images needed by the TMX map's tilesets to this asset loader.
The Tiled map.
Retrieves a resource by ID.
The ID of the resource.
The resource, or null if not found.
Returns the image corresponding to a Tiled tileset. This method is called by the library and is typically not called directly by the application.
The tile set.
The tileset image.
Returns whether all assets in thie loader have successfully loaded.
Whether all assets have loaded.
Adds a resource.
The ID for the resource.
The resource value.
Generated using TypeDoc
Loads resources for a game. All games have to load resources such as images, sound effects, JSON data, sprite sheets, etc. This class provides a wrapper around the loading of such resources, as well as a callback mechanism to know when loading completes. Games can use this class in a "loading" state, for example.
Currently supported resources include: