Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5. <title>Jacob Chestman</title>
  6. <style>
  7. canvas
  8. {
  9. border: 5px solid black;
  10.  
  11. }
  12.  
  13. </style>
  14. <script type="text/javascript">
  15. var cvs, ctx;
  16. var t = [];
  17. function Init()
  18. {
  19. cvs = document.getElementById("cvs");
  20. ctx = cvs.getContext("2d");
  21. }
  22. function BoundingRect(p_x, p_y, p_w, p_h)
  23. {
  24. x = p_x;
  25. this.x = p_x;
  26. this.y = p_y;
  27. this.w = p_w;
  28. this.h = p_h;
  29. this.ToString = function ()
  30. {
  31. return"{" + this.x + ";" + this.y + ";" + this.w + ";" + this.h + "}";
  32. };
  33.  
  34. }
  35. function Draw() {
  36. var b = new BoundingRect(20, 20, 200, 200);
  37. alert(b.ToString());
  38. t.pu
  39. }
  40.  
  41.  
  42. </script>
  43. </head>
  44.  
  45. <body onload="Init(); Draw();">
  46. <canvas id="cvs" width="800" height="600">
  47. Browser does not support canvas.....
  48. </canvas>
  49.  
  50.  
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement