Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
T_FT_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
T_FT_01
Commits
5198910d
Commit
5198910d
authored
Jan 31, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复标题显示的问题
parent
cfdd1e33
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Scene.js
play/assets/tmpGame/script/Scene.js
+6
-4
No files found.
play/assets/tmpGame/script/Scene.js
View file @
5198910d
...
@@ -325,20 +325,22 @@ cc.Class({
...
@@ -325,20 +325,22 @@ cc.Class({
label
.
font
=
cc
.
find
(
'
Canvas/res/font/FatMarker
'
).
getComponent
(
cc
.
Label
).
font
;
label
.
font
=
cc
.
find
(
'
Canvas/res/font/FatMarker
'
).
getComponent
(
cc
.
Label
).
font
;
label
.
string
=
`<size=
${
size
}
><color=#6e160c>
${
this
.
data
.
title
.
val
}
</color></size>`
label
.
string
=
`<size=
${
size
}
><color=#6e160c>
${
this
.
data
.
title
.
val
}
</color></size>`
label
.
horizontalAlign
=
cc
.
macro
.
TextAlignment
.
LEFT
label
.
horizontalAlign
=
cc
.
macro
.
TextAlignment
.
LEFT
labelNode
.
anchorX
=
0
;
labelNode
.
anchorX
=
0
.5
;
labelNode
.
anchorY
=
0.5
;
labelNode
.
anchorY
=
0.5
;
labelNode
.
rotation
=
-
3
;
labelNode
.
rotation
=
-
3
;
labelNode
.
x
=
(
titleBgNode
.
width
-
labelNode
.
width
)
/
2
;
labelNode
.
y
=
-
(
titleBgNode
.
height
-
labelNode
.
height
)
/
2
;
this
.
titleLabel
=
label
;
this
.
titleLabel
=
label
;
const
maxW
=
titleBgNode
.
width
*
0.
7
;
const
maxW
=
titleBgNode
.
width
*
0.
65
;
if
(
labelNode
.
width
>
maxW
)
{
if
(
labelNode
.
width
>
maxW
)
{
labelNode
.
scale
=
maxW
/
labelNode
.
width
;
labelNode
.
scale
=
maxW
/
labelNode
.
width
;
}
}
labelNode
.
x
=
titleBgNode
.
width
/
2
-
20
*
this
.
_cocosScale
;
labelNode
.
y
=
-
(
titleBgNode
.
height
-
labelNode
.
height
)
/
2
;
titleBgNode
.
addComponent
(
cc
.
Button
);
titleBgNode
.
addComponent
(
cc
.
Button
);
titleBgNode
.
on
(
'
click
'
,
()
=>
{
titleBgNode
.
on
(
'
click
'
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
title
.
audioUrl
);
this
.
playAudioByUrl
(
this
.
data
.
title
.
audioUrl
);
...
...
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