correction de l'affichage de pierres sur las vitraux

affichage-v2
adplantade 5 years ago
parent de7554dab4
commit 885eb0a563

@ -100,17 +100,18 @@
function drawImg(x,y,color,lectx)
{
var img= new Image();
img.src="ress/"+color+".png";
//lectx2=eval(lectx);
nx=(width/6)*(x>0 ? x+2 : x+3);
ny=(height/6)*(y>0 ? y+2 : y+3);
var nx=(width/6)*(x>0 ? x+2 : x+3);
var ny=(height/6)*(y>0 ? y+2 : y+3);
img.onload = function(){
console.log("x:"+x+" y:"+y+" col:"+color);
lectx.drawImage(img,nx,ny,width/6,height/6);
}
img.src="ress/"+color+".png";
}
function tourneG(letab,lecanvas,lectx)
@ -150,6 +151,7 @@
lectx.clearRect(0, 0, lecanvas.width, lecanvas.height);
if(pts[0])
{
for(i=1;i<pts.length;i++)
{
if(Array.isArray(pts[i]))
@ -460,9 +462,9 @@
tab1.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[3,-3,"purple"]);
//tab2.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[3,-3,"purple"]);
//tab3.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[3,-3,"purple"]);
//tab4.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[1,1,"purple"]);
tab2.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[3,-3,"purple"]);
tab3.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[3,-3,"purple"]);
tab4.push(true,[-3,-3,"green"],[-3,2,"red"],[1,2,"yellow"],[1,1,"purple"]);
/*
tab1.push(true,[-1,-1,"green"],[-2,-2,"red"]);
@ -472,9 +474,9 @@
*/
toutDessiner(tab1,canvas1,ctx1);
//toutDessiner(tab2,canvas2,ctx2);
//toutDessiner(tab3,canvas3,ctx3);
//toutDessiner(tab4,canvas4,ctx4);
toutDessiner(tab2,canvas2,ctx2);
toutDessiner(tab3,canvas3,ctx3);
toutDessiner(tab4,canvas4,ctx4);

Loading…
Cancel
Save