Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔立强
db-game-template
Commits
08228071
Commit
08228071
authored
Nov 09, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e2a614d7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
MainBase.ts
egret/libs/new_wx/MainBase.ts
+5
-5
StartSceneBase.ts
egret/libs/new_wx/components/StartSceneBase.ts
+28
-1
StartSkin.exml
egret/resource/skins/StartSkin.exml
+1
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
08228071
...
...
@@ -24,6 +24,9 @@ export default class MainBase extends eui.UILayer {
super
();
check_webp_feature
();
Loading
.
instace
.
loadImage
();
DataManager
.
ins
.
gameCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
gameId
=
window
[
"gameId"
];
this
.
getData
();
}
protected
registerModules
()
{
...
...
@@ -82,9 +85,6 @@ export default class MainBase extends eui.UILayer {
egret
.
ImageLoader
.
crossOrigin
=
"anonymous"
;
DataManager
.
ins
.
gameCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
gameId
=
window
[
"gameId"
];
layers
.
init
(
this
);
Loading
.
init
(
layers
.
topLayer
);
Loading
.
instace
.
show
();
...
...
@@ -98,7 +98,7 @@ export default class MainBase extends eui.UILayer {
this
.
loadFirstScreen
();
Loading
.
instace
.
show
();
this
.
getData
();
RES
.
setMaxLoadingThread
(
10
);
this
.
runGame
().
catch
(
e
=>
{
console
.
log
(
e
);
...
...
egret/libs/new_wx/components/StartSceneBase.ts
View file @
08228071
...
...
@@ -16,16 +16,37 @@ export default class StartSceneBase extends Scene {
recordBtn
:
eui
.
Button
;
startBtn
:
eui
.
Button
;
rankBtn
:
eui
.
Button
;
countdownTxt
:
eui
.
Label
;
countTxt
:
eui
.
Label
;
exemptionTxt
:
eui
.
Label
;
bg
:
eui
.
Image
;
_timer
:
egret
.
Timer
;
async
start
(
data
?)
{
this
.
startBtn
.
visible
=
false
;
this
.
updateGetInfoView
();
this
.
updateExemptionTxt
();
this
.
showElements
();
this
.
autoStart
();
}
autoStart
()
{
const
n
=
15
;
const
timer
=
new
egret
.
Timer
(
1000
,
n
);
timer
.
addEventListener
(
egret
.
TimerEvent
.
TIMER
,
()
=>
{
this
.
updateCountdownTxt
(
n
-
timer
.
currentCount
);
},
this
);
timer
.
once
(
egret
.
TimerEvent
.
TIMER_COMPLETE
,
()
=>
{
this
.
onTap_startBtn
();
},
this
);
timer
.
start
();
this
.
updateCountdownTxt
(
n
);
this
.
_timer
=
timer
;
}
updateCountdownTxt
(
n
)
{
this
.
countdownTxt
.
text
=
`生活不容易,(
${
n
}
)秒后帮您自动开始游戏`
}
showElements
()
{
...
...
@@ -105,7 +126,8 @@ export default class StartSceneBase extends Scene {
onTap_recordBtn
(
e
:
egret
.
Event
)
{
}
async
onTap_startBtn
(
e
:
egret
.
Event
)
{
async
onTap_startBtn
(
e
?:
egret
.
Event
)
{
this
.
stopTimer
();
egret
.
Tween
.
removeTweens
(
this
.
startBtn
);
egret
.
Tween
.
get
(
this
.
startBtn
).
to
({
horizontalCenter
:
750
},
200
);
egret
.
Tween
.
get
(
this
.
countTxt
).
to
({
horizontalCenter
:
-
750
},
200
);
...
...
@@ -113,6 +135,11 @@ export default class StartSceneBase extends Scene {
await
wait
(
200
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
PALY_SCENE
);
}
private
stopTimer
()
{
this
.
_timer
.
stop
();
egret
.
Tween
.
get
(
this
.
countdownTxt
).
to
({
alpha
:
0
},
200
);
}
onTap_rankBtn
(
e
:
egret
.
Event
)
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RANK_PANEL
);
}
...
...
egret/resource/skins/StartSkin.exml
View file @
08228071
...
...
@@ -10,6 +10,7 @@
</e:skinName>
</e:Button>
<e:Label
id=
"countTxt"
text=
"Label"
width=
"100%"
verticalAlign=
"middle"
textAlign=
"center"
y=
"901"
horizontalCenter=
"0"
/>
<e:Label
id=
"countdownTxt"
text=
""
width=
"100%"
verticalAlign=
"middle"
textAlign=
"center"
y=
"729"
horizontalCenter=
"0"
/>
<e:Label
id=
"exemptionTxt"
text=
"*兑换项与活动均与设备制造商Apple Inc.公司无关*"
width=
"100%"
horizontalCenter=
"0"
bottom=
"5"
verticalAlign=
"middle"
textAlign=
"center"
textColor=
"0x333333"
size=
"18"
/>
<e:Button
id=
"recordBtn"
label=
"奖品记录"
y=
"16"
scaleX=
"1"
scaleY=
"1"
right=
"23"
>
<e:skinName>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment