Add: RoundRectButton icon
This commit is contained in:
@@ -146,29 +146,50 @@ class RoundRectButton {
|
||||
return btnText;
|
||||
}
|
||||
|
||||
setIcon(icon) {
|
||||
this.buttonIcon = this.button.addChild(icon);
|
||||
this.buttonIcon.x = this.button.width / 2;
|
||||
this.buttonIcon.y = this.button.height / 2;
|
||||
this.buttonIcon.anchor.setTo(0.5, 0.5);
|
||||
|
||||
this.mouseOut();
|
||||
}
|
||||
|
||||
|
||||
mouseOut() {
|
||||
this.text.fill = this.setting.textColors.out;
|
||||
this.buttonStroke.tint = this.setting.strokeColors.out;
|
||||
this.button.tint = this.setting.buttonColors.out;
|
||||
if(typeof this.buttonIcon !== "undefined") {
|
||||
this.buttonIcon.tint = this.setting.strokeColors.out;
|
||||
}
|
||||
}
|
||||
|
||||
mouseOver() {
|
||||
this.text.fill = this.setting.textColors.over;
|
||||
this.buttonStroke.tint = this.setting.strokeColors.over;
|
||||
this.button.tint = this.setting.buttonColors.over;
|
||||
if(typeof this.buttonIcon !== "undefined") {
|
||||
this.buttonIcon.tint = this.setting.strokeColors.over;
|
||||
}
|
||||
}
|
||||
|
||||
mouseDown() {
|
||||
this.text.fill = this.setting.textColors.down;
|
||||
this.buttonStroke.tint = this.setting.strokeColors.down;
|
||||
this.button.tint = this.setting.buttonColors.down;
|
||||
if(typeof this.buttonIcon !== "undefined") {
|
||||
this.buttonIcon.tint = this.setting.strokeColors.down;
|
||||
}
|
||||
}
|
||||
|
||||
buttonDisabled() {
|
||||
this.text.fill = this.setting.textColors.disabled;
|
||||
this.buttonStroke.tint = this.setting.strokeColors.disabled;
|
||||
this.button.tint = this.setting.buttonColors.disabled;
|
||||
if(typeof this.buttonIcon !== "undefined") {
|
||||
this.buttonIcon.tint = this.setting.strokeColors.disabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user