Commit 4cd4c94c authored by 李维's avatar 李维

添加获取字体方法

parent ef721862
No preview for this file type
{
"ver": "1.1.0",
"uuid": "4342162b-829c-4ccb-af5e-e9ad4b6f5af0",
"subMetas": {}
}
\ No newline at end of file
......@@ -335,10 +335,10 @@
"_active": true,
"_components": [
{
"__id__": 96
"__id__": 99
},
{
"__id__": 97
"__id__": 100
}
],
"_prefab": null,
......@@ -3180,6 +3180,9 @@
},
{
"__id__": 87
},
{
"__id__": 96
}
],
"_active": false,
......@@ -4243,6 +4246,161 @@
"preload": false,
"_id": "c7wSKx4xVIyYgtbXtj2vvD"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 75
},
"_children": [
{
"__id__": 97
}
],
"_active": true,
"_components": [],
"_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": "b5C8ulhRdOdIt0xfcjHkH9"
},
{
"__type__": "cc.Node",
"_name": "ms_bold",
"_objFlags": 0,
"_parent": {
"__id__": 96
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 98
}
],
"_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": "33F9uuJn1CP76AhgkzB5qO"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 97
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "4342162b-829c-4ccb-af5e-e9ad4b6f5af0"
},
"_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": "cagPVzHylKWaCzIRfF2/Wv"
},
{
"__type__": "cc.Widget",
"_name": "",
......
......@@ -83,6 +83,15 @@ export default class MiddleLayerClass extends middleLayerBase {
// }, 2000);
}
getFont(fontName) {
const fN = cc.find(`middleLayer/res/font/${fontName}`)
if(fN) {
return fN.getComponent(cc.Label).font
} else {
return null
}
}
saveAnswer(data) {
return new Promise(resovle => {
this.callNetworkApiPost(`/api/kyxq/v1/user/saveanswer`, {
......
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