답변 2개
모양은 어떤 모양일까요?
색상 변경은 chatGPT 한테 물어보니 알려주네요.
var canvas2 = document.createElement("canvas");
var canvas2Context = canvas2.getContext("2d")
canvas2.width = canvas2.height = 20;
canvas2Context.lineWidth = 2;
<em>canvas2Context.strokeStyle = "red"; // Change this to your desired color</em>
canvas2Context.beginPath();
canvas2Context.moveTo(10, 0);
canvas2Context.lineTo(10, 20);
canvas2Context.moveTo(0, 10);
canvas2Context.lineTo(20, 10);
canvas2Context.stroke();</p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
function draw(){
if(mouseOver && mouseMoved){
calculateIconPosition();
mouseMoved = false;
}
context.clearRect(0, 0, c.width, c.height);
context.save();
// context.beginPath();
for(var i = 0; i < gridLength; i++){
for(var j = 0; j <gridLength; j++){
var sign = signs[i][j];
sign.draw(context);
}
}
// context.closePath();
context.restore();
// context.stroke();
}
여기 draw 한국에서 sign.draw함수 이전에 strokeStyle = 'yellow' 같이 설정하시면 됩니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인