Commit d7ffde95 authored by 邱旭's avatar 邱旭

还是把_stageList放回去吧,调试插件要用到

parent d0677f3d
......@@ -26,8 +26,28 @@ export class Stage extends Container {
*/
public renderObj: SystemRenderer = null;
/**
* 直接获取stage的引用,避免总是从Event.ADD_TO_STAGE 事件中去获取stage引用
* @property getStage
* @param {string} stageName
* @return {any}
* @since 2.0.0
*/
public static getStage(stageName: string = "cusEngine"): Stage {
return Stage._stageList[stageName];
}
/**
* @property _stageList
* @static
* @type {Object}
* @private
*/
private static _stageList: any = {};
/**
* 相对于stage的可见区域,考虑不对外开放,但是有些地方又有用,比如某点是否在舞台可见区域内viewRect.isPointIn(gp)
* 舞台在设备里截取后的可见区域,有些时候知道可见区域是非常重要的,因为这样你就可以根据舞台的可见区域做自适应了。
* @property viewRect
* @public
* @since 1.0.0
......@@ -198,6 +218,7 @@ export class Stage extends Container {
this.canvas = canvas;
let s: Stage = this;
this._instanceType = "Stage";
Stage._stageList["canvas"] = s;
s.stage = this;
s.name = "stageInstance_" + s.instanceId;
s.desWidth = desWidth;
......
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