Answers for "canvas text aligt"

3

javascript canvas text align

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.textAlign = "start"; // left/right depending on language
ctx.textAlign = "end"; // left/right depending on language
ctx.textAlign = "left";
ctx.textAlign = "center";
ctx.textAlign = "right";
ctx.fillText("my text!", 150, 140);
Posted by: Guest on March-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language