local widget = ccs.GUIReader:getInstance():widgetFromJsonFile("commonLayout.json")
and it tips
Assertion failed!
Program: C:\project\GameClient\simulator\win32\libcocos2d.dll
File: C:\project\GameClient\frameworks\cocos2d-x…/document.h
Line: 839
Expression: false
thanks alot @zhangxm
Here is json file
{
“ID”: “18638f6d-e1cb-4bd3-9bf1-3f4661df3100”,
“Version”: “3.10.0.0”,
“Name”: “commonLayout”,
“Content”: {
“Content”: {
“Animation”: {
“Duration”: 0,
“Speed”: 1.0,
“Timelines”: [],
“ctype”: “TimelineActionData”
},
“AnimationList”: [],
“ObjectData”: {
“Tag”: 202,
“Children”: [
{
“FileData”: {
“Type”: “Normal”,
“Path”: “HelloWorld.png”,
“Plist”: “”
},
“Scale9OriginX”: 316,
“Scale9OriginY”: 211,
“Scale9Width”: 328,
“Scale9Height”: 218,
“AnchorPoint”: {
“ScaleX”: 0.5,
“ScaleY”: 0.5
},
“Position”: {
“X”: 475.3405,
“Y”: 320.4154
},
“Scale”: {
“ScaleX”: 1.0,
“ScaleY”: 1.0
},
“CColor”: {},
“IconVisible”: false,
“PrePosition”: {
“X”: 0.4951,
“Y”: 0.5006
},
“PreSize”: {
“X”: 1.0,
“Y”: 1.0
},
“LeftMargin”: -4.6595,
“RightMargin”: 4.6595,
“TopMargin”: -0.4154,
“BottomMargin”: 0.4154,
“Tag”: 203,
“ActionTag”: -1783401763,
“Size”: {
“X”: 960.0,
“Y”: 640.0
},
“Name”: “Image_1”,
“ctype”: “ImageViewObjectData”
}
],
“Size”: {
“X”: 960.0,
“Y”: 640.0
},
“Name”: “Layer”,
“ctype”: “LayerObjectData”
},
“UsedResources”: [
“HelloWorld.png”
],
“ctype”: “GameFileData”
}
},
“Type”: “Layer”
}