Commit c1fc2956 authored by wildfirecode's avatar wildfirecode

1

parent 89af0506
...@@ -225,9 +225,9 @@ ...@@ -225,9 +225,9 @@
</e:Group> </e:Group>
<e:Group id="boxLayer" x="0" y="0" visible="false"> <e:Group id="boxLayer" x="0" y="0" visible="false">
<e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/> <e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/>
<e:Group id="boxani"> <e:Group id="boxani" width="750" height="1624">
<e:Image source="common_box_btn_png" y="957.41" x="189" scaleX="1" scaleY="1"/>
</e:Group> </e:Group>
<e:Label text="点击开宝箱" y="791" size="37" horizontalCenter="0" bold="true"/>
</e:Group> </e:Group>
<e:Group id="guide" visible="false" locked="true"> <e:Group id="guide" visible="false" locked="true">
<e:Rect width="750" height="1624" x="0" y="0" alpha="0.7"/> <e:Rect width="750" height="1624" x="0" y="0" alpha="0.7"/>
......
...@@ -37,6 +37,7 @@ import getIconGroup from "./getIconGroup"; ...@@ -37,6 +37,7 @@ import getIconGroup from "./getIconGroup";
import getSignBtn from "./getSignBtn"; import getSignBtn from "./getSignBtn";
import getAdBtn from "./getAdBtn"; import getAdBtn from "./getAdBtn";
import getInviteBtn from "./getInviteBtn"; import getInviteBtn from "./getInviteBtn";
import { play2, play1 } from "../panels/help/svgaTool";
let doHelpFlag = false; let doHelpFlag = false;
// let doScratchHelpFlag = false; // let doScratchHelpFlag = false;
...@@ -87,6 +88,8 @@ export default class MapScene extends Scene { ...@@ -87,6 +88,8 @@ export default class MapScene extends Scene {
parmas.push({ netCallback: netCallback, code: code }); parmas.push({ netCallback: netCallback, code: code });
} }
return true; return true;
// play2()
} }
// 邀请有礼角标倒计时 // 邀请有礼角标倒计时
...@@ -1035,56 +1038,50 @@ export default class MapScene extends Scene { ...@@ -1035,56 +1038,50 @@ export default class MapScene extends Scene {
} }
private _mc; private _mc;
private stopFunc;
async onTap_boxLayer() { async onTap_boxLayer() {
NetManager.ins.clickLog(getlogItem(1)); NetManager.ins.clickLog(getlogItem(1));
const data = getHomeData(); const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) { if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true; this['boxLayer'].visible = true;
this['boxani'].y = this.stage.stageHeight / 2 - 1624 / 2;
if (!this._mc) if (!this._mc)
this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']); this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this._mc.stop(); // this._mc.stop();
this._mc.gotoAndStop(1); // this._mc.gotoAndStop(1);
this._mc.anchorOffsetX = 750 / 2; // this._mc.anchorOffsetX = 750 / 2;
this._mc.anchorOffsetY = 500 + 50 + 30; // this._mc.anchorOffsetY = 500 + 50 + 30;
this._mc.x = 750 / 2; // this._mc.x = 750 / 2;
this._mc.y = 500 + 50 + 30; // this._mc.y = 500 + 50 + 30;
this._mc.visible = false; this._mc.visible = false;
await wait(50); await wait(50);
this._mc.visible = true; this._mc.visible = true;
const a = 100, b = 10; this.stopFunc = play1(this._mc, 1, 120);
egret.Tween.get(this._mc, { loop: true }).set({ rotation: b })
.to({ rotation: -b }, a).to({ rotation: b }, a)
.to({ rotation: -b }, a).to({ rotation: b }, a)
.to({ rotation: -b }, a).to({ rotation: b }, a)
.to({ rotation: 0 }, a / 2)
.wait(1000);
} }
} }
async playAni() { async playAni() {
if (this._mc) { if (this._mc) {
egret.Tween.removeTweens(this._mc); await play2(this._mc,121,240);
this._mc.gotoAndPlay(1, true);
await this.onPlaySTOP();
} }
this['boxLayer'].visible = false; this['boxLayer'].visible = false;
} }
async onPlaySTOP() { // async onPlaySTOP() {
return new Promise((r) => { // return new Promise((r) => {
const func = () => { // const func = () => {
if (this._mc.currentFrame >= 100) { // if (this._mc.currentFrame >= 100) {
this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this); // this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this);
this._mc.stop(); // this._mc.stop();
r(); // r();
} // }
} // }
this._mc.addEventListener(egret.Event.ENTER_FRAME, func, this); // this._mc.addEventListener(egret.Event.ENTER_FRAME, func, this);
}); // });
} // }
async onTap_box() { async onTap_box() {
console.log(1) console.log(1)
......
//播放完之后,在一个区间循环 //播放完之后,在一个区间循环
// export const play1 = (mv, start, end, loopStart, loopEnd) => { export const play1 = (mv, loopStart, loopEnd) => {
// const func1 = () => { const func1 = () => {
// if (mv.currentFrame == end) if (mv.currentFrame == loopEnd)
mv.gotoAndPlay(loopStart);
};
// }; mv.gotoAndPlay(loopStart);
// mv.gotoAndPlay(start); mv.addEventListener(egret.Event.ENTER_FRAME, func1, this);
// mv.addEventListener(egret.Event.ENTER_FRAME, func1, this); return () => {
mv.removeEventListener(egret.Event.ENTER_FRAME, func1, this);
}
// mv.addEventListener(egret.Event.ENTER_FRAME, () => { }
// if (this.mv1.currentFrame == this.mv1_end)
// this.mv1.gotoAndPlay(this.mv1_start);
// if (this.mv1.currentFrame == 420) {
// this.mv1_start = 421;
// this.mv1_end = this.mv1.totalFrames;
// }
// }, 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