Fix: hand position

This commit is contained in:
2019-05-15 20:42:15 +09:00
parent 6e88d4b471
commit 9d0c9770c2
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -27,13 +27,17 @@ function Hand(keyMapper) {
this.little_finger.alpha = 0.5; this.little_finger.alpha = 0.5;
this.hand.addChild(this.little_finger); this.hand.addChild(this.little_finger);
this.offsetY = 0;
if(isTypingTestApp())
this.offsetY = 80;
var maskOffsetY = 0; var maskOffsetY = 0;
if(isTypingTestApp()) if(isTypingTestApp())
maskOffsetY = 40; maskOffsetY = 40;
var mask = game.add.graphics(); var mask = game.add.graphics();
mask.beginFill(0xffffff); mask.beginFill(0xffffff);
mask.drawRect(100, 300 + maskOffsetY, 1028, 360); mask.drawRect(100, 300 + maskOffsetY, 828, 360);
this.hand.mask = mask; this.hand.mask = mask;
} }
@@ -53,7 +57,7 @@ Hand.prototype.moveToDefaultPosition = function() {
Hand.prototype.moveRow = function(rowNo, key) { Hand.prototype.moveRow = function(rowNo, key) {
var rowIndex = rowNo - 1; var rowIndex = rowNo - 1;
this.hand.y = Hand.DEFAULT_Y_PX + Keyboard.DEFAULT_KEY_SIZE_PX * rowIndex; this.hand.y = Hand.DEFAULT_Y_PX + Keyboard.DEFAULT_KEY_SIZE_PX * rowIndex + this.offsetY;
this.moveColumn(rowNo, key); this.moveColumn(rowNo, key);
} }
+1
View File
@@ -282,6 +282,7 @@ Keyboard.prototype.initKeyData = function(keyMapper) {
var row1offsetY = 0; var row1offsetY = 0;
if(isTypingTestApp()) if(isTypingTestApp())
row1offsetY = 80; row1offsetY = 80;
// row 1 // row 1
this.addFunctionKeyData( this.addFunctionKeyData(
"Backquote", "Backquote",