-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path03.html
49 lines (37 loc) · 967 Bytes
/
03.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<!--
Setting the basic attributes of the sketch; for example, note the
Processing commands for setting the size of the sketch and the background
color of its canvas. Our canvas shows up when these commands are run. In the
inspector, note how the canvas tag is updated.
-->
<head>
<script src='processing-1.4.1.js'></script>
<style>
canvas {
outline: none;
}
/* So that when we click, the canvas isn't outlined */
</style>
</head>
<body>
<canvas></canvas>
</body>
<script>
var canvas = document.getElementsByTagName('canvas')[0];
function sketch(p) {
p.println("The basic sketch!");
function setup() {
p.size(200, 200);
p.background(0); // set the background color to black
// p.noLoop();
}
function draw() {
p.println("running draw!");
}
p.setup = setup;
p.draw = draw;
}
var p = new Processing(canvas, sketch); // attach & run sketch
</script>
</html>