|
25
|
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 |
|
|
26
|
28 |
function tuio_callback(type, sid, fid, x, y, z, angle) { |
|
|
29 |
tuio.callback(type, sid, fid, x, y, z, angle); |
|
25
|
30 |
} |
|
|
31 |
|