function drawSprite(context, extentFactor, xPos, yPos, image) {
    var offscreen = document.createElement("canvas");
    offscreen.width = image.width;
    offscreen.height = image.height;
    var offCtx = offscreen.getContext('2d'); // an offscreen canvas

    //offCtx.globalAlpha = 0.0;
    //offCtx.clearRect(0, 0, image.width, image.height);
    offCtx.putImageData(image, 0, 0);
    //draw on main canvas (putimage will lose alpha)
    context.drawImage(offCtx.canvas, (xPos * extentFactor), (yPos * extentFactor), image.width, image.height);
}
//this must be drawn offscreen in order to maintain alpha transparency
this must be drawn offscreen in order to maintain alpha transparency
this must be drawn offscreen in order to maintain alpha transparency
function drawSprite(context, extentFactor, xPos, yPos, image) {
    var offscreen = document.createElement("canvas");
    offscreen.width = image.width;
    offscreen.height = image.height;
    var offCtx = offscreen.getContext('2d'); 
    offCtx.putImageData(image, 0, 0);
    context.drawImage(offCtx.canvas, (xPos * extentFactor), (yPos * extentFactor), image.width, image.height);
}
function drawSprite ( context , extentFactor , xPos , yPos , image ) { var offscreen = document . createElement ( "canvas" ) ; offscreen . width = image . width ; offscreen . height = image . height ; var offCtx = offscreen . getContext ( '2d' ) ; offCtx . putImageData ( image , 0 , 0 ) ; context . drawImage ( offCtx . canvas , ( xPos * extentFactor ) , ( yPos * extentFactor ) , image . width , image . height ) ; }
this must be drawn offscreen in order to maintain alpha transparency
this must be drawn offscreen in order to maintain alpha transparency
// an offscreen canvas //offCtx.globalAlpha = 0.0; //offCtx.clearRect(0, 0, image.width, image.height); //draw on main canvas (putimage will lose alpha)