3
내가 여기 예를 들어 캔버스 모양 에 텍스트를 추가 내 코드이다하는 방법을 알아 내려고 노력하고 있어요와 캔버스 모양을 작성 :텍스트
var text ="5"; // text to display over the circle
context.fillStyle = "red";
context.beginPath();
context.arc(50,70, 10, 0, Math.PI * 2);
context.closePath();
context.fill();
누군가가한다면 나는 매우 그것을 appriciate 것 고맙습니다. 미리 감사드립니다.
내가이 너무 캔버스에 다시 작성해야 알아낼 EDIT 내가 지금까지 가지고 무엇 ...하지만 원의 중심에있는 텍스트 나던 allign :
context.fillStyle = "red";
context.beginPath();
var radius = 10; // for example
context.arc(200, 200, radius, 0, Math.PI * 2);
context.closePath();
context.fill();
context.fillStyle = "black"; // font color to write the text with
var font = "bold " + radius +"px serif";
context.font = font;
context.textBaseline = "top";
context.fillText(text, 200-radius/4 ,200-radius/2);