Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
et_22
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_22
Commits
8cf45477
Commit
8cf45477
authored
Dec 17, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
066f2581
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
adapter.js
play/assets/et_22/components/karaoke/scripts/adapter.js
+11
-11
karaoke.js
play/assets/et_22/components/karaoke/scripts/karaoke.js
+10
-10
No files found.
play/assets/et_22/components/karaoke/scripts/adapter.js
View file @
8cf45477
...
...
@@ -170,7 +170,7 @@ cc.Class({
const
anim
=
this
.
showImageNode
.
getChildByName
(
'
image
'
).
getComponent
(
cc
.
Animation
);
let
canClick
=
true
;
let
b4ClickIsPlaying
=
false
;
anim
.
on
(
cc
.
Animation
.
EventType
.
FINISHED
,
(
evt
,
state
)
=>
{
anim
.
on
(
cc
.
Animation
.
EventType
.
FINISHED
,
function
(
evt
,
state
)
{
const
{
width
,
height
,
scale
}
=
this
.
showImageNode
.
getChildByName
(
'
image
'
)
// console.log(555, width,height, scale)
...
...
@@ -186,8 +186,8 @@ cc.Class({
}
}
})
this
.
showImageButton
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
event
)
=>
{
}
,
this
)
this
.
showImageButton
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
function
(
event
)
{
this
.
buttonTapAudioEffect
.
play
()
if
(
!
canClick
)
{
return
;
...
...
@@ -222,13 +222,13 @@ cc.Class({
anim
.
play
(
'
popin
'
);
}
});
}
,
this
);
});
}
// const self = this;
this
.
replayButton
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
event
)
=>
{
this
.
replayButton
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
function
(
event
)
{
this
.
buttonTapAudioEffect
.
play
()
const
btn
=
event
.
currentTarget
;
if
(
!
this
.
lrc
.
isCurrentAudioSourcePlaying
())
{
...
...
@@ -237,7 +237,7 @@ cc.Class({
this
.
lrc
.
stopAndResetHighLight
();
this
.
lrc
.
resume
();
});
}
,
this
);
if
(
this
.
title_audio_url
)
{
cc
.
assetManager
.
loadRemote
(
this
.
title_audio_url
,
(
err
,
titleAudioCip
)
=>
{
this
.
_titleAudioSource
=
new
cc
.
AudioSource
();
...
...
@@ -301,19 +301,19 @@ cc.Class({
window
.
dispatchEvent
(
new
CustomEvent
(
'
resize
'
),
true
)
// window.dispatchEvent(new cc.Event.EventCustom('resize', true))
},
this
);
cc
.
director
.
on
(
'
GAME_VIEW_DISPLAYED
'
,
()
=>
{
cc
.
director
.
on
(
'
GAME_VIEW_DISPLAYED
'
,
function
()
{
// this.karaoke.prepare();
});
}
,
this
);
window
.
gg
=
this
this
.
btnGroup
.
children
.
forEach
(
button
=>
{
console
.
log
(
button
);
button
.
actionStatus
=
this
.
BUTTON_STATUS
.
IDLE
;
button
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
event
)
=>
{
button
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
function
(
event
)
{
const
btn
=
event
.
currentTarget
;
this
.
buttonGroupChange
(
btn
)
// cc.log("This is a callback after the trigger event", event);
})
});
}
,
this
)
}
,
this
);
// const btn1 = cc.find('Canvas/BodyContainer/LRCComponent/buttons-group/mode3')
// btn1.actionStatus = this.BUTTON_STATUS.IDLE;
// btn1.addComponent(cc.Button)
...
...
play/assets/et_22/components/karaoke/scripts/karaoke.js
View file @
8cf45477
...
...
@@ -114,13 +114,13 @@ cc.Class({
this
.
_audioClip
=
audioClip
;
this
.
_audioSource
=
new
cc
.
AudioSource
();
this
.
_audioSource
.
clip
=
this
.
_audioClip
;
this
.
_audioSource
.
audio
.
on
(
'
ended
'
,
()
=>
{
this
.
_audioSource
.
audio
.
on
(
'
ended
'
,
function
()
{
console
.
log
(
'
_audioClip ended
'
);
this
.
_audioSource
.
setCurrentTime
(
0
)
});
this
.
_audioSource
.
audio
.
on
(
'
stop
'
,
()
=>
{
}
,
this
);
this
.
_audioSource
.
audio
.
on
(
'
stop
'
,
function
()
{
console
.
log
(
'
_audioClip stop
'
);
});
}
,
this
);
// this.currentAudioId = audioEngine.play(this._audioClip, false, 0);
// audioEngine.pause(this.currentAudioId);
// audioEngine.setCurrentTime(this.currentAudioId, 0);
...
...
@@ -145,13 +145,13 @@ cc.Class({
this
.
_audioAcClip
=
audioClip
;
this
.
_audioACSource
=
new
cc
.
AudioSource
();
this
.
_audioACSource
.
clip
=
this
.
_audioAcClip
;
this
.
_audioACSource
.
audio
.
on
(
'
ended
'
,
()
=>
{
this
.
_audioACSource
.
audio
.
on
(
'
ended
'
,
function
()
{
console
.
log
(
'
_audioACSource ended
'
);
this
.
_audioACSource
.
setCurrentTime
(
0
)
});
this
.
_audioACSource
.
audio
.
on
(
'
stop
'
,
()
=>
{
}
,
this
);
this
.
_audioACSource
.
audio
.
on
(
'
stop
'
,
function
()
{
console
.
log
(
'
_audioACSource stop
'
);
});
}
,
this
);
// this.currentAcAudioId = audioEngine.play(this._audioAcClip, false, 0);
...
...
@@ -630,11 +630,11 @@ 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
,
()
=>
{
n
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
function
()
{
console
.
log
(
n
.
_id
,
ss
,
breakIndex
,
tm
,
idx
,
n
.
x
,
n
.
y
,
this
.
richText
.
node
.
children
.
indexOf
(
n
)
);
this
.
calcSentenceRichText
.
string
=
this
.
sentenceContent
[
tm
];
this
.
playByTime
(
tm
);
});
}
,
this
);
const
s
=
n
.
getComponent
(
cc
.
Label
).
string
;
this
.
findSentenceIndexByWords
(
s
,
sentenceIndexObj
);
}
...
...
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