Przeglądaj źródła

Added isMouseInBounds() and lastMousePosition() from Input.

dev-tmpl
Bryan Miller 5 lat temu
rodzic
commit
f598b53dfa
1 zmienionych plików z 7 dodań i 0 usunięć
  1. +7
    -0
      app/js/ui/Input.js

+ 7
- 0
app/js/ui/Input.js Wyświetl plik

this.__mouseLastButton = -1; this.__mouseLastButton = -1;
this.__mouseLastAction = ""; this.__mouseLastAction = "";
this.__mouseButtons = []; this.__mouseButtons = [];
this.__mouseInBounds = false;


this.__keyboardEnabled = false; this.__keyboardEnabled = false;
this.__mouseEnabled = false; this.__mouseEnabled = false;
} }
pos.x = Math.floor(pos.x); pos.x = Math.floor(pos.x);
pos.y = Math.floor(pos.y); pos.y = Math.floor(pos.y);
this.__mouseInBounds = pos.inbounds;
return pos; return pos;
}).bind(this); }).bind(this);


return false; return false;
} }


isMouseInBounds(){return this.__mouseInBounds;}
lastMousePosition(){
return [this.__mousePosition.x, this.__mousePosition.y];
}

listen(ename, func, owner=null, once=false){ listen(ename, func, owner=null, once=false){
if (([ if (([
"keyup", "keyup",

Ładowanie…
Anuluj
Zapisz