Files
chocomae/src/game/lib/flat_button/tab_setting.js
T
2019-09-15 19:25:41 +09:00

84 lines
1.8 KiB
JavaScript

function TabSetting(x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.fontSize = 10;
this.buttonColors = TabSetting.DEFAULT_BUTTON_COLORS;
this.textColors = TabSetting.DEFAULT_TEXT_COLORS;
this.iconColors = TabSetting.DEFAULT_ICON_COLORS;
this.fontStyle = TabSetting.DEFAULT_TEXT_FONT;
};
TabSetting.prototype.setFont = function(fontName) {
this.font = fontName;
}
TabSetting.prototype.setFontSize = function(size) {
this.fontSize = size;
}
TabSetting.prototype.setButtonColor = function(out, over, down, disabled) {
this.buttonColors = { };
this.buttonColors.out = out;
this.buttonColors.over = over;
this.buttonColors.down = down;
this.buttonColors.disabled = disabled;
}
TabSetting.prototype.setTextColor = function(out, over, down, disabled) {
this.textColors = { };
this.textColors.out = out;
this.textColors.over = over;
this.textColors.down = down;
this.textColors.disabled = disabled;
}
TabSetting.prototype.setIconColor = function(out, over, down, disabled) {
this.iconColors = { };
this.iconColors.out = out;
this.iconColors.over = over;
this.iconColors.down = down;
this.iconColors.disabled = disabled;
}
TabSetting.DEFAULT_STROKE_COLORS = {
out: 0x666666,
over: 0x333333,
down: 0x333333,
disabled: 0x666666
};
TabSetting.DEFAULT_BUTTON_COLORS = {
out: 0xffffff,
over: 0xddffdd,
down: 0xaaffaa,
disabled: 0x333333
};
TabSetting.DEFAULT_TEXT_COLORS = {
out: "#000",
over: "#333",
down: "#666",
disabled: "#999"
};
TabSetting.DEFAULT_ICON_COLORS = {
out: 0xffffff,
over: 0xddffdd,
down: 0xaaffaa,
disabled: 0x333333
};
TabSetting.DEFAULT_TEXT_FONT = {
font: "30px",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: "#fff",
align: "center"
};
TabSetting.DEFAULT_TEXT_LINE_SPACING_PX = -10; // in pixel