-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbridge.js
More file actions
34 lines (34 loc) · 1.01 KB
/
Copy pathbridge.js
File metadata and controls
34 lines (34 loc) · 1.01 KB
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
import control from "./control.js";
import color from"./color.js"
const bdg=document.createElement("canvas");
bdg.width=1600;
bdg.height=900;
bdg.id="bridge";
document.body.append(bdg);
export const ctx1=bdg.getContext("2d");
const Bridge={
position:[0,0],
button:[],
draw(){
let lst=control.convert(this.position[0],this.position[1]);
ctx1.save();
ctx1.fillStyle=color.getDarkColor("#CDCDC1",0.3);
ctx1.transform(1,1.36, 0, 1, lst[0],lst[1]);
ctx1.fillRect(0, 0,24,10);
ctx1.restore();
ctx1.save();
ctx1.fillStyle=color.getLightColor("#CDCDC1",0.2);
ctx1.transform(1.2,0,0.785, 1, lst[0],lst[1]);
ctx1.fillRect(0, 0,67,31.8);
ctx1.restore();
ctx1.save();
ctx1.fillStyle="#CDCDC1";
ctx1.translate(lst[0]+24,lst[1]+32);
ctx1.fillRect( 0, 0,80,10);
ctx1.restore();
} ,
clear(){
ctx1.clearRect(0,0,1600,900);
},
}
export default Bridge;