Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LST-04-01
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
LST-04-01
Commits
fb0c9675
Commit
fb0c9675
authored
Jan 26, 2021
by
Li MingZhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 开始按钮
parent
569cbdd4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
516 additions
and
53 deletions
+516
-53
play.component.ts
src/app/play/play.component.ts
+44
-3
resources.js
src/app/play/resources.js
+3
-0
start_btn.png
src/assets/play/start_btn.png
+0
-0
yarn.lock
yarn.lock
+469
-50
No files found.
src/app/play/play.component.ts
View file @
fb0c9675
...
...
@@ -3,7 +3,7 @@ import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListene
import
{
Label
,
MyAnimation
,
MySprite
,
shake
,
ShapeRect
,
tweenChange
,
MySprite
,
removeItemFromArr
,
shake
,
ShapeRect
,
tweenChange
,
}
from
'
./Unit
'
;
import
{
res
,
resAudio
}
from
'
./resources
'
;
...
...
@@ -93,6 +93,9 @@ export class PlayComponent implements OnInit, OnDestroy {
timeId
=
null
;
startBtn
;
startLayer
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
onResize
(
event
)
{
this
.
winResizeEventStream
.
next
();
...
...
@@ -635,9 +638,28 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initBg
();
this
.
showNext
();
this
.
initMagnifier
();
this
.
addStartLayer
();
}
addStartLayer
()
{
const
startLayer
=
new
ShapeRect
();
startLayer
.
setSize
(
this
.
canvasWidth
,
this
.
canvasHeight
);
startLayer
.
alpha
=
0.5
;
startLayer
.
fillColor
=
"
#000000
"
;
startLayer
.
x
=
0
;
startLayer
.
y
=
0
;
this
.
startLayer
=
startLayer
;
const
startBtn
=
new
MySprite
();
startBtn
.
init
(
this
.
images
.
get
(
'
start_btn
'
));
startBtn
.
setScaleXY
(
this
.
mapScale
);
startBtn
.
x
=
this
.
canvasWidth
/
2
;
startBtn
.
y
=
this
.
canvasHeight
/
2
;
startLayer
.
addChild
(
startBtn
);
this
.
startBtn
=
startBtn
;
}
...
...
@@ -974,6 +996,12 @@ export class PlayComponent implements OnInit, OnDestroy {
mapDown
(
event
)
{
if
(
this
.
startBtn
&&
this
.
checkClickTarget
(
this
.
startBtn
)){
console
.
log
(
'
in startbtn
'
)
this
.
startBtnClick
();
return
;
}
if
(
!
this
.
canTouch
)
{
return
;
}
...
...
@@ -1054,6 +1082,15 @@ export class PlayComponent implements OnInit, OnDestroy {
}
startBtnClick
()
{
// removeItemFromArr(this.renderArr, this.startLayer);
this
.
startLayer
=
null
;
this
.
startBtn
=
null
;
this
.
initMagnifier
();
this
.
showNext
();
}
update
()
{
...
...
@@ -1075,6 +1112,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
updateArr
(
this
.
textLabelArr
);
this
.
updateArr
(
this
.
endRenderArr
);
if
(
this
.
startLayer
)
{
this
.
startLayer
.
update
();
}
}
...
...
src/app/play/resources.js
View file @
fb0c9675
...
...
@@ -34,6 +34,9 @@ const res = [
[
'
bg_wrong
'
,
"
assets/play/bg_wrong.png
"
],
[
'
bg_zi
'
,
"
assets/play/bg_zi.png
"
],
[
'
icon_tiao
'
,
"
assets/play/icon_tiao.png
"
],
[
'
start_btn
'
,
"
assets/play/start_btn.png
"
],
];
...
...
src/assets/play/start_btn.png
0 → 100644
View file @
fb0c9675
71.1 KB
yarn.lock
View file @
fb0c9675
This diff is collapsed.
Click to expand it.
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