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


<html><head>
<script type="text/javascript" src="../../src/tuio.js"></script>
<script type="text/javascript" src="../../connector/npTuioClient/tuiojs.npTuioClient.js"></script>
<script type="text/javascript" src="processing.js"></script>
<script type="text/javascript" src="tuio.processing.js"></script>
<script type="text/javascript" src="init.js"></script>
</head>
<body>

<script type="application/processing">
// All Examples Written by Casey Reas and Ben Fry
// unless otherwise stated.
var client;

void setup() {
  size(200, 200);
  background(102);
  client = new tuio.TuioProcessing(this);
}

void draw() {
  stroke(255);
  var list = client.getTuioCursors();
  int i, len = list.length();
  for (i=0; i<len; i++) {
    var o = list[i];
    arc(o.getScreenX(width), o.getScreenY(height), 15, 15, 0, 2*PI);
  }
}

</script><canvas width="300" height="300"></canvas>

</body></html>