LayerManager.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * 图层管理类
  3. * @author xiongjian
  4. * @date 2016/6/27
  5. *
  6. */
  7. import { SingleClass } from "./SingleClass";
  8. import FrameworkCfg from "../../lightMVC/core/FrameworkCfg";
  9. const { ccclass, property } = cc._decorator;
  10. @ccclass
  11. export default class LayerManager extends SingleClass {
  12. /**根容器*/
  13. private rootLayer: cc.Node;
  14. /**锁定动画层*/
  15. public lockLayer: cc.Node;
  16. /**提示语层*/
  17. public tipLayer: cc.Node;
  18. public constructor() {
  19. super();
  20. this.rootLayer = new cc.Node("rootLayer");
  21. //this.rootLayer.addComponent(cc.BlockInputEvents);
  22. cc.game.addPersistRootNode(this.rootLayer);
  23. this.rootLayer.width = FrameworkCfg.DESIGN_RESOLUTION.width;
  24. this.rootLayer.height = FrameworkCfg.DESIGN_RESOLUTION.height;
  25. this.rootLayer.x = 360;
  26. this.rootLayer.y = 640;
  27. this.lockLayer = new cc.Node("lockLayer");
  28. this.rootLayer.addChild(this.lockLayer);
  29. this.tipLayer = new cc.Node("tipLayer");
  30. this.rootLayer.addChild(this.tipLayer);
  31. }
  32. }