Add: BasicTab, TabSetting

This commit is contained in:
2019-07-25 16:29:31 +09:00
parent 4e18fb4272
commit 2eae5af3a9
7 changed files with 406 additions and 17 deletions
+84
View File
@@ -0,0 +1,84 @@
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