mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added zooming with +, - and 0
This commit is contained in:
parent
cc8cf6c5f9
commit
ac27da1e31
7 changed files with 82 additions and 12 deletions
|
|
@ -38,7 +38,11 @@ function (Parent, KeyboardInput, MouseInput, Nc, GamepadInput) {
|
|||
|
||||
space: 32,
|
||||
|
||||
tab: 9
|
||||
tab: 9,
|
||||
|
||||
plus: 187,
|
||||
minus: 189,
|
||||
zero: 48
|
||||
}
|
||||
|
||||
this.init(keys);
|
||||
|
|
@ -63,6 +67,10 @@ function (Parent, KeyboardInput, MouseInput, Nc, GamepadInput) {
|
|||
this.keyboardInput.registerKey(keys.up, 'jump', 'jumpStop');
|
||||
this.keyboardInput.registerKey(keys.space, 'jump', 'jumpStop');
|
||||
|
||||
this.keyboardInput.registerKey(keys.plus, 'zoomIn');
|
||||
this.keyboardInput.registerKey(keys.minus, 'zoomOut');
|
||||
this.keyboardInput.registerKey(keys.zero, 'zoomReset');
|
||||
|
||||
this.keyboardInput.registerKey(keys.tab, 'showInfo', 'hideInfo');
|
||||
|
||||
this.keyboardInput.registerKey(keys.f, 'handActionLeft');
|
||||
|
|
@ -127,6 +135,18 @@ function (Parent, KeyboardInput, MouseInput, Nc, GamepadInput) {
|
|||
Nc.trigger(Nc.ns.client.game.gameInfo.toggle, false);
|
||||
};
|
||||
|
||||
PlayerController.prototype.zoomIn = function() {
|
||||
Nc.trigger(Nc.ns.client.game.zoomIn, true);
|
||||
};
|
||||
|
||||
PlayerController.prototype.zoomOut = function() {
|
||||
Nc.trigger(Nc.ns.client.game.zoomOut, false);
|
||||
};
|
||||
|
||||
PlayerController.prototype.zoomReset = function() {
|
||||
Nc.trigger(Nc.ns.client.game.zoomReset, false);
|
||||
};
|
||||
|
||||
PlayerController.prototype.destroy = function() {
|
||||
Nc.offAll(this.ncTokens);
|
||||
Parent.prototype.destroy.call(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue