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

111

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