Class: ImageAsset

ImageAsset

FM.ImageAsset

new ImageAsset(pName, pPath)

An image asset is used to represent a sprite usable by the FM.js engine.
Parameters:
Name Type Description
pName string The name of the asset.
pPath string The path of the asset.
Author:
  • Simon Chauvin
Source:

Methods

getImage() → {Image}

Get the HTML5 Image object.
Source:
Returns:
The HTML5 object.
Type
Image

getName() → {string}

Get the name of the asset.
Source:
Returns:
The name of the asset.
Type
string

getPath() → {string}

Get the path to the image file.
Source:
Returns:
The path to the asset.
Type
string

isLoaded() → {boolean}

Check if this image has been loaded.
Source:
Returns:
Whether the image is loaded or not.
Type
boolean

load()

Load the image.
Source:

setLoaded()

Set the loaded boolean variable to true.
Source: