Added support for Pointer Lock API.

This commit is contained in:
Richard Davey
2013-09-09 19:59:31 +01:00
parent 60f0e8967f
commit 2ba6b4ff67
2 changed files with 66 additions and 0 deletions
+8
View File
@@ -114,6 +114,12 @@ Phaser.Device = function () {
*/
this.css3D = false;
/**
* Is Pointer Lock available?
* @type {boolean}
*/
this.pointerLock = false;
// Browser
/**
@@ -319,6 +325,8 @@ Phaser.Device.prototype = {
if (window.navigator.msPointerEnabled) {
this.mspointer = true;
}
this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;
},