0
我画过的代码丝带:如何在绘制的画布上书写文字?
var canvas = document.getElementById('draw-ribbon');
ctx = canvas.getContext("2d");
ctx.fillStyle = 'red';
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(300, 0);
ctx.lineTo(260, 75);
ctx.lineTo(300, 150);
ctx.lineTo(0, 150);
ctx.closePath();
ctx.fill();
得到这个:
: 在这之后我试图filltext()
但没有工作,我想要实现这个
https://developer.mozilla.org/en-US/docs/Drawing_text_using_a_canvas –