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
e2e713c4
Commit
e2e713c4
authored
Dec 19, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dc58073e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
12 deletions
+52
-12
StartSceneBase.ts
egret/libs/new_wx/components/StartSceneBase.ts
+18
-2
panelCtrl.ts
egret/libs/new_wx/ctrls/panelCtrl.ts
+4
-4
startbtnGray.png
egret/resource/assets/startScene/startbtnGray.png
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
StartSkin.exml
egret/resource/skins/StartSkin.exml
+11
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+12
-2
createItems.ts
egret/src/startScene/createItems.ts
+1
-2
No files found.
egret/libs/new_wx/components/StartSceneBase.ts
View file @
e2e713c4
...
@@ -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
)
{
...
...
egret/libs/new_wx/ctrls/panelCtrl.ts
View file @
e2e713c4
...
@@ -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
;
}
}
...
...
egret/resource/assets/startScene/startbtnGray.png
0 → 100644
View file @
e2e713c4
11.2 KB
egret/resource/default.res.json
View file @
e2e713c4
...
@@ -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
egret/resource/skins/StartSkin.exml
View file @
e2e713c4
...
@@ -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
egret/src/startScene/StartScene.ts
View file @
e2e713c4
...
@@ -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
();
}
}
...
...
egret/src/startScene/createItems.ts
View file @
e2e713c4
...
@@ -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
)
}
}
...
...
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