Commit e2e713c4 authored by wildfirecode's avatar wildfirecode

1

parent dc58073e
......@@ -16,10 +16,12 @@ export default class StartSceneBase extends Scene {
recordBtn: eui.Button;
rankBtn: eui.Button;
elements: eui.Group;
startBtn: eui.Button;
exemptionTxt: eui.Label;
countTxt: eui.Label;
async start(data?) {
this.startBtn.visible = false;
this.updateGetInfoView();
this.updateExemptionTxt();
super.start();
......@@ -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() {
if (this.countTxt) {
this.countTxt.text = getCountTxt();
}
}
updateExemptionTxt() {
......@@ -71,6 +81,12 @@ export default class StartSceneBase extends Scene {
this.recordBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_recordBtn, this);
if (this.rankBtn)
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) {
......
......@@ -43,7 +43,7 @@ export default class PanelCtrl {
if (!this._mask) {
this._mask = new egret.Sprite();
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.endFill();
}
......@@ -52,13 +52,13 @@ export default class PanelCtrl {
}
removeMask(tag) {
if (this._mask) {
if (this._mask && this._mask.parent) {
if (tag) {
this._parent.removeChild(this._mask)
}
else
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 {
private remove(panel: Panel, tag = false) {
if (tag) {
this._parent.removeChild(panel);
panel.parent && this._parent.removeChild(panel);
this.removeMask(tag);
return;
}
......
......@@ -10,7 +10,7 @@
},
{
"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": [
......@@ -327,6 +327,11 @@
"name": "startbtn_png",
"type": "image",
"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 @@
<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: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:Button id="recordBtn" label="奖品记录" y="16" scaleX="1" scaleY="1" right="23" visible="false">
<e:skinName>
......@@ -137,5 +147,5 @@
</e:Skin>
</e:skinName>
</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>
\ No newline at end of file
......@@ -73,7 +73,9 @@ export default class StartScene extends StartSceneBase {
this['group'].addChild(this['leftBtn']);
this['group'].addChild(this['rightBtn']);
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;
// run the engine
......@@ -134,7 +136,7 @@ export default class StartScene extends StartSceneBase {
reslist.map(res => RES.getResAsync(`${res}_json`))
);
createItems(this);
// createItems(this);
let touchLeft = false;
let touchRight = false;
......@@ -204,6 +206,14 @@ export default class StartScene extends StartSceneBase {
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() {
super.destroy();
}
......
......@@ -28,7 +28,6 @@ const ontick = () => {
else if (tags == 2) {
frameInterval = 60;
}
i=1;
const type = types[i];
let body;
if (type == LabelType.Candy2) {
......@@ -77,7 +76,7 @@ const ontick = () => {
}
export default ($this: StartScene, start = true) => {
export default ($this: StartScene) => {
_this = $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