Commit c8726d5f authored by XieChuanJin's avatar XieChuanJin

1111

parent c6d85829
import Panel from "../views/Panel";
import Loading from "../Loading/Loading";
export default class PanelCtrl {
private _parent: eui.UILayer;
private _parent: eui.Group;
private _mask: egret.Shape;
private hasMaskCount = 0;
private stack: Panel[] = [];
......@@ -12,7 +12,7 @@ export default class PanelCtrl {
return PanelCtrl._instance || (PanelCtrl._instance = new PanelCtrl())
}
init(parent: eui.UILayer) {
init(parent: eui.Group) {
this._parent = parent;
let mask = new egret.Shape();
mask.graphics.beginFill(0, 0.8);
......
......@@ -3,17 +3,17 @@ import IScene from "../components/IScene";
import Scene from "../views/Scene";
export default class SceneCtrl {
public get parent(): eui.UILayer {
public get parent(): eui.Group {
return this._parent;
}
private _parent: eui.UILayer;
private _parent: eui.Group;
private _currentScene: Scene;
static _instance: SceneCtrl;
static get instance() {
return SceneCtrl._instance || (SceneCtrl._instance = new SceneCtrl())
}
init(parent: eui.UILayer) {
init(parent: eui.Group) {
this._parent = parent;
}
......
import { ThroughSubmitData } from "../../libs/tw/data/custom/throughSubmit/ThroughSubmitData";
import GameMgr from "../Mgr/GameMgr";
class Layers extends eui.UILayer {
private _topLayer: eui.UILayer;
private _popupLayer: eui.UILayer;
private _sceneLayer: eui.UILayer;
const MinHeight = 1200;
class MLayers extends eui.UILayer {
public sceneLayer: eui.Group = null;
public popupLayer: eui.Group = null;
public topLayer: eui.UILayer = new eui.UILayer();
public toastLayer: eui.UILayer = new eui.UILayer();
public scroller: eui.Scroller = null;
private static _instance: MLayers = null;
public static get instance(): MLayers {
if (!this._instance) {
this._instance = new MLayers();
}
return this._instance;
}
public setScroller(v: boolean) {
if (this.scroller == null) return;
if (v == true) {
this.scroller.viewport = this;
} else {
this.scroller.viewport = null;
this.scroller.addChild(this);
}
}
init(root: eui.UILayer) {
root.addChild(this);
this._topLayer = new eui.UILayer();
this._popupLayer = new eui.UILayer();
this._sceneLayer = new eui.UILayer();
this.addChild(this._sceneLayer);
this.addChild(this._popupLayer);
this.addChild(this._topLayer);
if (document.body.clientWidth / document.body.clientHeight > 750 / MinHeight) {
let scroller = new eui.Scroller();
this.scroller = scroller;
root.addChild(scroller);
scroller.viewport = this;
scroller.bounces = false;
scroller.addChild(this);
this.popupLayer = new eui.Group();
this.popupLayer.width = 750;
this.popupLayer.height = MinHeight;
this.sceneLayer = new eui.Group();
this.sceneLayer.width = 750
this.sceneLayer.height = MinHeight;
this.addChild(this.sceneLayer);
this.addChild(this.popupLayer);
} else {
root.addChild(this);
this.popupLayer = new eui.UILayer();
this.sceneLayer = new eui.UILayer();
this.addChild(this.sceneLayer);
this.addChild(this.popupLayer);
}
this.addChild(this.toastLayer);
this.addChild(this.topLayer);
this._popupLayer.visible = false;
this._topLayer.visible = false;
this.popupLayer.visible = false;
this.topLayer.visible = false;
this.toastLayer.touchEnabled = false;
}
get topLayer() { return this._topLayer }
get popupLayer() { return this._popupLayer }
get sceneLayer() { return this._sceneLayer }
}
const instance = new Layers();
export default instance
\ No newline at end of file
export default new MLayers();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment