Commit 650898cb authored by limingzhe's avatar limingzhe

feat: 增加字幕

parent ab8a2067
No preview for this file type
{
"ver": "1.1.2",
"uuid": "58587a0d-2954-4d49-9762-4bc8340a3f0b",
"uuid": "7d83ec39-5093-4021-9666-49e26af37cdb",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "52c8f1b8-c44f-42f9-b34d-4486372560b0",
"uuid": "80914185-1216-4324-9b13-7d1ebcc55999",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.0.1",
"uuid": "52baad63-c416-4ec6-b4e2-3d535a8e7056",
"uuid": "289260df-2f07-4a31-8082-123cd385c32e",
"downloadMode": 0,
"duration": 5.112,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "a14a7ea4-582b-4e92-ba6e-be0aee7915dc",
"uuid": "55cbd1a5-0a8d-4481-b814-0cf74905b80a",
"downloadMode": 0,
"duration": 1.1755,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "81f241f1-b861-45b3-8620-a95a16924ae0",
"uuid": "577ba884-99f1-4a6e-859c-17ec9b7feaab",
"downloadMode": 0,
"duration": 2.592,
"subMetas": {}
......
{
"ver": "1.1.2",
"uuid": "23fdb510-13c5-4617-ae3a-5d6c4099eed3",
"uuid": "eebb13fa-ef63-44c8-9cb5-c2a167f1e569",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "ec00843c-297f-4f13-94e3-7b619f1705e6",
"uuid": "e461f353-2456-4de1-aa9c-efa5c8fb143d",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.1",
"uuid": "6a5fc360-8e55-4b5a-a9d4-7e1d9dd13fe8",
"uuid": "f9b3f455-7403-4966-8242-e0617584e0c8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "3465dbdf-c386-4f21-adaa-4ed96ec5f714",
"uuid": "a6510d4e-3d67-4d4b-811b-005bacb2684d",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "636cf6ff-13be-4f48-b152-fceea95a3f3b",
"uuid": "3b19a449-f453-464b-8295-4fb421f2dc21",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"goodjob_tex": {
"ver": "1.0.4",
"uuid": "9ed0e969-1a40-445d-8105-001b5eba71f4",
"rawTextureUuid": "636cf6ff-13be-4f48-b152-fceea95a3f3b",
"uuid": "323e2187-adcb-4514-bcf1-62270086a2ae",
"rawTextureUuid": "3b19a449-f453-464b-8295-4fb421f2dc21",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "1.1.2",
"uuid": "25476d03-8993-4061-b91e-85e4d2d4df81",
"uuid": "97adcfce-1c03-4180-9634-4481430fff65",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.1",
"uuid": "c7092834-ce75-45c6-9e9f-0366caed94ef",
"uuid": "adb74601-6b78-4bb1-bbdc-4dac757da424",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "768bfac6-97a3-41a1-9106-36c7008119aa",
"uuid": "47ad91d9-be2c-4763-a62c-506ddc2d9fc5",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "bb93cc0b-ff19-48d7-99c2-3e24b68f1a7f",
"uuid": "39214557-5d75-4c50-b704-e710853a25f7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"hand_tex": {
"ver": "1.0.4",
"uuid": "7ef73f64-a67a-4eb5-9759-f08e3d1aa76d",
"rawTextureUuid": "bb93cc0b-ff19-48d7-99c2-3e24b68f1a7f",
"uuid": "e9c4c3ec-fa53-4581-8d9f-366741a6794b",
"rawTextureUuid": "39214557-5d75-4c50-b704-e710853a25f7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "1.1.2",
"uuid": "170fc469-84f8-46bb-966f-bb95a7e0af7e",
"uuid": "41cc4753-9759-42b1-bcbf-51ab4bcd754b",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.0",
"uuid": "34a37173-d7d1-4064-a0d2-ecd2c2da9fd9",
"uuid": "26e07875-b048-4e69-9271-ddf105a0b13a",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "96d7abab-93f6-42c0-a36f-bdc8727c95b6",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e36e76fb-b27a-4661-9603-f7d5605d9684",
"uuid": "0d621872-f6fb-41fb-9e33-4dde2457beea",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
......@@ -58,7 +58,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "ce833750-de1a-4b8a-ab94-59435bc4d744"
"_id": "682b69c6-e1e3-41cf-9702-7c19c8552b62"
},
{
"__type__": "cc.Node",
......@@ -84,13 +84,13 @@
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 37
},
{
"__id__": 36
"__id__": 38
},
{
"__id__": 37
"__id__": 39
}
],
"_prefab": null,
......@@ -320,7 +320,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "c7092834-ce75-45c6-9e9f-0366caed94ef#768bfac6-97a3-41a1-9106-36c7008119aa",
"_armatureKey": "adb74601-6b78-4bb1-bbdc-4dac757da424#47ad91d9-be2c-4763-a62c-506ddc2d9fc5",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -328,10 +328,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "c7092834-ce75-45c6-9e9f-0366caed94ef"
"__uuid__": "adb74601-6b78-4bb1-bbdc-4dac757da424"
},
"_N$dragonAtlasAsset": {
"__uuid__": "768bfac6-97a3-41a1-9106-36c7008119aa"
"__uuid__": "47ad91d9-be2c-4763-a62c-506ddc2d9fc5"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
......@@ -422,7 +422,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "6a5fc360-8e55-4b5a-a9d4-7e1d9dd13fe8#3465dbdf-c386-4f21-adaa-4ed96ec5f714",
"_armatureKey": "f9b3f455-7403-4966-8242-e0617584e0c8#a6510d4e-3d67-4d4b-811b-005bacb2684d",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -430,10 +430,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "6a5fc360-8e55-4b5a-a9d4-7e1d9dd13fe8"
"__uuid__": "f9b3f455-7403-4966-8242-e0617584e0c8"
},
"_N$dragonAtlasAsset": {
"__uuid__": "3465dbdf-c386-4f21-adaa-4ed96ec5f714"
"__uuid__": "a6510d4e-3d67-4d4b-811b-005bacb2684d"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
......@@ -455,10 +455,10 @@
"__id__": 10
},
{
"__id__": 13
"__id__": 15
},
{
"__id__": 28
"__id__": 30
}
],
"_active": false,
......@@ -521,6 +521,9 @@
"_children": [
{
"__id__": 11
},
{
"__id__": 13
}
],
"_active": true,
......@@ -652,7 +655,7 @@
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "34a37173-d7d1-4064-a0d2-ecd2c2da9fd9"
"__uuid__": "26e07875-b048-4e69-9271-ddf105a0b13a"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
......@@ -666,6 +669,99 @@
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
},
{
"__type__": "cc.Node",
"_name": "Muli_1GDlj",
"_objFlags": 0,
"_parent": {
"__id__": 10
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "49tqCj61pPmJYirNU4UgSF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "96d7abab-93f6-42c0-a36f-bdc8727c95b6"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "2bYYY85zFFeb0H180di0sU"
},
{
"__type__": "cc.Node",
"_name": "img",
......@@ -674,9 +770,6 @@
"__id__": 9
},
"_children": [
{
"__id__": 14
},
{
"__id__": 16
},
......@@ -694,6 +787,9 @@
},
{
"__id__": 26
},
{
"__id__": 28
}
],
"_active": true,
......@@ -751,13 +847,13 @@
"_name": "start_title",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
"__id__": 17
}
],
"_prefab": null,
......@@ -813,14 +909,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 16
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6622dd95-250a-4902-a32b-c5ca336b636c"
"__uuid__": "f9e19613-f44a-4447-89db-f5dad5e77c86"
},
"_type": 0,
"_sizeMode": 1,
......@@ -841,13 +937,13 @@
"_name": "light",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
"__id__": 19
}
],
"_prefab": null,
......@@ -903,14 +999,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 18
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1ac2d36e-e198-4b3d-8e60-0d97d85707ec"
"__uuid__": "a23f66a1-a179-4787-b44f-737bc7681e1a"
},
"_type": 0,
"_sizeMode": 1,
......@@ -931,13 +1027,13 @@
"_name": "black",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 21
}
],
"_prefab": null,
......@@ -993,14 +1089,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 20
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3b643066-451a-4245-8bbb-43ae9dfa2738"
"__uuid__": "292a36c1-396e-4f00-9b85-31fb6c669665"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1021,13 +1117,13 @@
"_name": "go_1",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 23
}
],
"_prefab": null,
......@@ -1083,14 +1179,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
"__id__": 22
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "4c403e42-5f96-4eee-bab6-481b2b93f071"
"__uuid__": "c725d2b7-2f84-43c7-93e9-c22173d814de"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1111,13 +1207,13 @@
"_name": "go_2",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 25
}
],
"_prefab": null,
......@@ -1173,14 +1269,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 24
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "57b38476-21b0-407c-9d66-6010161747d2"
"__uuid__": "c9460eb1-5326-4676-a57d-e0233423fe14"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1201,13 +1297,13 @@
"_name": "go_3",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
"__id__": 27
}
],
"_prefab": null,
......@@ -1263,14 +1359,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 26
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b8362dbc-ca4c-486a-a5f5-c0c06d464c39"
"__uuid__": "ea23d6b1-522a-4dc1-ad59-9155653658c0"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1291,13 +1387,13 @@
"_name": "go_0",
"_objFlags": 0,
"_parent": {
"__id__": 13
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 29
}
],
"_prefab": null,
......@@ -1353,14 +1449,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 28
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "67a29bd4-e5c4-4545-90f2-3f9a1beb3d7e"
"__uuid__": "c01177c1-ff8f-4606-9d49-4aef7476d22d"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1384,14 +1480,14 @@
"__id__": 9
},
"_children": [
{
"__id__": 29
},
{
"__id__": 31
},
{
"__id__": 33
},
{
"__id__": 35
}
],
"_active": true,
......@@ -1449,13 +1545,13 @@
"_name": "ready",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 32
}
],
"_prefab": null,
......@@ -1511,11 +1607,11 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 31
},
"_enabled": true,
"_clip": {
"__uuid__": "81f241f1-b861-45b3-8620-a95a16924ae0"
"__uuid__": "577ba884-99f1-4a6e-859c-17ec9b7feaab"
},
"_volume": 1,
"_mute": false,
......@@ -1530,13 +1626,13 @@
"_name": "go",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 32
"__id__": 34
}
],
"_prefab": null,
......@@ -1592,11 +1688,11 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 33
},
"_enabled": true,
"_clip": {
"__uuid__": "52baad63-c416-4ec6-b4e2-3d535a8e7056"
"__uuid__": "289260df-2f07-4a31-8082-123cd385c32e"
},
"_volume": 1,
"_mute": false,
......@@ -1611,13 +1707,13 @@
"_name": "goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
"__id__": 36
}
],
"_prefab": null,
......@@ -1673,11 +1769,11 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
"__id__": 35
},
"_enabled": true,
"_clip": {
"__uuid__": "a14a7ea4-582b-4e92-ba6e-be0aee7915dc"
"__uuid__": "55cbd1a5-0a8d-4481-b814-0cf74905b80a"
},
"_volume": 1,
"_mute": false,
......@@ -1732,7 +1828,7 @@
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "2c6032+jvBDnKLCc6RcXDVL",
"__type__": "d6a9aU8DFdPrrDz1okJfsEv",
"_name": "",
"_objFlags": 0,
"node": {
......
{
"ver": "1.2.9",
"uuid": "ce833750-de1a-4b8a-ab94-59435bc4d744",
"uuid": "682b69c6-e1e3-41cf-9702-7c19c8552b62",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
......
......@@ -61,13 +61,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
getState(cb) {
// this.isFirst = this.checkIsFirst();
// this.isLast = this.checkIsLast();
// this.playTimes = this.checkPlayTimes();
// this.jumpData = this.getJumpData();
this.isFirst = this.checkIsFirst();
this.isLast = this.checkIsLast();
this.playTimes = this.checkPlayTimes();
this.jumpData = this.getJumpData();
// cb && cb();
// return;
cb && cb();
return;
callMiddleLayerFunction('PSQS_get_course_info', {}, (data) => {
this.isFirst = data.first; //this.checkIsFirst();
......@@ -93,7 +93,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
getJumpData() {
return {step: 2};
return {step: 1};
}
......@@ -104,7 +104,38 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._cantouch = true;
this.canvas = cc.find("Canvas");
this.initLocalAudio();
this.initLyrics();
}
textArr;
textArrIndex;
initLyrics() {
this.textArr = [];
this.textArrIndex = 0;
const lyrics = this.data?.lrcData?.lyrics;
if (!lyrics) {
return;
}
for (let i=0; i<lyrics.length; i++) {
const data = lyrics[i].data;
if (!data) {
continue;
}
const time = lyrics[i].time;
let duration = 0;
if (i != lyrics.length - 1) {
duration = lyrics[i+1].time - lyrics[i].time;
}
this.textArr.push({data, time, duration});
}
}
readyClip;
......@@ -334,6 +365,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
audioId;
startAnim() {
this.dragonDisplay.playAnimation(this.animaNode.animationNames[0], 1);
......@@ -341,6 +373,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.playAudioByUrl(this.data.lrcData.audio_url);
cc.assetManager.loadRemote(this.data.lrcData.audio_url, (err, audioClip) => {
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
});
}
showHand(id) {
......@@ -364,10 +400,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
const clickBox = new cc.Node();
clickBox.width = clickBox.height = boxLen;
clickBox.parent = hand;
const ctx = clickBox.addComponent(cc.Graphics);
ctx.fillColor = cc.Color.RED.setA(100);
ctx.fillRect(-boxLen/2, -boxLen/2, boxLen, boxLen);
ctx.fill();
// const ctx = clickBox.addComponent(cc.Graphics);
// ctx.fillColor = cc.Color.RED.setA(100);
// ctx.fillRect(-boxLen/2, -boxLen/2, boxLen, boxLen);
// ctx.fill();
clickBox.on('touchstart', () => {
......@@ -388,6 +424,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.assetManager.loadRemote(this.data.lrcData.audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setCurrentTime(audioId, time);
this.audioId = audioId;
});
}
......@@ -446,7 +483,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// callMiddleLayerFunction('PSQS_show_rabbit', null, () => {
console.log(' in animPlayEnd 2')
callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
callMiddleLayerFunction('PSQS_play_animate_over', this.animaNode, () => {})
// })
}
......@@ -458,11 +495,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
const animaNode = new cc.Node();
this.canvas.addChild(animaNode);
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
if (!data.texPngData) {
return
......@@ -551,16 +586,120 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
curTextObj;
checkShowText() {
if (this.audioId == null) {
return;
}
if (!this.curTextObj) {
this.curTextObj = this.getCurTextObj();
}
if (!this.curTextObj) {
return;
}
const currentTime = cc.audioEngine.getCurrentTime(this.audioId);
const startTime = this.curTextObj.time;
if (currentTime >= startTime) {
this.showText(this.curTextObj, currentTime);
}
}
getCurTextObj() {
const data = this.textArr[this.textArrIndex];
if (data) {
this.textArrIndex ++;
}
return data;
}
textLabel;
showText(textObj, currentTime) {
if (textObj.isShow) {
return;
}
textObj.isShow = true;
// update (dt) {},
if (currentTime > Number(textObj.time) + Number(textObj.duration)) {
this.curTextObj = null;
return;
}
console.log('textObj: ', textObj);
if (!this.textLabel) {
this.textLabel = this.getTextLabel();
}
if (this.textLabel.curTween) {
this.textLabel.curTween.stop();
}
this.textLabel.string = `<outline color=white width=4>${textObj.data}</outline>`
if (textObj.duration ) {
this.textLabel.curTween = cc.tween(this.textLabel.node)
.to(0.1, {opacity: 0})
.to(0.2, {opacity: 255}, {easing: 'sineOut'})
.delay(textObj.duration - 0.4)
.call(() => {
this.curTextObj = null;
})
.to(0.1, {opacity: 0})
.start();
} else {
this.textLabel.curTween = cc.tween(this.textLabel.node)
.to(0.1, {opacity: 0})
.to(0.2, {opacity: 255}, {easing: 'sineOut'})
.start();
}
}
getTextLabel() {
const richTextNode = new cc.Node();
richTextNode.y = -this.canvas.height / 2 + 20 * this._mapScaleMin ;
richTextNode.opacity = 0;
richTextNode.anchorY = 0;
richTextNode.scale = this._mapScaleMin;
richTextNode.color = cc.Color.BLACK;
const richText = richTextNode.addComponent(cc.RichText);
const font = this.getFont('Muli_1GDlj');
richText.font = font;
richText.fontSize = 50;
richText.lineHeight = 60;
richText.maxWidth = this.canvas.width * 0.9;
richText.horizontalAlign = cc.macro.TextAlignment.CENTER;
this.canvas.addChild(richTextNode, 14);
return richText
}
getFont(name) {
const fontNode = cc.find("Canvas/res/font/" + name);
const font = fontNode.getComponent(cc.Label).font;
return font
}
update (dt) {
this.checkShowText();
}
initListener() {
......
{
"ver": "1.0.8",
"uuid": "2c603dbe-8ef0-439c-a2c2-73a45c5c354b",
"uuid": "d6a9a53c-0c57-4fae-b0f3-d689097ec12f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "76cfa3d9-c241-4a97-9588-90fd018e6bc1",
"uuid": "a82b10b7-1e87-40f5-b354-50539b4ef0d5",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.0.8",
"uuid": "4f0ad458-c88a-4261-b03d-c99468bfce75",
"uuid": "9fce4186-7c9e-4baf-9735-a6c62ac80606",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
export const defaultData = {"songArr":[{},{},{},{}],"lrcData":{"audio_url":"http://staging-teach.cdn.ireadabc.com/16cebf8be768535b68df70b8d25a7462.mp3","fontSize":24,"lineHeight":32,"lyrics":[]},"stepArr":[{"text":"432","px":"0","X":"0.2","Y":"0.3"},{"text":"648","X":"0","Y":"0"}],"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/275aa8c510a1ee7b936ca837de00ca2a.json","name":"1_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/fec620437ee4d51e11e7fe7a524f06ea.json","name":"1_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/4fb895205ad5787e582cd65e517026d6.png","name":"1_tex.png"},"frame":"24"}
\ No newline at end of file
export const defaultData = {"songArr":[{},{},{},{}],"lrcData":{"audio_url":"http://staging-teach.cdn.ireadabc.com/16cebf8be768535b68df70b8d25a7462.mp3","fontSize":24,"lineHeight":32,"lyrics":[{"time":20.399973,"data":"zi zi zi ...","newLine":false},{"time":23.867417,"data":"","newLine":false},{"time":26.611311,"data":"This wheel is for the bicycle. This wheel is for the bicycle This wheel is for the bicycle This wheel is for the bicycle ","newLine":false},{"time":30.723609,"data":"","newLine":false}]},"stepArr":[{"text":"432","px":"0","X":"0.2","Y":"0.3"},{"text":"648","X":"0","Y":"0"}],"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/275aa8c510a1ee7b936ca837de00ca2a.json","name":"1_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/fec620437ee4d51e11e7fe7a524f06ea.json","name":"1_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/4fb895205ad5787e582cd65e517026d6.png","name":"1_tex.png"},"frame":"24"}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "23126436-3314-4fea-96f0-d987fc8d981a",
"uuid": "3edc0987-b8f6-4e44-8846-d74d1680403b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "ddb68b8b-723c-49b4-9b14-114cfcc509f7",
"uuid": "059446da-7c3a-4f5c-bd42-6bd19edffe7d",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "4ed42bef-3ad4-4b2a-9688-3561bd3c0d6d",
"uuid": "4f93fcde-7820-4638-a9dc-463611e3392b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "4c4b4a70-6acb-419d-b0cd-48b496781355",
"uuid": "53746a03-9379-4c18-9336-7bd92a141edb",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.3.5",
"uuid": "ea996201-76d2-4c57-a338-edcc9e0cdac1",
"uuid": "371e4dcb-abc8-4934-bba4-41e35302a2bb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"black": {
"ver": "1.0.4",
"uuid": "3b643066-451a-4245-8bbb-43ae9dfa2738",
"rawTextureUuid": "ea996201-76d2-4c57-a338-edcc9e0cdac1",
"uuid": "292a36c1-396e-4f00-9b85-31fb6c669665",
"rawTextureUuid": "371e4dcb-abc8-4934-bba4-41e35302a2bb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "f0dbf162-4578-4725-9323-807d8ffbf4cd",
"uuid": "b507a037-3317-41bc-be75-8dcf2fed794a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_0": {
"ver": "1.0.4",
"uuid": "67a29bd4-e5c4-4545-90f2-3f9a1beb3d7e",
"rawTextureUuid": "f0dbf162-4578-4725-9323-807d8ffbf4cd",
"uuid": "c01177c1-ff8f-4606-9d49-4aef7476d22d",
"rawTextureUuid": "b507a037-3317-41bc-be75-8dcf2fed794a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "58424e90-a27a-488e-a0bd-ae62d9fa7a2e",
"uuid": "8490959f-296f-4770-8a5a-9e09f4b9566e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_1": {
"ver": "1.0.4",
"uuid": "4c403e42-5f96-4eee-bab6-481b2b93f071",
"rawTextureUuid": "58424e90-a27a-488e-a0bd-ae62d9fa7a2e",
"uuid": "c725d2b7-2f84-43c7-93e9-c22173d814de",
"rawTextureUuid": "8490959f-296f-4770-8a5a-9e09f4b9566e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "383fd552-6745-41fc-9fd1-f05fdc93d2f7",
"uuid": "53548508-0fc3-4c4a-a39c-8313e7c913ac",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_2": {
"ver": "1.0.4",
"uuid": "57b38476-21b0-407c-9d66-6010161747d2",
"rawTextureUuid": "383fd552-6745-41fc-9fd1-f05fdc93d2f7",
"uuid": "c9460eb1-5326-4676-a57d-e0233423fe14",
"rawTextureUuid": "53548508-0fc3-4c4a-a39c-8313e7c913ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "68b06215-5c2e-435c-9403-c41cfdb9998f",
"uuid": "d0464e45-c70b-4902-a559-a91b842735c1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"go_3": {
"ver": "1.0.4",
"uuid": "b8362dbc-ca4c-486a-a5f5-c0c06d464c39",
"rawTextureUuid": "68b06215-5c2e-435c-9403-c41cfdb9998f",
"uuid": "ea23d6b1-522a-4dc1-ad59-9155653658c0",
"rawTextureUuid": "d0464e45-c70b-4902-a559-a91b842735c1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "26d69f6f-63f6-44c6-b5e7-9908c310588d",
"uuid": "1c32a1fd-f076-4d71-b32d-55c47a82f8b5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"light": {
"ver": "1.0.4",
"uuid": "1ac2d36e-e198-4b3d-8e60-0d97d85707ec",
"rawTextureUuid": "26d69f6f-63f6-44c6-b5e7-9908c310588d",
"uuid": "a23f66a1-a179-4787-b44f-737bc7681e1a",
"rawTextureUuid": "1c32a1fd-f076-4d71-b32d-55c47a82f8b5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"ver": "2.3.5",
"uuid": "5a962eaa-60b6-4a7f-b75e-ac959bee4f8d",
"uuid": "74aed9e9-851d-4e81-b5b1-d8ed5222c353",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
......@@ -13,8 +13,8 @@
"subMetas": {
"start_title": {
"ver": "1.0.4",
"uuid": "6622dd95-250a-4902-a32b-c5ca336b636c",
"rawTextureUuid": "5a962eaa-60b6-4a7f-b75e-ac959bee4f8d",
"uuid": "f9e19613-f44a-4447-89db-f5dad5e77c86",
"rawTextureUuid": "74aed9e9-851d-4e81-b5b1-d8ed5222c353",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "ce833750-de1a-4b8a-ab94-59435bc4d744",
"startScene": "682b69c6-e1e3-41cf-9702-7c19c8552b62",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
......
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