Crafty.image_whitelist
A list of file extensions that can be loaded as images by Crafty.load
Example
// add tif extension to list of supported image files
Crafty.image_whitelist.push("tif");
var assets = {
"sprites": {
"sprite.tif": { //set a tif sprite
"tile": 64,
"tileh": 32,
"map": { "sprite_car": [0, 0] }
}
},
"audio": {
"jump": "jump.mp3";
}
};
Crafty.load( assets, // preload the assets
function() { //when loaded
Crafty.audio.play("jump"); //Play the audio file
Crafty.e('2D, DOM, sprite_car'); // create entity with sprite
},
function(e) { //progress
},
function(e) { //uh oh, error loading
}
);