Commit e2a30ada authored by wildfirecode's avatar wildfirecode

1

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