Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jj15_zww
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
jj15_zww
Commits
697286ab
Commit
697286ab
authored
May 22, 2024
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文字大小一致
parent
902c5297
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
jj15_zww.fire
assets/jj15_zww/scene/jj15_zww.fire
+1
-1
jj15_zww.ts
assets/jj15_zww/scene/jj15_zww.ts
+18
-0
defaultData_jj15_zww.ts
assets/jj15_zww/script/defaultData_jj15_zww.ts
+4
-4
No files found.
assets/jj15_zww/scene/jj15_zww.fire
View file @
697286ab
...
...
@@ -2497,7 +2497,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2
4
0,
"width": 2
2
0,
"height": 80
},
"_anchorPoint": {
...
...
assets/jj15_zww/scene/jj15_zww.ts
View file @
697286ab
...
...
@@ -517,6 +517,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
layout_card
.
addChild
(
item
);
this
.
updateCard
(
item
,
dt
);
})
// 设置所有文字的大小问题
this
.
scheduleOnce
(()
=>
{
let
minFont
=
999
;
layout_card
.
children
.
forEach
((
item
,
i
)
=>
{
let
data
=
item
.
data
;
if
(
data
.
type
!=
'
img_txt
'
)
return
;
let
text
=
pg
.
view
.
find
(
item
,
'
image_text_text
'
);
let
font
=
text
.
getComponent
(
cc
.
Label
).
actualFontSize
;
if
(
minFont
>
font
)
minFont
=
font
;
})
layout_card
.
children
.
forEach
((
item
,
i
)
=>
{
let
data
=
item
.
data
;
if
(
data
.
type
!=
'
img_txt
'
)
return
;
let
text
=
pg
.
view
.
find
(
item
,
'
image_text_text
'
);
text
.
getComponent
(
cc
.
Label
).
fontSize
=
minFont
text
.
getComponent
(
cc
.
Label
).
overflow
=
cc
.
Label
.
Overflow
.
NONE
;
})
},
0.01
)
}
updateCard
(
item
,
data
)
{
...
...
assets/jj15_zww/script/defaultData_jj15_zww.ts
View file @
697286ab
...
...
@@ -5,15 +5,15 @@ export const defaultData = {
"
title
"
:
"
Which animal have wings?
"
,
"
options
"
:
[
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
type
"
:
"
img_
txt
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/c62b5960641fd7cf29613cc45fb00cd6.png
"
,
"
text
"
:
"
bird
"
,
"
audio
"
:
'
http://staging-teach.cdn.ireadabc.com/981ebff00a4717b1327b9dcd32b9ad2f_l.mp3
'
},
{
"
type
"
:
"
img
"
,
"
type
"
:
"
img
_txt
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/c62b5960641fd7cf29613cc45fb00cd6.png
"
,
"
text
"
:
""
,
"
text
"
:
"
interface
"
,
"
audio
"
:
'
http://staging-teach.cdn.ireadabc.com/981ebff00a4717b1327b9dcd32b9ad2f_l.mp3
'
},
{
...
...
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