Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM-28
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
YM-28
Commits
631f7f50
Commit
631f7f50
authored
May 18, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善
parent
a4761847
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
12 deletions
+27
-12
Exercises.ts
src/app/play/Exercises.ts
+1
-1
Skin.ts
src/app/play/Skin.ts
+18
-10
play.component.ts
src/app/play/play.component.ts
+8
-1
No files found.
src/app/play/Exercises.ts
View file @
631f7f50
...
...
@@ -100,7 +100,7 @@ export class Exercises {
playAudio
(
type
,
callback
=
null
){
if
(
type
==
'
T
'
){
playAudio
(
this
.
audio
);
playAudio
(
this
.
audio
,
true
);
return
this
.
audio
;
}
else
if
(
type
==
'
I
'
){
...
...
src/app/play/Skin.ts
View file @
631f7f50
...
...
@@ -42,7 +42,7 @@ export class Skin {
this
.
scaleX
=
this
.
scaleY
=
sacle
;
if
(
this
.
skinType
==
'
B
'
)
{
this
.
intervalHeight
=
56
*
this
.
scaleY
;
this
.
intervalHeight
=
117
*
this
.
scaleY
;
this
.
intervalWidth
=
28
*
this
.
scaleX
;
...
...
@@ -125,14 +125,22 @@ export class Skin {
textLabel
.
y
=
bg
.
height
/
2
;
bg
.
addChild
(
textLabel
);
const
indexBg
=
new
MySprite
();
indexBg
.
init
(
this
.
images
.
get
(
'
skin_2_index_bg
'
));
indexBg
.
scaleX
=
this
.
scaleX
;
indexBg
.
scaleY
=
this
.
scaleY
;
indexBg
.
x
=
bg
.
width
/
2
;
indexBg
.
y
=
-
indexBg
.
getBoundingBox
().
height
/
2
+
14
*
this
.
scaleY
;
const
indexPic
=
new
MySprite
();
indexPic
.
init
(
this
.
images
.
get
(
'
skin_2_index_bg
'
));
indexPic
.
scaleX
=
this
.
scaleX
;
indexPic
.
scaleY
=
this
.
scaleY
;
indexPic
.
x
=
indexPic
.
getBoundingBox
().
width
/
2
;
indexPic
.
y
=
indexPic
.
getBoundingBox
().
height
/
2
;
const
indexBg
=
new
ShapeRect
();
indexBg
.
setSize
(
indexPic
.
getBoundingBox
().
width
,
indexPic
.
getBoundingBox
().
height
);
indexBg
.
x
=
(
bg
.
width
-
indexBg
.
width
)
/
2
;
indexBg
.
y
=
-
(
indexBg
.
height
-
14
*
this
.
scaleY
);
indexBg
.
alpha
=
0
;
exercises
.
indexBg
=
indexBg
;
bg
.
addChild
(
indexBg
);
indexBg
.
addChild
(
indexPic
);
const
indexLabel
=
new
Label
();
exercises
.
indexLabel
=
indexLabel
;
...
...
@@ -143,8 +151,8 @@ export class Skin {
indexLabel
.
fontColor
=
"
#000000
"
;
indexLabel
.
setMaxSize
(
indexBg
.
getBoundingBox
().
width
);
indexLabel
.
refreshSize
();
indexLabel
.
x
=
-
indexLabel
.
width
/
2
+
6
*
this
.
scaleX
;
indexLabel
.
y
=
-
6
*
this
.
scaleY
;
indexLabel
.
x
=
(
indexBg
.
width
-
indexLabel
.
getBoundingBox
().
width
)
/
2
+
2
*
this
.
scaleX
;
indexLabel
.
y
=
indexBg
.
height
/
2
-
4
*
this
.
scaleY
;
indexLabel
.
alpha
=
0
;
indexBg
.
addChild
(
indexLabel
);
}
...
...
src/app/play/play.component.ts
View file @
631f7f50
...
...
@@ -515,6 +515,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
curAnswerIndex
=
1
;
if
(
this
.
curAudio
)
{
this
.
curAudio
.
pause
();
}
}
...
...
@@ -674,7 +678,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
//起始y坐标
let
startY
=
(
this
.
canvasHeight
-
totalHeight
)
/
2
;
let
startY
=
(
this
.
canvasHeight
-
totalHeight
)
/
2
+
this
.
title
.
titleBg
.
height
;
let
tempStartX
=
startX
;
...
...
@@ -770,6 +774,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
exercisesObj
.
indexShowed
)
{
this
.
curAudio
=
exercisesObj
.
playAudio
(
'
I
'
);
}
else
{
this
.
curAudio
=
exercisesObj
.
playAudio
(
'
T
'
);
}
}
return
;
...
...
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