Commit e2e713c4 authored by wildfirecode's avatar wildfirecode

1

parent dc58073e
...@@ -16,10 +16,12 @@ export default class StartSceneBase extends Scene { ...@@ -16,10 +16,12 @@ export default class StartSceneBase extends Scene {
recordBtn: eui.Button; recordBtn: eui.Button;
rankBtn: eui.Button; rankBtn: eui.Button;
elements: eui.Group; elements: eui.Group;
startBtn: eui.Button;
exemptionTxt: eui.Label; exemptionTxt: eui.Label;
countTxt: eui.Label;
async start(data?) { async start(data?) {
this.startBtn.visible = false;
this.updateGetInfoView(); this.updateGetInfoView();
this.updateExemptionTxt(); this.updateExemptionTxt();
super.start(); super.start();
...@@ -44,10 +46,18 @@ export default class StartSceneBase extends Scene { ...@@ -44,10 +46,18 @@ export default class StartSceneBase extends Scene {
} }
} }
async updateStartBtnStatus() { updateStartBtnStatus() {
if (this.startBtn) {
this.startBtn.visible = true;
this.startBtn.enabled = getStartBtnEnable();
}
} }
updateCountTxt() { updateCountTxt() {
if (this.countTxt) {
this.countTxt.text = getCountTxt();
}
} }
updateExemptionTxt() { updateExemptionTxt() {
...@@ -71,6 +81,12 @@ export default class StartSceneBase extends Scene { ...@@ -71,6 +81,12 @@ export default class StartSceneBase extends Scene {
this.recordBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_recordBtn, this); this.recordBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_recordBtn, this);
if (this.rankBtn) if (this.rankBtn)
this.rankBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_rankBtn, this); this.rankBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_rankBtn, this);
if (this.startBtn)
this.startBtn.once(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
}
onTap_startBtn(e?: egret.Event) {
doStart();
} }
onTap_ruleBtn(e: egret.Event) { onTap_ruleBtn(e: egret.Event) {
......
...@@ -43,7 +43,7 @@ export default class PanelCtrl { ...@@ -43,7 +43,7 @@ export default class PanelCtrl {
if (!this._mask) { if (!this._mask) {
this._mask = new egret.Sprite(); this._mask = new egret.Sprite();
this._mask.touchEnabled = true; this._mask.touchEnabled = true;
this._mask.graphics.beginFill(0, .3); this._mask.graphics.beginFill(0, .7);
this._mask.graphics.drawRect(0, 0, 750, 1624); this._mask.graphics.drawRect(0, 0, 750, 1624);
this._mask.graphics.endFill(); this._mask.graphics.endFill();
} }
...@@ -52,13 +52,13 @@ export default class PanelCtrl { ...@@ -52,13 +52,13 @@ export default class PanelCtrl {
} }
removeMask(tag) { removeMask(tag) {
if (this._mask) { if (this._mask && this._mask.parent) {
if (tag) { if (tag) {
this._parent.removeChild(this._mask) this._parent.removeChild(this._mask)
} }
else else
egret.Tween.get(this._mask).to({ alpha: 0 }, 300, egret.Ease.quartIn).call( egret.Tween.get(this._mask).to({ alpha: 0 }, 300, egret.Ease.quartIn).call(
() => this._parent.removeChild(this._mask), this); () => this._mask.parent&&this._parent.removeChild(this._mask), this);
} }
} }
...@@ -69,7 +69,7 @@ export default class PanelCtrl { ...@@ -69,7 +69,7 @@ export default class PanelCtrl {
private remove(panel: Panel, tag = false) { private remove(panel: Panel, tag = false) {
if (tag) { if (tag) {
this._parent.removeChild(panel); panel.parent && this._parent.removeChild(panel);
this.removeMask(tag); this.removeMask(tag);
return; return;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
}, },
{ {
"name": "preload", "name": "preload",
"keys": "btnLeft1_png,btnRight1_png,toast_png,垃圾桶前盖_png,碗前盖_png,显示器纹路_png,boomalert_png,success_json,failed_json,startbtn_png" "keys": "btnLeft1_png,btnRight1_png,toast_png,垃圾桶前盖_png,碗前盖_png,显示器纹路_png,boomalert_png,success_json,failed_json,startbtn_png,startbtnGray_png"
} }
], ],
"resources": [ "resources": [
...@@ -327,6 +327,11 @@ ...@@ -327,6 +327,11 @@
"name": "startbtn_png", "name": "startbtn_png",
"type": "image", "type": "image",
"url": "assets/startScene/startbtn.png" "url": "assets/startScene/startbtn.png"
},
{
"name": "startbtnGray_png",
"type": "image",
"url": "assets/startScene/startbtnGray.png"
} }
] ]
} }
\ No newline at end of file
...@@ -102,6 +102,16 @@ ...@@ -102,6 +102,16 @@
<e:Image source="toast_png" x="0" y="0"/> <e:Image source="toast_png" x="0" y="0"/>
<e:Label id="toastInfo" text="收集到一个甜筒甜筒" width="100%" height="100%" verticalAlign="middle" textAlign="center" horizontalCenter="0" verticalCenter="0" size="28"/> <e:Label id="toastInfo" text="收集到一个甜筒甜筒" width="100%" height="100%" verticalAlign="middle" textAlign="center" horizontalCenter="0" verticalCenter="0" size="28"/>
</e:Group> </e:Group>
<e:Image id="startBtnBg" source="dot_png" x="0" y="0" width="750" height="1624" touchEnabled="true" scaleX="1" scaleY="1"/>
<e:Button id="startBtn" label="" scaleX="1" scaleY="1" y="1376" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="startbtn_png" source.down="startbtn_png" source.disabled="startbtnGray_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" size="26"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="countTxt" text="0积分每次" width="100%" verticalAlign="middle" textAlign="center" size="19" y="1458.67" textColor="0xffd434"/>
</e:Group> </e:Group>
<e:Button id="recordBtn" label="奖品记录" y="16" scaleX="1" scaleY="1" right="23" visible="false"> <e:Button id="recordBtn" label="奖品记录" y="16" scaleX="1" scaleY="1" right="23" visible="false">
<e:skinName> <e:skinName>
...@@ -137,5 +147,5 @@ ...@@ -137,5 +147,5 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Image id="boomalert" source="boomalert_png" x="0" y="0" scale9Grid="314,472,142,220" alpha="0" touchEnabled="false"/> <e:Image id="boomalert" source="boomalert_png" x="0" y="0" scale9Grid="314,472,142,220" alpha="0" touchEnabled="false" locked="true"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -73,7 +73,9 @@ export default class StartScene extends StartSceneBase { ...@@ -73,7 +73,9 @@ export default class StartScene extends StartSceneBase {
this['group'].addChild(this['leftBtn']); this['group'].addChild(this['leftBtn']);
this['group'].addChild(this['rightBtn']); this['group'].addChild(this['rightBtn']);
this['group'].addChild(this['guild2pic']); this['group'].addChild(this['guild2pic']);
// this.addChild(this['ruleBtn']); this['group'].addChild(this['startBtnBg']);
this['group'].addChild(this['startBtn']);
this['group'].addChild(this['countTxt']);
this['guide'].visible = this['tips'].visible = this['tips2'].visible = this['guild2pic'].visible = this['getitBtn'].visible = false; this['guide'].visible = this['tips'].visible = this['tips2'].visible = this['guild2pic'].visible = this['getitBtn'].visible = false;
// run the engine // run the engine
...@@ -134,7 +136,7 @@ export default class StartScene extends StartSceneBase { ...@@ -134,7 +136,7 @@ export default class StartScene extends StartSceneBase {
reslist.map(res => RES.getResAsync(`${res}_json`)) reslist.map(res => RES.getResAsync(`${res}_json`))
); );
createItems(this); // createItems(this);
let touchLeft = false; let touchLeft = false;
let touchRight = false; let touchRight = false;
...@@ -204,6 +206,14 @@ export default class StartScene extends StartSceneBase { ...@@ -204,6 +206,14 @@ export default class StartScene extends StartSceneBase {
return false; return false;
} }
onTap_startBtn(e?: egret.Event) {
super.onTap_startBtn(e);
this['startBtnBg'].visible=false;
this['startBtn'].visible=false;
this['countTxt'].visible=false;
createItems(this);
}
destroy() { destroy() {
super.destroy(); super.destroy();
} }
......
...@@ -28,7 +28,6 @@ const ontick = () => { ...@@ -28,7 +28,6 @@ const ontick = () => {
else if (tags == 2) { else if (tags == 2) {
frameInterval = 60; frameInterval = 60;
} }
i=1;
const type = types[i]; const type = types[i];
let body; let body;
if (type == LabelType.Candy2) { if (type == LabelType.Candy2) {
...@@ -77,7 +76,7 @@ const ontick = () => { ...@@ -77,7 +76,7 @@ const ontick = () => {
} }
export default ($this: StartScene, start = true) => { export default ($this: StartScene) => {
_this = $this; _this = $this;
egret.startTick(ontick, this) egret.startTick(ontick, 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