Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
et_21
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
et_21
Commits
be554395
Commit
be554395
authored
Mar 29, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: lrc width
parent
9d55a4bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
karaoke.js
play/assets/et_21/components/karaoke/scripts/karaoke.js
+7
-2
scene.js
play/assets/et_21/script/scene.js
+19
-13
No files found.
play/assets/et_21/components/karaoke/scripts/karaoke.js
View file @
be554395
...
...
@@ -222,6 +222,7 @@ cc.Class({
// this.labelComp.node.anchorY = 1;
// this.labelComp.node.x = -this.node.width / 2;
// this.labelComp.node.y = this.node.height / 2;
const
mask
=
this
.
getComponent
(
cc
.
Mask
);
if
(
!
mask
)
{
this
.
addComponent
(
cc
.
Mask
);
...
...
@@ -282,7 +283,10 @@ cc.Class({
]
};*/
//#endregion
this
.
node
.
width
=
this
.
node
.
width
-
50
;
// this.richText.node.maxWidth = this.node.width- 150;
// this.richText.node.name = 'lrcbody'
// this.node.x = this.node.x + 25;
this
.
richText
.
maxWidth
=
this
.
node
.
width
;
...
...
@@ -308,6 +312,7 @@ cc.Class({
this
.
maskHighlightNode
.
y
=
99999
;
this
.
maskHighlightNode
.
zIndex
=
99999
this
.
calcHighlightNode
=
new
cc
.
Node
();
...
...
@@ -689,7 +694,7 @@ cc.Class({
// console.log(n._id,ss,breakIndex,tm, idx, n.x,n.y);
n
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
)
n
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
console
.
log
(
n
.
_id
,
ss
,
breakIndex
,
tm
,
idx
,
n
.
x
,
n
.
y
,
this
.
richText
.
no
de
.
children
.
indexOf
(
n
)
);
console
.
log
(
n
.
_id
,
ss
,
breakIndex
,
tm
,
idx
,
n
.
x
,
n
.
y
,
de
.
children
.
indexOf
(
n
)
);
this
.
calcSentenceRichText
.
string
=
this
.
sentenceContent
[
tm
];
this
.
playByTime
(
tm
);
});
...
...
play/assets/et_21/script/scene.js
View file @
be554395
...
...
@@ -122,17 +122,7 @@ cc.Class({
getDefaultData
()
{
const
data
=
{
"
songArr
"
:[
/*{"lrcData":{
"audio_url":"http://staging-teach.cdn.ireadabc.com/3fa65d5f667a2ef9059d3dfc5df74a4d.mp3",
"fontSize":24,
"lineHeight":32,
"lyrics":[
{"time":4.81026,"data":"AAA","newLine":true},
{"time":8.63464,"data":"aaaaa vbbbb ccc ddd","newLine":true},
{"time":10.489051,"data":"eeee fffff gg hhh","newLine":false}
]},
"pic_url":"http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png","accompany_audio_url":"http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3"
},*/
{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/2a25aaff4b6c84b859b4d77f944de57a.mp3
"
,
"
fontSize
"
:
24
,
...
...
@@ -145,7 +135,19 @@ cc.Class({
{
"
time
"
:
27.93
,
"
data
"
:
"
一闪一闪亮晶晶
"
,
"
newLine
"
:
true
},
{
"
time
"
:
32.32
,
"
data
"
:
"
满天都是小星星
"
,
"
newLine
"
:
true
},{
"
time
"
:
41.1
,
"
data
"
:
"
一闪一闪亮晶晶
"
,
"
newLine
"
:
true
},{
"
time
"
:
45.45
,
"
data
"
:
"
满天都是小星星
"
,
"
newLine
"
:
true
},{
"
time
"
:
49.74
,
"
data
"
:
"
挂在天上放光明
"
,
"
newLine
"
:
true
},{
"
time
"
:
54.16
,
"
data
"
:
"
好像许多小眼睛
"
,
"
newLine
"
:
true
},{
"
time
"
:
58.39
,
"
data
"
:
"
一闪一闪亮晶晶
"
,
"
newLine
"
:
true
},{
"
time
"
:
62.9
,
"
data
"
:
"
满天都是小星星
"
,
"
newLine
"
:
true
},{
"
time
"
:
76.36
,
"
data
"
:
"
一闪一闪亮晶晶
"
,
"
newLine
"
:
true
},{
"
time
"
:
80.28
,
"
data
"
:
"
满天都是小星星
"
,
"
newLine
"
:
true
},{
"
time
"
:
84.65
,
"
data
"
:
"
挂在天上放光明
"
,
"
newLine
"
:
true
},{
"
time
"
:
88.92
,
"
data
"
:
"
好像许多小眼睛
"
,
"
newLine
"
:
true
},{
"
time
"
:
93.41
,
"
data
"
:
"
一闪一闪亮晶晶
"
,
"
newLine
"
:
true
},
{
"
time
"
:
97.72
,
"
data
"
:
"
满天都是小星星
"
,
"
newLine
"
:
true
}
]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/86614bd904f63ab02fc69304e99618c6.mp3
"
}
]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/86614bd904f63ab02fc69304e99618c6.mp3
"
},
{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/3fa65d5f667a2ef9059d3dfc5df74a4d.mp3
"
,
"
fontSize
"
:
24
,
"
lineHeight
"
:
32
,
"
lyrics
"
:[
{
"
time
"
:
4.81026
,
"
data
"
:
"
AAA
"
,
"
newLine
"
:
true
},
{
"
time
"
:
8.63464
,
"
data
"
:
"
aaaaa bbbb ccc ddddeedddddddgg
"
,
"
newLine
"
:
true
},
{
"
time
"
:
10.489051
,
"
data
"
:
"
eeee fffff gg hhh
"
,
"
newLine
"
:
false
}
]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3
"
}
],
"
title
"
:
"
Let's play
"
,
"
title_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/cd8daa8b4d8ff707b3a3680e80bc4761.mp3
"
...
...
@@ -430,6 +432,7 @@ cc.Class({
const
item
=
this
.
setOneSongItem
(
arr
[
i
]);
item
.
x
=
px
;
item
.
y
=
py
;
px
+=
(
item
.
width
*
this
.
_mapScaleMin
+
disW
)
if
(
i
==
1
)
{
...
...
@@ -498,10 +501,13 @@ cc.Class({
// lrcScript.lrc.node.width =
// lrcScript.lrc.node.height
console
.
log
(
111
,
item
);
lrcScript
.
lrc
.
node
.
name
=
'
aaaaa
'
//
lrcScript.lrc.node.name = 'aaaaa'
lrcScript
.
lrc
.
node
.
height
=
item
.
height
-
50
;
// lrcScript.lrc.node.width = item.width - 30;
console
.
log
(
'
aaaa y
'
,
lrcScript
.
lrc
.
node
.
y
);
lrcScript
.
stopSong
();
// console.log(333444);
// lrcScript.lrc.richText.node.width = lrcScript.lrc.richText.node.width - 50;
lrcNode
.
y
=
-
lrcScript
.
lrc
.
node
.
height
/
2
*
lrcScript
.
lrc
.
node
.
scale
+
90
*
this
.
_mapScaleMin
;
...
...
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