front_idill/extern/fajran-tuiojs/examples/processingjs/paint.html
author bastiena
Thu, 12 Apr 2012 15:33:25 +0200
changeset 28 9ccef81f02ab
parent 25 a7b0e40bcab0
permissions -rw-r--r--
Charset set to UTF-8 without bom tab replaced by 4 spaces \r\n replaced by \n in non cs files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     1
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     2
<html><head>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     3
<script type="text/javascript" src="../../src/tuio.js"></script>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     4
<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     5
<script type="text/javascript" src="processing.js"></script>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     6
<script type="text/javascript" src="tuio.processing.js"></script>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     7
<script type="text/javascript" src="init.js"></script>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     8
</head>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     9
<body>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    10
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    11
<script type="application/processing">
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    12
// All Examples Written by Casey Reas and Ben Fry
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    13
// unless otherwise stated.
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    14
var client;
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    15
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    16
void setup() {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    17
  size(200, 200);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    18
  background(102);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    19
  client = new tuio.TuioProcessing(this);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    20
}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    21
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    22
void draw() {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    23
  stroke(255);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    24
  var list = client.getTuioCursors();
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    25
  int i, len = list.length();
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    26
  for (i=0; i<len; i++) {
28
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 25
diff changeset
    27
    var o = list[i];
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 25
diff changeset
    28
    arc(o.getScreenX(width), o.getScreenY(height), 15, 15, 0, 2*PI);
25
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    29
  }
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    30
}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    31
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    32
</script><canvas width="300" height="300"></canvas>
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    33
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    34
</body></html>