问题描述及使用流程:
有时候用纯代码生成非常复杂和麻烦,就像我写一个小单脚本,用得到UI,就需要设置各种属性之类的,很麻烦。
直接设置UI界面,会让东西增加很多,guan'l
复制按钮后,会复制为JSON,官方是否有通过JSON来创建UI的?这样减少好多UI设置的时间。
如JSON: 通过一个API 导入这个JSON 就会创建一个自己想要按钮
{
"Button": {
"RenderOffset": {
"X": 0.0,
"Y": 0.0
},
"RenderBlankSizeScale": 1.0,
"Text": "菜单",
"Translate": true,
"FontSize": 30.0,
"FontSpace": 0.0,
"Font": {
"FontSize": 30.0,
"LetterSpacing": 0.0,
"FontGlyph": 0.0,
"FontStrikeline": false,
"FontUnderline": false,
"ContentColor": {
"R": 0.002125,
"G": 0.061246,
"B": 0.043735,
"A": 1.0
},
"ShadowColor": {
"R": 0.0,
"G": 0.0,
"B": 0.0,
"A": 1.0
},
"ShadowOffset": {
"X": 0.0,
"Y": 0.0
},
"TextAlign": 1.0,
"TextVerticalAlign": 1.0,
"TextOutlineColor": {
"R": 0.0,
"G": 0.806952,
"B": 0.0,
"A": 1.0
},
"TextOutlineSize": 0.0,
"FontFamily": "Roboto"
},
"NormalTexture": {
"ImageSize": {
"X": 292.0,
"Y": 104.0
},
"ImageColor": {
"R": 0.000304,
"G": 1.0,
"B": 0.610496,
"A": 1.0
},
"DrawAs": 1.0,
"Margin": {
"Left": 0.2,
"Top": 0.2,
"Right": 0.2,
"Bottom": 0.2
},
"FileGuid": "142733"
},
"HasTransition": false,
"PressedTexture": {
"ImageSize": {
"X": 292.0,
"Y": 104.0
},
"ImageColor": {
"R": 0.0,
"G": 0.822786,
"B": 0.617207,
"A": 1.0
},
"DrawAs": 1.0,
"Margin": {
"Left": 0.2,
"Top": 0.2,
"Right": 0.2,
"Bottom": 0.2
},
"FileGuid": "142733"
},
"DisabledTexture": {
"ImageSize": {
"X": 292.0,
"Y": 104.0
},
"ImageColor": {
"R": 0.000304,
"G": 1.0,
"B": 0.610496,
"A": 1.0
},
"DrawAs": 1.0,
"Margin": {
"Left": 0.2,
"Top": 0.2,
"Right": 0.2,
"Bottom": 0.2
},
"FileGuid": "142733"
},
"RenderOpacity": 1.0,
"Transform": {
"Position": {
"X": 760.0,
"Y": 930.0
},
"Size": {
"X": 400.0,
"Y": 100.0
}
},
"Constraint": {
"MWUIConstraintH": 3.0,
"MWUIConstraintV": 3.0
},
"Name": "菜单"
}
}
相关截图或视频:
补充信息(版本、日志等):
|