CSParseBinary.fbs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. // ParseBinary IDL file
  2. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3. // !! When adding new pairs to the maps below, !!
  4. // !! please add to the last position of the map. !!
  5. // !! It will ensure the reader's version compatible. !!
  6. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  7. namespace flatbuffers;
  8. table CSParseBinary
  9. {
  10. //Make sure the version is the 1st pair in this map!
  11. //It will make sure Cocos2d-x can parse the version string correctly from csbs in various versions.
  12. version:string;
  13. textures:[string];
  14. texturePngs:[string];
  15. nodeTree:NodeTree;
  16. action:NodeAction;
  17. animationList:[AnimationInfo];
  18. }
  19. root_type CSParseBinary;
  20. table NodeTree
  21. {
  22. classname:string;
  23. children:[NodeTree];
  24. options:Options;
  25. customClassName:string;
  26. }
  27. table Options
  28. {
  29. data:WidgetOptions;
  30. }
  31. table WidgetOptions
  32. {
  33. name:string;
  34. actionTag:int= 0;
  35. rotationSkew:RotationSkew;
  36. zOrder:int;
  37. visible:bool = true;
  38. alpha:ubyte = 255;
  39. tag:int = 0;
  40. position:Position;
  41. scale:Scale;
  42. anchorPoint:AnchorPoint;
  43. color:Color;
  44. size:FlatSize;
  45. flipX:bool = false;
  46. flipY:bool = false;
  47. ignoreSize:bool = false;
  48. touchEnabled:bool;
  49. frameEvent:string;
  50. customProperty:string;
  51. callBackType:string;
  52. callBackName:string;
  53. layoutComponent:LayoutComponentTable;
  54. }
  55. table LayoutComponentTable
  56. {
  57. positionXPercentEnabled:bool;
  58. positionYPercentEnabled:bool;
  59. positionXPercent:float;
  60. positionYPercent:float;
  61. sizeXPercentEnable:bool;
  62. sizeYPercentEnable:bool;
  63. sizeXPercent:float;
  64. sizeYPercent:float;
  65. stretchHorizontalEnabled:bool;
  66. stretchVerticalEnabled:bool;
  67. horizontalEdge:string;
  68. verticalEdge:string;
  69. leftMargin:float;
  70. rightMargin:float;
  71. topMargin:float;
  72. bottomMargin:float;
  73. }
  74. table SingleNodeOptions
  75. {
  76. nodeOptions:WidgetOptions;
  77. }
  78. table SpriteOptions
  79. {
  80. nodeOptions:WidgetOptions;
  81. fileNameData:ResourceData;
  82. blendFunc:BlendFunc;
  83. }
  84. table ParticleSystemOptions
  85. {
  86. nodeOptions:WidgetOptions;
  87. fileNameData:ResourceData;
  88. blendFunc:BlendFunc;
  89. }
  90. table GameMapOptions
  91. {
  92. nodeOptions:WidgetOptions;
  93. fileNameData:ResourceData;
  94. }
  95. table ButtonOptions
  96. {
  97. widgetOptions:WidgetOptions;
  98. normalData:ResourceData;
  99. pressedData:ResourceData;
  100. disabledData:ResourceData;
  101. fontResource:ResourceData;
  102. text:string;
  103. isLocalized:bool = false;
  104. fontName:string;
  105. fontSize:int;
  106. textColor:Color;
  107. capInsets:CapInsets;
  108. scale9Size:FlatSize;
  109. scale9Enabled:bool;
  110. displaystate:bool = true;
  111. outlineEnabled:bool = false;
  112. outlineColor:Color;
  113. outlineSize:int = 1;
  114. shadowEnabled:bool = false;
  115. shadowColor:Color;
  116. shadowOffsetX:float = 2;
  117. shadowOffsetY:float = -2;
  118. shadowBlurRadius:int;
  119. }
  120. table CheckBoxOptions
  121. {
  122. widgetOptions:WidgetOptions;
  123. backGroundBoxData:ResourceData;
  124. backGroundBoxSelectedData:ResourceData;
  125. frontCrossData:ResourceData;
  126. backGroundBoxDisabledData:ResourceData;
  127. frontCrossDisabledData:ResourceData;
  128. selectedState:bool = true;
  129. displaystate:bool = true;
  130. }
  131. table ImageViewOptions
  132. {
  133. widgetOptions:WidgetOptions;
  134. fileNameData:ResourceData;
  135. capInsets:CapInsets;
  136. scale9Size:FlatSize;
  137. scale9Enabled:bool;
  138. }
  139. table TextAtlasOptions
  140. {
  141. widgetOptions:WidgetOptions;
  142. charMapFileData:ResourceData;
  143. stringValue:string;
  144. startCharMap:string;
  145. itemWidth:int;
  146. itemHeight:int;
  147. }
  148. table TextBMFontOptions
  149. {
  150. widgetOptions:WidgetOptions;
  151. fileNameData:ResourceData;
  152. text:string;
  153. isLocalized:bool = false;
  154. }
  155. table TextOptions
  156. {
  157. widgetOptions:WidgetOptions;
  158. fontResource:ResourceData;
  159. fontName:string;
  160. fontSize:int;
  161. text:string;
  162. isLocalized:bool = false;
  163. areaWidth:int;
  164. areaHeight:int;
  165. hAlignment:int;
  166. vAlignment:int;
  167. touchScaleEnable:bool = false;
  168. isCustomSize:bool = false;
  169. outlineEnabled:bool = false;
  170. outlineColor:Color;
  171. outlineSize:int = 1;
  172. shadowEnabled:bool = false;
  173. shadowColor:Color;
  174. shadowOffsetX:float = 2;
  175. shadowOffsetY:float = -2;
  176. shadowBlurRadius:int;
  177. }
  178. table TextFieldOptions
  179. {
  180. widgetOptions:WidgetOptions;
  181. fontResource:ResourceData;
  182. fontName:string;
  183. fontSize:int;
  184. text:string;
  185. isLocalized:bool = false;
  186. placeHolder:string;
  187. passwordEnabled:bool = false;
  188. passwordStyleText:string;
  189. maxLengthEnabled:bool = false;
  190. maxLength:int;
  191. areaWidth:int;
  192. areaHeight:int;
  193. isCustomSize:bool = false;
  194. }
  195. table LoadingBarOptions
  196. {
  197. widgetOptions:WidgetOptions;
  198. textureData:ResourceData;
  199. percent:int = 80;
  200. direction:int = 0;
  201. }
  202. table SliderOptions
  203. {
  204. widgetOptions:WidgetOptions;
  205. barFileNameData:ResourceData;
  206. ballNormalData:ResourceData;
  207. ballPressedData:ResourceData;
  208. ballDisabledData:ResourceData;
  209. progressBarData:ResourceData;
  210. percent:int = 50;
  211. displaystate:bool = true;
  212. }
  213. table PanelOptions
  214. {
  215. widgetOptions:WidgetOptions;
  216. backGroundImageData:ResourceData;
  217. clipEnabled:bool = false;
  218. bgColor:Color;
  219. bgStartColor:Color;
  220. bgEndColor:Color;
  221. colorType:int = 0;
  222. bgColorOpacity:ubyte = 255;
  223. colorVector:ColorVector;
  224. capInsets:CapInsets;
  225. scale9Size:FlatSize;
  226. backGroundScale9Enabled:bool = false;
  227. }
  228. table ScrollViewOptions
  229. {
  230. widgetOptions:WidgetOptions;
  231. backGroundImageData:ResourceData;
  232. clipEnabled:bool = false;
  233. bgColor:Color;
  234. bgStartColor:Color;
  235. bgEndColor:Color;
  236. colorType:int = 0;
  237. bgColorOpacity:ubyte = 255;
  238. colorVector:ColorVector;
  239. capInsets:CapInsets;
  240. scale9Size:FlatSize;
  241. backGroundScale9Enabled:bool = false;
  242. innerSize:FlatSize;
  243. direction:int;
  244. bounceEnabled:bool = false;
  245. scrollbarEnabeld:bool = true;
  246. scrollbarAutoHide:bool = true;
  247. scrollbarAutoHideTime:float = 0.2;
  248. }
  249. table PageViewOptions
  250. {
  251. widgetOptions:WidgetOptions;
  252. backGroundImageData:ResourceData;
  253. clipEnabled:bool = false;
  254. bgColor:Color;
  255. bgStartColor:Color;
  256. bgEndColor:Color;
  257. colorType:int = 0;
  258. bgColorOpacity:ubyte = 255;
  259. colorVector:ColorVector;
  260. capInsets:CapInsets;
  261. scale9Size:FlatSize;
  262. backGroundScale9Enabled:bool = false;
  263. }
  264. table ListViewOptions
  265. {
  266. widgetOptions:WidgetOptions;
  267. backGroundImageData:ResourceData;
  268. clipEnabled:bool = false;
  269. bgColor:Color;
  270. bgStartColor:Color;
  271. bgEndColor:Color;
  272. colorType:int = 0;
  273. bgColorOpacity:ubyte = 255;
  274. colorVector:ColorVector;
  275. capInsets:CapInsets;
  276. scale9Size:FlatSize;
  277. backGroundScale9Enabled:bool = false;
  278. innerSize:FlatSize;
  279. direction:int;
  280. bounceEnabled:bool = false;
  281. itemMargin:int = 0;
  282. directionType:string;
  283. horizontalType:string;
  284. verticalType:string;
  285. }
  286. table ProjectNodeOptions
  287. {
  288. nodeOptions:WidgetOptions;
  289. fileName:string;
  290. innerActionSpeed:float;
  291. }
  292. table ComponentOptions
  293. {
  294. nodeOptions:WidgetOptions;
  295. type:string;
  296. comAudioOptions:ComAudioOptions;
  297. }
  298. table ComAudioOptions
  299. {
  300. nodeOptions:WidgetOptions;
  301. name:string;
  302. enabled:bool;
  303. loop:bool;
  304. volume:int;
  305. fileNameData:ResourceData;
  306. }
  307. table AnimationInfo
  308. {
  309. name:string;
  310. startIndex:int;
  311. endIndex:int;
  312. }
  313. table NodeAction
  314. {
  315. duration:int;
  316. speed:float;
  317. timeLines:[TimeLine];
  318. currentAnimationName:string;
  319. }
  320. table TimeLine
  321. {
  322. property:string;
  323. actionTag:int;
  324. frames:[Frame];
  325. }
  326. table Frame
  327. {
  328. pointFrame:PointFrame;
  329. scaleFrame:ScaleFrame;
  330. colorFrame:ColorFrame;
  331. textureFrame:TextureFrame;
  332. eventFrame:EventFrame;
  333. intFrame:IntFrame;
  334. boolFrame:BoolFrame;
  335. innerActionFrame:InnerActionFrame;
  336. blendFrame:BlendFrame;
  337. }
  338. // PointFrame
  339. table PointFrame
  340. {
  341. frameIndex:int;
  342. tween:bool = true;
  343. position:Position;
  344. easingData:EasingData;
  345. }
  346. // ScaleFrame
  347. table ScaleFrame
  348. {
  349. frameIndex:int;
  350. tween:bool = true;
  351. scale:Scale;
  352. easingData:EasingData;
  353. }
  354. // ColorFrame
  355. table ColorFrame
  356. {
  357. frameIndex:int;
  358. tween:bool = true;
  359. color:Color;
  360. easingData:EasingData;
  361. }
  362. // TextureFrame
  363. table TextureFrame
  364. {
  365. frameIndex:int;
  366. tween:bool = true;
  367. textureFile:ResourceData;
  368. easingData:EasingData;
  369. }
  370. // EventFrame
  371. table EventFrame
  372. {
  373. frameIndex:int;
  374. tween:bool = true;
  375. value:string;
  376. easingData:EasingData;
  377. }
  378. // IntFrame
  379. table IntFrame
  380. {
  381. frameIndex:int;
  382. tween:bool = true;
  383. value:int;
  384. easingData:EasingData;
  385. }
  386. // BoolFrame
  387. table BoolFrame
  388. {
  389. frameIndex:int;
  390. tween:bool = true;
  391. value:bool = true;
  392. easingData:EasingData;
  393. }
  394. // InnerActionFrame
  395. table InnerActionFrame
  396. {
  397. frameIndex:int;
  398. tween:bool = true;
  399. innerActionType:int;
  400. currentAniamtionName:string;
  401. singleFrameIndex:int;
  402. easingData:EasingData;
  403. }
  404. // EasingData
  405. table EasingData
  406. {
  407. type:int = -1;
  408. points:[Position];
  409. }
  410. struct RotationSkew
  411. {
  412. rotationSkewX:float;
  413. rotationSkewY:float;
  414. }
  415. struct Position
  416. {
  417. x:float;
  418. y:float;
  419. }
  420. struct Scale
  421. {
  422. scaleX:float;
  423. scaleY:float;
  424. }
  425. struct AnchorPoint
  426. {
  427. scaleX:float;
  428. scaleY:float;
  429. }
  430. struct Color
  431. {
  432. a:ubyte;
  433. r:ubyte;
  434. g:ubyte;
  435. b:ubyte;
  436. }
  437. struct ColorVector
  438. {
  439. vectorX:float;
  440. vectorY:float;
  441. }
  442. struct FlatSize
  443. {
  444. width:float;
  445. height:float;
  446. }
  447. struct CapInsets
  448. {
  449. x:float;
  450. y:float;
  451. width:float;
  452. height:float;
  453. }
  454. struct BlendFunc
  455. {
  456. src:int;
  457. dst:int;
  458. }
  459. table ResourceData
  460. {
  461. path:string;
  462. plistFile:string;
  463. resourceType:int;
  464. }
  465. // BlendFrame
  466. table BlendFrame
  467. {
  468. frameIndex:int;
  469. tween:bool = true;
  470. blendFunc:BlendFunc;
  471. easingData:EasingData;
  472. }