tuio-nw
v1.0.1
Published
A JavaScript implementation of the TUIO protocol for multitouch and tangible interaction for NodeWebkit (nwjs).
Downloads
15
Maintainers
Readme
tuio-nw
A JavaScript implementation of the TUIO protocol for multitouch and tangible interaction for NodeWebkit (nw).
Install
$ npm install tuio-nw
Usage
var Tuio = require('tuio-nw');
var tuioClient = new Tuio.Client({
host: '127.0.0.1',
port: 3333
});
var onAddTuioCursor = function (addCursor) {
console.log(addCursor);
},
onUpdateTuioCursor = function (updateCursor) {
console.log(updateCursor);
},
onRemoveTuioCursor = function (removeCursor) {
console.log(removeCursor);
},
onAddTuioObject = function (addObject) {
console.log(addObject);
},
onUpdateTuioObject = function (updateObject) {
console.log(updateObject);
},
onRemoveTuioObject = function (removeObject) {
console.log(removeObject);
},
onRefresh = function (time) {
console.log(time);
};
tuioClient.on('addTuioCursor', onAddTuioCursor);
tuioClient.on('updateTuioCursor', onUpdateTuioCursor);
tuioClient.on('removeTuioCursor', onRemoveTuioCursor);
tuioClient.on('addTuioObject', onAddTuioObject);
tuioClient.on('updateTuioObject', onUpdateTuioObject);
tuioClient.on('removeTuioObject', onRemoveTuioObject);
tuioClient.on('refresh', onRefresh);
tuioClient.listen();
License
MIT © Diego Montesinos