Commit 89ab2f16 authored by 邱旭's avatar 邱旭

1

parent e31c8680
{"file":"hbCutTimeFont.png","frames":{
"0":{"x":116,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"1":{"x":57,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"2":{"x":174,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"3":{"x":58,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"4":{"x":116,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"5":{"x":0,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"6":{"x":0,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"7":{"x":173,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"8":{"x":58,"y":83,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"9":{"x":0,"y":83,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"0":{"x":0,"y":0,"w":56,"h":81,"offX":-0.5,"offY":0,"sourceW":55,"sourceH":81},
"1":{"x":58,"y":0,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"2":{"x":115,"y":0,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"3":{"x":171,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"4":{"x":0,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"5":{"x":114,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"6":{"x":57,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"7":{"x":57,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"8":{"x":172,"y":0,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"9":{"x":0,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"分":{"x":153,"y":166,"w":36,"h":34,"offX":3,"offY":23,"sourceW":42,"sourceH":81},
"秒":{"x":114,"y":166,"w":37,"h":35,"offX":2,"offY":23,"sourceW":42,"sourceH":81},
"时":{"x":191,"y":166,"w":34,"h":34,"offX":4,"offY":23,"sourceW":42,"sourceH":81}}}
"时":{"x":191,"y":166,"w":34,"h":34,"offX":4,"offY":23,"sourceW":42,"sourceH":81}}}
\ No newline at end of file
{"file":"hbCutTimeFont.png","frames":{
"0":{"x":116,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"1":{"x":57,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"2":{"x":174,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"3":{"x":58,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"4":{"x":116,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"5":{"x":0,"y":0,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"6":{"x":0,"y":166,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"7":{"x":173,"y":83,"w":55,"h":81,"offX":0,"offY":0,"sourceW":55,"sourceH":81},
"8":{"x":58,"y":83,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"9":{"x":0,"y":83,"w":56,"h":81,"offX":0,"offY":0,"sourceW":56,"sourceH":81},
"分":{"x":153,"y":166,"w":36,"h":34,"offX":3,"offY":23,"sourceW":42,"sourceH":81},
"秒":{"x":114,"y":166,"w":37,"h":35,"offX":2,"offY":23,"sourceW":42,"sourceH":81},
"时":{"x":191,"y":166,"w":34,"h":34,"offX":4,"offY":23,"sourceW":42,"sourceH":81}}}
......@@ -189,7 +189,7 @@
"name": "hbnoprize"
},
{
"keys": "1_png,2_png,3_png,hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGameNumFont_fnt,hbGameNumFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png",
"keys": "hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGameNumFont_fnt,hbGameNumFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png,hbGame_1_png,hbGame_2_png,hbGame_3_png",
"name": "hbgame"
},
{
......@@ -2998,21 +2998,6 @@
"type": "image",
"name": "hbNoPrize_btn_png"
},
{
"url": "assets/hbGame/1.png",
"type": "image",
"name": "1_png"
},
{
"url": "assets/hbGame/2.png",
"type": "image",
"name": "2_png"
},
{
"url": "assets/hbGame/3.png",
"type": "image",
"name": "3_png"
},
{
"url": "assets/hbGame/hbGameCutTimeFont.fnt",
"type": "font",
......@@ -3127,6 +3112,21 @@
"url": "assets/redbagalert/redbagalert红包任务.png",
"type": "image",
"name": "redbagalert红包任务_png"
},
{
"url": "assets/hbGame/hbGame_1.png",
"type": "image",
"name": "hbGame_1_png"
},
{
"url": "assets/hbGame/hbGame_2.png",
"type": "image",
"name": "hbGame_2_png"
},
{
"url": "assets/hbGame/hbGame_3.png",
"type": "image",
"name": "hbGame_3_png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
<e:Skin class="HbGame" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<e:Button id="ok_btn" label="" y="764" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="hbNoPrize_btn_png" source.down="hbNoPrize_btn_png" source.disabled="hbNoPrize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label text="红包雨" y="325" size="124" textColor="0xff0000" horizontalCenter="0"/>
<e:Group x="610" y="48">
<e:Group right="40" top="45">
<e:Image y="0" source="hbGame_num_bg_png" horizontalCenter="0"/>
<e:BitmapLabel y="33" font="hbGameNumFont_fnt" text="0" horizontalCenter="0"/>
<e:BitmapLabel id="numLabel" y="33" font="hbGameNumFont_fnt" text="0" horizontalCenter="0"/>
</e:Group>
<e:Group y="45" horizontalCenter="0">
<e:Image y="0" horizontalCenter="0" source="hbGame_CutTime_bg_png"/>
<e:BitmapLabel y="65" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0"/>
<e:Image y="30" source="hbGame_CutTime_progress_png" horizontalCenter="-0.5"/>
<e:BitmapLabel id="cutTimeLabel" y="65" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0"/>
</e:Group>
<e:Group id="readyGroup" y="310.5" horizontalCenter="0" width="560" height="500">
<e:Image id="readyTips" y="0" horizontalCenter="0" source="hbGame_tips_png"/>
<e:Image id="readyCutTime" y="118" horizontalCenter="0" x="10" source="hbGame_1_png"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -91,7 +91,7 @@ export default class MapScene extends Scene {
this.sendInvite();
PanelCtrl.instance.show("HbCutTime");
// PanelCtrl.instance.show("HbGame");
this.updateMyInfo();
this.updateAdData();
......
import Panel from "../../../libs/new_wx/components/Panel";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import getHomeData from "../../getHomeData";
import { changeMapScene } from "../../startScene/StartScene";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { addAdComp } from "../BoxPanel";
import Utils from "../../Utils";
import CutTimer from "../../CutTimer";
/**
* 红包雨主游戏
*/
export default class HbGame extends Panel {
public closeBtn:eui.Button;
public ok_btn:eui.Button;
public numLabel: eui.BitmapLabel;
public cutTimeLabel: eui.BitmapLabel;
public readyGroup: eui.Group;
public readyTips: eui.Image;
public readyCutTime: eui.Image;
constructor(data) {
super();
......@@ -28,19 +24,49 @@ export default class HbGame extends Panel {
}
private readyTimeEffect() {
let obj = this.readyCutTime
, _scaleMin = 0.1 // 缩放最小值
, _scaleMax = 1.7 // 缩放最大值
, t1 = 450 // 缩放第一阶段时间
, tw = 50 // 缩放中间停留时间 // t1 + tw + t2 = 1000; 1秒
, t2 = 500 // 缩放第二阶段时间
, _ease = egret.Ease.quadInOut;
this.readyGroup.visible = true;
obj.source = "hbGame_3_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
obj.source = "hbGame_2_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
obj.source = "hbGame_1_png", obj.scaleX = obj.scaleY = _scaleMin, obj.alpha = 1;
egret.Tween.get(obj).to({scaleX: 1, scaleY: 1, alpha: 1}, t1, _ease).wait(tw).call(() => {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
this.readyGroup.visible = false;
})
});
})
});
})
});
}
private readyTipsEffect() {
this.readyTips.alpha = 0;
egret.Tween.get(this.readyTips).to({alpha: 1}, 300).call(() => this.readyTimeEffect());
}
protected onSkinComplete() {
this.readyGroup.visible = false;
setTimeout(() => this.readyTipsEffect(), 1000);
}
initEvents() {
super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
removeEvents() {
super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
}
onTouchTap_closeBtn() {
......
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