Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM-22
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-22
Commits
80eba6ad
Commit
80eba6ad
authored
Apr 22, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善
parent
2637e618
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
Exercises.ts
src/app/play/Exercises.ts
+2
-0
play.component.ts
src/app/play/play.component.ts
+19
-9
No files found.
src/app/play/Exercises.ts
View file @
80eba6ad
...
@@ -17,6 +17,8 @@ export class Exercises {
...
@@ -17,6 +17,8 @@ export class Exercises {
/**答案顺序标签 */
/**答案顺序标签 */
answerIndexLabel
:
Label
=
null
;
answerIndexLabel
:
Label
=
null
;
answerBg
:
MySprite
=
null
;
answerShowed
=
false
;
answerShowed
=
false
;
/**单词图片 */
/**单词图片 */
...
...
src/app/play/play.component.ts
View file @
80eba6ad
...
@@ -667,10 +667,11 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -667,10 +667,11 @@ export class PlayComponent implements OnInit, OnDestroy {
const
btnPlay
=
new
MySprite
();
const
btnPlay
=
new
MySprite
();
btnPlay
.
init
(
this
.
images
.
get
(
'
play
'
));
btnPlay
.
init
(
this
.
images
.
get
(
'
play
'
));
btnPlay
.
x
=
this
.
canvasWidth
-
100
*
this
.
mapScale
;
btnPlay
.
y
=
this
.
canvasHeight
-
100
*
this
.
mapScale
;
btnPlay
.
setScaleXY
(
this
.
mapScale
);
btnPlay
.
setScaleXY
(
this
.
mapScale
);
btnPlay
.
x
=
this
.
canvasWidth
-
btnPlay
.
getBoundingBox
().
width
/
2
-
8
*
this
.
mapScale
;
btnPlay
.
y
=
this
.
canvasHeight
-
btnPlay
.
getBoundingBox
().
height
/
2
-
8
*
this
.
mapScale
;
this
.
renderArr
.
push
(
btnPlay
);
this
.
renderArr
.
push
(
btnPlay
);
...
@@ -695,7 +696,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -695,7 +696,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//初始化标题
//初始化标题
const
titePart1Bg
=
new
MySprite
();
const
titePart1Bg
=
new
MySprite
();
titePart1Bg
.
init
(
this
.
images
.
get
(
'
titlePart1Bg
'
));
titePart1Bg
.
init
(
this
.
images
.
get
(
'
titlePart1Bg
'
));
titePart1Bg
.
x
=
titePart1Bg
.
width
/
2
;
titePart1Bg
.
x
=
60
*
this
.
mapScale
+
titePart1Bg
.
width
/
2
;
titePart1Bg
.
y
=
titePart1Bg
.
height
/
2
;
titePart1Bg
.
y
=
titePart1Bg
.
height
/
2
;
//标题1内容
//标题1内容
...
@@ -716,7 +717,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -716,7 +717,7 @@ export class PlayComponent implements OnInit, OnDestroy {
part2
.
fontName
=
"
FUTURAB
"
;
part2
.
fontName
=
"
FUTURAB
"
;
part2
.
fontColor
=
"
#000000
"
;
part2
.
fontColor
=
"
#000000
"
;
part2
.
refreshSize
();
part2
.
refreshSize
();
part2
.
x
=
titePart1Bg
.
width
+
1
0
*
this
.
mapScale
;
part2
.
x
=
titePart1Bg
.
width
+
7
0
*
this
.
mapScale
;
part2
.
y
=
titePart1Bg
.
height
/
2
;
part2
.
y
=
titePart1Bg
.
height
/
2
;
let
bgWidth
=
titePart1Bg
.
width
+
part2
.
getBoundingBox
().
width
+
10
*
this
.
mapScale
;
let
bgWidth
=
titePart1Bg
.
width
+
part2
.
getBoundingBox
().
width
+
10
*
this
.
mapScale
;
...
@@ -860,6 +861,15 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -860,6 +861,15 @@ export class PlayComponent implements OnInit, OnDestroy {
letterBg
.
addChild
(
letter
);
letterBg
.
addChild
(
letter
);
}
}
const
answerBg
=
new
MySprite
();
answerBg
.
init
(
this
.
images
.
get
(
'
answer
'
));
answerBg
.
setScaleXY
(
this
.
mapScale
);
answerBg
.
x
=
-
wordBg
.
width
/
2
+
answerBg
.
width
/
2
+
13
;
answerBg
.
y
=
-
5
*
this
.
mapScale
;
answerBg
.
alpha
=
0
;
exercisesObj
.
answerBg
=
answerBg
;
wordBg
.
addChild
(
answerBg
);
//答案顺序
//答案顺序
const
answerIndex
=
new
Label
();
const
answerIndex
=
new
Label
();
answerIndex
.
text
=
exercises
.
answerIndex
;
answerIndex
.
text
=
exercises
.
answerIndex
;
...
@@ -869,9 +879,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -869,9 +879,9 @@ export class PlayComponent implements OnInit, OnDestroy {
answerIndex
.
refreshSize
();
answerIndex
.
refreshSize
();
answerIndex
.
alpha
=
0
;
answerIndex
.
alpha
=
0
;
answerIndex
.
setMaxSize
(
80
*
this
.
mapScale
);
answerIndex
.
setMaxSize
(
80
*
this
.
mapScale
);
answerIndex
.
y
=
-
5
*
this
.
mapScale
;
answerIndex
.
y
=
0
;
answerIndex
.
x
=
-
wordBg
.
getBoundingBox
().
width
/
2
+
13
*
this
.
mapScale
+
80
*
this
.
mapScale
/
2
;
answerIndex
.
x
=
-
answerIndex
.
getBoundingBox
().
width
/
2
+
13
;
word
Bg
.
addChild
(
answerIndex
);
answer
Bg
.
addChild
(
answerIndex
);
exercisesObj
.
answerIndexLabel
=
answerIndex
;
exercisesObj
.
answerIndexLabel
=
answerIndex
;
}
}
...
@@ -1077,7 +1087,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1077,7 +1087,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
//点击灰色部分,判断是否显示答案
//点击灰色部分,判断是否显示答案
if
(
this
.
checkClickTarget
(
exercises
.
answer
IndexLabel
)){
if
(
this
.
checkClickTarget
(
exercises
.
answer
Bg
)){
if
(
exercises
.
answerIndexLabel
.
text
){
if
(
exercises
.
answerIndexLabel
.
text
){
if
(
this
.
nextShowAnser
==
exercises
.
answerIndexLabel
.
text
){
if
(
this
.
nextShowAnser
==
exercises
.
answerIndexLabel
.
text
){
...
...
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