Charset set to UTF-8 without bom
tab replaced by 4 spaces
\r\n replaced by \n in non cs files
<!--
Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
-->
<html><head>
<meta charset="UTF-8" />
<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>
<center>
<script type="application/processing">
<!--// All Examples Written by Casey Reas and Ben Fry
// unless otherwise stated.
var tuioClient;
/*FONCTION D'INITIALISATION
Entrée :
Sortie : Cr�ation de la fenêtre et du client TUIO*/
void setup()
{
size (640, 480);
showMask();
tuioClient = new tuio.TuioProcessing(this);
textAlign(CENTER);
imageMode(CENTER);
smooth();
}
/*FONCTION DE DESSIN
Entrée :
Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
void draw()
{
fill(0);
tuioInput();
noStroke();
}
/*FONCTION DE RECEPTION DES MESSAGES OSC
Entrée :
Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
void tuioInput()
{
fill(255);
var tuioStringList = tuioClient.getTuioStrings();
if(tuioStringList.length() <= 0)
{
showMask();
text("Gesture non détectée.", width/2 - 20, 20);
}
else
{
showMask();
showGestureMessage(tuioStringList[0]);
}
}
/*FONCTION DE GENERATION DU MASQUE
Entrée :
Sortie : Place des rectangles autour de la zone de dessin*/
void showMask()
{
background(0);
fill(255);
rect(0, 80, width, height-130);
}
/*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
Entree :
Sortie : Affichage du code de la gesture*/
void showGestureMessage(var tstr)
{
text("Gesture détectée : " + tstr.getCode(), width/2 - 20, 20);
}
</script>
<canvas></canvas>
</center>
</body></html>