<script>
// DEFINE YOUR GLOBAL VARIABLES HERE
var canvas;
var context;
var myWords = new Array();
myWords = ["From", "fairest", "creatures", "we", "desire", "increase"];
// INITIALIZE THE STARTING FUNCTION
function init() {
canvas = document.getElementById("myCanvas");
context = canvas.getContext("2d");
// CALL SUBSEQUENT FUNCTIONS, as many as you need2
drawBkgd(); // COVER TRANSPARENT CANVAS
create(); // THIS IS WHERE AL HAPPENS
}
function drawBkgd() { // USE THIS AREA TO MODIFY BKGD
context.fillStyle = "rgb(117,117,117)";
context.fillRect(0,0,canvas.width, canvas.height);
}
function create() {
// >>>>>>>>>>>>>>>>>>>>>>>>>> START HERE
var msg = myWords.length;
var num = Math.round( Math.random() * (myWords.length-1) );
context.font = 'bold 80px Helvetica';
context.lineWidth = 5;
context.strokeStyle = "rgb(0,0,0)";
context.textAlign = "center";
context.save();
context.translate(canvas.width/2, canvas.height/2);
context.rotate(Math.PI*2/((Math.random()*10+1)));
context.strokeText(myWords[num], 0, 0);
context.restore();
// >>>>>>>>>>>>>>>>>>>>>>>>>> END HERE
}
</script>