front_idill/extern/fajran-tuiojs/connector/npTuioClient/tuiojs.npTuioClient.js
changeset 25 a7b0e40bcab0
child 26 858e90c7cbaa
equal deleted inserted replaced
24:2bdf5d51d434 25:a7b0e40bcab0
       
     1 
       
     2 tuio.setConnector({
       
     3 	_failmsg: "Unable to initialize npTuioClient plugin.",
       
     4 	_id: "__tuiojs_connector_npTuioClient",
       
     5 
       
     6 	start: function() {
       
     7 		var el = document.getElementById(this._id);
       
     8 		if (el == undefined) {
       
     9 			var el = document.createElement('object');
       
    10 			el.setAttribute('id', this._id);
       
    11 			el.setAttribute('type', 'application/x-tuio');
       
    12 			el.appendChild(document.createTextNode(this._failmsg));
       
    13 			document.body.appendChild(el);
       
    14 		}
       
    15 
       
    16 		// TODO: check if the plugin can be loaded. 
       
    17 		//       if so, hide the plugin (display:none).
       
    18 	},
       
    19 
       
    20 	stop: function() {
       
    21 		var el = document.getElementById(this._id);
       
    22 		if (el != undefined) {
       
    23 			document.body.removeChild(el);
       
    24 		}
       
    25 	}
       
    26 });
       
    27 
       
    28 function tuio_callback(type, sid, fid, x, y, angle)  {
       
    29 	tuio.callback(type, sid, fid, x, y, angle);
       
    30 }
       
    31