1
0

QuestTab.js 834 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. bgFrames: [cc.SpriteFrame],
  5. iconFrames: [cc.SpriteFrame],
  6. icon: cc.Node,
  7. arrow: cc.Node,
  8. text: cc.Node
  9. },
  10. onLoad () {
  11. },
  12. init (quest) {
  13. this.quest = quest
  14. },
  15. show () {
  16. this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[1]
  17. this.icon.getComponent('cc.Sprite').spriteFrame = this.iconFrames[1]
  18. this.icon.y = 35
  19. this.text.y = -17
  20. this.arrow.active = true
  21. },
  22. hide () {
  23. this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[0]
  24. this.icon.getComponent('cc.Sprite').spriteFrame = this.iconFrames[0]
  25. this.icon.y = 12
  26. this.text.y = -30
  27. this.arrow.active = false
  28. }
  29. // update (dt) {},
  30. });