window.onload = function(){
var canvas = document.getElementById("test");
var context = canvas.getContext("2d");
context.translate(canvas.width / 2, canvas.height / 2);
context.font = "30pt Calibri";
context.scale(-1, 1);
context.textAlign = "center";
context.fillStyle = "#A52A2A";
context.shadowColor = "#800000";
context.shadowBlur = 20;
context.fillText("RACECAR", 0, 0);
}
And the outcome is available here.
Explanation:
To put the text in the canvas we need the:
context.fillTextto have a shadow we put:
context.shadowColorand for the mirror:
context.scale(-1, 1)
Nice. But don't leave us hanging... When you say "I came across a", we want to see what you saw!
ReplyDelete