Commit 639f1b82 authored by wildfirecode's avatar wildfirecode

1

parent 839b1d1e
......@@ -26,3 +26,4 @@ bin-release
.DS_Store
egret/.DS_Store
**/*/.tmproject
egret/.DS_Store
No preview for this file type
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"startscene_5","version":5,"files":["../assets/startScene/ruleBtn.png","../assets/startScene/optionBtn.png"]}
\ No newline at end of file
......@@ -21,8 +21,8 @@
"name": "guide"
},
{
"name": "preload",
"keys": "thumb_pb_png,track_pb_png"
"keys": "ruleBtn_png,optionBtn_png",
"name": "startscene"
}
],
"resources": [
......@@ -139,14 +139,14 @@
"name": "guide_dialog_png"
},
{
"name": "thumb_pb_png",
"url": "assets/startScene/optionBtn.png",
"type": "image",
"url": "assets/ProgressBar/thumb_pb.png"
"name": "optionBtn_png"
},
{
"name": "track_pb_png",
"url": "assets/startScene/ruleBtn.png",
"type": "image",
"url": "assets/ProgressBar/track_pb.png"
"name": "ruleBtn_png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Skin class="StartSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="ruleBtn" label="" x="29.27" y="42">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="ruleBtn_png" source.down="ruleBtn_png" source.disabled="ruleBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="optionBtn" label="" x="632.57" y="42">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="optionBtn_png" source.down="optionBtn_png" source.disabled="optionBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
......@@ -18,6 +18,7 @@ class Main extends MainBase {
super.getData();
NetManager.ins.getInfo();
}
protected async createGameScene() {
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
......
import Panel from "../views/Panel";
import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RulePanel extends Panel {
constructor(){
super()
NetManager.ins.getRule(()=>{
var tx:egret.TextField = new egret.TextField;
constructor() {
super();
NetManager.ins.getRule(() => {
var tx: egret.TextField = new egret.TextField;
tx.width = this.stage.stageWidth - 220;
tx.textFlow = (new egret.HtmlTextParser).parser(
DataManager.ins.getRuleData ? DataManager.ins.getRuleData.ruleText :
(DataManager.ins.ajaxElementData ? DataManager.ins.ajaxElementData.rule :
(window['ruleCFG'] ? window['ruleCFG'] : "规则")
)
DataManager.ins.getRuleData ? DataManager.ins.getRuleData.ruleText :
(DataManager.ins.ajaxElementData ? DataManager.ins.ajaxElementData.rule :
(window['ruleCFG'] ? window['ruleCFG'] : "规则")
)
);
tx.x = 110;
tx.y = 330;
tx.textColor = 0x333333;
this.addChild( tx );
this.addChild(tx);
})
}
......
......@@ -12,6 +12,8 @@ import BoxOpenState from "./view/BoxOpenState";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import submitAfterDostart from "../../libs/new_tw/ctrls/submitAfterDostart";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
const { TouchEvent } = egret;
export default class StartScene extends Scene {
......@@ -23,6 +25,7 @@ export default class StartScene extends Scene {
static NET_RANGE = 200;
private _debug: debug;
async start(data?) {
this.addUI();
const t1 = Date.now() - __t0__;
console.log(`startScene添加到stage:${t1 / 1000}s`)
......@@ -205,6 +208,23 @@ export default class StartScene extends Scene {
});
}
addUI() {
const uiLayer = this.getLayer(LayerTypes.ui);
uiLayer.addChild(this['ruleBtn']);
uiLayer.addChild(this['optionBtn']);
this['ruleBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
this['optionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_optionBtn, this);
}
onTap_ruleBtn() {
// alert('onTap_ruleBtn');
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
}
onTap_optionBtn() {
alert('onTap_optionBtn')
}
protected get layerKeys() {
return [
LayerTypes.bg,
......@@ -213,10 +233,14 @@ export default class StartScene extends Scene {
LayerTypes.net,
LayerTypes.box,
LayerTypes.monkey,
LayerTypes.ui,
LayerTypes.top,
]
}
ruleBtn: eui.Button;
optionBtn: eui.Button;
protected get skinKey() { return 'Start' }
get guideView() { return this._guideView }
get monkey() { return this._monkey }
......
enum LayerTypes {
bg, kids, box, net, monkey, guide, top
bg, kids, box, net, monkey, guide, top,ui
}
export default LayerTypes
\ No newline at end of file
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