Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LST-06
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-06
Commits
ef072d79
Commit
ef072d79
authored
Jan 26, 2021
by
Li MingZhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fear: 开始按钮
parent
061c9f6a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
515 additions
and
54 deletions
+515
-54
play.component.ts
src/app/play/play.component.ts
+41
-2
resources.js
src/app/play/resources.js
+3
-0
start_btn.png
src/assets/play/start_btn.png
+0
-0
yarn.lock
yarn.lock
+471
-52
No files found.
src/app/play/play.component.ts
View file @
ef072d79
...
@@ -2,7 +2,7 @@ import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListene
...
@@ -2,7 +2,7 @@ import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListene
import
{
import
{
Label
,
Label
,
MySprite
,
ShapeRect
,
tweenChange
,
MySprite
,
removeItemFromArr
,
ShapeRect
,
tweenChange
,
}
from
'
./Unit
'
;
}
from
'
./Unit
'
;
import
{
res
,
resAudio
}
from
'
./resources
'
;
import
{
res
,
resAudio
}
from
'
./resources
'
;
...
@@ -81,6 +81,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -81,6 +81,8 @@ export class PlayComponent implements OnInit, OnDestroy {
rightAnswer
:
Answer
;
rightAnswer
:
Answer
;
startBtn
;
startLayer
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
onResize
(
event
)
{
onResize
(
event
)
{
...
@@ -551,7 +553,29 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -551,7 +553,29 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initStage
();
this
.
initStage
();
this
.
showNewExerices
();
this
.
addStartLayer
();
// this.showNewExerices();
}
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
;
this
.
renderArr
.
push
(
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
;
}
}
initBg
()
{
initBg
()
{
...
@@ -584,11 +608,19 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -584,11 +608,19 @@ export class PlayComponent implements OnInit, OnDestroy {
mapDown
(
event
)
{
mapDown
(
event
)
{
if
(
this
.
startBtn
&&
this
.
checkClickTarget
(
this
.
startBtn
)){
console
.
log
(
'
in startbtn
'
)
this
.
startBtnClick
();
return
;
}
console
.
log
(
this
.
canTouch
);
console
.
log
(
this
.
canTouch
);
if
(
!
this
.
canTouch
)
{
if
(
!
this
.
canTouch
)
{
return
;
return
;
}
}
if
(
this
.
checkClickTarget
(
this
.
stage
.
audioAni
.
bg
)){
if
(
this
.
checkClickTarget
(
this
.
stage
.
audioAni
.
bg
)){
if
(
this
.
stage
.
audioAni
.
playing
){
if
(
this
.
stage
.
audioAni
.
playing
){
this
.
stage
.
audioAni
.
pauseAudio
();
this
.
stage
.
audioAni
.
pauseAudio
();
...
@@ -660,6 +692,13 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -660,6 +692,13 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
startBtnClick
()
{
removeItemFromArr
(
this
.
renderArr
,
this
.
startLayer
);
this
.
startBtn
=
null
;
this
.
showNewExerices
();
}
clickAnswer
(
flag
){
clickAnswer
(
flag
){
this
.
canTouch
=
false
;
this
.
canTouch
=
false
;
...
...
src/app/play/resources.js
View file @
ef072d79
...
@@ -44,6 +44,9 @@ const res = [
...
@@ -44,6 +44,9 @@ const res = [
[
'
petal_6
'
,
"
assets/play/petal_6.png
"
],
[
'
petal_6
'
,
"
assets/play/petal_6.png
"
],
[
'
petal_7
'
,
"
assets/play/petal_7.png
"
],
[
'
petal_7
'
,
"
assets/play/petal_7.png
"
],
[
'
petal_8
'
,
"
assets/play/petal_8.png
"
],
[
'
petal_8
'
,
"
assets/play/petal_8.png
"
],
[
'
start_btn
'
,
"
assets/play/start_btn.png
"
],
];
];
...
...
src/assets/play/start_btn.png
0 → 100644
View file @
ef072d79
54.6 KB
yarn.lock
View file @
ef072d79
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