Commit 8cf45477 authored by liujiaxin's avatar liujiaxin

1

parent 066f2581
......@@ -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)
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment