EnjoyPanel.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var JoyPanel = require("JoyPanel");
  2. var HousePanel = require("HousePanel");
  3. var TreatPanel = require("TreatPanel");
  4. var CarPanel = require("CarPanel");
  5. var EnjoyPanel = cc.Class({
  6. extends: cc.Component,
  7. properties: {
  8. MainAtlas:cc.SpriteAtlas,
  9. TipNameSp:cc.Sprite,
  10. joyPanel:JoyPanel,
  11. housePanel:HousePanel,
  12. carPanel:CarPanel,
  13. //treatPanel:TreatPanel,
  14. },
  15. ShowPanel:function(){
  16. //this.OpenJoyPanel();
  17. },
  18. OpenJoyPanel:function () {
  19. cc.Mgr.AudioMgr.playSFX("click");
  20. this.joyPanel.node.active = true;
  21. this.housePanel.node.active = false;
  22. this.carPanel.node.active = false;
  23. this.TipNameSp.spriteFrame = this.MainAtlas.getSpriteFrame("funny");
  24. //this.treatPanel.node.active = false;
  25. },
  26. OpenHousePanel:function () {
  27. cc.Mgr.AudioMgr.playSFX("click");
  28. this.joyPanel.node.active = false;
  29. this.housePanel.node.active = true;
  30. this.carPanel.node.active = false;
  31. //this.treatPanel.node.active = false;
  32. this.TipNameSp.spriteFrame = this.MainAtlas.getSpriteFrame("house");
  33. this.housePanel.ShowPanel();
  34. },
  35. OpenCarPanel:function () {
  36. cc.Mgr.AudioMgr.playSFX("click");
  37. this.joyPanel.node.active = false;
  38. this.housePanel.node.active = false;
  39. this.carPanel.node.active = true;
  40. //this.treatPanel.node.active = false;
  41. this.TipNameSp.spriteFrame = this.MainAtlas.getSpriteFrame("text_car");
  42. this.carPanel.ShowPanel();
  43. },
  44. OpenTreatPanel:function () {
  45. cc.Mgr.AudioMgr.playSFX("click");
  46. this.joyPanel.node.active = false;
  47. this.housePanel.node.active = false;
  48. this.carPanel.node.active = false;
  49. //this.treatPanel.node.active = true;
  50. },
  51. ClosePanel:function(){
  52. cc.Mgr.AudioMgr.playSFX("click");
  53. this.node.active = false;
  54. },
  55. });
  56. module.exports = EnjoyPanel;