-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguia3.js
34 lines (27 loc) · 823 Bytes
/
guia3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
window.onload = function(){
let canvas = document.getElementById("tehLostCanvas");
if(canvas && canvas.getContext){
let ctx = canvas.getContext("2d");
if(ctx){
ctx.lineaWidth = 15;
ctx.strokeStyle = "yellow";
ctx.fillStyle = "red";
ctx.beginPath();
ctx.moveTo(50,100);
ctx.lineTo(100,50);
ctx.lineTo(150,100);
ctx.lineTo(100,150);
//ctx.fill();
ctx.stroke();
//sengunda linea
ctx.moveTo(200,100);
ctx.lineTo(250,50);
ctx.lineTo(300,100);
ctx.lineTo(250,150);
ctx.closePath();
ctx.stoke();
}
}else{
alert("su navegador no soporta canvas");
}
}