Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM-42
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-42
Commits
f0c7c95c
Commit
f0c7c95c
authored
Sep 18, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复标题显示问题,修复弹出大框没有灰色背景的问题,修复各个字体的问题
parent
c76ad82f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
26 deletions
+45
-26
Exercises.ts
src/app/play/Exercises.ts
+12
-11
Title.ts
src/app/play/Title.ts
+18
-12
play.component.ts
src/app/play/play.component.ts
+15
-3
No files found.
src/app/play/Exercises.ts
View file @
f0c7c95c
...
...
@@ -82,9 +82,10 @@ export class Exercises {
this
.
initB
(
scaleX
,
scaleY
,
type
);
}
let
width
=
1101
*
scaleX
;
let
height
=
479
*
scaleY
;
let
width
=
1101
*
scaleX
-
20
*
scaleX
;
let
height
=
479
*
scaleY
-
20
*
scaleY
;
const
cardBg
=
new
MySprite
();
cardBg
.
init
(
this
.
images
.
get
(
'
box
'
));
cardBg
.
scaleX
=
scaleX
;
...
...
@@ -496,8 +497,8 @@ export class Exercises {
let
textHeight
=
addText
(
contentBg
,
skin
,
72
);
//图片最大高度和宽度
let
maxWidth
=
width
-
40
*
this
.
scale
Y
;
let
maxHeight
=
height
-
80
*
this
.
scale
X
-
textHeight
.
height
;
let
maxWidth
=
width
-
40
*
this
.
scale
X
;
let
maxHeight
=
height
-
80
*
this
.
scale
Y
-
textHeight
.
height
;
const
contentPic
=
new
MySprite
();
contentPic
.
init
(
this
.
images
.
get
(
this
.
exercisesData
.
pic_url
));
...
...
@@ -507,9 +508,9 @@ export class Exercises {
if
(
scale
<
1
)
{
contentPic
.
setScaleXY
(
scale
);
}
contentPic
.
x
=
width
/
2
;
contentPic
.
y
=
height
-
textHeight
.
sHeight
-
17
*
this
.
scaleY
-
contentPic
.
getBoundingBox
().
height
/
2
-
22
*
this
.
scaleY
;
contentPic
.
y
=
60
*
this
.
scaleY
+
maxHeight
/
2
;
contentBg
.
addChild
(
contentPic
);
}
...
...
@@ -519,9 +520,9 @@ export class Exercises {
closePic
.
scaleX
=
parent
.
scaleX
;
closePic
.
scaleY
=
parent
.
scaleY
;
closePic
.
x
=
parent
.
width
;
closePic
.
x
=
parent
.
width
-
5
*
this
.
scaleX
;
closePic
.
y
=
0
;
closePic
.
y
=
0
+
5
*
this
.
scaleY
;
parent
.
addChild
(
closePic
);
return
closePic
;
...
...
@@ -533,9 +534,9 @@ export class Exercises {
overturnPic
.
scaleX
=
parent
.
scaleX
;
overturnPic
.
scaleY
=
parent
.
scaleY
;
overturnPic
.
x
=
parent
.
width
-
10
*
parent
.
scaleX
-
overturnPic
.
getBoundingBox
().
width
/
2
;
overturnPic
.
x
=
parent
.
width
-
28
*
parent
.
scaleX
-
overturnPic
.
getBoundingBox
().
width
/
2
;
overturnPic
.
y
=
parent
.
height
-
1
0
*
parent
.
scaleY
-
overturnPic
.
getBoundingBox
().
height
/
2
;
overturnPic
.
y
=
parent
.
height
-
1
5
*
parent
.
scaleY
-
overturnPic
.
getBoundingBox
().
height
/
2
;
parent
.
addChild
(
overturnPic
);
return
overturnPic
;
...
...
@@ -554,7 +555,7 @@ export class Exercises {
this
.
cardBg
.
y
=
this
.
bg
.
y
;
tweenChange
(
this
.
cardBg
,
{
scaleX
:
1
,
scaleY
:
1
,
x
:
toX
,
y
:
toY
},
0.5
,
()
=>
{
tweenChange
(
this
.
cardBg
,
{
scaleX
:
1
,
scaleY
:
1
,
x
:
toX
,
y
:
toY
},
0.5
,
()
=>
{
console
.
log
(
this
.
bigCard
.
width
);
this
.
canClickCard
=
true
;
this
.
showed
=
true
;
if
(
callback
)
{
...
...
src/app/play/Title.ts
View file @
f0c7c95c
...
...
@@ -30,13 +30,19 @@ export class Title {
}
init
(
mapScaleX
=
1
,
mapScaleY
=
1
)
{
let
titleBg
=
new
ShapeRect
();
//初始化标题1背景
const
titePart1Bg
=
new
MySprite
();
titePart1Bg
.
init
(
this
.
images
.
get
(
'
titlePart1Bg
'
));
titePart1Bg
.
scaleX
=
mapScaleX
;
titePart1Bg
.
scaleY
=
mapScaleY
;
titePart1Bg
.
x
=
titePart1Bg
.
getBoundingBox
().
width
/
2
;
const
titePart1Bg
=
new
ShapeRect
();
titePart1Bg
.
fillColor
=
"
#567790
"
;
let
pWidth
=
121
*
mapScaleX
;
let
pHeight
=
69
*
mapScaleY
;
titePart1Bg
.
setSize
(
pWidth
,
pHeight
);
titePart1Bg
.
setShadow
(
4
,
4
,
0
,
'
rgba(0, 0, 0, 0.2)
'
);
titePart1Bg
.
x
=
0
;
titleBg
.
addChild
(
titePart1Bg
);
//标题1内容
const
part1
=
new
Label
();
...
...
@@ -46,14 +52,14 @@ export class Title {
part1
.
fontName
=
"
BRLNSDB
"
;
part1
.
fontColor
=
"
#ffffff
"
;
part1
.
refreshSize
();
part1
.
x
=
titePart1Bg
.
getBoundingBox
().
width
/
2
-
part1
.
getBoundingBox
().
width
-
13
*
mapScaleX
;
tit
ePart1
Bg
.
addChild
(
part1
);
part1
.
x
=
pWidth
-
part1
.
getBoundingBox
().
width
-
13
*
mapScaleX
;
tit
le
Bg
.
addChild
(
part1
);
//标题2内容
const
part2
=
new
Label
();
part2
.
text
=
this
.
titleData
.
part2
;
part2
.
fontSize
=
36
;
part2
.
fontName
=
"
F
uturaStd
"
;
part2
.
fontName
=
"
F
UTURA
"
;
part2
.
fontColor
=
"
#000000
"
;
part2
.
refreshSize
();
part2
.
x
=
titePart1Bg
.
getBoundingBox
().
width
+
11
*
mapScaleX
;
...
...
@@ -62,14 +68,14 @@ export class Title {
let
height
=
Math
.
max
(
titePart1Bg
.
getBoundingBox
().
height
,
part2
.
getBoundingBox
().
height
);
let
width
=
titePart1Bg
.
getBoundingBox
().
width
+
part2
.
getBoundingBox
().
width
+
11
*
mapScaleX
;
titePart1Bg
.
y
=
(
height
-
pHeight
)
/
2
;
let
titleBg
=
new
ShapeRect
();
part1
.
y
=
height
/
2
;
titleBg
.
setSize
(
width
,
height
);
titleBg
.
alpha
=
0
;
titePart1Bg
.
y
=
height
/
2
;
titleBg
.
addChild
(
titePart1Bg
);
part2
.
y
=
height
/
2
;
titleBg
.
addChild
(
part2
);
...
...
src/app/play/play.component.ts
View file @
f0c7c95c
...
...
@@ -4,7 +4,8 @@ import {
Label
,
MySprite
,
tweenChange
,
Line
,
ShapeRectNew
ShapeRectNew
,
ShapeRect
}
from
'
./Unit
'
;
import
{
res
,
resAudio
}
from
'
./resources
'
;
...
...
@@ -87,6 +88,8 @@ export class PlayComponent implements OnInit, OnDestroy {
curAudio
;
mask
:
ShapeRect
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
onResize
(
event
)
{
this
.
winResizeEventStream
.
next
();
...
...
@@ -808,10 +811,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}
else
{
if
(
this
.
data
.
skin
===
'
A
'
)
{
startY
=
startY
+
exercises
.
bg
.
height
+
78
*
this
.
mapScaleY
;
startY
=
startY
+
exercises
.
bg
.
height
+
65
*
this
.
mapScaleY
;
}
else
{
startY
=
startY
+
exercises
.
bg
.
height
+
65
*
this
.
mapScaleY
;
startY
=
startY
+
exercises
.
bg
.
height
+
78
*
this
.
mapScaleY
;
}
hight
=
exercises
.
bg
.
height
;
startYArr
.
push
(
startY
);
...
...
@@ -852,6 +855,13 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
exercisesArr
[
i
].
resetText
(
minScale
,
this
.
data
.
skin
);
}
const
mask
=
new
ShapeRect
();
mask
.
setSize
(
this
.
canvasWidth
,
this
.
canvasHeight
);
mask
.
visible
=
false
;
mask
.
alpha
=
0.3
mask
.
fillColor
=
"
#000000
"
;
this
.
renderArr
.
push
(
mask
);
this
.
mask
=
mask
;
}
mapDown
(
event
)
{
...
...
@@ -901,6 +911,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
!
exer
.
showed
)
{
this
.
playAudio
(
'
waves
'
,
true
);
this
.
mask
.
visible
=
true
;
exer
.
showBigCard
(
this
.
canvasWidth
/
2
,
this
.
canvasHeight
/
2
,
()
=>
{
//将其它词组设置为不可点击
...
...
@@ -931,6 +942,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
playAudio
(
'
turn
'
,
true
);
this
.
mask
.
visible
=
false
;
exer
.
close
(()
=>
{
//将词组设置为可点击
for
(
let
j
=
0
;
j
<
this
.
exercisesArr
.
length
;
++
j
)
{
...
...
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