class TypingTabButton extends RoundRectButton { constructor(x, y, iconName, buttonText, clickEvent) { let setting = new RoundRectButtonSetting( x, y, TypingTabButton.BUTTON_WIDTH, TypingTabButton.BUTTON_HEIGHT ); setting.fontStyle.boundsAlignH = "center"; // left, center. right setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom setting.strokeWidthPx = 5; setting.setStrokeColor( 0x446688, 0x6688aa, 0x6688aa, 0x333333 ); setting.setButtonColor( 0xaabbdd, 0xddeeff, 0xddeeff, 0x666666 ); setting.setTextColor( "#468", "#68a", "#68a", "#333" ); super(setting, iconName, buttonText, clickEvent); if(iconName.length > 0) { let icon_fullscreen = game.add.sprite(0, 0, iconName); icon_fullscreen.width = 80; icon_fullscreen.height = 80; this.button.setIcon(icon_fullscreen); } } } TypingTabButton.BUTTON_WIDTH = 445; TypingTabButton.BUTTON_HEIGHT = 80; TypingTabButton.BUTTON_GAP = 26; TypingTabButton.MARGIN_VERTICAL = 100; TypingTabButton.PRACTICE_BUTTON_POS_X = GAME_SCREEN_SIZE.x / 4 + TypingTabButton.BUTTON_GAP; TypingTabButton.TEST_BUTTON_POS_X = GAME_SCREEN_SIZE.x / 4 * 3 - TypingTabButton.BUTTON_GAP; TypingTabButton.BUTTON_POS_Y = GAME_SCREEN_SIZE.y - 104;