Code: Select all
function LoadResources(){
alert("In load socket");
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var tiles= new Array();
var loadedCount=0;
for (x = 101; x <= 155; x++) {
var imageObj = new Image(); // new instance for each image
imageObj.src = "Resources/ClassicCardImages/deck1/dood_deck/"+x+".GIF";
imageObj.onload= imageOnLoad;
if(x==155){
//setInterval(cardsImagesLoaded, 1200);
}
tiles.push(imageObj);
}
function imageOnLoad(){
loadedCount++;
console.log(loadedCount);
if(loadedCount==55){
cardsImagesLoaded();
}else {
alert(loadedCount);
}
};
context.font = "italic 20pt Calibri";
context.fillText("Your shuffled cards", 150, 460);
};
Which means that the images are not loaded at all ...
Any kind of help clue will be alot appreciated.
If anyone can add me on skype see the whole code will surely get more idea ...
"lazygeeker" is my skype id...