Cómo implementar la conexión del lienzo
lt;htmlgt;
lt;headgt;
lt;meta charset="UTF-8"gt;
lt;titlegt;lt;/titlegt;
lt;scriptrc="js/jquery-2.1.3.min.js"gt;lt;/scriptgt; p> p>
lt;/headgt;
lt;bodygt;
lt;canvas id=" myCanvas" width="600" height="800" style= "pantalla: bloque; posición: absoluta; "gt; lt /canvasgt;
lt;
/draw
arr = [{ p>
x: 10,
y: 10,
ancho: 50,
alto: 50,
} , {
x: 110,
y: 10,
ancho: 50,
alto: 50,
}, {
x: 110,
y: 110,
ancho: 50,
alto: 50,
p>
}, {
x: 10,
y: 110,
ancho: 50, p>
alto: 50,
}, {
x: 10,
y: 210,
ancho: 50,
altura: 50,
}
, {
x: 110,
y: 210,
ancho: 50,
alto: 50,
}
, {
x: 10,
y: 310,
ancho: 50,
alto: 50,
}
, {
x: 110,
y: 310,
ancho: 50,
alto: 50,
}
];
línea de función (i) {
lista = [{
x: 35, p>
y: p>}, {
x: 135,
y: 35,
}, {
x: 135,
p>y: 135,
}, {
x: 35,
y: 135,
}, {
x: 35,
y: 235,
}, {
x : 135,
y: 235,
}, {
x: 35,
y: 335,
}, {
x: 135,
y: 335,
}
]; p>if(i == 1) {
ctx.moveTo(lista[0].x, lista[0].y)
for(var
j=0;jlt;i;j){
ctx.lineTo(lista[j 1].x, lista[j 1].y)
}
ctx.stroke()
}
if(i == 2) {
ctx.moveTo(lista[0].x, lista[0].y)
for(var j=0;jlt;i;j){
ctx.lineTo(lista[j 1].x, lista[j 1].y)
};
ctx.stroke()
}
if(i == 3) {
ctx.moveTo(lista[0].x, lista[0].y)
for(var j=0;jlt;i;j){
ctx.stroke()