Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Canvas Template</title>
- <style type="text/css">
- body {
- text-align: center;
- }
- </style>
- </head>
- <body>
- <canvas id="canvas" width="500" height="500"></canvas>
- <script>
- function renderFrame() {
- let canvas = document.getElementById('canvas');
- let ctx = canvas.getContext('2d');
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- // draw stuff here
- requestAnimationFrame(renderFrame);
- }
- requestAnimationFrame(renderFrame);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement