Commit b26bb8d2 authored by xytk's avatar xytk

提交代码

parent ddfebd10
{
"CurrentProjectSetting": null
}
\ No newline at end of file
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
<div style="width: 300px; margin-top: 15px;"> <div style="width: 300px; margin-top: 15px;">
<span>文本: </span> <span>xytk文本: </span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()"> <input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
</div> </div>
......
...@@ -79,18 +79,21 @@ ...@@ -79,18 +79,21 @@
}, },
{ {
"__id__": 14 "__id__": 14
},
{
"__id__": 16
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 26
}, },
{ {
"__id__": 25 "__id__": 27
}, },
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -180,7 +183,7 @@ ...@@ -180,7 +183,7 @@
"array": [ "array": [
0, 0,
0, 0,
362.85545494732423, 850.775237689672,
0, 0,
0, 0,
0, 0,
...@@ -728,6 +731,102 @@ ...@@ -728,6 +731,102 @@
"_N$target": null, "_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu" "_id": "1aj32fYY1IxLesa77E70Qu"
}, },
{
"__type__": "cc.Node",
"_name": "text",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97.87,
"height": 50.4
},
"_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": "efo5LzjDlMRriwQcUxFOHM"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": false,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "51gVNnEZhDmqxnOzvoCWjS"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "res", "_name": "res",
...@@ -737,13 +836,13 @@ ...@@ -737,13 +836,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 15 "__id__": 17
}, },
{ {
"__id__": 18 "__id__": 20
}, },
{ {
"__id__": 21 "__id__": 23
} }
], ],
"_active": false, "_active": false,
...@@ -801,11 +900,11 @@ ...@@ -801,11 +900,11 @@
"_name": "font", "_name": "font",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 16
}, },
"_children": [ "_children": [
{ {
"__id__": 16 "__id__": 18
} }
], ],
"_active": true, "_active": true,
...@@ -863,13 +962,13 @@ ...@@ -863,13 +962,13 @@
"_name": "BRLNSDB", "_name": "BRLNSDB",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 15 "__id__": 17
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 19
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -925,7 +1024,7 @@ ...@@ -925,7 +1024,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 18
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -957,11 +1056,11 @@ ...@@ -957,11 +1056,11 @@
"_name": "img", "_name": "img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 16
}, },
"_children": [ "_children": [
{ {
"__id__": 19 "__id__": 21
} }
], ],
"_active": true, "_active": true,
...@@ -1019,13 +1118,13 @@ ...@@ -1019,13 +1118,13 @@
"_name": "icon", "_name": "icon",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 18 "__id__": 20
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 20 "__id__": 22
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1081,7 +1180,7 @@ ...@@ -1081,7 +1180,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 19 "__id__": 21
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -1109,11 +1208,11 @@ ...@@ -1109,11 +1208,11 @@
"_name": "audio", "_name": "audio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 16
}, },
"_children": [ "_children": [
{ {
"__id__": 22 "__id__": 24
} }
], ],
"_active": true, "_active": true,
...@@ -1171,13 +1270,13 @@ ...@@ -1171,13 +1270,13 @@
"_name": "btn", "_name": "btn",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 23
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 25
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1233,7 +1332,7 @@ ...@@ -1233,7 +1332,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -1298,6 +1397,9 @@ ...@@ -1298,6 +1397,9 @@
"__id__": 2 "__id__": 2
}, },
"_enabled": true, "_enabled": true,
"textLabel": {
"__id__": 15
},
"_id": "e687yyoRBIzZAOVRL8Sseh" "_id": "e687yyoRBIzZAOVRL8Sseh"
} }
] ]
\ No newline at end of file
...@@ -12,8 +12,11 @@ cc.Class({ ...@@ -12,8 +12,11 @@ cc.Class({
extends: cc.Component, extends: cc.Component,
properties: { properties: {
textLabel:cc.Label
}, },
// 生命周期 onLoad // 生命周期 onLoad
onLoad() { onLoad() {
this.initSceneData(); this.initSceneData();
...@@ -70,6 +73,7 @@ cc.Class({ ...@@ -70,6 +73,7 @@ cc.Class({
console.log('data:', data); console.log('data:', data);
this.data = data || this.getDefaultData(); this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data)) this.data = JSON.parse(JSON.stringify(this.data))
this.preloadItem() this.preloadItem()
}) })
}, },
...@@ -80,7 +84,7 @@ cc.Class({ ...@@ -80,7 +84,7 @@ cc.Class({
getDefaultData() { getDefaultData() {
const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}' const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"这是测试文本xytk.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}'
const data = JSON.parse(dataJson); const data = JSON.parse(dataJson);
return data; return data;
}, },
...@@ -95,13 +99,13 @@ cc.Class({ ...@@ -95,13 +99,13 @@ cc.Class({
addPreloadImage() { addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url }); // this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 }); // this._imageResList.push({ url: this.data.pic_url_2 });
}, },
addPreloadAudio() { addPreloadAudio() {
this._audioResList.push({ url: this.data.audio_url }); // this._audioResList.push({ url: this.data.audio_url });
}, },
addPreloadAnima() { addPreloadAnima() {
......
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