BrU32

JS Wave Drawer V1

Jun 20th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <body onmousemove="drawe();" onchange="drawe();">
  5. <canvas id="myCanvas" width="500" height="500" style="border:1px">
  6. Your browser does not support the canvas element.
  7. </canvas>
  8. <script>
  9. function drawe(){
  10. var canvas = document.getElementById("myCanvas");
  11. var ctx = canvas.getContext("2d");
  12. ctx.moveTo(event.x++,event.y=+1);
  13. ctx.lineThickness='100px';
  14. ctx.lineTo(event.x,event.y);
  15. ctx.stroke();
  16. }
  17. </script>
  18. </body>
  19. </html>
Advertisement
Add Comment
Please, Sign In to add comment