Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_lettersort
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
hw_lettersort
Commits
cdbb4bb3
Commit
cdbb4bb3
authored
May 24, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
7e1760fa
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
320 additions
and
143 deletions
+320
-143
hw_lettersort.fire
assets/hw_lettersort/scene/hw_lettersort.fire
+255
-138
hw_lettersort.js
assets/hw_lettersort/scene/hw_lettersort.js
+65
-5
No files found.
assets/hw_lettersort/scene/hw_lettersort.fire
View file @
cdbb4bb3
This diff is collapsed.
Click to expand it.
assets/hw_lettersort/scene/hw_lettersort.js
View file @
cdbb4bb3
...
@@ -1460,8 +1460,10 @@ cc.Class({
...
@@ -1460,8 +1460,10 @@ cc.Class({
getLetter
(
text
)
{
getLetter
(
text
)
{
const
node
=
new
cc
.
Node
();
const
node
=
new
cc
.
Node
();
const
letterY
=
this
.
getRichText
(
text
,
140
,
"
#b4502e
"
,
2
,
"
#ffffff
"
,
true
,
true
);
// const letterY = this.getRichText(text, 140, "#b4502e", 2, "#ffffff", true, true);
const
letterB
=
this
.
getRichText
(
text
,
140
,
"
#3a77ad
"
,
2
,
"
#ffffff
"
,
true
,
true
);
// const letterB = this.getRichText(text, 140, "#3a77ad", 2, "#ffffff", true, true);
const
letterY
=
this
.
getLabelNew
(
text
,
140
,
"
#b4502e
"
,
2
,
"
#ffffff
"
,
true
);
const
letterB
=
this
.
getLabelNew
(
text
,
140
,
"
#3a77ad
"
,
2
,
"
#ffffff
"
,
true
);
letterY
.
active
=
false
;
letterY
.
active
=
false
;
node
.
yNode
=
letterY
;
node
.
yNode
=
letterY
;
...
@@ -1543,16 +1545,16 @@ cc.Class({
...
@@ -1543,16 +1545,16 @@ cc.Class({
getRichText
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isB
lo
d
=
false
,
isFont
=
false
)
{
getRichText
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isB
ol
d
=
false
,
isFont
=
false
)
{
const
labelNode
=
new
cc
.
Node
();
const
labelNode
=
new
cc
.
Node
();
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
label
.
string
=
`<outline color=
${
outlineColor
}
width=
${
outlineWidth
}
><color=
${
color
}
><size=
${
fontSize
}
>
${
text
}
</></color></outline>`
label
.
string
=
`<outline color=
${
outlineColor
}
width=
${
outlineWidth
}
><color=
${
color
}
><size=
${
fontSize
}
>
${
text
}
</></color></outline>`
if
(
isB
lo
d
)
{
if
(
isB
ol
d
)
{
label
.
string
=
`<b>
${
label
.
string
}
</b>`
label
.
string
=
`<b>
${
label
.
string
}
</b>`
labelNode
.
isB
lo
d
=
true
;
labelNode
.
isB
ol
d
=
true
;
}
}
labelNode
.
color
=
cc
.
Color
.
BLACK
;
labelNode
.
color
=
cc
.
Color
.
BLACK
;
...
@@ -6139,6 +6141,64 @@ cc.Class({
...
@@ -6139,6 +6141,64 @@ cc.Class({
return
labelNode
;
return
labelNode
;
},
},
getLabelNew
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isBold
=
false
)
{
const
baseNode
=
cc
.
find
(
'
Canvas/res/font/MMTB_label
'
);
const
labelNode
=
cc
.
instantiate
(
baseNode
);
const
label
=
labelNode
.
getComponent
(
cc
.
Label
);
const
labelOutline
=
labelNode
.
getComponent
(
cc
.
LabelOutline
);
label
.
string
=
text
;
label
.
fontSize
=
fontSize
;
labelNode
.
color
=
cc
.
Color
.
fromHEX
(
new
cc
.
Color
(),
color
);
labelOutline
.
width
=
outlineWidth
;
labelOutline
.
color
=
cc
.
Color
.
fromHEX
(
new
cc
.
Color
(),
outlineColor
);
// label.enableBold = isBold;
label
.
lineHeight
=
fontSize
;
// const labelNode = new cc.Node();
// const label = labelNode.addComponent(cc.Label);
// label.string = text;
// labelNode.color = cc.Color.BLACK;
// label.fontSize = fontSize;
// label.lineHeight = fontSize;
// label.font = cc.find('Canvas/res/font/MMTB').getComponent(cc.Label).font;
// if (isBold) {
// label.string = `<b>${label.string}</b>`
// labelNode.isBold = true;
// }
// labelNode.color = cc.Color.BLACK;
// // label.fontSize = fontSize;
// labelNode.baseFontSize = fontSize;
// labelNode.baseColor = color;
// labelNode.baseOutlineColor = outlineColor;
// labelNode.baseOutlineWidth = outlineWidth;
// label.lineHeight = fontSize * 1.2;
// label.horizontalAlign = cc.macro.TextAlignment.CENTER;
// if (isFont) {
// label.font = cc.find('Canvas/res/font/MMTB').getComponent(cc.Label).font;
// label.MMTB = label.font;
// }
return
labelNode
;
},
debugLayer
:
null
,
debugLayer
:
null
,
...
...
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