Commit d39c7d69 authored by wildfirecode's avatar wildfirecode

1

parent 40d1e5c8
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
return b; return b;
} }
</script> </script>
<img id="pic" style="width:100%;position: absolute;z-index: 999" src="https://yun.duiba.com.cn/db_games/activity/game/1565600901/resource/assets/startScene/startscenebg.jpg"/>
<script src="output.js"></script> <script src="output.js"></script>
</body> </body>
......
...@@ -23,18 +23,20 @@ export default async (parent?: egret.DisplayObjectContainer) => { ...@@ -23,18 +23,20 @@ export default async (parent?: egret.DisplayObjectContainer) => {
return getPrintScreenData(showoff, 0, 0, pic.textureWidth, pic.textureHeight); return getPrintScreenData(showoff, 0, 0, pic.textureWidth, pic.textureHeight);
}) })
} }
const img:any = document.getElementById('pic');
export const getShareUrl = async (parent?: egret.DisplayObjectContainer) => { img.style.display = 'none';
export const getShareUrl = async (parent?: egret.DisplayObjectContainer) => {
return new Promise(async (r) => { return new Promise(async (r) => {
const pic: egret.Texture = await RES.getResAsync('share2_jpg'); const pic: egret.Texture = await RES.getResAsync('share2_jpg');
const showoff = new Share(); const showoff = new Share();
showoff.loadSkin(); showoff.loadSkin();
showoff.start(); showoff.start();
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, pic.textureHeight); const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight);
NetManager.ins.imgUrl((success)=>{ NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
r(data) img.src = data;
},base64); r(data);
}, base64);
}) })
} }
\ No newline at end of file
...@@ -25,11 +25,11 @@ export default async (parent?: egret.DisplayObjectContainer) => { ...@@ -25,11 +25,11 @@ export default async (parent?: egret.DisplayObjectContainer) => {
showoff.loadSkin(); showoff.loadSkin();
showoff.start(); showoff.start();
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, pic.textureHeight); const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight);
NetManager.ins.imgUrl((success)=>{ NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
r(data) r(data)
},base64) }, base64);
}) })
} }
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