TypingExamButton.prototype = Object.create(RoundRectButton.prototype);
TypingExamButton.constructor = TypingExamButton;

function TypingExamButton(x, y, iconName, buttonText, writingID) {
	this.writingID = writingID;

	var setting = new RoundRectButtonSetting(
		x, y,
		TypingExamButton.BUTTON_WIDTH, TypingExamButton.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"
	);

	RoundRectButton.call(this, setting, iconName, buttonText, this.onClick);
}


TypingExamButton.prototype.onClick = function() {
	sessionStorageManager.setPlayingAppID(200);
	sessionStorageManager.setPlayingAppName("typing_exam");
	sessionStorageManager.setPlayingAppKoreanName("타자검정");
	sessionStorageManager.setWritingID(this.writingID);
	// location.href = '../../web/client/typing_exam.html';
	location.href = '../../web/client/start.html';
	// printSessionStorage();
}


TypingExamButton.BUTTON_WIDTH		= 490;
TypingExamButton.BUTTON_HEIGHT		= 80;

TypingExamButton.BUTTON_GAP			= 5;
TypingExamButton.MARGIN_VERTICAL		= 100;

TypingExamButton.PRACTICE_BUTTON_POS_X	= GAME_SCREEN_SIZE.x / 4 + TypingExamButton.BUTTON_GAP;
TypingExamButton.TEST_BUTTON_POS_X		= GAME_SCREEN_SIZE.x / 4 * 3 - TypingExamButton.BUTTON_GAP;

TypingExamButton.BUTTON_POS_Y		=  GAME_SCREEN_SIZE.y - 104;