1234567891011121314151617181920212223242526272829303132333435363738 |
- cc.Class({
- extends: cc.Component,
- properties: {
- bgFrames: [cc.SpriteFrame],
- tabRichText: cc.RichText
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad () {
- },
- start () {
- },
- init (text) {
- this.text = text;
- },
- show () {
- this.getComponent(cc.Button).interactable = false;
- this.getComponent(cc.Sprite).spriteFrame = this.bgFrames[1];
- this.tabRichText.string = `<b><outline color=#ffae00 width=2><color=#fef3cf>${this.text}</color></outline></b>`;
- },
- hide () {
- this.getComponent(cc.Button).interactable = true;
- this.getComponent(cc.Sprite).spriteFrame = this.bgFrames[0];
- this.tabRichText.string = `<b><color=#b6896b>${this.text}</color></b>`;
- },
- // update (dt) {},
- });
|