Add: mouse icon
This commit is contained in:
@@ -30,6 +30,7 @@ BasicTab.prototype.createButton = function(setting, clickEvent) {
|
||||
this.buttonSprite.addChild(this.mainText);
|
||||
|
||||
this.shortcutText = this.makeShortcutText();
|
||||
// this.shortcutText.fontWeight = "bold";
|
||||
this.buttonSprite.addChild(this.shortcutText);
|
||||
|
||||
this.applyLoadedFont();
|
||||
@@ -77,7 +78,7 @@ BasicTab.prototype.makeActiveLineSprite = function() {
|
||||
var texture = null;
|
||||
texture = new Phaser.Graphics()
|
||||
// .beginFill(0xffffff)
|
||||
.beginFill(MainColor.LIGHT_CHOCO_HEX)
|
||||
.beginFill(MainColor.WHITE_HEX)
|
||||
.drawRoundedRect(0, 0, lineWidth, lineHeight, 1)
|
||||
.endFill()
|
||||
.generateTexture();
|
||||
@@ -105,9 +106,7 @@ BasicTab.prototype.addIcon = function(spriteName) {
|
||||
this.iconSprite.x = this.buttonSprite.width / 2;
|
||||
this.iconSprite.y = this.buttonSprite.height / 2;
|
||||
this.iconSprite.anchor.setTo(0.5, 0.5);
|
||||
// this.setIconSize(40);
|
||||
this.setIconWidth(42);
|
||||
this.setIconHeight(25);
|
||||
this.setIconSize(50);
|
||||
this.buttonSprite.addChild(this.iconSprite);
|
||||
|
||||
this.mainText.text = "";
|
||||
@@ -223,7 +222,7 @@ BasicTab.prototype.alignContents = function() {
|
||||
var offsetRatio = 7;
|
||||
var offsetMainText = mainTextHeight / offsetRatio;
|
||||
var offsetShortcutText = shortcutTextHeight / offsetRatio;
|
||||
var gap = (iconSpriteHeight > 0 ? 0 : gap = BasicTab.SHORTCUT_TEXT_FONTSIZE / 4);
|
||||
var gap = (iconSpriteHeight > 0 ? 0 : BasicTab.SHORTCUT_TEXT_FONTSIZE / 2);
|
||||
|
||||
if(shortcutTextHeight === 0) {
|
||||
if(mainTextHeight > 0)
|
||||
@@ -238,7 +237,8 @@ BasicTab.prototype.alignContents = function() {
|
||||
this.iconSprite.y = this.buttonSprite.height / 2 - shortcutTextHeightHalf;
|
||||
}
|
||||
|
||||
this.shortcutText.y = this.buttonSprite.height / 2 + mainContentHeightHalf + offsetShortcutText + gap;
|
||||
// this.shortcutText.y = this.buttonSprite.height / 2 + mainContentHeightHalf + offsetShortcutText + gap;
|
||||
this.shortcutText.y = this.buttonSprite.height / 2 + mainContentHeightHalf + offsetShortcutText - 8;
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ BasicTab.prototype.mouseOut = function() {
|
||||
if(this.shortcutText !== undefined)
|
||||
this.shortcutText.fill = this.setting.textColors.out;
|
||||
|
||||
// this.activeLineSprite.tint = this.setting.activeLineColors.out;
|
||||
this.activeLineSprite.tint = this.setting.activeLineColors.out;
|
||||
}
|
||||
|
||||
BasicTab.prototype.mouseOver = function() {
|
||||
@@ -291,7 +291,7 @@ BasicTab.prototype.mouseOver = function() {
|
||||
if(this.shortcutText !== undefined)
|
||||
this.shortcutText.fill = this.setting.textColors.over;
|
||||
|
||||
// this.activeLineSprite.tint = this.setting.activeLineColors.over;
|
||||
this.activeLineSprite.tint = this.setting.activeLineColors.over;
|
||||
}
|
||||
|
||||
BasicTab.prototype.mouseDown = function() {
|
||||
@@ -304,7 +304,7 @@ BasicTab.prototype.mouseDown = function() {
|
||||
if(this.shortcutText !== undefined)
|
||||
this.shortcutText.fill = this.setting.textColors.down;
|
||||
|
||||
// this.activeLineSprite.tint = this.setting.activeLineColors.down;
|
||||
this.activeLineSprite.tint = this.setting.activeLineColors.down;
|
||||
}
|
||||
|
||||
BasicTab.prototype.buttonDisabled = function() {
|
||||
@@ -317,7 +317,7 @@ BasicTab.prototype.buttonDisabled = function() {
|
||||
if(typeof this.shortcutText !== undefined)
|
||||
this.shortcutText.fill = this.setting.textColors.disabled;
|
||||
|
||||
// this.activeLineSprite.tint = this.setting.activeLineColors.disabled;
|
||||
this.activeLineSprite.tint = this.setting.activeLineColors.disabled;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user