mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added pointer locking and viewport moving
This commit is contained in:
parent
072e984215
commit
6d9d02615a
12 changed files with 236 additions and 141 deletions
|
|
@ -357,6 +357,7 @@ function (ColorConverter, Exception) {
|
|||
clearInterval(instance.channelDestructionTimeout);
|
||||
}
|
||||
|
||||
requestPointerLock();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -385,6 +386,19 @@ function (ColorConverter, Exception) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function requestPointerLock() {
|
||||
|
||||
var c = $("#canvas");
|
||||
c.requestPointerLock = c.requestPointerLock ||
|
||||
c.mozRequestPointerLock ||
|
||||
c.webkitRequestPointerLock;
|
||||
|
||||
// Ask the browser to lock the pointer)
|
||||
c.requestPointerLock();
|
||||
}
|
||||
|
||||
$("#canvas").onclick = requestPointerLock;
|
||||
|
||||
return Menu;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue