新增场景截图 requestScreenshot

This commit is contained in:
yhh
2020-08-12 19:57:06 +08:00
parent c89ed25d8a
commit 4012a9f6d1
7 changed files with 49 additions and 9 deletions

View File

@@ -1719,6 +1719,15 @@ var es;
}
}
}
if (this._screenshotRequestCallback) {
var tex = new egret.RenderTexture();
tex.drawToTexture(this, new es.Rectangle(0, 0, this.stage.stageWidth, this.stage.stageHeight));
this._screenshotRequestCallback(tex);
this._screenshotRequestCallback = null;
}
};
Scene.prototype.requestScreenshot = function (callback) {
this._screenshotRequestCallback = callback;
};
Scene.prototype.addSceneComponent = function (component) {
component.scene = this;