Commit 2d3ac2b9 authored by Tt's avatar Tt

bug修复 字体更换待处理公共内容

parent e41f742d
{
"ver": "1.1.0",
"uuid": "ce03a98b-db6a-4cfd-8bc5-f651ecb70ec5",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "32baa0a8-ccb9-4586-8805-55df5ad154d6",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "b6526ba1-a312-466b-98b0-fb0e4c49c488",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "95f57760-9ad9-41aa-8c8d-49e71a2ecb38",
"subMetas": {}
}
\ No newline at end of file
...@@ -1081,7 +1081,7 @@ ...@@ -1081,7 +1081,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 109.93,
"height": 65.52 "height": 65.52
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -1135,11 +1135,13 @@ ...@@ -1135,11 +1135,13 @@
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "", "_string": "",
"_N$string": "", "_N$string": "",
"_fontSize": 52, "_fontSize": 55,
"_lineHeight": 52, "_lineHeight": 55,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "b6526ba1-a312-466b-98b0-fb0e4c49c488"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -1561,7 +1563,7 @@ ...@@ -1561,7 +1563,7 @@
"__id__": 32 "__id__": 32
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 34 "__id__": 34
...@@ -1640,8 +1642,8 @@ ...@@ -1640,8 +1642,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 183.52, "width": 225.16,
"height": 75.6 "height": 126
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1652,7 +1654,7 @@ ...@@ -1652,7 +1654,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
50, 81.33,
-30, -30,
0, 0,
0, 0,
...@@ -1694,11 +1696,13 @@ ...@@ -1694,11 +1696,13 @@
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "58.198", "_string": "58.198",
"_N$string": "58.198", "_N$string": "58.198",
"_fontSize": 60, "_fontSize": 90,
"_lineHeight": 60, "_lineHeight": 100,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "32baa0a8-ccb9-4586-8805-55df5ad154d6"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -1833,8 +1837,8 @@ ...@@ -1833,8 +1837,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 183.52, "width": 225.16,
"height": 75.6 "height": 126
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1845,7 +1849,7 @@ ...@@ -1845,7 +1849,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
50, 81.33,
-30, -30,
0, 0,
0, 0,
...@@ -1868,7 +1872,7 @@ ...@@ -1868,7 +1872,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "d8kRzVywNPibGWOTNd1k8M" "_id": "b04mSMnDNFFb6m08l/Us7s"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -1885,13 +1889,15 @@ ...@@ -1885,13 +1889,15 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "58.189", "_string": "58.198",
"_N$string": "58.189", "_N$string": "58.198",
"_fontSize": 60, "_fontSize": 90,
"_lineHeight": 60, "_lineHeight": 100,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "32baa0a8-ccb9-4586-8805-55df5ad154d6"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -1901,7 +1907,7 @@ ...@@ -1901,7 +1907,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "a4TqRVFnFC7YSU0wdifXrh" "_id": "b3GLz/oAVDnYopkTRBiAG1"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2194,7 +2200,7 @@ ...@@ -2194,7 +2200,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 100,
"height": 40 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -2249,7 +2255,7 @@ ...@@ -2249,7 +2255,7 @@
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "188cf4e0-e904-4deb-a4fc-6a3c295984e1" "__uuid__": "188cf4e0-e904-4deb-a4fc-6a3c295984e1"
}, },
"_type": 0, "_type": 1,
"_sizeMode": 0, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
...@@ -2403,7 +2409,7 @@ ...@@ -2403,7 +2409,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 28.36, "width": 30.09,
"height": 64.26 "height": 64.26
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -2415,8 +2421,8 @@ ...@@ -2415,8 +2421,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0.43999999999999995,
10, 9.128,
0, 0,
0, 0,
0, 0,
...@@ -2460,8 +2466,10 @@ ...@@ -2460,8 +2466,10 @@
"_fontSize": 51, "_fontSize": 51,
"_lineHeight": 51, "_lineHeight": 51,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "ce03a98b-db6a-4cfd-8bc5-f651ecb70ec5"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -2567,7 +2575,7 @@ ...@@ -2567,7 +2575,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
0, -4,
0, 0,
0, 0,
0, 0,
...@@ -2816,7 +2824,7 @@ ...@@ -2816,7 +2824,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
236, 229.226,
754, 754,
0, 0,
0, 0,
...@@ -3180,7 +3188,7 @@ ...@@ -3180,7 +3188,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 22.25, "width": 23.6,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3237,8 +3245,10 @@ ...@@ -3237,8 +3245,10 @@
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "ce03a98b-db6a-4cfd-8bc5-f651ecb70ec5"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -3275,7 +3285,7 @@ ...@@ -3275,7 +3285,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 44.49, "width": 47.2,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3332,8 +3342,10 @@ ...@@ -3332,8 +3342,10 @@
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "ce03a98b-db6a-4cfd-8bc5-f651ecb70ec5"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -3370,7 +3382,7 @@ ...@@ -3370,7 +3382,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 44.49, "width": 47.2,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3382,7 +3394,7 @@ ...@@ -3382,7 +3394,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
236, 229.226,
820, 820,
0, 0,
0, 0,
...@@ -3427,8 +3439,10 @@ ...@@ -3427,8 +3439,10 @@
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "ce03a98b-db6a-4cfd-8bc5-f651ecb70ec5"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
...@@ -3763,7 +3777,7 @@ ...@@ -3763,7 +3777,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 572, "width": 547.35,
"height": 65.52 "height": 65.52
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3815,13 +3829,15 @@ ...@@ -3815,13 +3829,15 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "请在秒内说出正确答案", "_string": "请在5秒内说出正确答案",
"_N$string": "请在秒内说出正确答案", "_N$string": "请在5秒内说出正确答案",
"_fontSize": 52, "_fontSize": 52,
"_lineHeight": 52, "_lineHeight": 52,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": {
"_isSystemFontUsed": true, "__uuid__": "b6526ba1-a312-466b-98b0-fb0e4c49c488"
},
"_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 0,
......
...@@ -97,10 +97,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -97,10 +97,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
getCurrent() { getCurrent() {
return this.data.options[this.currentId]; return this.data.options[this.currentId];
} }
getNext() {
return this.data.options[this.currentId + 1];
}
async initGame() { async initGame() {
// this.showCamera(); this.showCamera();
// await this.showBegin() await this.showBegin()
// this.hideBegin(); this.hideBegin();
this.startQuestion(); this.startQuestion();
} }
...@@ -128,10 +131,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -128,10 +131,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.aniBottomEnter().then(() => { this.aniBottomEnter().then(() => {
pg.hw.playAudio('readyGo', false, () => { pg.hw.playAudio('readyGo', false, () => {
}); });
cc.tween(ready).to(1, { y: -20 }).to(0.2, { y: 0 }).delay(0.3).call(() => { cc.tween(ready).to(1, { y: -50 }).to(0.2, { y: 0 }).delay(0.3).call(() => {
ready.active = false; ready.active = false;
}).start(); }).start();
cc.tween(go).delay(1).to(1, { y: -20 }).to(0.2, { y: 0 }).delay(0.5).call(() => { cc.tween(go).delay(1.3).to(1, { y: -50 }).to(0.2, { y: 0 }).delay(0.5).call(() => {
go.active = false; go.active = false;
resolve(''); resolve('');
}).start(); }).start();
...@@ -167,7 +170,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -167,7 +170,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.gameStart = true; this.gameStart = true;
this.state = State.Recording; this.state = State.Recording;
this.currentItemQuestion = this.createQuestionItem(cc.v2(0, 50)); this.currentItemQuestion = this.createQuestionItem(cc.v2(0, 50));
this.updateQuestion(); this.updateQuestion(this.currentItemQuestion, this.getCurrent());
this.updateProgress(); this.updateProgress();
} }
...@@ -183,13 +186,27 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -183,13 +186,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
//题目 //题目
updateQuestion() { updateQuestion(item, data) {
let itemQuestion = this.currentItemQuestion; pg.view.setNetImg(pg.view.find(item, "img"), data.image, { w: 700, h: 360 })
let data = this.getCurrent(); pg.view.setString(pg.view.find(item, "text"), data.text)
pg.view.setNetImg(pg.view.find(itemQuestion, "img"), data.image, { w: 700, h: 360 }) }
pg.view.setString(pg.view.find(itemQuestion, "text"), data.text) nextQuestion() {
this.currentId++;
if (!this.getCurrent()) {
this.gameOver();
return;
}
this.hideAnswer();
this.nextItemQuestion = this.createQuestionItem(cc.v2(2000, 50));
this.updateQuestion(this.nextItemQuestion, this.getCurrent());
pg.hw.playLocalAudio('showCard')
cc.tween(this.currentItemQuestion).to(0.5, { x: -2000, y: 50 }).start();
cc.tween(this.nextItemQuestion).to(0.5, { x: 0, y: 50 }).call(() => {
this.currentItemQuestion.parent = null;
this.currentItemQuestion = this.nextItemQuestion;
this.nextItemQuestion = null;
}).start();
} }
//------------------------------Loop---------------------------------- //------------------------------Loop----------------------------------
private gameStart: boolean; private gameStart: boolean;
private state: number; private state: number;
...@@ -225,13 +242,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -225,13 +242,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
break; break;
case State.RecordShow: case State.RecordShow:
this.state = State.Recording; this.state = State.Recording;
this.hideAnswer(); this.nextQuestion()
this.currentId++;
if (!this.getCurrent()) {
this.gameOver();
return;
}
this.updateQuestion()
break; break;
} }
} }
...@@ -258,11 +269,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -258,11 +269,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
//回答正确后回调 //回答正确后回调
onAnswerRight(row) { onAnswerRight(row) {
//答对题目数 //答对题目数
pg.hw.playLocalAudio('right');
this.right += 1 this.right += 1
row.children[0].active = true row.children[0].active = true
this.updateProgressPercent(); this.updateProgressPercent();
} }
onAnswerError(row) { onAnswerError(row) {
pg.hw.playLocalAudio('mistake');
//错误音频 //错误音频
pg.audio.playAudioByUrl(this.getCurrent().audio); pg.audio.playAudioByUrl(this.getCurrent().audio);
//错误 //错误
...@@ -347,10 +360,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -347,10 +360,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
//星星切换 //星星切换
for (let i = 1; i <= 3; i++) { for (let i = 1; i <= 3; i++) {
if (this.right == Math.round(this.data.options.length / 3 * i)) { if (this.right == Math.round(this.data.options.length / 3 * i)) {
layout_progress.children[2].children[i - 1].active = false layout_progress.getChildByName("star2").children[i - 1].active = false
layout_progress.children[2].children[i + 2].active = true layout_progress.getChildByName("star2").children[i + 2].active = true
}
if (this.right == Math.round(this.data.options.length / 3 * 2)) {
layout_progress.getChildByName('ProgressBar').getChildByName('ColoredProgressBar').active = true
} }
if (this.right == Math.round(this.data.options.length / 3 * 2)) layout_progress.children[0].children[1].active = true
} }
//进度条 //进度条
this.lengthProgress += 1 / this.data.options.length this.lengthProgress += 1 / this.data.options.length
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
"rawHeight": 42, "rawHeight": 42,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 13,
"borderRight": 0, "borderRight": 11,
"subMetas": {} "subMetas": {}
} }
} }
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
"rawHeight": 40, "rawHeight": 40,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 14,
"borderRight": 0, "borderRight": 17,
"subMetas": {} "subMetas": {}
} }
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f74eb491-1495-417c-9c21-25a480709072", "uuid": "f74eb491-1495-417c-9c21-25a480709072",
"downloadMode": 0, "downloadMode": 0,
"duration": 3.168, "duration": 2.664,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
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