Fix: make game app button and typing app button smaller

This commit is contained in:
2018-09-01 15:11:59 +09:00
parent 5ff260f05f
commit 29539e9ce7
8 changed files with 100 additions and 78 deletions
+17 -2
View File
@@ -53,6 +53,21 @@ class GameAppButton extends RoundRectButton {
break;
}
setting.fontStyle = {
font: "24px Arial",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: "#fff"
};
let textCount = buttonText.length;
if(textCount > 7)
setting.fontStyle.font = "18px Arial";
else if(textCount > 5)
setting.fontStyle.font = "22px Arial";
else
setting.fontStyle.font = "24px Arial";
super(setting, iconName, buttonText, clickEvent);
}
@@ -62,8 +77,8 @@ GameAppButton.TYPE_MOUSE_APP = 0;
GameAppButton.TYPE_TYPING_PRACTICE = 1;
GameAppButton.TYPE_TYPING_APP = 2;
GameAppButton.BUTTON_WIDTH = 150;
GameAppButton.BUTTON_HEIGHT = 150;
GameAppButton.BUTTON_WIDTH = 120;
GameAppButton.BUTTON_HEIGHT = 120;
GameAppButton.BUTTON_GAP = 20;
GameAppButton.MARGIN_VERTICAL = 100;