Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Jacob Chestman</title>
- <style>
- canvas
- {
- border: 5px solid black;
- }
- </style>
- <script type="text/javascript">
- var cvs, ctx;
- var t = [];
- function Init()
- {
- cvs = document.getElementById("cvs");
- ctx = cvs.getContext("2d");
- }
- function BoundingRect(p_x, p_y, p_w, p_h)
- {
- x = p_x;
- this.x = p_x;
- this.y = p_y;
- this.w = p_w;
- this.h = p_h;
- this.ToString = function ()
- {
- return"{" + this.x + ";" + this.y + ";" + this.w + ";" + this.h + "}";
- };
- }
- function Draw() {
- var b = new BoundingRect(20, 20, 200, 200);
- alert(b.ToString());
- t.pu
- }
- </script>
- </head>
- <body onload="Init(); Draw();">
- <canvas id="cvs" width="800" height="600">
- Browser does not support canvas.....
- </canvas>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement