Skip to content

Commit d00d85c

Browse files
author
Em01
committed
basic canvas functions
1 parent 4642cce commit d00d85c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

canvas/canvas.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
<canvas id="canvas" width="200" height="200"></canvas>
99

1010
<script>
11-
11+
var canvas = document.getElementById("canvas");
12+
var ctx = canvas.getContext("2d");
13+
for (var i = 0; i < 8; i++) {
14+
ctx.fillStyle = "Red";
15+
ctx.fillRect(i * 10, i * 10, 10, 10);
16+
}
17+
// ctx.fillRect(0, 0, 10, 10);
1218
</script
1319
</body>
1420
</html>

0 commit comments

Comments
 (0)