What would be the best way to call render() once all the imageData vars have been populated?
would I just call them all in sequence using callbacks, and call render, or is there a better method?
function loadImageData()
{
//Get Background Image Data
var backgroundImg = loadImage(background, function(){
backgroundData = getDataFromImage(backgroundImg);
});
//Get Overlay Image Data
var overlayImg = loadImage(overlay, function(){
overlayData = getDataFromImage(overlayImg);
});
//Get more Image Data
//Get more Image Data
//Get more Image Data
}
function render()
{
ctx.putImageData(backgroundData, 0,0);
}