了解一下stageFrameControler笔记
来源:互联网 发布:网络布线技巧 编辑:程序博客网 时间:2024/04/29 09:21
做新手引导层级放在最上层。这个是我添加的。还有好多地方需要注意的东西
////////////////////////////////////////////////////////////////////////////////////////created by zhengxin at 2016-05-17//Stage的rootContainer为Main DisplayObjectContainer对象,见Main.ts//把游戏分为3个主要场景Scene:LoginFrame、MainFrame、BattleFrame,还可以有其他类型BattleFrame//StartStoryFrame开场动画等//UILayer自动与stage保持同宽高//Group大小不限//////////////////////////////////////////////////////////////////////////////////////'use strict';class StageFrameControl { private static _instance: StageFrameControl; static get instance(): StageFrameControl { if(!this._instance) { this._instance = new StageFrameControl(); } return this._instance; } /* * 地图滑动的容器和视域,作为一个Scroller,在最底层 * */ private mapScroll: eui.Scroller; /* * mapScroll的IViewport对象 * */ private mapViewportGroup: eui.Group; /* * 地图容器,地图跟着scroller滑动,child of mapViewportGroup * */ private mapGroup: eui.Group; /* * scene容器,场景里的显示对象也跟着scroller滑动,child of mapViewportGroup * */ private sceneGroup: eui.Group; private uiRootLayer: eui.UILayer; private topRootLayer: eui.UILayer; /**新手引导层*/ private newBeeGuideLayer:eui.UILayer; /**开场动画层级*/ private welcomeRootLayer: eui.UILayer; public constructor() { } /* * 布置stage的分层结构 * */ public init(stage:egret.Stage) { this.mapGroup = new eui.Group(); // this.sceneGroup = new eui.Group(); this.sceneGroup.touchThrough = true; // this.mapViewportGroup = new eui.Group(); this.mapViewportGroup.addChild(this.mapGroup); this.mapViewportGroup.addChild(this.sceneGroup); // this.mapScroll = new eui.Scroller(); this.mapScroll.width = stage.stageWidth; this.mapScroll.height = stage.stageHeight; // this.mapScroll.viewport = this.mapViewportGroup; stage.addChild(this.mapScroll); foxgame.Global.rootScroller = this.mapScroll; // this.welcomeRootLayer = new eui.UILayer(); stage.addChild(this.welcomeRootLayer); foxgame.Global.welcomeLayer = this.welcomeRootLayer; // this.uiRootLayer = new eui.UILayer(); this.uiRootLayer.touchThrough = true; stage.addChild(this.uiRootLayer); foxgame.Global.uiLayer = this.uiRootLayer; // this.topRootLayer = new eui.UILayer(); this.topRootLayer.touchThrough = true; this.topRootLayer.touchEnabled = false; stage.addChild(this.topRootLayer); foxgame.Global.topLayer = this.topRootLayer; //新手引导 this.newBeeGuideLayer = new eui.UILayer(); this.newBeeGuideLayer.touchThrough = true; this.newBeeGuideLayer.touchEnabled = false; stage.addChild(this.newBeeGuideLayer); foxgame.Global.newBeeGuideLayer = this.newBeeGuideLayer; // foxgame.Global.stageWidth = stage.stageWidth; foxgame.Global.stageHeight = stage.stageHeight; //initMapViewportGroupManager foxgame.MapViewportGroupManager.instance.init(this.sceneGroup,this.mapGroup,this.mapViewportGroup); } /* * * */ public enableTouchTopLayer() { this.topRootLayer.touchEnabled = true; } /* * * */ public disableTouchTopLayer() { this.topRootLayer.touchEnabled = false; } /* * * */ public enterLoginFrame() { } /* * * */ public removeWelcomeLayer() { if (this.welcomeRootLayer) { if(this.welcomeRootLayer.parent) this.welcomeRootLayer.parent.removeChild(this.welcomeRootLayer); // this.welcomeRootLayer = null; foxgame.Global.welcomeLayer = null; // } } /** * 设置滚动试图能否滑动 * */ public setScrollEnabled(state:boolean){ this.mapScroll.touchEnabled = state;// this.mapScroll.viewport.scrollEnabled = state; } /** * viewport * */ public getScrollViewport(){ return this.mapViewportGroup; }}
0 0
- 了解一下stageFrameControler笔记
- 了解一下JSON
- 了解一下版权贸易
- 了解一下“PV”
- 了解一下语义网
- 了解一下NTLM
- 了解一下NginX
- 了解一下Resin
- 了解一下cics
- 了解了一下cache
- 了解一下HDMI标准
- 了解一下Adapter吧
- 快速了解一下数据库
- 了解一下PDO
- Guava 有空了解一下
- c# request了解一下
- 小小了解一下NIO
- 了解一下ffmpeg
- [PHP基础][01]我的第一个php程序
- 第七周项目5-排队看病模拟
- linux设置tomcat开机自动启动
- 水经注地图下载器为什么叫万能下载器
- Trafodion表与HBase表如何映射
- 了解一下stageFrameControler笔记
- AS项目错误
- 数据分析在携程产品设计中的应用
- 压缩
- OpenCv中norm()函数,cvNorm()函数,CV_L1,CV_L2等宏定义的源代码解读
- 磁盘调度算法,内存调度,内存分配策略
- 第七周 项目一——建立顺序环形队列算法库
- java数据结构和算法(SortBase)
- 第七周项目1 -——建立顺序环形队列算法库