javascript canvas text align

Solutions on MaxInterview for javascript canvas text align by the best coders in the world

showing results for - "javascript canvas text align"
Hadrien
05 Jan 2019
1var c = document.getElementById("myCanvas");
2var ctx = c.getContext("2d");
3ctx.textAlign = "start"; // left/right depending on language
4ctx.textAlign = "end"; // left/right depending on language
5ctx.textAlign = "left";
6ctx.textAlign = "center";
7ctx.textAlign = "right";
8ctx.fillText("my text!", 150, 140);