Commit 27ce5e84 authored by shunx 马's avatar shunx 马

111

parent 8be616ad
This diff is collapsed.
...@@ -728,15 +728,7 @@ export const SkinJson ={ ...@@ -728,15 +728,7 @@ export const SkinJson ={
"y": 0, "y": 0,
"type": "container", "type": "container",
"children": [ "children": [
{
"name": "prize_bg2",
"x": 0,
"y": 0,
"type": "sprite",
"props": {
"source": "prize_bg2.png"
}
},
{ {
"name": "prize_bg", "name": "prize_bg",
"x": 78, "x": 78,
......
import { showPanel } from "../../module/ctrls";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField"; import centerTextField from "../common/centerTextField";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import { PrizePanel } from "./prize";
let section; let section;
export class CostPanel extends Panel { export class CostPanel extends Panel {
...@@ -11,13 +13,9 @@ export class CostPanel extends Panel { ...@@ -11,13 +13,9 @@ export class CostPanel extends Panel {
getObject(this, "cost_tips").text = `消耗${cost}积分拆开1个盲盒`; getObject(this, "cost_tips").text = `消耗${cost}积分拆开1个盲盒`;
} }
cost_open() { cost_open() {
const indexsvga = new FYGE.MovieClip(RES.getRes("盲盒开启-打开-输出.svga")); this.dispatchEvent("stopIndexEnterFrame", { });
indexsvga.mouseChildren = indexsvga.mouseEnable = false; this.hidePanel();
// indexsvga.position.set(100,100) showPanel(PrizePanel)
this.addChild(indexsvga);
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
});
} }
get groupNames() { get groupNames() {
...@@ -41,6 +39,11 @@ export class CostPanel extends Panel { ...@@ -41,6 +39,11 @@ export class CostPanel extends Panel {
this.cost_open, this.cost_open,
this this
); );
getObject(this, "cost_close").addEventListener(
FYGE.MouseEvent.CLICK,
this.closePop,
this
)
} }
removeEvents() { removeEvents() {
...@@ -52,7 +55,11 @@ export class CostPanel extends Panel { ...@@ -52,7 +55,11 @@ export class CostPanel extends Panel {
); );
} }
protected get closeBtns(): any[] { closePop() {
return [getObject(this, "cost_close")]; this.stage.dispatchEvent("restartEnterFrame", {})
this.hidePanel();
} }
} }
...@@ -13,11 +13,32 @@ export class NoPrizePanel extends Panel { ...@@ -13,11 +13,32 @@ export class NoPrizePanel extends Panel {
get groupNames() { return ["noprize"] } get groupNames() { return ["noprize"] }
get skinName() { return "noprize" } get skinName() { return "noprize" }
prizeContainer: FYGE.Sprite;
initUi() { initUi() {
super.initUi(); super.initUi();
var skin = RES.getSkinDataByName(this.skinName); var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y); this.position.set(skin.x, skin.y);
// centerTextField(getObject(this,'prize_name'),731); centerTextField(getObject(this, 'prize_name'), 731);
centerTextField(getObject(this, 'prize_tips'), 731);
const prizePop = getObject(this, "prizeInner");
prizePop.visible = false;
const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒开启-打开-输出.svga'));
const container = this.prizeContainer = prizePop.addChild(new FYGE.Sprite);
container.position.set(286, 276);
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
indexsvga.position.set(731/2-750/2,720/2-1624/2)
this.addChild(indexsvga);
this.addChild(prizePop)
indexsvga.addEventListener(FYGE.Event.ENTER_FRAME, () => {
if (indexsvga.currentFrame == indexsvga.totalFrames-10) {
prizePop.visible = true;
}
},this)
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
this.removeChild(indexsvga)
});
} }
initEvents() { initEvents() {
......
...@@ -2,8 +2,10 @@ import { RES } from "../../module/RES"; ...@@ -2,8 +2,10 @@ import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField"; import centerTextField from "../common/centerTextField";
import { createMask } from "../common/createMask"; import { createMask } from "../common/createMask";
import { showPanel } from "../../module/ctrls";
import { getImage } from "../common/getImage"; import { getImage } from "../common/getImage";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import { CostPanel } from "./cost";
let section; let section;
export class PrizePanel extends Panel { export class PrizePanel extends Panel {
...@@ -20,7 +22,7 @@ export class PrizePanel extends Panel { ...@@ -20,7 +22,7 @@ export class PrizePanel extends Panel {
} }
click_prize_open() { click_prize_open() {
console.log('click_prize_open'); console.log('click_prize_open')
} }
get groupNames() { return ["prize"] } get groupNames() { return ["prize"] }
...@@ -33,10 +35,23 @@ export class PrizePanel extends Panel { ...@@ -33,10 +35,23 @@ export class PrizePanel extends Panel {
this.position.set(skin.x, skin.y); this.position.set(skin.x, skin.y);
centerTextField(getObject(this, 'prize_name'), 731); centerTextField(getObject(this, 'prize_name'), 731);
centerTextField(getObject(this, 'prize_tips'), 731); centerTextField(getObject(this, 'prize_tips'), 731);
const prizePop = getObject(this, "prizeInner");
const container = this.prizeContainer = this.addChild(new FYGE.Sprite); prizePop.visible = false;
const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒开启-打开-输出.svga'));
const container = this.prizeContainer = prizePop.addChild(new FYGE.Sprite);
container.position.set(286, 276); container.position.set(286, 276);
window['q'] = container; indexsvga.mouseChildren = indexsvga.mouseEnable = false;
indexsvga.position.set(731/2-750/2,720/2-1624/2)
this.addChild(indexsvga);
this.addChild(prizePop)
indexsvga.addEventListener(FYGE.Event.ENTER_FRAME, () => {
if (indexsvga.currentFrame == indexsvga.totalFrames-13) {
prizePop.visible = true;
}
},this)
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
this.removeChild(indexsvga)
});
} }
initEvents() { initEvents() {
...@@ -48,6 +63,11 @@ export class PrizePanel extends Panel { ...@@ -48,6 +63,11 @@ export class PrizePanel extends Panel {
getObject(this, 'prize_open').removeEventListener(FYGE.MouseEvent.CLICK, this.click_prize_open, this); getObject(this, 'prize_open').removeEventListener(FYGE.MouseEvent.CLICK, this.click_prize_open, this);
} }
hidePanel() {
this.stage.dispatchEvent("restartEnterFrame",{})
super.hidePanel();
}
protected get closeBtns(): any[] { protected get closeBtns(): any[] {
return [getObject(this, 'prize_close')] return [getObject(this, 'prize_close')]
} }
......
...@@ -12,9 +12,11 @@ let boxGroupDown = []; ...@@ -12,9 +12,11 @@ let boxGroupDown = [];
let boxGroupUpRight = []; let boxGroupUpRight = [];
export class BoxGroup extends FYGE.Sprite { export class BoxGroup extends FYGE.Sprite {
indexsvga;
constructor() { constructor() {
super(); super();
this.initBox(); this.initBox();
} }
...@@ -70,8 +72,8 @@ export class BoxGroup extends FYGE.Sprite { ...@@ -70,8 +72,8 @@ export class BoxGroup extends FYGE.Sprite {
} }
handleClick(e) { handleClick(e) {
const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒选中-输出.svga')); const indexsvga = this.indexsvga = new FYGE.MovieClip(RES.getRes('盲盒选中-输出.svga'));
this.dispatchEvent("stopIndexEnterFrame", { isMove: false }); this.dispatchEvent("stopIndexEnterFrame", { });
indexsvga.mouseChildren = indexsvga.mouseEnable = false; indexsvga.mouseChildren = indexsvga.mouseEnable = false;
indexsvga.position.set(e.target.x-200,e.target.y-190) indexsvga.position.set(e.target.x-200,e.target.y-190)
this.addChild(indexsvga); this.addChild(indexsvga);
......
...@@ -18,7 +18,7 @@ import { sendWebNet } from "../WebNet"; ...@@ -18,7 +18,7 @@ import { sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName"; import { WebNetName } from "../WebNetName";
let boxGroup; let boxGroup: BoxGroup;
let boxArea; let boxArea;
export class IndexScene extends Scene { export class IndexScene extends Scene {
...@@ -32,15 +32,19 @@ export class IndexScene extends Scene { ...@@ -32,15 +32,19 @@ export class IndexScene extends Scene {
start() { start() {
super.start(); super.start();
this.getIndex(); this.getIndex();
// showPanel(SharePanel);
getObject(this,'index_sharetips').visible=false; getObject(this,'index_sharetips').visible=false;
this.initContainer(); this.initContainer();
this.initmask(); this.initmask();
const limit = getObject(this, 'index_timestips2');
limit.position.set(255, 1129);
const credits = getObject(this, 'index_moneytips2');
credits.position.set(608, 1129);
const list = new FYGE.ScrollList(ScrollItem, 131+20, 131, 620, 154, false); const list = new FYGE.ScrollList(ScrollItem, 131+20, 131, 620, 154, false);
const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png']; const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'];
list.updateData(array); list.updateData(array);
list.position.set(80, 1240+30); list.position.set(80, 1240+30);
this.addChild(list); this.addChild(list);
this.stage.addEventListener("restartEnterFrame",this.onRestartFrame,this);
} }
initContainer() { initContainer() {
...@@ -64,6 +68,7 @@ export class IndexScene extends Scene { ...@@ -64,6 +68,7 @@ export class IndexScene extends Scene {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
this.addEventListener("restartEnterFrame", this.onRestartFrame, this);
const rulePop = getObject(this,'index_rule'); const rulePop = getObject(this,'index_rule');
rulePop && rulePop.addEventListener(FYGE.MouseEvent.CLICK, this.toRule, this); rulePop && rulePop.addEventListener(FYGE.MouseEvent.CLICK, this.toRule, this);
} }
...@@ -73,13 +78,17 @@ export class IndexScene extends Scene { ...@@ -73,13 +78,17 @@ export class IndexScene extends Scene {
boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this); boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this);
} }
onRestartFrame() {
boxGroup.removeChild(boxGroup.indexsvga);
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
}
toRule() { toRule() {
showPanel(RulePanel); showPanel(RulePanel);
} }
removeEvent() { removeEvent() {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
} }
getIndex = async () => { getIndex = async () => {
...@@ -95,6 +104,5 @@ export class IndexScene extends Scene { ...@@ -95,6 +104,5 @@ export class IndexScene extends Scene {
} }
} }
} }
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