Guest User

Untitled

a guest
Oct 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>Dungeons and Dragons 3.5 Map Generator</title>
  5. <script src="GenerateMaps.js"></script>
  6.  
  7. <link rel='stylesheet'>
  8. <link rel="stylesheet" type="text/css" href="index.css">
  9. </head>
  10. <body onload="runExperiments();">
  11. <div id="row">
  12. <div class="page_items" id="map">
  13. <script>
  14. window.onload=function() {
  15. let c = document.getElementById("map");
  16. let ctx = c.getContext("2d");
  17. let x;
  18. let y;
  19. c.width = (window.innerWidth / 2)-(window.innerWidth % 30);
  20. c.height = (window.innerHeight)-(window.innerHeight % 30);
  21. ctx.width = c.width - 30;
  22. ctx.height = c.width - 30;
  23. let elem = document.createElement("image");
  24. elem.setAttribute("src", "floor.png");
  25. elem.setAttribute("height", "30");
  26. elem.setAttribute("width", "30");
  27. elem.setAttribute("src", "floor.png");
  28. for (x = 30; x < ctx.height; x += 30) {
  29. for (y = 30; y < ctx.width; y += 30) {
  30. c.appendChild(elem);
  31. }
  32. }
  33. }
  34. </script>
  35. </div>
  36. </div>
  37. </body>
Add Comment
Please, Sign In to add comment