Article introduction of Wulin.com (www.vevb.com): To align HTML5 Canvas text, we can use the textAlign attribute in the background of the canvas, which can be set to top, bottom, left, center, or right. The alignment is relative to a hypothetical x position by the vertical line of the defind text fillText() or strokeText(). Unless otherwise set, the TextAlign property defaults to left, which reminds us of css
To align HTML5 Canvas text, we can use the textAlign property in the background of the canvas, which can be set to top, bottom, left, center, or right. The alignment is relative to a hypothetical x position by the vertical line of the defind text fillText() or strokeText(). Unless otherwise set, the TextAlign property defaults to left, which reminds us of text-align in the css property