topical media & game development

talk show tell print

graphic-canvas-example-draw-text.htm / htm



  <script type=text/javascript>
  function draw() {
    var ctx = document.getElementById('canvas').getContext('2d');
  
    ctx.shadowOffsetX = 2;
    ctx.shadowOffsetY = 2;
    ctx.shadowBlur = 2;
    ctx.shadowColor = "rgba(0, 0, 0, 0.5)";
   
    ctx.font = "20px Times New Roman";
    ctx.fillStyle = "Black";
    ctx.fillText("Sample String", 5, 30);
  }
  </script>
  <body onload="draw();">
  <canvas id="canvas" width="200" height="200"></canvas>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.