Advertisement
BrU32

JS Canvas Radnom Circle Gen V1

Jul 24th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <html>
  2. <body onload="var intt=prompt('Enter Amount Of Circles Gen:');
  3. for(var i=0;i<intt;i++){
  4. Draw();
  5. }">
  6. <canvas id="myCanvas" width="1000" height="1000"
  7. style="border:0px solid #d3d3d3;">
  8. Your browser does not support the canvas element.
  9. </canvas>
  10. <script>
  11. function Draw(){
  12. var canvas = document.getElementById("myCanvas");
  13. var ctx=canvas.getContext("2d");
  14. ctx.border='1px';
  15. ctx.fillAlign = "center";
  16. ctx.beginPath();
  17. ctx.fillStyle='magenta';
  18. ctx.arc(Math.random()*1000,Math.random()*1000,40,0,2*Math.PI);
  19. ctx.fill();
  20. }
  21. </script>
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement