GameTab.js 809 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. bgFrames: [cc.SpriteFrame],
  5. titleRichText: cc.RichText,
  6. tabText: '好友排行'
  7. },
  8. // LIFE-CYCLE CALLBACKS:
  9. // onLoad () {},
  10. start () {
  11. },
  12. init () {
  13. },
  14. show () {
  15. this.getComponent(cc.Button).interactable = false;
  16. this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[1];
  17. this.titleRichText.string = `<b><outline color=#ffae00 width=2><color=white>${this.tabText}</color></outline></b>`;
  18. },
  19. hide () {
  20. this.getComponent(cc.Button).interactable = true;
  21. this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[0];
  22. this.titleRichText.string = `<b><color=#B6896B>${this.tabText}</color></b>`;
  23. }
  24. // update (dt) {},
  25. });