Commit 81ff8b16 authored by limingzhe's avatar limingzhe

fix: debug

parent 519a274e
...@@ -202,6 +202,7 @@ cc.Class({ ...@@ -202,6 +202,7 @@ cc.Class({
console.log('[answer] thinking and playing'); console.log('[answer] thinking and playing');
// check every second // check every second
const id = setInterval(() => { const id = setInterval(() => {
console.log("aaaaaa");
if (!this._lastFingerPosition.dirty) { if (!this._lastFingerPosition.dirty) {
return; return;
} }
...@@ -295,11 +296,23 @@ cc.Class({ ...@@ -295,11 +296,23 @@ cc.Class({
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
const an = context.questions[context.questionIndex].node; const an = context.questions[context.questionIndex].node;
an.active = true; an.active = true;
if (an.isSpine) {
const skeleton = an.getComponent(sp.Skeleton);
skeleton.setToSetupPose();
setTimeout(() => {
skeleton.setAnimation(0, 'normal', true);
}, 1);
} else {
const dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay); const dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('normal', 0); dragonDisplay.playAnimation('normal', 0);
console.log('show animation', an.active); console.log('show animation', an.active);
} }
}
playAudioByUrl(wrongEffect, () => { playAudioByUrl(wrongEffect, () => {
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
// const an = context.questions[context.questionIndex].node; // const an = context.questions[context.questionIndex].node;
...@@ -461,9 +474,12 @@ cc.Class({ ...@@ -461,9 +474,12 @@ cc.Class({
if (t.isSpine) { if (t.isSpine) {
const skeleton = t.getComponent(sp.Skeleton); const skeleton = t.getComponent(sp.Skeleton);
skeleton.pause();
skeleton.loop = false; skeleton.setToSetupPose();
skeleton.animation = 'enlarge'; setTimeout(() => {
skeleton.setAnimation(0, 'enlarge', false);
}, 1);
// skeleton.animation = skeleton.animationNames[0]; // skeleton.animation = skeleton.animationNames[0];
} else { } else {
...@@ -504,9 +520,16 @@ cc.Class({ ...@@ -504,9 +520,16 @@ cc.Class({
if (t.isSpine) { if (t.isSpine) {
const skeleton = t.getComponent(sp.Skeleton); const skeleton = t.getComponent(sp.Skeleton);
skeleton.pause(); console.log('skeleton: ', skeleton);
skeleton.loop = true;
skeleton.animation = 'normal' skeleton.setToSetupPose();
setTimeout(() => {
skeleton.setAnimation(0, 'normal', true);
}, 1);
console.log('skeleton 22: ', skeleton);
// skeleton.animation = skeleton.animationNames[0]; // skeleton.animation = skeleton.animationNames[0];
} else { } else {
...@@ -535,6 +558,10 @@ cc.Class({ ...@@ -535,6 +558,10 @@ cc.Class({
}, },
// 生命周期 start // 生命周期 start
start() { start() {
let getData = this.getData.bind(this); let getData = this.getData.bind(this);
...@@ -584,6 +611,7 @@ cc.Class({ ...@@ -584,6 +611,7 @@ cc.Class({
}, },
checkInRegion(r) { checkInRegion(r) {
console.log('r~~~: ', r);
if (!this._lastFingerPosition && !this._lastFingerPosition.pos) { if (!this._lastFingerPosition && !this._lastFingerPosition.pos) {
return null; return null;
} }
...@@ -611,7 +639,7 @@ cc.Class({ ...@@ -611,7 +639,7 @@ cc.Class({
}, },
getDefaultData() { getDefaultData() {
return {"begin_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","begin_sep_time":1,"guide_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","playing_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","right_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio1":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio2":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","end_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png","rect":{"x":549.55,"y":0,"width":449.9,"height":582}},"hotZoneItemArr":[{"id":"1659333645573","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3","itemType":"rect","fontScale":1.21015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.21015625,"dragDot":{"x":774.5,"y":289.55016883743366},"gIdx":"1","labelText":"1","posX":887.5,"posY":165.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/d1f859d3fba84bd03565e543c986fb28.json","name":"6_4_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/70f96e1cc7f013e27ed1952c503fb750.json","name":"6_4_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/b06f9b90018a6eb0175a01e355b9ced6.png","name":"6_4_tex.png"},"animType":"dragonBone","rect":{"x":36.08,"y":49.19,"width":153.95,"height":150.19}},{"id":"1659334098930","index":1,"audio_url":"http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3","itemType":"rect","fontScale":1.21015625,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.21015625,"dragDot":{"x":774.5,"y":289.55016883743366},"gIdx":"0","labelText":"1","posX":1212.5,"posY":643.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/bdbadb06e0c1157e727cecd28f28d10e.json","name":"spineboy-pro.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas","name":"spineboy-pro.atlas"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png","name":"spineboy-pro.png"},"animType":"spine","rect":{"x":282.03,"y":408.15,"width":150.19,"height":150.19}}]} return {"begin_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","begin_sep_time":1,"guide_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","playing_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","right_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio1":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio2":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","end_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png","rect":{"x":736.95,"y":0,"width":599.09,"height":775}},"hotZoneItemArr":[{"id":"1659333645573","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3","itemType":"rect","fontScale":1.61953125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.61953125,"dragDot":{"x":1036.5,"y":387.5},"gIdx":"1","labelText":"1","posX":887.5,"posY":165.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/133a1f60719ed26247e35dc022d82862.json","name":"spineboy-pro.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas","name":"spineboy-pro.atlas"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png","name":"spineboy-pro.png"},"animType":"spine","rect":{"x":48.05,"y":65.5,"width":205,"height":200}},{"id":"1659334098930","index":1,"audio_url":"http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3","itemType":"rect","fontScale":1.61953125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.61953125,"dragDot":{"x":1036.5,"y":387.5},"gIdx":"0","labelText":"1","posX":1212.5,"posY":643.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/679fed26daa464819d553de6331b3552.json","name":"alien-pro.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/65d8214c6b5c5d0496e17adb0408276a.atlas","name":"alien-pro.atlas"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/a319b372899239325b90bb4ec07b4970.png","name":"alien-pro.png"},"animType":"spine","rect":{"x":375.56,"y":543.5,"width":200,"height":200}}]}
// return defaultData; // return defaultData;
}, },
...@@ -829,9 +857,8 @@ cc.Class({ ...@@ -829,9 +857,8 @@ cc.Class({
n.height = height; n.height = height;
n.active = true; n.active = true;
// db.playAnimation('null', 0); // db.playAnimation('null', 0);
// skeleton.setToSetupPose();
// skeleton.loop = true; // skeleton.setAnimation(0, 'enlarge', true);
// skeleton.animation = skeleton.animationNames[0]
this._allAnimationNodes.push(n); this._allAnimationNodes.push(n);
finishDbCount++; finishDbCount++;
...@@ -890,6 +917,8 @@ cc.Class({ ...@@ -890,6 +917,8 @@ cc.Class({
}; };
this._figurePointRectArray.push(rectInfo); this._figurePointRectArray.push(rectInfo);
// this.addRectNodeListener(block);
if (block.labelText) { if (block.labelText) {
const k = +block.labelText * 1000; const k = +block.labelText * 1000;
if(!isNaN(k)) { if(!isNaN(k)) {
...@@ -967,6 +996,42 @@ cc.Class({ ...@@ -967,6 +996,42 @@ cc.Class({
// this.initIcon(); // this.initIcon();
// }, // },
addRectNodeListener(data) {
const bg = cc.find(`Canvas/frame-border/ground/bg`);
const rate = (bg.scale * bg.width) / this.data.bgItem.rect.width;
const rectNode = new cc.Node();
rectNode.name = 'rect' + data.index;
bg.addChild(rectNode);
const ctx = rectNode.addComponent(cc.Graphics);
// 红色矩形
ctx.lineWidth = 4;
ctx.strokeColor = cc.Color.BLACK;
ctx.fillColor = cc.Color.WHITE.setA(100);
const scale = rate / bg.scaleY;
rectNode.width = data.rect.width * scale;
rectNode.height = data.rect.height * scale;
rectNode.x = -bg.width / 2 + data.rect.x * scale;
rectNode.y = bg.height / 2 - data.rect.height * scale - data.rect.y * scale;
rectNode.anchorX = rectNode.anchorY = 0;
// if (pageData.bgItem.isShowDebugLine) {
ctx.rect(0, 0, rectNode.width, rectNode.height);
// }
ctx.stroke();
ctx.fill();
},
initBg() { initBg() {
const bgNode = cc.find('Canvas/bg'); const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax; bgNode.scale = this._mapScaleMax;
......
...@@ -206,6 +206,8 @@ cc.Class({ ...@@ -206,6 +206,8 @@ cc.Class({
console.log('[answer] thinking and playing'); // check every second console.log('[answer] thinking and playing'); // check every second
var id = setInterval(function () { var id = setInterval(function () {
console.log("aaaaaa");
if (!_this._lastFingerPosition.dirty) { if (!_this._lastFingerPosition.dirty) {
return; return;
} }
...@@ -308,10 +310,19 @@ cc.Class({ ...@@ -308,10 +310,19 @@ cc.Class({
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
var an = context.questions[context.questionIndex].node; var an = context.questions[context.questionIndex].node;
an.active = true; an.active = true;
if (an.isSpine) {
var skeleton = an.getComponent(sp.Skeleton);
skeleton.setToSetupPose();
setTimeout(function () {
skeleton.setAnimation(0, 'normal', true);
}, 1);
} else {
var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('normal', 0); dragonDisplay.playAnimation('normal', 0);
console.log('show animation', an.active); console.log('show animation', an.active);
} }
}
(0, _util.playAudioByUrl)(wrongEffect, function () { (0, _util.playAudioByUrl)(wrongEffect, function () {
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
...@@ -470,9 +481,10 @@ cc.Class({ ...@@ -470,9 +481,10 @@ cc.Class({
actions: function actions() { actions: function actions() {
if (t.isSpine) { if (t.isSpine) {
var skeleton = t.getComponent(sp.Skeleton); var skeleton = t.getComponent(sp.Skeleton);
skeleton.pause(); skeleton.setToSetupPose();
skeleton.loop = false; setTimeout(function () {
skeleton.animation = 'enlarge'; // skeleton.animation = skeleton.animationNames[0]; skeleton.setAnimation(0, 'enlarge', false);
}, 1); // skeleton.animation = skeleton.animationNames[0];
} else { } else {
var dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('enlarge', 1); dragonDisplay.playAnimation('enlarge', 1);
...@@ -510,11 +522,16 @@ cc.Class({ ...@@ -510,11 +522,16 @@ cc.Class({
var _t = _this._allAnimationNodes[_i]; var _t = _this._allAnimationNodes[_i];
if (_t.isSpine) { if (_t.isSpine) {
(function () {
var skeleton = _t.getComponent(sp.Skeleton); var skeleton = _t.getComponent(sp.Skeleton);
skeleton.pause(); console.log('skeleton: ', skeleton);
skeleton.loop = true; skeleton.setToSetupPose();
skeleton.animation = 'normal'; // skeleton.animation = skeleton.animationNames[0]; setTimeout(function () {
skeleton.setAnimation(0, 'normal', true);
}, 1);
console.log('skeleton 22: ', skeleton); // skeleton.animation = skeleton.animationNames[0];
})();
} else { } else {
var dragonDisplay = _t.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = _t.getComponent(dragonBones.ArmatureDisplay);
...@@ -593,6 +610,8 @@ cc.Class({ ...@@ -593,6 +610,8 @@ cc.Class({
this.isDebug = false; this.isDebug = false;
}, },
checkInRegion: function checkInRegion(r) { checkInRegion: function checkInRegion(r) {
console.log('r~~~: ', r);
if (!this._lastFingerPosition && !this._lastFingerPosition.pos) { if (!this._lastFingerPosition && !this._lastFingerPosition.pos) {
return null; return null;
} }
...@@ -638,10 +657,10 @@ cc.Class({ ...@@ -638,10 +657,10 @@ cc.Class({
"bgItem": { "bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png", "url": "http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png",
"rect": { "rect": {
"x": 549.55, "x": 736.95,
"y": 0, "y": 0,
"width": 449.9, "width": 599.09,
"height": 582 "height": 775
} }
}, },
"hotZoneItemArr": [{ "hotZoneItemArr": [{
...@@ -649,74 +668,74 @@ cc.Class({ ...@@ -649,74 +668,74 @@ cc.Class({
"index": 0, "index": 0,
"audio_url": "http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3", "audio_url": "http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3",
"itemType": "rect", "itemType": "rect",
"fontScale": 1.21015625, "fontScale": 1.61953125,
"imgScale": 1, "imgScale": 1,
"imgSizeW": 0, "imgSizeW": 0,
"imgSizeH": 0, "imgSizeH": 0,
"mapScale": 1.21015625, "mapScale": 1.61953125,
"dragDot": { "dragDot": {
"x": 774.5, "x": 1036.5,
"y": 289.55016883743366 "y": 387.5
}, },
"gIdx": "1", "gIdx": "1",
"labelText": "1", "labelText": "1",
"posX": 887.5, "posX": 887.5,
"posY": 165.5, "posY": 165.5,
"skeJsonData": { "skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/d1f859d3fba84bd03565e543c986fb28.json", "url": "http://staging-teach.cdn.ireadabc.com/133a1f60719ed26247e35dc022d82862.json",
"name": "6_4_ske.json" "name": "spineboy-pro.json"
}, },
"texJsonData": { "texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/70f96e1cc7f013e27ed1952c503fb750.json", "url": "http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas",
"name": "6_4_tex.json" "name": "spineboy-pro.atlas"
}, },
"texPngData": { "texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/b06f9b90018a6eb0175a01e355b9ced6.png", "url": "http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png",
"name": "6_4_tex.png" "name": "spineboy-pro.png"
}, },
"animType": "dragonBone", "animType": "spine",
"rect": { "rect": {
"x": 36.08, "x": 48.05,
"y": 49.19, "y": 65.5,
"width": 153.95, "width": 205,
"height": 150.19 "height": 200
} }
}, { }, {
"id": "1659334098930", "id": "1659334098930",
"index": 1, "index": 1,
"audio_url": "http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3", "audio_url": "http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3",
"itemType": "rect", "itemType": "rect",
"fontScale": 1.21015625, "fontScale": 1.61953125,
"imgScale": 1, "imgScale": 1,
"imgSizeW": 0, "imgSizeW": 0,
"imgSizeH": 0, "imgSizeH": 0,
"mapScale": 1.21015625, "mapScale": 1.61953125,
"dragDot": { "dragDot": {
"x": 774.5, "x": 1036.5,
"y": 289.55016883743366 "y": 387.5
}, },
"gIdx": "0", "gIdx": "0",
"labelText": "1", "labelText": "1",
"posX": 1212.5, "posX": 1212.5,
"posY": 643.5, "posY": 643.5,
"skeJsonData": { "skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/bdbadb06e0c1157e727cecd28f28d10e.json", "url": "http://staging-teach.cdn.ireadabc.com/679fed26daa464819d553de6331b3552.json",
"name": "spineboy-pro.json" "name": "alien-pro.json"
}, },
"texJsonData": { "texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas", "url": "http://staging-teach.cdn.ireadabc.com/65d8214c6b5c5d0496e17adb0408276a.atlas",
"name": "spineboy-pro.atlas" "name": "alien-pro.atlas"
}, },
"texPngData": { "texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png", "url": "http://staging-teach.cdn.ireadabc.com/a319b372899239325b90bb4ec07b4970.png",
"name": "spineboy-pro.png" "name": "alien-pro.png"
}, },
"animType": "spine", "animType": "spine",
"rect": { "rect": {
"x": 282.03, "x": 375.56,
"y": 408.15, "y": 543.5,
"width": 150.19, "width": 200,
"height": 150.19 "height": 200
} }
}] }]
}; // return defaultData; }; // return defaultData;
...@@ -985,8 +1004,9 @@ cc.Class({ ...@@ -985,8 +1004,9 @@ cc.Class({
n.width = width; n.width = width;
n.height = height; n.height = height;
n.active = true; // db.playAnimation('null', 0); n.active = true; // db.playAnimation('null', 0);
// skeleton.loop = true; // skeleton.setToSetupPose();
// skeleton.animation = skeleton.animationNames[0]
skeleton.setAnimation(0, 'enlarge', true);
_this4._allAnimationNodes.push(n); _this4._allAnimationNodes.push(n);
...@@ -1048,7 +1068,8 @@ cc.Class({ ...@@ -1048,7 +1068,8 @@ cc.Class({
} }
}; };
_this4._figurePointRectArray.push(rectInfo); _this4._figurePointRectArray.push(rectInfo); // this.addRectNodeListener(block);
if (_block.labelText) { if (_block.labelText) {
var k = +_block.labelText * 1000; var k = +_block.labelText * 1000;
...@@ -1116,6 +1137,29 @@ cc.Class({ ...@@ -1116,6 +1137,29 @@ cc.Class({
// // this.initBtn(); // // this.initBtn();
// this.initIcon(); // this.initIcon();
// }, // },
addRectNodeListener: function addRectNodeListener(data) {
var bg = cc.find("Canvas/frame-border/ground/bg");
var rate = bg.scale * bg.width / this.data.bgItem.rect.width;
var rectNode = new cc.Node();
rectNode.name = 'rect' + data.index;
bg.addChild(rectNode);
var ctx = rectNode.addComponent(cc.Graphics); // 红色矩形
ctx.lineWidth = 4;
ctx.strokeColor = cc.Color.BLACK;
ctx.fillColor = cc.Color.WHITE.setA(100);
var scale = rate / bg.scaleY;
rectNode.width = data.rect.width * scale;
rectNode.height = data.rect.height * scale;
rectNode.x = -bg.width / 2 + data.rect.x * scale;
rectNode.y = bg.height / 2 - data.rect.height * scale - data.rect.y * scale;
rectNode.anchorX = rectNode.anchorY = 0; // if (pageData.bgItem.isShowDebugLine) {
ctx.rect(0, 0, rectNode.width, rectNode.height); // }
ctx.stroke();
ctx.fill();
},
initBg: function initBg() { initBg: function initBg() {
var bgNode = cc.find('Canvas/bg'); var bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax; bgNode.scale = this._mapScaleMax;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{ {
"nodeFoldStates": [ "nodeFoldStates": [
"37BUaKzO1GZatP7LpgbPNB" "37BUaKzO1GZatP7LpgbPNB",
"a5esZu+45LA5mBpvttspPD",
"4ap0eXsutH0p6T23R6gLW2",
"4cweWAxLhJZ6Y+paziXBfG",
"15R6Qnt3BGO7etkSPd83yJ",
"8c7k8ep/ZFNpO263+1QHz9",
"0aAzbH6R1E+6AmGRrkKa5O",
"9bLfcYeeNKrr524vzWchiM",
"53LUHHG2pEr79fyrvazXJs",
"b823DIVC9L+Ihc3T9Bt7m3"
] ]
} }
{"version":"1.0.8","stats":{"/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/__qc_index__.js":"2022-08-01T06:30:44.713Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/defaultData.js":"2022-08-01T06:30:44.689Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/scene/OP15.js":"2022-08-01T06:30:44.691Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/state.js":"2022-08-01T06:30:44.688Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/util.js":"2022-08-01T06:30:44.689Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/xstate.js":"2022-08-01T06:30:44.690Z"}} {"version":"1.0.8","stats":{"/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/__qc_index__.js":"2022-08-02T07:11:42.746Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/util.js":"2022-08-02T07:11:42.719Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/state.js":"2022-08-02T07:11:42.717Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/defaultData.js":"2022-08-02T07:11:42.722Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/scene/OP15.js":"2022-08-02T07:11:42.726Z","/Users/lmz/Documents/workspace/pro_hw/OP15/temp/quick-scripts/src/assets/OP15/script/xstate.js":"2022-08-02T07:11:42.724Z"}}
This diff is collapsed.
(function () { (function () {
var scripts = [{"deps":{"./assets/OP15/script/state":3,"./assets/OP15/script/xstate":5,"./assets/OP15/script/defaultData":1,"./assets/OP15/scene/OP15":2,"./assets/OP15/script/util":4},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/defaultData.js"},{"deps":{"../script/defaultData":1,"../script/xstate":5,"../script/util":4},"path":"preview-scripts/assets/OP15/scene/OP15.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/state.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/util.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/xstate.js"}]; var scripts = [{"deps":{"./assets/OP15/script/util":1,"./assets/OP15/script/state":2,"./assets/OP15/script/defaultData":3,"./assets/OP15/script/xstate":5,"./assets/OP15/scene/OP15":4},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/util.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/state.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/defaultData.js"},{"deps":{"../script/util":1,"../script/defaultData":3,"../script/xstate":5},"path":"preview-scripts/assets/OP15/scene/OP15.js"},{"deps":{},"path":"preview-scripts/assets/OP15/script/xstate.js"}];
var entries = ["preview-scripts/__qc_index__.js"]; var entries = ["preview-scripts/__qc_index__.js"];
var bundleScript = 'preview-scripts/__qc_bundle__.js'; var bundleScript = 'preview-scripts/__qc_bundle__.js';
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -206,6 +206,8 @@ cc.Class({ ...@@ -206,6 +206,8 @@ cc.Class({
console.log('[answer] thinking and playing'); // check every second console.log('[answer] thinking and playing'); // check every second
var id = setInterval(function () { var id = setInterval(function () {
console.log("aaaaaa");
if (!_this._lastFingerPosition.dirty) { if (!_this._lastFingerPosition.dirty) {
return; return;
} }
...@@ -308,10 +310,19 @@ cc.Class({ ...@@ -308,10 +310,19 @@ cc.Class({
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
var an = context.questions[context.questionIndex].node; var an = context.questions[context.questionIndex].node;
an.active = true; an.active = true;
if (an.isSpine) {
var skeleton = an.getComponent(sp.Skeleton);
skeleton.setToSetupPose();
setTimeout(function () {
skeleton.setAnimation(0, 'normal', true);
}, 1);
} else {
var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('normal', 0); dragonDisplay.playAnimation('normal', 0);
console.log('show animation', an.active); console.log('show animation', an.active);
} }
}
(0, _util.playAudioByUrl)(wrongEffect, function () { (0, _util.playAudioByUrl)(wrongEffect, function () {
if (context.questionPlayTimes >= context.maxQuestionTryTimes) { if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
...@@ -470,9 +481,10 @@ cc.Class({ ...@@ -470,9 +481,10 @@ cc.Class({
actions: function actions() { actions: function actions() {
if (t.isSpine) { if (t.isSpine) {
var skeleton = t.getComponent(sp.Skeleton); var skeleton = t.getComponent(sp.Skeleton);
skeleton.pause(); skeleton.setToSetupPose();
skeleton.loop = false; setTimeout(function () {
skeleton.animation = 'enlarge'; // skeleton.animation = skeleton.animationNames[0]; skeleton.setAnimation(0, 'enlarge', false);
}, 1); // skeleton.animation = skeleton.animationNames[0];
} else { } else {
var dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('enlarge', 1); dragonDisplay.playAnimation('enlarge', 1);
...@@ -510,11 +522,16 @@ cc.Class({ ...@@ -510,11 +522,16 @@ cc.Class({
var _t = _this._allAnimationNodes[_i]; var _t = _this._allAnimationNodes[_i];
if (_t.isSpine) { if (_t.isSpine) {
(function () {
var skeleton = _t.getComponent(sp.Skeleton); var skeleton = _t.getComponent(sp.Skeleton);
skeleton.pause(); console.log('skeleton: ', skeleton);
skeleton.loop = true; skeleton.setToSetupPose();
skeleton.animation = 'normal'; // skeleton.animation = skeleton.animationNames[0]; setTimeout(function () {
skeleton.setAnimation(0, 'normal', true);
}, 1);
console.log('skeleton 22: ', skeleton); // skeleton.animation = skeleton.animationNames[0];
})();
} else { } else {
var dragonDisplay = _t.getComponent(dragonBones.ArmatureDisplay); var dragonDisplay = _t.getComponent(dragonBones.ArmatureDisplay);
...@@ -593,6 +610,8 @@ cc.Class({ ...@@ -593,6 +610,8 @@ cc.Class({
this.isDebug = false; this.isDebug = false;
}, },
checkInRegion: function checkInRegion(r) { checkInRegion: function checkInRegion(r) {
console.log('r~~~: ', r);
if (!this._lastFingerPosition && !this._lastFingerPosition.pos) { if (!this._lastFingerPosition && !this._lastFingerPosition.pos) {
return null; return null;
} }
...@@ -638,10 +657,10 @@ cc.Class({ ...@@ -638,10 +657,10 @@ cc.Class({
"bgItem": { "bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png", "url": "http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png",
"rect": { "rect": {
"x": 549.55, "x": 736.95,
"y": 0, "y": 0,
"width": 449.9, "width": 599.09,
"height": 582 "height": 775
} }
}, },
"hotZoneItemArr": [{ "hotZoneItemArr": [{
...@@ -649,74 +668,74 @@ cc.Class({ ...@@ -649,74 +668,74 @@ cc.Class({
"index": 0, "index": 0,
"audio_url": "http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3", "audio_url": "http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3",
"itemType": "rect", "itemType": "rect",
"fontScale": 1.21015625, "fontScale": 1.61953125,
"imgScale": 1, "imgScale": 1,
"imgSizeW": 0, "imgSizeW": 0,
"imgSizeH": 0, "imgSizeH": 0,
"mapScale": 1.21015625, "mapScale": 1.61953125,
"dragDot": { "dragDot": {
"x": 774.5, "x": 1036.5,
"y": 289.55016883743366 "y": 387.5
}, },
"gIdx": "1", "gIdx": "1",
"labelText": "1", "labelText": "1",
"posX": 887.5, "posX": 887.5,
"posY": 165.5, "posY": 165.5,
"skeJsonData": { "skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/d1f859d3fba84bd03565e543c986fb28.json", "url": "http://staging-teach.cdn.ireadabc.com/133a1f60719ed26247e35dc022d82862.json",
"name": "6_4_ske.json" "name": "spineboy-pro.json"
}, },
"texJsonData": { "texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/70f96e1cc7f013e27ed1952c503fb750.json", "url": "http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas",
"name": "6_4_tex.json" "name": "spineboy-pro.atlas"
}, },
"texPngData": { "texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/b06f9b90018a6eb0175a01e355b9ced6.png", "url": "http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png",
"name": "6_4_tex.png" "name": "spineboy-pro.png"
}, },
"animType": "dragonBone", "animType": "spine",
"rect": { "rect": {
"x": 36.08, "x": 48.05,
"y": 49.19, "y": 65.5,
"width": 153.95, "width": 205,
"height": 150.19 "height": 200
} }
}, { }, {
"id": "1659334098930", "id": "1659334098930",
"index": 1, "index": 1,
"audio_url": "http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3", "audio_url": "http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3",
"itemType": "rect", "itemType": "rect",
"fontScale": 1.21015625, "fontScale": 1.61953125,
"imgScale": 1, "imgScale": 1,
"imgSizeW": 0, "imgSizeW": 0,
"imgSizeH": 0, "imgSizeH": 0,
"mapScale": 1.21015625, "mapScale": 1.61953125,
"dragDot": { "dragDot": {
"x": 774.5, "x": 1036.5,
"y": 289.55016883743366 "y": 387.5
}, },
"gIdx": "0", "gIdx": "0",
"labelText": "1", "labelText": "1",
"posX": 1212.5, "posX": 1212.5,
"posY": 643.5, "posY": 643.5,
"skeJsonData": { "skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/bdbadb06e0c1157e727cecd28f28d10e.json", "url": "http://staging-teach.cdn.ireadabc.com/679fed26daa464819d553de6331b3552.json",
"name": "spineboy-pro.json" "name": "alien-pro.json"
}, },
"texJsonData": { "texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas", "url": "http://staging-teach.cdn.ireadabc.com/65d8214c6b5c5d0496e17adb0408276a.atlas",
"name": "spineboy-pro.atlas" "name": "alien-pro.atlas"
}, },
"texPngData": { "texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png", "url": "http://staging-teach.cdn.ireadabc.com/a319b372899239325b90bb4ec07b4970.png",
"name": "spineboy-pro.png" "name": "alien-pro.png"
}, },
"animType": "spine", "animType": "spine",
"rect": { "rect": {
"x": 282.03, "x": 375.56,
"y": 408.15, "y": 543.5,
"width": 150.19, "width": 200,
"height": 150.19 "height": 200
} }
}] }]
}; // return defaultData; }; // return defaultData;
...@@ -985,8 +1004,9 @@ cc.Class({ ...@@ -985,8 +1004,9 @@ cc.Class({
n.width = width; n.width = width;
n.height = height; n.height = height;
n.active = true; // db.playAnimation('null', 0); n.active = true; // db.playAnimation('null', 0);
// skeleton.loop = true; // skeleton.setToSetupPose();
// skeleton.animation = skeleton.animationNames[0]
skeleton.setAnimation(0, 'enlarge', true);
_this4._allAnimationNodes.push(n); _this4._allAnimationNodes.push(n);
...@@ -1048,7 +1068,8 @@ cc.Class({ ...@@ -1048,7 +1068,8 @@ cc.Class({
} }
}; };
_this4._figurePointRectArray.push(rectInfo); _this4._figurePointRectArray.push(rectInfo); // this.addRectNodeListener(block);
if (_block.labelText) { if (_block.labelText) {
var k = +_block.labelText * 1000; var k = +_block.labelText * 1000;
...@@ -1116,6 +1137,29 @@ cc.Class({ ...@@ -1116,6 +1137,29 @@ cc.Class({
// // this.initBtn(); // // this.initBtn();
// this.initIcon(); // this.initIcon();
// }, // },
addRectNodeListener: function addRectNodeListener(data) {
var bg = cc.find("Canvas/frame-border/ground/bg");
var rate = bg.scale * bg.width / this.data.bgItem.rect.width;
var rectNode = new cc.Node();
rectNode.name = 'rect' + data.index;
bg.addChild(rectNode);
var ctx = rectNode.addComponent(cc.Graphics); // 红色矩形
ctx.lineWidth = 4;
ctx.strokeColor = cc.Color.BLACK;
ctx.fillColor = cc.Color.WHITE.setA(100);
var scale = rate / bg.scaleY;
rectNode.width = data.rect.width * scale;
rectNode.height = data.rect.height * scale;
rectNode.x = -bg.width / 2 + data.rect.x * scale;
rectNode.y = bg.height / 2 - data.rect.height * scale - data.rect.y * scale;
rectNode.anchorX = rectNode.anchorY = 0; // if (pageData.bgItem.isShowDebugLine) {
ctx.rect(0, 0, rectNode.width, rectNode.height); // }
ctx.stroke();
ctx.fill();
},
initBg: function initBg() { initBg: function initBg() {
var bgNode = cc.find('Canvas/bg'); var bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax; bgNode.scale = this._mapScaleMax;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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