this.pause.normalSprite = this.btnSprite[0];//this.btnSprite在编辑器已经设置好的
this.pause.pressedSprite = this.btnSprite[1];
this.pause.hoverSprite = this.btnSprite[1];
//设置按钮不可点击
this.buttonRight.interactable = false;
//按钮点击事件
buttonClicked: function() {
cc.log("button Clicked!");
if (this.singleLineText.string !== "") {
this.showEditorBoxLabel.string = i18n.t("cases/02_ui/07_editBox/editbox.js.1") + this.singleLineText.string;
}
else {
this.showEditorBoxLabel.string = "";
}
}
//或者
setFocus: function (event){
var target = event.target;
if (target.name === "Button1") {}
}