Commit 4912d64b authored by limingzhe's avatar limingzhe

fix: debug

parent e653e317
No preview for this file type
...@@ -724,6 +724,8 @@ initMask() { ...@@ -724,6 +724,8 @@ initMask() {
console.log( ' in initView') console.log( ' in initView')
// this.data.isDebug = true;
this.hideMask(); this.hideMask();
this.initVideo(); this.initVideo();
...@@ -758,9 +760,10 @@ initMask() { ...@@ -758,9 +760,10 @@ initMask() {
// rightAnim.scale = 1; // rightAnim.scale = 1;
// rightAnim.y = 30; // rightAnim.y = 30;
let display = rightAnim.getComponent(dragonBones.ArmatureDisplay) let display = rightAnim.getComponent(dragonBones.ArmatureDisplay)
display.timeScale = 1; display.timeScale = 0.5;
rightAnim.scale = 1.5; rightAnim.scale = 2;
// this.rightAnim = display; // this.rightAnim = display;
}, },
...@@ -1033,15 +1036,15 @@ initMask() { ...@@ -1033,15 +1036,15 @@ initMask() {
layer.anchorX = 0; layer.anchorX = 0;
layer.anchorY = 1; layer.anchorY = 1;
if (!quesData.bgItem2) { if (!quesData.bgItem2) {
return; continue;
} }
layer.data = quesData.bgItem2; layer.data = quesData.bgItem2;
cc.loader.load({url: quesData.bgItem2.url}, (err, img) => { cc.loader.load({url: quesData.bgItem2.url}, (err, img) => {
quesData.debugBgImg = img; quesData.debugBgImg = img;
quesData.checkBg = img; quesData.checkBg = img;
layer.width = img.width; layer.width = img.width;
...@@ -1093,25 +1096,16 @@ initMask() { ...@@ -1093,25 +1096,16 @@ initMask() {
quesData.debugLayer = layer; quesData.debugLayer = layer;
const drawLayer = new cc.Node(); const drawLayer = new cc.Node();
quesData.debugLayer.addChild(drawLayer, 2); quesData.debugLayer.addChild(drawLayer, 2);
quesData.debugDrawLayer = drawLayer; quesData.debugDrawLayer = drawLayer;
// if (i != 0) { // if (i != 0) {
// quesData.debugLayer.active = false; // quesData.debugLayer.active = false;
// } // }
} }
}, },
...@@ -1575,6 +1569,11 @@ showStartLight() { ...@@ -1575,6 +1569,11 @@ showStartLight() {
this.quesIndex++; this.quesIndex++;
this.initCurQues(); this.initCurQues();
if (this.curQues?.debugLayer) {
this.curQues.debugLayer.active = true;
}
// this.initVideoRemote(); // this.initVideoRemote();
return; return;
...@@ -2764,6 +2763,10 @@ showStartLight() { ...@@ -2764,6 +2763,10 @@ showStartLight() {
const {x, y} = data; const {x, y} = data;
const colorDot = this.getColorDot(x, -y, 0.05, 0.05); const colorDot = this.getColorDot(x, -y, 0.05, 0.05);
// const colorDot = this.getColorDot(0, 0, 0.05, 0.05);
// this.canvas.addChild(colorDot);
this.curQues.debugDrawLayer.addChild(colorDot, 1); this.curQues.debugDrawLayer.addChild(colorDot, 1);
...@@ -2879,12 +2882,17 @@ showStartLight() { ...@@ -2879,12 +2882,17 @@ showStartLight() {
const dotV2 = new cc.Vec2(rect.x + rect.width/2, rect.y + rect.height / 2); const dotV2 = new cc.Vec2(rect.x + rect.width/2, rect.y + rect.height / 2);
const checkArr = this.curQues.starRectCheckArr; const checkArr = this.curQues.starRectCheckArr;
// console.log("checkArr: " ,checkArr);
for (let i=0; i<checkArr.length; i++) { for (let i=0; i<checkArr.length; i++) {
const checkRect = checkArr[i].ccRect; const checkRect = checkArr[i].ccRect;
const key = checkArr[i].data.index + 1; const key = checkArr[i].data.index + 1;
console.log("checkRect: " ,checkRect);
console.log("dotV2: " ,dotV2);
if (checkRect.contains(dotV2)) { if (checkRect.contains(dotV2)) {
answerData[key] = {isFinish: true}; answerData[key] = {isFinish: true};
} }
...@@ -2903,7 +2911,9 @@ showStartLight() { ...@@ -2903,7 +2911,9 @@ showStartLight() {
const animaNode = this.curQues.starAnimaArr[i]; const animaNode = this.curQues.starAnimaArr[i];
const key = (animaNode.data.index + 1).toString(); // const key = (animaNode.data.index + 1).toString();
const key = (i + 1).toString();
// console.log('~animaNode: ', animaNode) // console.log('~animaNode: ', animaNode)
// console.log('~key: ', key) // console.log('~key: ', key)
...@@ -2966,6 +2976,10 @@ showStartLight() { ...@@ -2966,6 +2976,10 @@ showStartLight() {
w *= this.curQues.debugBgImg.width; w *= this.curQues.debugBgImg.width;
h *= this.curQues.debugBgImg.height; h *= this.curQues.debugBgImg.height;
console.log("w: ~" + w);
console.log("h: ~" + h);
console.log("this.curQues.debugLayer: ~" , this.curQues.debugLayer);
if (this.curQues.debugLayer.parent && this.curQues.debugLayer.active) { if (this.curQues.debugLayer.parent && this.curQues.debugLayer.active) {
const rect = { const rect = {
...@@ -3011,6 +3025,8 @@ showStartLight() { ...@@ -3011,6 +3025,8 @@ showStartLight() {
} else if (this.data2 != true) { } else if (this.data2 != true) {
photoData = {"page_id":"3","book_name":"LWP_L2_B01_OnTheBoat_LotsofJobs_LOWRES"} photoData = {"page_id":"3","book_name":"LWP_L2_B01_OnTheBoat_LotsofJobs_LOWRES"}
this.data2 = true; this.data2 = true;
} else if (this.data3 != true) { } else if (this.data3 != true) {
...@@ -3027,10 +3043,11 @@ showStartLight() { ...@@ -3027,10 +3043,11 @@ showStartLight() {
this.data6 = true; this.data6 = true;
} }
} else { } else {
// photoData = {"x":"0.55","y":"0.13"};
photoData = {"x":"0.26","y":"0.65"}; photoData = {"x":"0.21","y":"0.80"};
// photoData = {"x":"0.26","y":"0.65"};
// photoData = {"x":"0.64","y":"0.69"}
} }
cb(photoData); cb(photoData);
...@@ -3757,7 +3774,7 @@ showStartLight() { ...@@ -3757,7 +3774,7 @@ showStartLight() {
rectNode.anchorX = rectNode.anchorY = 0; rectNode.anchorX = rectNode.anchorY = 0;
if (quesData.bgItem.isShowDebugLine) { if (quesData.bgItem.isShowDebugLine || this.data.isDebug) {
ctx.rect(0, 0, rectNode.width, rectNode.height); ctx.rect(0, 0, rectNode.width, rectNode.height);
} }
ctx.stroke(); ctx.stroke();
...@@ -3775,6 +3792,7 @@ showStartLight() { ...@@ -3775,6 +3792,7 @@ showStartLight() {
}); });
} }
console.log("rectNode~: ", rectNode);
animaNode.rectNode = rectNode; animaNode.rectNode = rectNode;
......
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