Fix: make game app button and typing app button smaller
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user