-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguia2.js
41 lines (33 loc) · 1.07 KB
/
guia2.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
35
36
37
38
39
40
41
window.onload = function(){
let canvas = document.getElementById("tehLostCanvas");
if(canvas && canvas.getContext){
let ctx = canvas.getContext("2d");
if(ctx){
//ancho de linea
ctx.lineWidth = 15;
ctx.strokeStyle = "yellow";//borde amarillo
//trazado
ctx.beginPath();//inicia la linea
ctx.lineCap = "round";//punta de la linea redonda
ctx.moveTo(50,50);
ctx.lineTo(350,50);// final del punto
ctx.stroke();
//sengunda linea
ctx.strokeStyle = "orange";
ctx.lineCap = "square";
ctx.beginPath();
ctx.moveTo(25, 100);
ctx.lineTo(350,100);
ctx.stroke();
//trecera linea
ctx.strokeStyle = "blue";
ctx.lineCap = "butt";
ctx.beginPath();
ctx.moveTo(50, 150);
ctx.lineTo(350,150);
ctx.stroke();
}
}else{
alert("su navegador no soporta canvas");
}
}