# HG changeset patch # User bastiena # Date 1342184263 -7200 # Node ID 983d7be910c1b2c5673196fdf8a4ecf0d260acde # Parent 4e1ee94d70b19fa9c581febd01fb97470d0ed2a1 Front JS: pointers repaired + help added to gestures diff -r 4e1ee94d70b1 -r 983d7be910c1 contact.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contact.txt Fri Jul 13 14:57:43 2012 +0200 @@ -0,0 +1,5 @@ +Ce fichier contient les adresses où vous pouvez me joindre ou joindre l'Institut de Recherche et d'Innovation : +This file contains my email or IRI's if you want to contact us : + +Mon email : alexandre.bastien.033569@gmail.com +Contact IRI : contact@iri.centrepompidou.fr \ No newline at end of file diff -r 4e1ee94d70b1 -r 983d7be910c1 front_js/gestures/communication/js/client.js --- a/front_js/gestures/communication/js/client.js Mon Jul 09 14:24:42 2012 +0200 +++ b/front_js/gestures/communication/js/client.js Fri Jul 13 14:57:43 2012 +0200 @@ -21,7 +21,7 @@ * Un client est défini par une socket, qui permettra de recevoir les données du server websocket du Middleware. * On accède aussi à la classe des pointeurs. */ -function client(host, port, _gestures) +function Client(host, port, _gestures) { this.socket; this.gestures = _gestures; @@ -33,7 +33,7 @@ /* * Création et Initialisation des sockets et listeners permettant d'écouter le server. */ -client.prototype.createWebSocket = function(host) +Client.prototype.createWebSocket = function(host) { var _this = this; @@ -81,7 +81,7 @@ /* * Traite un message reçu du Middleware. */ -client.prototype.processMsg = function(msg) +Client.prototype.processMsg = function(msg) { if(typeof msg === 'undefined' || typeof msg.data === 'undefined') { diff -r 4e1ee94d70b1 -r 983d7be910c1 front_js/gestures/gestures/css/gestures.css --- a/front_js/gestures/gestures/css/gestures.css Mon Jul 09 14:24:42 2012 +0200 +++ b/front_js/gestures/gestures/css/gestures.css Fri Jul 13 14:57:43 2012 +0200 @@ -23,7 +23,7 @@ overflow: hidden; } -#textPanel +#textPanel, #helpText { position: relative; height: 50px; @@ -36,4 +36,18 @@ #imagePanel { position: absolute; +} + +.help_imgs +{ + position: relative; + margin: 15px; + width: 150px; + height: 150px; +} + +#helpImgs +{ + width: 100%; + text-align: center; } \ No newline at end of file diff -r 4e1ee94d70b1 -r 983d7be910c1 front_js/gestures/gestures/js/gestures.js --- a/front_js/gestures/gestures/js/gestures.js Mon Jul 09 14:24:42 2012 +0200 +++ b/front_js/gestures/gestures/js/gestures.js Fri Jul 13 14:57:43 2012 +0200 @@ -20,7 +20,7 @@ /* * Classe définissant les gestes. */ -function gestures(config) +function Gestures(config) { this.isGestureShown = false; this.showGestureTimeout; @@ -29,6 +29,8 @@ this.imgHeight; this.config = config; + + this.help(); var textPanel = "
";
@@ -42,18 +44,19 @@
//On positionne l'image au centre de l'écran.
$('#imagePanel').css(
{
- top: ($(window).height() - this.imgWidth) / 2,
+ top: ($(window).height() - $('#help').position().top) / 2,
left: ($(window).width() - this.imgHeight) / 2
});
});
- this.wsClient = new client(this.config["host"], this.config["port"], this);
+ this.wsClient = new Client(this.config.host, this.config.port, this);
+
}
/*
* Affiche les gestures reçues.
*/
-gestures.prototype.showGesture = function(gesture)
+Gestures.prototype.showGesture = function(gesture)
{
//Si on n'avait aucune gesture, on peut l'afficher.
if(!this.isGestureShown)
@@ -72,6 +75,35 @@
_this.isGestureShown = false;
$('#imagePanel').attr("src", "./img/black.png");
$('#textPanel').html("Aucune gesture n'est détectée.");
- }, this.config["timeShowGesture"]);
+ }, this.config.timeShowGesture);
}
+}
+
+/*
+ * Affiche les gestes affichables.
+*/
+Gestures.prototype.help = function()
+{
+ //On crée le texte et les images à mettre en bas de la fenêtre pour guider l'utilisateur.
+ var imgs = ['bend', 'fall', 'hello', 'jump', 'knee_up', 'pull_both', 'pull_right', 'pull_left', 'push_both', 'push_left', 'push_right', 'swipe_left', 'swipe_right'];
+ var helpText = '
';
+ }
+ helpImgs += '