Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sb_karaoke_cocos
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
sb_karaoke_cocos
Commits
afcbe681
Commit
afcbe681
authored
Dec 17, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a
parent
8f77493b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
17 deletions
+33
-17
sb_karaoke_cocos.meta
assets/sb_karaoke_cocos.meta
+15
-1
adapter.js
...ts/sb_karaoke_cocos/components/karaoke/scripts/adapter.js
+8
-8
karaoke.js
...ts/sb_karaoke_cocos/components/karaoke/scripts/karaoke.js
+6
-4
sb_karaoke_cocos.js
assets/sb_karaoke_cocos/scene/sb_karaoke_cocos.js
+4
-4
No files found.
assets/sb_karaoke_cocos.meta
View file @
afcbe681
{"ver":"1.1.2","uuid":"810c015d-857f-44be-aa35-fcda8b54edb3","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "810c015d-857f-44be-aa35-fcda8b54edb3",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/sb_karaoke_cocos/components/karaoke/scripts/adapter.js
View file @
afcbe681
...
...
@@ -220,13 +220,13 @@ cc.Class({
cc
.
director
.
on
(
'
GAME_RESOURCE_LOADED
'
,
()
=>
{
cc
.
director
.
on
(
'
GAME_RESOURCE_LOADED
'
,
function
()
{
this
.
lrc
.
initialize
();
this
.
setCurrentMode
(
this
.
lrc
.
PLAY_MODE
.
MODE1
);
this
.
buttonGroupChange
(
this
.
modeNameMap
[
this
.
getCurrentMode
()])
// this.lrc.node.zIndex = 99999
});
cc
.
director
.
on
(
'
GAME_DATA_FETCHED
'
,
(
data
)
=>
{
}
,
this
);
cc
.
director
.
on
(
'
GAME_DATA_FETCHED
'
,
function
(
data
)
{
const
{
width
:
dw
,
height
:
dh
}
=
cc
.
view
.
getDesignResolutionSize
();
const
{
width
:
fw
,
height
:
fh
}
=
cc
.
view
.
getFrameSize
();
...
...
@@ -330,19 +330,19 @@ cc.Class({
this
.
node
.
zIndex
=
9999
// window.dispatchEvent(new CustomEvent('resize'), true)
// window.dispatchEvent(new cc.Event.EventCustom('resize', true))
});
cc
.
director
.
on
(
'
GAME_VIEW_DISPLAYED
'
,
()
=>
{
}
,
this
);
cc
.
director
.
on
(
'
GAME_VIEW_DISPLAYED
'
,
function
()
{
// this.karaoke.prepare();
});
}
,
this
);
window
.
gg
=
this
this
.
btnGroup
.
children
.
forEach
(
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
;
window
.
bb
=
btn
;
this
.
buttonGroupChange
(
btn
)
// cc.log("This is a callback after the trigger event", event);
})
}
,
this
)
});
;
},
...
...
assets/sb_karaoke_cocos/components/karaoke/scripts/karaoke.js
View file @
afcbe681
...
...
@@ -146,9 +146,9 @@ cc.Class({
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
window
[
'
kk
'
]
=
this
;
cc
.
director
.
on
(
'
STOP_ALL_AUDIO
'
,
()
=>
{
cc
.
director
.
on
(
'
STOP_ALL_AUDIO
'
,
function
()
{
this
.
pause
();
});
}
,
this
);
},
setPlayInteractivateMode
(
mode
)
{
...
...
@@ -646,11 +646,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
);
}
...
...
@@ -998,6 +998,8 @@ cc.Class({
audioEngine
.
stop
(
this
.
_currentAudioId
);
this
.
_audioSource
.
destroy
();
this
.
_audioACSource
.
destroy
();
this
.
_audioSource
=
null
;
this
.
_audioACSource
=
null
;
}
});
assets/sb_karaoke_cocos/scene/sb_karaoke_cocos.js
View file @
afcbe681
...
...
@@ -470,7 +470,7 @@ cc.Class({
}
rectNode
.
addComponent
(
cc
.
Button
);
rectNode
.
on
(
'
click
'
,
()
=>
{
rectNode
.
on
(
'
click
'
,
function
()
{
if
(
rectNode
.
isClicked
)
{
// return;
}
...
...
@@ -486,7 +486,7 @@ cc.Class({
if
(
animationNames
.
length
>
0
)
{
dragonDisplay
.
playAnimation
(
animationNames
[
0
],
1
);
}
});
}
,
this
);
}
});
...
...
@@ -534,12 +534,12 @@ cc.Class({
});
picNode
.
addComponent
(
cc
.
Button
);
picNode
.
on
(
'
click
'
,
()
=>
{
picNode
.
on
(
'
click
'
,
function
()
{
if
(
picNode
.
audioClip
)
{
cc
.
audioEngine
.
stopAllEffects
();
cc
.
audioEngine
.
playEffect
(
picNode
.
audioClip
,
false
,
0.8
);
}
});
}
,
this
);
},
...
...
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