<script> // DEFINE YOUR GLOBAL VARIABLES HERE var canvas; var context; var myWords = new Array(); myWords = ["From", "fairest", "creatures", "we", "desire", "increase"]; var myFonts = new Array(); myFonts[0] = "bold 80px Helvetica"; myFonts[1] = "italic 40px Courier"; myFonts[2] = "normal 100px Times"; myFonts[3] = "bold 80px Comic"; myFonts[4] = "normal 80px Arial"; // 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) ); var fl = myFonts.length; var fnum = Math.round( Math.random() * (myFonts.length-1) ); context.font = myFonts[fnum]; context.lineWidth = 5; context.strokeStyle = "rgb(0,0,0)"; context.strokeText(myWords[num], canvas.width/10, canvas.height/2); // >>>>>>>>>>>>>>>>>>>>>>>>>> END HERE } </script>