Commit e2a30ada authored by wildfirecode's avatar wildfirecode

1

parent 0dd184ed
...@@ -22,6 +22,7 @@ export const getPrintScreenData = (scene, startX, startY, width, height) => { ...@@ -22,6 +22,7 @@ export const getPrintScreenData = (scene, startX, startY, width, height) => {
const imageData = renderTexture.toDataURL("image/jpg"); const imageData = renderTexture.toDataURL("image/jpg");
return imageData; return imageData;
} }
const img: any = document.getElementById('pic');
export default async (stage, parent?: egret.DisplayObjectContainer, ) => { export default async (stage, parent?: egret.DisplayObjectContainer, ) => {
// return new Promise(async (r) => { // return new Promise(async (r) => {
const pic: egret.Texture = await RES.getResAsync('showoff_jpg'); const pic: egret.Texture = await RES.getResAsync('showoff_jpg');
...@@ -29,18 +30,18 @@ export default async (stage, parent?: egret.DisplayObjectContainer, ) => { ...@@ -29,18 +30,18 @@ export default async (stage, parent?: egret.DisplayObjectContainer, ) => {
showoff.loadSkin(); showoff.loadSkin();
showoff.start(); showoff.start();
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
showoff.cacheAsBitmap=true; showoff.visible=false;
// stage.once(egret.Event.ENTER_FRAME, () => {
const base64 = getPrintScreenData(showoff['pic'], 0, 0, pic.textureWidth, stage.stageHeight); const base64 = getPrintScreenData(showoff['pic'], 0, 0, pic.textureWidth, stage.stageHeight);
NetManager.ins.imgUrl((success) => { NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
// r(data.data); // r(data.data);
img.src = data.data;
if (!iswx()) { if (!iswx()) {
callShareApi(data.data, 1); callShareApi(data.data, 1);
} }
}, base64); }, base64);
// }, this);
} }
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