Commit accdb0c9 authored by limingzhe's avatar limingzhe

fix: debug

parent 092546fc
...@@ -511,10 +511,10 @@ cc.Class({ ...@@ -511,10 +511,10 @@ cc.Class({
//调起检测 //调起检测
startTesting() { startTesting() {
// this.getPhotoData((data) => { this.getPhotoData((data) => {
// this.photoEnd(data); this.photoEnd(data);
// }); });
// return; return;
const cw = window.courseware; const cw = window.courseware;
...@@ -598,6 +598,9 @@ cc.Class({ ...@@ -598,6 +598,9 @@ cc.Class({
this.debugDrawLayer.removeAllChildren(); this.debugDrawLayer.removeAllChildren();
this.checkIsRightArea(data);
const answerData = this.getAnswerData(data); const answerData = this.getAnswerData(data);
this.showUserRight(answerData, data); this.showUserRight(answerData, data);
...@@ -1060,6 +1063,21 @@ cc.Class({ ...@@ -1060,6 +1063,21 @@ cc.Class({
} }
const sentence = line.content; const sentence = line.content;
const label = this.getLabel(sentence, 150);
label.x = line.left * this.debugBgImg.width;
label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height;
label.parent = this.debugDrawLayer;
label.zIndex = 200;
// label.color = cc.Color.RED;
const l = label.getComponent(cc.Label);
label.anchorX = 0;
console.log(' sentence~: ', sentence);
if (this.checkIsInsert(textArr, sentence)) { if (this.checkIsInsert(textArr, sentence)) {
return line; return line;
} }
...@@ -1221,7 +1239,7 @@ cc.Class({ ...@@ -1221,7 +1239,7 @@ cc.Class({
picNode.hitCount++; picNode.hitCount++;
if (picNode.hitCount < 2) { if (picNode.hitCount < 1) {
return; return;
} }
...@@ -1997,12 +2015,13 @@ cc.Class({ ...@@ -1997,12 +2015,13 @@ cc.Class({
this.debugLayer.addChild(label); this.debugLayer.addChild(label);
}, },
getLabel(text) { getLabel(text, fontSize = 20) {
const labelNode = new cc.Node(); const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.Label); const label = labelNode.addComponent(cc.Label);
label.string = text; label.string = text;
labelNode.color = cc.Color.BLACK; labelNode.color = cc.Color.BLACK;
label.fontSize = 20; label.fontSize = fontSize;
label.lineHeight = fontSize;
return labelNode; return labelNode;
}, },
......
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