fairygui.d.ts 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701
  1. declare namespace fgui {
  2. class AsyncOperation {
  3. callback: (obj: GObject) => void;
  4. private _node;
  5. createObject(pkgName: string, resName: string): void;
  6. createObjectFromURL(url: string): void;
  7. cancel(): void;
  8. private internalCreateObject;
  9. private completed;
  10. }
  11. }
  12. declare namespace fgui {
  13. class Controller extends cc.EventTarget {
  14. private _selectedIndex;
  15. private _previousIndex;
  16. private _pageIds;
  17. private _pageNames;
  18. private _actions?;
  19. name: string;
  20. parent: GComponent;
  21. autoRadioGroupDepth?: boolean;
  22. changing?: boolean;
  23. constructor();
  24. dispose(): void;
  25. get selectedIndex(): number;
  26. set selectedIndex(value: number);
  27. onChanged(callback: Function, target?: any): void;
  28. offChanged(callback: Function, target?: any): void;
  29. setSelectedIndex(value: number): void;
  30. get previsousIndex(): number;
  31. get selectedPage(): string;
  32. set selectedPage(val: string);
  33. setSelectedPage(value: string): void;
  34. get previousPage(): string;
  35. get pageCount(): number;
  36. getPageName(index: number): string;
  37. addPage(name?: string): void;
  38. addPageAt(name: string, index: number): void;
  39. removePage(name: string): void;
  40. removePageAt(index: number): void;
  41. clearPages(): void;
  42. hasPage(aName: string): boolean;
  43. getPageIndexById(aId: string): number;
  44. getPageIdByName(aName: string): string;
  45. getPageNameById(aId: string): string;
  46. getPageId(index: number): string;
  47. get selectedPageId(): string;
  48. set selectedPageId(val: string);
  49. set oppositePageId(val: string);
  50. get previousPageId(): string;
  51. runActions(): void;
  52. setup(buffer: ByteBuffer): void;
  53. }
  54. }
  55. declare namespace fgui {
  56. class DragDropManager {
  57. private _agent;
  58. private _sourceData;
  59. private static _inst;
  60. static get inst(): DragDropManager;
  61. constructor();
  62. get dragAgent(): GObject;
  63. get dragging(): boolean;
  64. startDrag(source: GObject, icon: string, sourceData?: any, touchId?: number): void;
  65. cancel(): void;
  66. private onDragEnd;
  67. }
  68. }
  69. declare namespace fgui {
  70. enum ButtonMode {
  71. Common = 0,
  72. Check = 1,
  73. Radio = 2
  74. }
  75. enum AutoSizeType {
  76. None = 0,
  77. Both = 1,
  78. Height = 2,
  79. Shrink = 3
  80. }
  81. enum AlignType {
  82. Left = 0,
  83. Center = 1,
  84. Right = 2
  85. }
  86. enum VertAlignType {
  87. Top = 0,
  88. Middle = 1,
  89. Bottom = 2
  90. }
  91. enum LoaderFillType {
  92. None = 0,
  93. Scale = 1,
  94. ScaleMatchHeight = 2,
  95. ScaleMatchWidth = 3,
  96. ScaleFree = 4,
  97. ScaleNoBorder = 5
  98. }
  99. enum ListLayoutType {
  100. SingleColumn = 0,
  101. SingleRow = 1,
  102. FlowHorizontal = 2,
  103. FlowVertical = 3,
  104. Pagination = 4
  105. }
  106. enum ListSelectionMode {
  107. Single = 0,
  108. Multiple = 1,
  109. Multiple_SingleClick = 2,
  110. None = 3
  111. }
  112. enum OverflowType {
  113. Visible = 0,
  114. Hidden = 1,
  115. Scroll = 2
  116. }
  117. enum PackageItemType {
  118. Image = 0,
  119. MovieClip = 1,
  120. Sound = 2,
  121. Component = 3,
  122. Atlas = 4,
  123. Font = 5,
  124. Swf = 6,
  125. Misc = 7,
  126. Unknown = 8,
  127. Spine = 9,
  128. DragonBones = 10
  129. }
  130. enum ObjectType {
  131. Image = 0,
  132. MovieClip = 1,
  133. Swf = 2,
  134. Graph = 3,
  135. Loader = 4,
  136. Group = 5,
  137. Text = 6,
  138. RichText = 7,
  139. InputText = 8,
  140. Component = 9,
  141. List = 10,
  142. Label = 11,
  143. Button = 12,
  144. ComboBox = 13,
  145. ProgressBar = 14,
  146. Slider = 15,
  147. ScrollBar = 16,
  148. Tree = 17,
  149. Loader3D = 18
  150. }
  151. enum ProgressTitleType {
  152. Percent = 0,
  153. ValueAndMax = 1,
  154. Value = 2,
  155. Max = 3
  156. }
  157. enum ScrollBarDisplayType {
  158. Default = 0,
  159. Visible = 1,
  160. Auto = 2,
  161. Hidden = 3
  162. }
  163. enum ScrollType {
  164. Horizontal = 0,
  165. Vertical = 1,
  166. Both = 2
  167. }
  168. enum FlipType {
  169. None = 0,
  170. Horizontal = 1,
  171. Vertical = 2,
  172. Both = 3
  173. }
  174. enum ChildrenRenderOrder {
  175. Ascent = 0,
  176. Descent = 1,
  177. Arch = 2
  178. }
  179. enum GroupLayoutType {
  180. None = 0,
  181. Horizontal = 1,
  182. Vertical = 2
  183. }
  184. enum PopupDirection {
  185. Auto = 0,
  186. Up = 1,
  187. Down = 2
  188. }
  189. enum RelationType {
  190. Left_Left = 0,
  191. Left_Center = 1,
  192. Left_Right = 2,
  193. Center_Center = 3,
  194. Right_Left = 4,
  195. Right_Center = 5,
  196. Right_Right = 6,
  197. Top_Top = 7,
  198. Top_Middle = 8,
  199. Top_Bottom = 9,
  200. Middle_Middle = 10,
  201. Bottom_Top = 11,
  202. Bottom_Middle = 12,
  203. Bottom_Bottom = 13,
  204. Width = 14,
  205. Height = 15,
  206. LeftExt_Left = 16,
  207. LeftExt_Right = 17,
  208. RightExt_Left = 18,
  209. RightExt_Right = 19,
  210. TopExt_Top = 20,
  211. TopExt_Bottom = 21,
  212. BottomExt_Top = 22,
  213. BottomExt_Bottom = 23,
  214. Size = 24
  215. }
  216. enum FillMethod {
  217. None = 0,
  218. Horizontal = 1,
  219. Vertical = 2,
  220. Radial90 = 3,
  221. Radial180 = 4,
  222. Radial360 = 5
  223. }
  224. enum FillOrigin {
  225. Top = 0,
  226. Bottom = 1,
  227. Left = 2,
  228. Right = 3
  229. }
  230. enum ObjectPropID {
  231. Text = 0,
  232. Icon = 1,
  233. Color = 2,
  234. OutlineColor = 3,
  235. Playing = 4,
  236. Frame = 5,
  237. DeltaTime = 6,
  238. TimeScale = 7,
  239. FontSize = 8,
  240. Selected = 9
  241. }
  242. }
  243. declare namespace fgui {
  244. class GObject {
  245. data?: any;
  246. packageItem?: PackageItem;
  247. static draggingObject: GObject;
  248. protected _x: number;
  249. protected _y: number;
  250. protected _alpha: number;
  251. protected _visible: boolean;
  252. protected _touchable: boolean;
  253. protected _grayed?: boolean;
  254. protected _draggable?: boolean;
  255. protected _skewX: number;
  256. protected _skewY: number;
  257. protected _pivotAsAnchor?: boolean;
  258. protected _sortingOrder: number;
  259. protected _internalVisible: boolean;
  260. protected _handlingController?: boolean;
  261. protected _tooltips?: string;
  262. protected _blendMode: BlendMode;
  263. protected _pixelSnapping?: boolean;
  264. protected _dragTesting?: boolean;
  265. protected _dragStartPos?: cc.Vec2;
  266. protected _relations: Relations;
  267. protected _group: GGroup;
  268. protected _gears: GearBase[];
  269. protected _node: cc.Node;
  270. protected _dragBounds?: cc.Rect;
  271. sourceWidth: number;
  272. sourceHeight: number;
  273. initWidth: number;
  274. initHeight: number;
  275. minWidth: number;
  276. minHeight: number;
  277. maxWidth: number;
  278. maxHeight: number;
  279. _parent: GComponent;
  280. _width: number;
  281. _height: number;
  282. _rawWidth: number;
  283. _rawHeight: number;
  284. _id: string;
  285. _name: string;
  286. _underConstruct: boolean;
  287. _gearLocked?: boolean;
  288. _sizePercentInGroup: number;
  289. _touchDisabled?: boolean;
  290. _partner: GObjectPartner;
  291. _treeNode?: GTreeNode;
  292. private _hitTestPt?;
  293. static _defaultGroupIndex: number;
  294. constructor();
  295. get id(): string;
  296. get name(): string;
  297. set name(value: string);
  298. get x(): number;
  299. set x(value: number);
  300. get y(): number;
  301. set y(value: number);
  302. setPosition(xv: number, yv: number): void;
  303. get xMin(): number;
  304. set xMin(value: number);
  305. get yMin(): number;
  306. set yMin(value: number);
  307. get pixelSnapping(): boolean;
  308. set pixelSnapping(value: boolean);
  309. center(restraint?: boolean): void;
  310. get width(): number;
  311. set width(value: number);
  312. get height(): number;
  313. set height(value: number);
  314. setSize(wv: number, hv: number, ignorePivot?: boolean): void;
  315. makeFullScreen(): void;
  316. ensureSizeCorrect(): void;
  317. get actualWidth(): number;
  318. get actualHeight(): number;
  319. get scaleX(): number;
  320. set scaleX(value: number);
  321. get scaleY(): number;
  322. set scaleY(value: number);
  323. setScale(sx: number, sy: number): void;
  324. get skewX(): number;
  325. set skewX(value: number);
  326. get skewY(): number;
  327. set skewY(value: number);
  328. setSkew(xv: number, yv: number): void;
  329. get pivotX(): number;
  330. set pivotX(value: number);
  331. get pivotY(): number;
  332. set pivotY(value: number);
  333. setPivot(xv: number, yv: number, asAnchor?: boolean): void;
  334. get pivotAsAnchor(): boolean;
  335. get touchable(): boolean;
  336. set touchable(value: boolean);
  337. get grayed(): boolean;
  338. set grayed(value: boolean);
  339. get enabled(): boolean;
  340. set enabled(value: boolean);
  341. get rotation(): number;
  342. set rotation(value: number);
  343. get alpha(): number;
  344. set alpha(value: number);
  345. get visible(): boolean;
  346. set visible(value: boolean);
  347. get _finalVisible(): boolean;
  348. get internalVisible3(): boolean;
  349. get sortingOrder(): number;
  350. set sortingOrder(value: number);
  351. requestFocus(): void;
  352. get tooltips(): string;
  353. set tooltips(value: string);
  354. get blendMode(): BlendMode;
  355. set blendMode(value: BlendMode);
  356. get onStage(): boolean;
  357. get resourceURL(): string;
  358. set group(value: GGroup);
  359. get group(): GGroup;
  360. getGear(index: number): GearBase;
  361. protected updateGear(index: number): void;
  362. checkGearController(index: number, c: Controller): boolean;
  363. updateGearFromRelations(index: number, dx: number, dy: number): void;
  364. addDisplayLock(): number;
  365. releaseDisplayLock(token: number): void;
  366. private checkGearDisplay;
  367. get gearXY(): GearXY;
  368. get gearSize(): GearSize;
  369. get gearLook(): GearLook;
  370. get relations(): Relations;
  371. addRelation(target: GObject, relationType: number, usePercent?: boolean): void;
  372. removeRelation(target: GObject, relationType: number): void;
  373. get node(): cc.Node;
  374. get parent(): GComponent;
  375. removeFromParent(): void;
  376. findParent(): GObject;
  377. get root(): GRoot;
  378. get asCom(): GComponent;
  379. get asButton(): GButton;
  380. get asLabel(): GLabel;
  381. get asProgress(): GProgressBar;
  382. get asTextField(): GTextField;
  383. get asRichTextField(): GRichTextField;
  384. get asTextInput(): GTextInput;
  385. get asLoader(): GLoader;
  386. get asList(): GList;
  387. get asTree(): GTree;
  388. get asGraph(): GGraph;
  389. get asGroup(): GGroup;
  390. get asSlider(): GSlider;
  391. get asComboBox(): GComboBox;
  392. get asImage(): GImage;
  393. get asMovieClip(): GMovieClip;
  394. static cast(obj: cc.Node): GObject;
  395. get text(): string;
  396. set text(value: string);
  397. get icon(): string;
  398. set icon(value: string);
  399. get treeNode(): GTreeNode;
  400. dispose(): void;
  401. protected onEnable(): void;
  402. protected onDisable(): void;
  403. protected onUpdate(): void;
  404. protected onDestroy(): void;
  405. onClick(listener: Function, target?: any): void;
  406. onceClick(listener: Function, target?: any): void;
  407. offClick(listener: Function, target?: any): void;
  408. clearClick(): void;
  409. hasClickListener(): boolean;
  410. on(type: string, listener: Function, target?: any): void;
  411. once(type: string, listener: Function, target?: any): void;
  412. off(type: string, listener?: Function, target?: any): void;
  413. get draggable(): boolean;
  414. set draggable(value: boolean);
  415. get dragBounds(): cc.Rect;
  416. set dragBounds(value: cc.Rect);
  417. startDrag(touchId?: number): void;
  418. stopDrag(): void;
  419. get dragging(): boolean;
  420. localToGlobal(ax?: number, ay?: number, result?: cc.Vec2): cc.Vec2;
  421. globalToLocal(ax?: number, ay?: number, result?: cc.Vec2): cc.Vec2;
  422. localToGlobalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: cc.Rect): cc.Rect;
  423. globalToLocalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: cc.Rect): cc.Rect;
  424. handleControllerChanged(c: Controller): void;
  425. protected handleAnchorChanged(): void;
  426. handlePositionChanged(): void;
  427. protected handleSizeChanged(): void;
  428. protected handleGrayedChanged(): void;
  429. handleVisibleChanged(): void;
  430. hitTest(globalPt: cc.Vec2, forTouch?: boolean): GObject;
  431. protected _hitTest(pt: cc.Vec2, globalPt: cc.Vec2): GObject;
  432. getProp(index: number): any;
  433. setProp(index: number, value: any): void;
  434. constructFromResource(): void;
  435. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  436. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  437. private onRollOver;
  438. private onRollOut;
  439. private initDrag;
  440. private dragBegin;
  441. private dragEnd;
  442. private onTouchBegin_0;
  443. private onTouchMove_0;
  444. private onTouchEnd_0;
  445. }
  446. class GObjectPartner extends cc.Component {
  447. _emitDisplayEvents: boolean;
  448. callLater(callback: Function, delay?: number): void;
  449. onClickLink(evt: Event, text: string): void;
  450. protected onEnable(): void;
  451. protected onDisable(): void;
  452. protected update(dt: any): void;
  453. protected onDestroy(): void;
  454. }
  455. }
  456. declare namespace fgui {
  457. class GComponent extends GObject {
  458. hitArea?: IHitTest;
  459. private _sortingChildCount;
  460. private _opaque;
  461. private _applyingController?;
  462. private _rectMask?;
  463. private _maskContent?;
  464. protected _margin: Margin;
  465. protected _trackBounds: boolean;
  466. protected _boundsChanged: boolean;
  467. protected _childrenRenderOrder: ChildrenRenderOrder;
  468. protected _apexIndex: number;
  469. _buildingDisplayList: boolean;
  470. _children: Array<GObject>;
  471. _controllers: Array<Controller>;
  472. _transitions: Array<Transition>;
  473. _container: cc.Node;
  474. _scrollPane?: ScrollPane;
  475. _alignOffset: cc.Vec2;
  476. _customMask?: cc.Mask;
  477. constructor();
  478. dispose(): void;
  479. get displayListContainer(): cc.Node;
  480. addChild(child: GObject): GObject;
  481. addChildAt(child: GObject, index: number): GObject;
  482. private getInsertPosForSortingChild;
  483. removeChild(child: GObject, dispose?: boolean): GObject;
  484. removeChildAt(index: number, dispose?: boolean): GObject;
  485. removeChildren(beginIndex?: number, endIndex?: number, dispose?: boolean): void;
  486. getChildAt(index: number): GObject;
  487. getChild(name: string): GObject;
  488. getChildByPath(path: String): GObject;
  489. getVisibleChild(name: string): GObject;
  490. getChildInGroup(name: string, group: GGroup): GObject;
  491. getChildById(id: string): GObject;
  492. getChildIndex(child: GObject): number;
  493. setChildIndex(child: GObject, index: number): void;
  494. setChildIndexBefore(child: GObject, index: number): number;
  495. private _setChildIndex;
  496. swapChildren(child1: GObject, child2: GObject): void;
  497. swapChildrenAt(index1: number, index2: number): void;
  498. get numChildren(): number;
  499. isAncestorOf(child: GObject): boolean;
  500. addController(controller: Controller): void;
  501. getControllerAt(index: number): Controller;
  502. getController(name: string): Controller;
  503. removeController(c: Controller): void;
  504. get controllers(): Array<Controller>;
  505. private onChildAdd;
  506. private buildNativeDisplayList;
  507. applyController(c: Controller): void;
  508. applyAllControllers(): void;
  509. adjustRadioGroupDepth(obj: GObject, c: Controller): void;
  510. getTransitionAt(index: number): Transition;
  511. getTransition(transName: string): Transition;
  512. isChildInView(child: GObject): boolean;
  513. getFirstChildInView(): number;
  514. get scrollPane(): ScrollPane;
  515. get opaque(): boolean;
  516. set opaque(value: boolean);
  517. get margin(): Margin;
  518. set margin(value: Margin);
  519. get childrenRenderOrder(): ChildrenRenderOrder;
  520. set childrenRenderOrder(value: ChildrenRenderOrder);
  521. get apexIndex(): number;
  522. set apexIndex(value: number);
  523. get mask(): GObject;
  524. set mask(value: GObject);
  525. setMask(value: GObject, inverted: boolean): void;
  526. private onMaskReady;
  527. private onMaskContentChanged;
  528. get _pivotCorrectX(): number;
  529. get _pivotCorrectY(): number;
  530. get baseUserData(): string;
  531. protected setupScroll(buffer: ByteBuffer): void;
  532. protected setupOverflow(overflow: OverflowType): void;
  533. protected handleAnchorChanged(): void;
  534. protected handleSizeChanged(): void;
  535. protected handleGrayedChanged(): void;
  536. handleControllerChanged(c: Controller): void;
  537. protected _hitTest(pt: cc.Vec2, globalPt: cc.Vec2): GObject;
  538. setBoundsChangedFlag(): void;
  539. private refresh;
  540. ensureBoundsCorrect(): void;
  541. protected updateBounds(): void;
  542. setBounds(ax: number, ay: number, aw: number, ah?: number): void;
  543. get viewWidth(): number;
  544. set viewWidth(value: number);
  545. get viewHeight(): number;
  546. set viewHeight(value: number);
  547. getSnappingPosition(xValue: number, yValue: number, resultPoint?: cc.Vec2): cc.Vec2;
  548. childSortingOrderChanged(child: GObject, oldValue: number, newValue?: number): void;
  549. constructFromResource(): void;
  550. constructFromResource2(objectPool: Array<GObject>, poolIndex: number): void;
  551. protected constructExtension(buffer: ByteBuffer): void;
  552. protected onConstruct(): void;
  553. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  554. protected onEnable(): void;
  555. protected onDisable(): void;
  556. }
  557. }
  558. declare namespace fgui {
  559. class GButton extends GComponent {
  560. protected _titleObject: GObject;
  561. protected _iconObject: GObject;
  562. private _mode;
  563. private _selected;
  564. private _title;
  565. private _selectedTitle;
  566. private _icon;
  567. private _selectedIcon;
  568. private _sound;
  569. private _soundVolumeScale;
  570. private _buttonController;
  571. private _relatedController?;
  572. private _relatedPageId;
  573. private _changeStateOnClick;
  574. private _linkedPopup?;
  575. private _downEffect;
  576. private _downEffectValue;
  577. private _downColor?;
  578. private _downScaled?;
  579. private _down;
  580. private _over;
  581. static UP: string;
  582. static DOWN: string;
  583. static OVER: string;
  584. static SELECTED_OVER: string;
  585. static DISABLED: string;
  586. static SELECTED_DISABLED: string;
  587. constructor();
  588. get icon(): string;
  589. set icon(value: string);
  590. get selectedIcon(): string;
  591. set selectedIcon(value: string);
  592. get title(): string;
  593. set title(value: string);
  594. get text(): string;
  595. set text(value: string);
  596. get selectedTitle(): string;
  597. set selectedTitle(value: string);
  598. get titleColor(): cc.Color;
  599. set titleColor(value: cc.Color);
  600. get titleFontSize(): number;
  601. set titleFontSize(value: number);
  602. get sound(): string;
  603. set sound(val: string);
  604. get soundVolumeScale(): number;
  605. set soundVolumeScale(value: number);
  606. set selected(val: boolean);
  607. get selected(): boolean;
  608. get mode(): ButtonMode;
  609. set mode(value: ButtonMode);
  610. get relatedController(): Controller;
  611. set relatedController(val: Controller);
  612. get relatedPageId(): string;
  613. set relatedPageId(val: string);
  614. get changeStateOnClick(): boolean;
  615. set changeStateOnClick(value: boolean);
  616. get linkedPopup(): GObject;
  617. set linkedPopup(value: GObject);
  618. getTextField(): GTextField;
  619. fireClick(): void;
  620. protected setState(val: string): void;
  621. protected setCurrentState(): void;
  622. handleControllerChanged(c: Controller): void;
  623. protected handleGrayedChanged(): void;
  624. getProp(index: number): any;
  625. setProp(index: number, value: any): void;
  626. protected constructExtension(buffer: ByteBuffer): void;
  627. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  628. private onRollOver_1;
  629. private onRollOut_1;
  630. private onTouchBegin_1;
  631. private onTouchEnd_1;
  632. private onClick_1;
  633. }
  634. }
  635. declare namespace fgui {
  636. class GComboBox extends GComponent {
  637. dropdown: GComponent;
  638. protected _titleObject: GObject;
  639. protected _iconObject: GObject;
  640. protected _list: GList;
  641. private _items;
  642. private _values;
  643. private _icons?;
  644. private _visibleItemCount;
  645. private _itemsUpdated;
  646. private _selectedIndex;
  647. private _buttonController;
  648. private _popupDirection;
  649. private _selectionController;
  650. private _over;
  651. private _down;
  652. constructor();
  653. get text(): string;
  654. set text(value: string);
  655. get icon(): string;
  656. set icon(value: string);
  657. get titleColor(): cc.Color;
  658. set titleColor(value: cc.Color);
  659. get titleFontSize(): number;
  660. set titleFontSize(value: number);
  661. get visibleItemCount(): number;
  662. set visibleItemCount(value: number);
  663. get popupDirection(): PopupDirection;
  664. set popupDirection(value: PopupDirection);
  665. get items(): Array<string>;
  666. set items(value: Array<string>);
  667. get icons(): Array<string>;
  668. set icons(value: Array<string>);
  669. get values(): Array<string>;
  670. set values(value: Array<string>);
  671. get selectedIndex(): number;
  672. set selectedIndex(val: number);
  673. get value(): string;
  674. set value(val: string);
  675. get selectionController(): Controller;
  676. set selectionController(value: Controller);
  677. getTextField(): GTextField;
  678. protected setState(val: string): void;
  679. getProp(index: number): any;
  680. setProp(index: number, value: any): void;
  681. protected constructExtension(buffer: ByteBuffer): void;
  682. handleControllerChanged(c: Controller): void;
  683. private updateSelectionController;
  684. dispose(): void;
  685. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  686. protected showDropdown(): void;
  687. private onPopupClosed;
  688. private onClickItem;
  689. private onClickItem2;
  690. private onRollOver_1;
  691. private onRollOut_1;
  692. private onTouchBegin_1;
  693. private onTouchEnd_1;
  694. }
  695. }
  696. declare namespace fgui {
  697. class GGraph extends GObject {
  698. _content: cc.Graphics;
  699. private _type;
  700. private _lineSize;
  701. private _lineColor;
  702. private _fillColor;
  703. private _cornerRadius?;
  704. private _sides?;
  705. private _startAngle?;
  706. private _polygonPoints?;
  707. private _distances?;
  708. private _hasContent;
  709. constructor();
  710. drawRect(lineSize: number, lineColor: cc.Color, fillColor: cc.Color, corner?: Array<number>): void;
  711. drawEllipse(lineSize: number, lineColor: cc.Color, fillColor: cc.Color): void;
  712. drawRegularPolygon(lineSize: number, lineColor: cc.Color, fillColor: cc.Color, sides: number, startAngle?: number, distances?: number[]): void;
  713. drawPolygon(lineSize: number, lineColor: cc.Color, fillColor: cc.Color, points: Array<number>): void;
  714. get distances(): number[];
  715. set distances(value: number[]);
  716. clearGraphics(): void;
  717. get type(): number;
  718. get color(): cc.Color;
  719. set color(value: cc.Color);
  720. private updateGraph;
  721. private drawPath;
  722. protected handleSizeChanged(): void;
  723. protected handleAnchorChanged(): void;
  724. getProp(index: number): any;
  725. setProp(index: number, value: any): void;
  726. protected _hitTest(pt: cc.Vec2): GObject;
  727. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  728. }
  729. }
  730. declare namespace fgui {
  731. class GGroup extends GObject {
  732. private _layout;
  733. private _lineGap;
  734. private _columnGap;
  735. private _excludeInvisibles;
  736. private _autoSizeDisabled;
  737. private _mainGridIndex;
  738. private _mainGridMinSize;
  739. private _boundsChanged;
  740. private _percentReady;
  741. private _mainChildIndex;
  742. private _totalSize;
  743. private _numChildren;
  744. _updating: number;
  745. constructor();
  746. dispose(): void;
  747. get layout(): number;
  748. set layout(value: number);
  749. get lineGap(): number;
  750. set lineGap(value: number);
  751. get columnGap(): number;
  752. set columnGap(value: number);
  753. get excludeInvisibles(): boolean;
  754. set excludeInvisibles(value: boolean);
  755. get autoSizeDisabled(): boolean;
  756. set autoSizeDisabled(value: boolean);
  757. get mainGridMinSize(): number;
  758. set mainGridMinSize(value: number);
  759. get mainGridIndex(): number;
  760. set mainGridIndex(value: number);
  761. setBoundsChangedFlag(positionChangedOnly?: boolean): void;
  762. private _ensureBoundsCorrect;
  763. ensureSizeCorrect(): void;
  764. ensureBoundsCorrect(): void;
  765. private updateBounds;
  766. private handleLayout;
  767. moveChildren(dx: number, dy: number): void;
  768. resizeChildren(dw: number, dh: number): void;
  769. handleAlphaChanged(): void;
  770. handleVisibleChanged(): void;
  771. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  772. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  773. }
  774. }
  775. declare namespace fgui {
  776. class GImage extends GObject {
  777. _content: Image;
  778. constructor();
  779. get color(): cc.Color;
  780. set color(value: cc.Color);
  781. get flip(): FlipType;
  782. set flip(value: FlipType);
  783. get fillMethod(): FillMethod;
  784. set fillMethod(value: FillMethod);
  785. get fillOrigin(): FillOrigin;
  786. set fillOrigin(value: FillOrigin);
  787. get fillClockwise(): boolean;
  788. set fillClockwise(value: boolean);
  789. get fillAmount(): number;
  790. set fillAmount(value: number);
  791. constructFromResource(): void;
  792. protected handleGrayedChanged(): void;
  793. getProp(index: number): any;
  794. setProp(index: number, value: any): void;
  795. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  796. }
  797. }
  798. declare namespace fgui {
  799. class GLabel extends GComponent {
  800. protected _titleObject: GObject;
  801. protected _iconObject: GObject;
  802. constructor();
  803. get icon(): string;
  804. set icon(value: string);
  805. get title(): string;
  806. set title(value: string);
  807. get text(): string;
  808. set text(value: string);
  809. get titleColor(): cc.Color;
  810. set titleColor(value: cc.Color);
  811. get titleFontSize(): number;
  812. set titleFontSize(value: number);
  813. set editable(val: boolean);
  814. get editable(): boolean;
  815. getTextField(): GTextField;
  816. getProp(index: number): any;
  817. setProp(index: number, value: any): void;
  818. protected constructExtension(buffer: ByteBuffer): void;
  819. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  820. }
  821. }
  822. declare namespace fgui {
  823. class GList extends GComponent {
  824. itemRenderer: (index: number, item: GObject) => void;
  825. itemProvider: (index: number) => string;
  826. scrollItemToViewOnClick: boolean;
  827. foldInvisibleItems: boolean;
  828. private _layout;
  829. private _lineCount;
  830. private _columnCount;
  831. private _lineGap;
  832. private _columnGap;
  833. private _defaultItem;
  834. private _autoResizeItem;
  835. private _selectionMode;
  836. private _align;
  837. private _verticalAlign;
  838. private _selectionController?;
  839. private _lastSelectedIndex;
  840. private _pool;
  841. private _virtual?;
  842. private _loop?;
  843. private _numItems;
  844. private _realNumItems;
  845. private _firstIndex;
  846. private _curLineItemCount;
  847. private _curLineItemCount2;
  848. private _itemSize?;
  849. private _virtualListChanged;
  850. private _virtualItems?;
  851. private _eventLocked?;
  852. private itemInfoVer;
  853. constructor();
  854. dispose(): void;
  855. get layout(): ListLayoutType;
  856. set layout(value: ListLayoutType);
  857. get lineCount(): number;
  858. set lineCount(value: number);
  859. get columnCount(): number;
  860. set columnCount(value: number);
  861. get lineGap(): number;
  862. set lineGap(value: number);
  863. get columnGap(): number;
  864. set columnGap(value: number);
  865. get align(): AlignType;
  866. set align(value: AlignType);
  867. get verticalAlign(): VertAlignType;
  868. set verticalAlign(value: VertAlignType);
  869. get virtualItemSize(): cc.Size;
  870. set virtualItemSize(value: cc.Size);
  871. get defaultItem(): string;
  872. set defaultItem(val: string);
  873. get autoResizeItem(): boolean;
  874. set autoResizeItem(value: boolean);
  875. get selectionMode(): ListSelectionMode;
  876. set selectionMode(value: ListSelectionMode);
  877. get selectionController(): Controller;
  878. set selectionController(value: Controller);
  879. get itemPool(): GObjectPool;
  880. getFromPool(url?: string): GObject;
  881. returnToPool(obj: GObject): void;
  882. addChildAt(child: GObject, index: number): GObject;
  883. addItem(url?: string): GObject;
  884. addItemFromPool(url?: string): GObject;
  885. removeChildAt(index: number, dispose?: boolean): GObject;
  886. removeChildToPoolAt(index: number): void;
  887. removeChildToPool(child: GObject): void;
  888. removeChildrenToPool(beginIndex?: number, endIndex?: number): void;
  889. get selectedIndex(): number;
  890. set selectedIndex(value: number);
  891. getSelection(result?: number[]): number[];
  892. addSelection(index: number, scrollItToView?: boolean): void;
  893. removeSelection(index: number): void;
  894. clearSelection(): void;
  895. private clearSelectionExcept;
  896. selectAll(): void;
  897. selectNone(): void;
  898. selectReverse(): void;
  899. handleArrowKey(dir: number): void;
  900. private onClickItem;
  901. protected dispatchItemEvent(item: GObject, evt: Event): void;
  902. private setSelectionOnEvent;
  903. resizeToFit(itemCount?: number, minSize?: number): void;
  904. getMaxItemWidth(): number;
  905. protected handleSizeChanged(): void;
  906. handleControllerChanged(c: Controller): void;
  907. private updateSelectionController;
  908. getSnappingPosition(xValue: number, yValue: number, resultPoint?: cc.Vec2): cc.Vec2;
  909. scrollToView(index: number, ani?: boolean, setFirst?: boolean): void;
  910. getFirstChildInView(): number;
  911. childIndexToItemIndex(index: number): number;
  912. itemIndexToChildIndex(index: number): number;
  913. setVirtual(): void;
  914. setVirtualAndLoop(): void;
  915. private _setVirtual;
  916. get numItems(): number;
  917. set numItems(value: number);
  918. refreshVirtualList(): void;
  919. private checkVirtualList;
  920. private setVirtualListChangedFlag;
  921. private _refreshVirtualList;
  922. private __scrolled;
  923. private getIndexOnPos1;
  924. private getIndexOnPos2;
  925. private getIndexOnPos3;
  926. private handleScroll;
  927. private static pos_param;
  928. private handleScroll1;
  929. private handleScroll2;
  930. private handleScroll3;
  931. private handleArchOrder1;
  932. private handleArchOrder2;
  933. private handleAlign;
  934. protected updateBounds(): void;
  935. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  936. protected readItems(buffer: ByteBuffer): void;
  937. protected setupItem(buffer: ByteBuffer, obj: GObject): void;
  938. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  939. }
  940. }
  941. declare namespace fgui {
  942. class GObjectPool {
  943. private _pool;
  944. private _count;
  945. constructor();
  946. clear(): void;
  947. get count(): number;
  948. getObject(url: string): GObject;
  949. returnObject(obj: GObject): void;
  950. }
  951. }
  952. declare namespace fgui {
  953. class GLoader extends GObject {
  954. _content: MovieClip;
  955. private _url;
  956. private _align;
  957. private _verticalAlign;
  958. private _autoSize;
  959. private _fill;
  960. private _shrinkOnly;
  961. private _showErrorSign;
  962. private _playing;
  963. private _frame;
  964. private _color;
  965. private _contentItem;
  966. private _container;
  967. private _errorSign?;
  968. private _content2?;
  969. private _updatingLayout;
  970. private static _errorSignPool;
  971. constructor();
  972. dispose(): void;
  973. get url(): string;
  974. set url(value: string);
  975. get icon(): string;
  976. set icon(value: string);
  977. get align(): AlignType;
  978. set align(value: AlignType);
  979. get verticalAlign(): VertAlignType;
  980. set verticalAlign(value: VertAlignType);
  981. get fill(): LoaderFillType;
  982. set fill(value: LoaderFillType);
  983. get shrinkOnly(): boolean;
  984. set shrinkOnly(value: boolean);
  985. get autoSize(): boolean;
  986. set autoSize(value: boolean);
  987. get playing(): boolean;
  988. set playing(value: boolean);
  989. get frame(): number;
  990. set frame(value: number);
  991. get color(): cc.Color;
  992. set color(value: cc.Color);
  993. get fillMethod(): FillMethod;
  994. set fillMethod(value: FillMethod);
  995. get fillOrigin(): FillOrigin;
  996. set fillOrigin(value: FillOrigin);
  997. get fillClockwise(): boolean;
  998. set fillClockwise(value: boolean);
  999. get fillAmount(): number;
  1000. set fillAmount(value: number);
  1001. get showErrorSign(): boolean;
  1002. set showErrorSign(value: boolean);
  1003. get component(): GComponent;
  1004. get texture(): cc.SpriteFrame;
  1005. set texture(value: cc.SpriteFrame);
  1006. protected loadContent(): void;
  1007. protected loadFromPackage(itemURL: string): void;
  1008. protected loadExternal(): void;
  1009. protected freeExternal(texture: cc.SpriteFrame): void;
  1010. protected onExternalLoadSuccess(texture: cc.SpriteFrame): void;
  1011. protected onExternalLoadFailed(): void;
  1012. private setErrorState;
  1013. private clearErrorState;
  1014. private updateLayout;
  1015. private clearContent;
  1016. protected handleSizeChanged(): void;
  1017. protected handleAnchorChanged(): void;
  1018. protected handleGrayedChanged(): void;
  1019. protected _hitTest(pt: cc.Vec2, globalPt: cc.Vec2): GObject;
  1020. getProp(index: number): any;
  1021. setProp(index: number, value: any): void;
  1022. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1023. }
  1024. }
  1025. declare namespace fgui {
  1026. class GLoader3D extends GObject {
  1027. private _url;
  1028. private _align;
  1029. private _verticalAlign;
  1030. private _autoSize;
  1031. private _fill;
  1032. private _shrinkOnly;
  1033. private _playing;
  1034. private _frame;
  1035. private _loop;
  1036. private _animationName;
  1037. private _skinName;
  1038. private _color;
  1039. private _contentItem;
  1040. private _container;
  1041. private _content;
  1042. private _updatingLayout;
  1043. constructor();
  1044. dispose(): void;
  1045. get url(): string;
  1046. set url(value: string);
  1047. get icon(): string;
  1048. set icon(value: string);
  1049. get align(): AlignType;
  1050. set align(value: AlignType);
  1051. get verticalAlign(): VertAlignType;
  1052. set verticalAlign(value: VertAlignType);
  1053. get fill(): LoaderFillType;
  1054. set fill(value: LoaderFillType);
  1055. get shrinkOnly(): boolean;
  1056. set shrinkOnly(value: boolean);
  1057. get autoSize(): boolean;
  1058. set autoSize(value: boolean);
  1059. get playing(): boolean;
  1060. set playing(value: boolean);
  1061. get frame(): number;
  1062. set frame(value: number);
  1063. get animationName(): string;
  1064. set animationName(value: string);
  1065. get skinName(): string;
  1066. set skinName(value: string);
  1067. get loop(): boolean;
  1068. set loop(value: boolean);
  1069. get color(): cc.Color;
  1070. set color(value: cc.Color);
  1071. get content(): sp.Skeleton | dragonBones.ArmatureDisplay;
  1072. protected loadContent(): void;
  1073. protected loadFromPackage(itemURL: string): void;
  1074. private onLoaded;
  1075. setSpine(asset: sp.SkeletonData, anchor: cc.Vec2, pma?: boolean): void;
  1076. setDragonBones(asset: dragonBones.DragonBonesAsset, atlasAsset: dragonBones.DragonBonesAtlasAsset, anchor: cc.Vec2, pma?: boolean): void;
  1077. private onChange;
  1078. private onChangeSpine;
  1079. private onChangeDragonBones;
  1080. protected loadExternal(): void;
  1081. private onLoaded2;
  1082. private updateLayout;
  1083. private clearContent;
  1084. protected handleSizeChanged(): void;
  1085. protected handleAnchorChanged(): void;
  1086. protected handleGrayedChanged(): void;
  1087. getProp(index: number): any;
  1088. setProp(index: number, value: any): void;
  1089. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1090. }
  1091. }
  1092. declare namespace fgui {
  1093. class GMovieClip extends GObject {
  1094. _content: MovieClip;
  1095. constructor();
  1096. get color(): cc.Color;
  1097. set color(value: cc.Color);
  1098. get playing(): boolean;
  1099. set playing(value: boolean);
  1100. get frame(): number;
  1101. set frame(value: number);
  1102. get timeScale(): number;
  1103. set timeScale(value: number);
  1104. rewind(): void;
  1105. syncStatus(anotherMc: GMovieClip): void;
  1106. advance(timeInSeconds: number): void;
  1107. setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;
  1108. protected handleGrayedChanged(): void;
  1109. protected handleSizeChanged(): void;
  1110. getProp(index: number): any;
  1111. setProp(index: number, value: any): void;
  1112. constructFromResource(): void;
  1113. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1114. }
  1115. }
  1116. declare namespace fgui {
  1117. class GProgressBar extends GComponent {
  1118. private _min;
  1119. private _max;
  1120. private _value;
  1121. private _titleType;
  1122. private _reverse;
  1123. private _titleObject;
  1124. private _aniObject;
  1125. private _barObjectH;
  1126. private _barObjectV;
  1127. private _barMaxWidth;
  1128. private _barMaxHeight;
  1129. private _barMaxWidthDelta;
  1130. private _barMaxHeightDelta;
  1131. private _barStartX;
  1132. private _barStartY;
  1133. constructor();
  1134. get titleType(): ProgressTitleType;
  1135. set titleType(value: ProgressTitleType);
  1136. get min(): number;
  1137. set min(value: number);
  1138. get max(): number;
  1139. set max(value: number);
  1140. get value(): number;
  1141. set value(value: number);
  1142. tweenValue(value: number, duration: number): GTweener;
  1143. update(newValue: number): void;
  1144. private setFillAmount;
  1145. protected constructExtension(buffer: ByteBuffer): void;
  1146. protected handleSizeChanged(): void;
  1147. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  1148. }
  1149. }
  1150. declare namespace fgui {
  1151. class GTextField extends GObject {
  1152. _label: cc.Label;
  1153. protected _font: string;
  1154. protected _realFont: string | cc.Font;
  1155. protected _fontSize: number;
  1156. protected _color: cc.Color;
  1157. protected _strokeColor?: cc.Color;
  1158. protected _shadowOffset?: cc.Vec2;
  1159. protected _shadowColor?: cc.Color;
  1160. protected _leading: number;
  1161. protected _text: string;
  1162. protected _ubbEnabled: boolean;
  1163. protected _templateVars?: {
  1164. [index: string]: string;
  1165. };
  1166. protected _autoSize: AutoSizeType;
  1167. protected _updatingSize: boolean;
  1168. protected _sizeDirty: boolean;
  1169. protected _outline?: cc.LabelOutline;
  1170. protected _shadow?: cc.LabelShadow;
  1171. constructor();
  1172. protected createRenderer(): void;
  1173. set text(value: string);
  1174. get text(): string;
  1175. get font(): string;
  1176. set font(value: string);
  1177. get fontSize(): number;
  1178. set fontSize(value: number);
  1179. get color(): cc.Color;
  1180. set color(value: cc.Color);
  1181. get align(): cc.Label.HorizontalAlign;
  1182. set align(value: cc.Label.HorizontalAlign);
  1183. get verticalAlign(): cc.Label.VerticalAlign;
  1184. set verticalAlign(value: cc.Label.VerticalAlign);
  1185. get leading(): number;
  1186. set leading(value: number);
  1187. get letterSpacing(): number;
  1188. set letterSpacing(value: number);
  1189. get underline(): boolean;
  1190. set underline(value: boolean);
  1191. get bold(): boolean;
  1192. set bold(value: boolean);
  1193. get italic(): boolean;
  1194. set italic(value: boolean);
  1195. get singleLine(): boolean;
  1196. set singleLine(value: boolean);
  1197. get stroke(): number;
  1198. set stroke(value: number);
  1199. get strokeColor(): cc.Color;
  1200. set strokeColor(value: cc.Color);
  1201. get shadowOffset(): cc.Vec2;
  1202. set shadowOffset(value: cc.Vec2);
  1203. get shadowColor(): cc.Color;
  1204. set shadowColor(value: cc.Color);
  1205. set ubbEnabled(value: boolean);
  1206. get ubbEnabled(): boolean;
  1207. set autoSize(value: AutoSizeType);
  1208. get autoSize(): AutoSizeType;
  1209. protected parseTemplate(template: string): string;
  1210. get templateVars(): {
  1211. [index: string]: string;
  1212. };
  1213. set templateVars(value: {
  1214. [index: string]: string;
  1215. });
  1216. setVar(name: string, value: string): GTextField;
  1217. flushVars(): void;
  1218. get textWidth(): number;
  1219. ensureSizeCorrect(): void;
  1220. protected updateText(): void;
  1221. protected assignFont(label: any, value: string | cc.Font): void;
  1222. protected assignFontColor(label: any, value: cc.Color): void;
  1223. protected updateFont(): void;
  1224. protected updateFontColor(): void;
  1225. protected updateStrokeColor(): void;
  1226. protected updateShadowColor(): void;
  1227. protected updateFontSize(): void;
  1228. protected updateOverflow(): void;
  1229. protected markSizeChanged(): void;
  1230. protected onLabelSizeChanged(): void;
  1231. protected handleSizeChanged(): void;
  1232. protected handleGrayedChanged(): void;
  1233. getProp(index: number): any;
  1234. setProp(index: number, value: any): void;
  1235. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1236. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  1237. }
  1238. }
  1239. declare namespace fgui {
  1240. class RichTextImageAtlas extends cc.SpriteAtlas {
  1241. getSpriteFrame(key: string): cc.SpriteFrame;
  1242. }
  1243. class GRichTextField extends GTextField {
  1244. _richText: cc.RichText;
  1245. private _bold;
  1246. private _italics;
  1247. private _underline;
  1248. linkUnderline: boolean;
  1249. linkColor: string;
  1250. constructor();
  1251. protected createRenderer(): void;
  1252. get align(): cc.Label.HorizontalAlign;
  1253. set align(value: cc.Label.HorizontalAlign);
  1254. get underline(): boolean;
  1255. set underline(value: boolean);
  1256. get bold(): boolean;
  1257. set bold(value: boolean);
  1258. get italic(): boolean;
  1259. set italic(value: boolean);
  1260. protected markSizeChanged(): void;
  1261. protected updateText(): void;
  1262. protected updateFont(): void;
  1263. protected updateFontColor(): void;
  1264. protected updateFontSize(): void;
  1265. protected updateOverflow(): void;
  1266. protected handleSizeChanged(): void;
  1267. }
  1268. }
  1269. declare namespace fgui {
  1270. class GRoot extends GComponent {
  1271. static contentScaleLevel: number;
  1272. private _modalLayer;
  1273. private _popupStack;
  1274. private _justClosedPopups;
  1275. private _modalWaitPane;
  1276. private _tooltipWin;
  1277. private _defaultTooltipWin;
  1278. private _volumeScale;
  1279. private _inputProcessor;
  1280. private _thisOnResized;
  1281. private static _inst;
  1282. static get inst(): GRoot;
  1283. static create(): GRoot;
  1284. constructor();
  1285. protected onDestroy(): void;
  1286. getTouchPosition(touchId?: number): cc.Vec2;
  1287. get touchTarget(): GObject;
  1288. get inputProcessor(): InputProcessor;
  1289. showWindow(win: Window): void;
  1290. hideWindow(win: Window): void;
  1291. hideWindowImmediately(win: Window): void;
  1292. bringToFront(win: Window): void;
  1293. showModalWait(msg?: string): void;
  1294. closeModalWait(): void;
  1295. closeAllExceptModals(): void;
  1296. closeAllWindows(): void;
  1297. getTopWindow(): Window;
  1298. get modalLayer(): GGraph;
  1299. get hasModalWindow(): boolean;
  1300. get modalWaiting(): boolean;
  1301. getPopupPosition(popup: GObject, target?: GObject, dir?: PopupDirection | boolean, result?: cc.Vec2): cc.Vec2;
  1302. showPopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;
  1303. togglePopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;
  1304. hidePopup(popup?: GObject): void;
  1305. get hasAnyPopup(): boolean;
  1306. private closePopup;
  1307. showTooltips(msg: string): void;
  1308. showTooltipsWin(tooltipWin: GObject): void;
  1309. hideTooltips(): void;
  1310. get volumeScale(): number;
  1311. set volumeScale(value: number);
  1312. playOneShotSound(clip: cc.AudioClip, volumeScale?: number): void;
  1313. private adjustModalLayer;
  1314. private onTouchBegin_1;
  1315. private onWinResize;
  1316. handlePositionChanged(): void;
  1317. private updateContentScaleLevel;
  1318. }
  1319. }
  1320. declare namespace fgui {
  1321. class GScrollBar extends GComponent {
  1322. private _grip;
  1323. private _arrowButton1;
  1324. private _arrowButton2;
  1325. private _bar;
  1326. private _target;
  1327. private _vertical;
  1328. private _scrollPerc;
  1329. private _fixedGripSize;
  1330. private _dragOffset;
  1331. private _gripDragging;
  1332. constructor();
  1333. setScrollPane(target: ScrollPane, vertical: boolean): void;
  1334. setDisplayPerc(value: number): void;
  1335. setScrollPerc(val: number): void;
  1336. get minSize(): number;
  1337. get gripDragging(): boolean;
  1338. protected constructExtension(buffer: ByteBuffer): void;
  1339. private onGripTouchDown;
  1340. private onGripTouchMove;
  1341. private onGripTouchEnd;
  1342. private onClickArrow1;
  1343. private onClickArrow2;
  1344. private onBarTouchBegin;
  1345. }
  1346. }
  1347. declare namespace fgui {
  1348. class GSlider extends GComponent {
  1349. private _min;
  1350. private _max;
  1351. private _value;
  1352. private _titleType;
  1353. private _reverse;
  1354. private _wholeNumbers;
  1355. private _titleObject;
  1356. private _barObjectH;
  1357. private _barObjectV;
  1358. private _barMaxWidth;
  1359. private _barMaxHeight;
  1360. private _barMaxWidthDelta;
  1361. private _barMaxHeightDelta;
  1362. private _gripObject;
  1363. private _clickPos;
  1364. private _clickPercent;
  1365. private _barStartX;
  1366. private _barStartY;
  1367. changeOnClick: boolean;
  1368. canDrag: boolean;
  1369. constructor();
  1370. get titleType(): ProgressTitleType;
  1371. set titleType(value: ProgressTitleType);
  1372. get wholeNumbers(): boolean;
  1373. set wholeNumbers(value: boolean);
  1374. get min(): number;
  1375. set min(value: number);
  1376. get max(): number;
  1377. set max(value: number);
  1378. get value(): number;
  1379. set value(value: number);
  1380. update(): void;
  1381. private updateWithPercent;
  1382. protected constructExtension(buffer: ByteBuffer): void;
  1383. protected handleSizeChanged(): void;
  1384. setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;
  1385. private onGripTouchBegin;
  1386. private onGripTouchMove;
  1387. private onBarTouchBegin;
  1388. }
  1389. }
  1390. declare namespace fgui {
  1391. class GTextInput extends GTextField {
  1392. _editBox: cc.EditBox;
  1393. private _promptText;
  1394. constructor();
  1395. protected createRenderer(): void;
  1396. set editable(val: boolean);
  1397. get editable(): boolean;
  1398. set maxLength(val: number);
  1399. get maxLength(): number;
  1400. set promptText(val: string);
  1401. get promptText(): string;
  1402. set restrict(value: string);
  1403. get restrict(): string;
  1404. get password(): boolean;
  1405. set password(val: boolean);
  1406. get align(): cc.Label.HorizontalAlign;
  1407. set align(value: cc.Label.HorizontalAlign);
  1408. get verticalAlign(): cc.Label.VerticalAlign;
  1409. set verticalAlign(value: cc.Label.VerticalAlign);
  1410. get singleLine(): boolean;
  1411. set singleLine(value: boolean);
  1412. requestFocus(): void;
  1413. protected markSizeChanged(): void;
  1414. protected updateText(): void;
  1415. protected updateFont(): void;
  1416. protected updateFontColor(): void;
  1417. protected updateFontSize(): void;
  1418. protected updateOverflow(): void;
  1419. private onTextChanged;
  1420. private onTouchEnd1;
  1421. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1422. }
  1423. }
  1424. declare namespace fgui {
  1425. class GTree extends GList {
  1426. treeNodeRender: (node: GTreeNode, obj: GComponent) => void;
  1427. treeNodeWillExpand: (node: GTreeNode, expanded: boolean) => void;
  1428. private _indent;
  1429. private _clickToExpand;
  1430. private _rootNode;
  1431. private _expandedStatusInEvt;
  1432. constructor();
  1433. get rootNode(): GTreeNode;
  1434. get indent(): number;
  1435. set indent(value: number);
  1436. get clickToExpand(): number;
  1437. set clickToExpand(value: number);
  1438. getSelectedNode(): GTreeNode;
  1439. getSelectedNodes(result?: Array<GTreeNode>): Array<GTreeNode>;
  1440. selectNode(node: GTreeNode, scrollItToView?: boolean): void;
  1441. unselectNode(node: GTreeNode): void;
  1442. expandAll(folderNode?: GTreeNode): void;
  1443. collapseAll(folderNode?: GTreeNode): void;
  1444. private createCell;
  1445. _afterInserted(node: GTreeNode): void;
  1446. private getInsertIndexForNode;
  1447. _afterRemoved(node: GTreeNode): void;
  1448. _afterExpanded(node: GTreeNode): void;
  1449. _afterCollapsed(node: GTreeNode): void;
  1450. _afterMoved(node: GTreeNode): void;
  1451. private getFolderEndIndex;
  1452. private checkChildren;
  1453. private hideFolderNode;
  1454. private removeNode;
  1455. private __cellMouseDown;
  1456. private __expandedStateChanged;
  1457. protected dispatchItemEvent(item: GObject, evt: Event): void;
  1458. setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;
  1459. protected readItems(buffer: ByteBuffer): void;
  1460. }
  1461. }
  1462. declare namespace fgui {
  1463. class GTreeNode {
  1464. data?: any;
  1465. private _parent;
  1466. private _children;
  1467. private _expanded;
  1468. private _level;
  1469. private _tree;
  1470. _cell: GComponent;
  1471. _resURL?: string;
  1472. constructor(hasChild: boolean, resURL?: string);
  1473. set expanded(value: boolean);
  1474. get expanded(): boolean;
  1475. get isFolder(): boolean;
  1476. get parent(): GTreeNode;
  1477. get text(): string;
  1478. set text(value: string);
  1479. get icon(): string;
  1480. set icon(value: string);
  1481. get cell(): GComponent;
  1482. get level(): number;
  1483. _setLevel(value: number): void;
  1484. addChild(child: GTreeNode): GTreeNode;
  1485. addChildAt(child: GTreeNode, index: number): GTreeNode;
  1486. removeChild(child: GTreeNode): GTreeNode;
  1487. removeChildAt(index: number): GTreeNode;
  1488. removeChildren(beginIndex?: number, endIndex?: number): void;
  1489. getChildAt(index: number): GTreeNode;
  1490. getChildIndex(child: GTreeNode): number;
  1491. getPrevSibling(): GTreeNode;
  1492. getNextSibling(): GTreeNode;
  1493. setChildIndex(child: GTreeNode, index: number): void;
  1494. swapChildren(child1: GTreeNode, child2: GTreeNode): void;
  1495. swapChildrenAt(index1: number, index2: number): void;
  1496. get numChildren(): number;
  1497. expandToRoot(): void;
  1498. get tree(): GTree;
  1499. _setTree(value: GTree): void;
  1500. }
  1501. }
  1502. declare namespace fgui {
  1503. interface IUISource {
  1504. fileName: string;
  1505. loaded: boolean;
  1506. load(callback: Function, target: any): void;
  1507. }
  1508. }
  1509. declare namespace fgui {
  1510. class Margin {
  1511. left: number;
  1512. right: number;
  1513. top: number;
  1514. bottom: number;
  1515. constructor();
  1516. copy(source: Margin): void;
  1517. isNone(): boolean;
  1518. }
  1519. }
  1520. declare namespace fgui {
  1521. class PackageItem {
  1522. owner: UIPackage;
  1523. type: PackageItemType;
  1524. objectType?: ObjectType;
  1525. id: string;
  1526. name: string;
  1527. width: number;
  1528. height: number;
  1529. file: string;
  1530. decoded?: boolean;
  1531. loading?: Array<Function>;
  1532. rawData?: ByteBuffer;
  1533. asset?: cc.Asset;
  1534. highResolution?: Array<string>;
  1535. branches?: Array<string>;
  1536. scale9Grid?: cc.Rect;
  1537. scaleByTile?: boolean;
  1538. tileGridIndice?: number;
  1539. smoothing?: boolean;
  1540. hitTestData?: PixelHitTestData;
  1541. interval?: number;
  1542. repeatDelay?: number;
  1543. swing?: boolean;
  1544. frames?: Array<Frame>;
  1545. extensionType?: any;
  1546. skeletonAnchor?: cc.Vec2;
  1547. atlasAsset?: dragonBones.DragonBonesAtlasAsset;
  1548. constructor();
  1549. load(): cc.Asset;
  1550. getBranch(): PackageItem;
  1551. getHighResolution(): PackageItem;
  1552. toString(): string;
  1553. }
  1554. }
  1555. declare namespace fgui {
  1556. class PopupMenu {
  1557. protected _contentPane: GComponent;
  1558. protected _list: GList;
  1559. constructor(url?: string);
  1560. dispose(): void;
  1561. addItem(caption: string, callback?: (item?: fgui.GObject, evt?: fgui.Event) => void): GButton;
  1562. addItemAt(caption: string, index: number, callback?: (item?: fgui.GObject, evt?: fgui.Event) => void): GButton;
  1563. addSeperator(): void;
  1564. getItemName(index: number): string;
  1565. setItemText(name: string, caption: string): void;
  1566. setItemVisible(name: string, visible: boolean): void;
  1567. setItemGrayed(name: string, grayed: boolean): void;
  1568. setItemCheckable(name: string, checkable: boolean): void;
  1569. setItemChecked(name: string, checked: boolean): void;
  1570. isItemChecked(name: string): boolean;
  1571. removeItem(name: string): boolean;
  1572. clearItems(): void;
  1573. get itemCount(): number;
  1574. get contentPane(): GComponent;
  1575. get list(): GList;
  1576. show(target?: GObject, dir?: PopupDirection | boolean): void;
  1577. private onClickItem;
  1578. private onClickItem2;
  1579. private onDisplay;
  1580. }
  1581. }
  1582. declare namespace fgui {
  1583. class RelationItem {
  1584. private _owner;
  1585. private _target;
  1586. private _defs;
  1587. private _targetX;
  1588. private _targetY;
  1589. private _targetWidth;
  1590. private _targetHeight;
  1591. constructor(owner: GObject);
  1592. get owner(): GObject;
  1593. set target(value: GObject);
  1594. get target(): GObject;
  1595. add(relationType: number, usePercent?: boolean): void;
  1596. internalAdd(relationType: number, usePercent?: boolean): void;
  1597. remove(relationType: number): void;
  1598. copyFrom(source: RelationItem): void;
  1599. dispose(): void;
  1600. get isEmpty(): boolean;
  1601. applyOnSelfResized(dWidth: number, dHeight: number, applyPivot: boolean): void;
  1602. private applyOnXYChanged;
  1603. private applyOnSizeChanged;
  1604. private addRefTarget;
  1605. private releaseRefTarget;
  1606. private __targetXYChanged;
  1607. private __targetSizeChanged;
  1608. private __targetSizeWillChange;
  1609. }
  1610. class RelationDef {
  1611. percent: boolean;
  1612. type: number;
  1613. axis: number;
  1614. constructor();
  1615. copyFrom(source: RelationDef): void;
  1616. }
  1617. }
  1618. declare namespace fgui {
  1619. class Relations {
  1620. private _owner;
  1621. private _items;
  1622. handling: GObject;
  1623. sizeDirty: boolean;
  1624. constructor(owner: GObject);
  1625. add(target: GObject, relationType: number, usePercent?: boolean): void;
  1626. remove(target: GObject, relationType?: number): void;
  1627. contains(target: GObject): boolean;
  1628. clearFor(target: GObject): void;
  1629. clearAll(): void;
  1630. copyFrom(source: Relations): void;
  1631. dispose(): void;
  1632. onOwnerSizeChanged(dWidth: number, dHeight: number, applyPivot: boolean): void;
  1633. ensureRelationsSizeCorrect(): void;
  1634. get empty(): boolean;
  1635. setup(buffer: ByteBuffer, parentToChild: boolean): void;
  1636. }
  1637. }
  1638. declare namespace fgui {
  1639. class ScrollPane extends cc.Component {
  1640. private _owner;
  1641. private _container;
  1642. private _maskContainer;
  1643. private _scrollType;
  1644. private _scrollStep;
  1645. private _mouseWheelStep;
  1646. private _decelerationRate;
  1647. private _scrollBarMargin;
  1648. private _bouncebackEffect;
  1649. private _touchEffect;
  1650. private _scrollBarDisplayAuto?;
  1651. private _vScrollNone;
  1652. private _hScrollNone;
  1653. private _needRefresh;
  1654. private _refreshBarAxis;
  1655. private _displayOnLeft?;
  1656. private _snapToItem?;
  1657. private _snappingPolicy?;
  1658. _displayInDemand?: boolean;
  1659. private _mouseWheelEnabled;
  1660. private _pageMode?;
  1661. private _inertiaDisabled?;
  1662. private _floating?;
  1663. private _dontClipMargin?;
  1664. private _xPos;
  1665. private _yPos;
  1666. private _viewSize;
  1667. private _contentSize;
  1668. private _overlapSize;
  1669. private _pageSize;
  1670. private _containerPos;
  1671. private _beginTouchPos;
  1672. private _lastTouchPos;
  1673. private _lastTouchGlobalPos;
  1674. private _velocity;
  1675. private _velocityScale;
  1676. private _lastMoveTime;
  1677. private _isHoldAreaDone;
  1678. private _aniFlag;
  1679. _loop: number;
  1680. private _headerLockedSize;
  1681. private _footerLockedSize;
  1682. private _refreshEventDispatching;
  1683. private _dragged;
  1684. private _hover;
  1685. private _tweening;
  1686. private _tweenTime;
  1687. private _tweenDuration;
  1688. private _tweenStart;
  1689. private _tweenChange;
  1690. private _pageController?;
  1691. private _hzScrollBar?;
  1692. private _vtScrollBar?;
  1693. private _header?;
  1694. private _footer?;
  1695. static draggingPane: ScrollPane;
  1696. setup(buffer: ByteBuffer): void;
  1697. protected onDestroy(): void;
  1698. hitTest(pt: cc.Vec2, globalPt: cc.Vec2): GObject;
  1699. get owner(): GComponent;
  1700. get hzScrollBar(): GScrollBar;
  1701. get vtScrollBar(): GScrollBar;
  1702. get header(): GComponent;
  1703. get footer(): GComponent;
  1704. get bouncebackEffect(): boolean;
  1705. set bouncebackEffect(sc: boolean);
  1706. get touchEffect(): boolean;
  1707. set touchEffect(sc: boolean);
  1708. set scrollStep(val: number);
  1709. get decelerationRate(): number;
  1710. set decelerationRate(val: number);
  1711. get scrollStep(): number;
  1712. get snapToItem(): boolean;
  1713. set snapToItem(value: boolean);
  1714. get snappingPolicy(): number;
  1715. set snappingPolicy(value: number);
  1716. get mouseWheelEnabled(): boolean;
  1717. set mouseWheelEnabled(value: boolean);
  1718. get isDragged(): boolean;
  1719. get percX(): number;
  1720. set percX(value: number);
  1721. setPercX(value: number, ani?: boolean): void;
  1722. get percY(): number;
  1723. set percY(value: number);
  1724. setPercY(value: number, ani?: boolean): void;
  1725. get posX(): number;
  1726. set posX(value: number);
  1727. setPosX(value: number, ani?: boolean): void;
  1728. get posY(): number;
  1729. set posY(value: number);
  1730. setPosY(value: number, ani?: boolean): void;
  1731. get contentWidth(): number;
  1732. get contentHeight(): number;
  1733. get viewWidth(): number;
  1734. set viewWidth(value: number);
  1735. get viewHeight(): number;
  1736. set viewHeight(value: number);
  1737. get currentPageX(): number;
  1738. set currentPageX(value: number);
  1739. get currentPageY(): number;
  1740. set currentPageY(value: number);
  1741. setCurrentPageX(value: number, ani?: boolean): void;
  1742. setCurrentPageY(value: number, ani?: boolean): void;
  1743. get isBottomMost(): boolean;
  1744. get isRightMost(): boolean;
  1745. get pageController(): Controller;
  1746. set pageController(value: Controller);
  1747. get scrollingPosX(): number;
  1748. get scrollingPosY(): number;
  1749. scrollTop(ani?: boolean): void;
  1750. scrollBottom(ani?: boolean): void;
  1751. scrollUp(ratio?: number, ani?: boolean): void;
  1752. scrollDown(ratio?: number, ani?: boolean): void;
  1753. scrollLeft(ratio?: number, ani?: boolean): void;
  1754. scrollRight(ratio?: number, ani?: boolean): void;
  1755. scrollToView(target: any, ani?: boolean, setFirst?: boolean): void;
  1756. isChildInView(obj: GObject): boolean;
  1757. cancelDragging(): void;
  1758. lockHeader(size: number): void;
  1759. lockFooter(size: number): void;
  1760. onOwnerSizeChanged(): void;
  1761. handleControllerChanged(c: Controller): void;
  1762. private updatePageController;
  1763. adjustMaskContainer(): void;
  1764. setSize(aWidth: number, aHeight: number): void;
  1765. setContentSize(aWidth: number, aHeight: number): void;
  1766. changeContentSizeOnScrolling(deltaWidth: number, deltaHeight: number, deltaPosX: number, deltaPosY: number): void;
  1767. private handleSizeChanged;
  1768. private posChanged;
  1769. private refresh;
  1770. private refresh2;
  1771. private onTouchBegin;
  1772. private onTouchMove;
  1773. private onTouchEnd;
  1774. private onRollOver;
  1775. private onRollOut;
  1776. private onMouseWheel;
  1777. private updateScrollBarPos;
  1778. updateScrollBarVisible(): void;
  1779. private updateScrollBarVisible2;
  1780. private __barTweenComplete;
  1781. private getLoopPartSize;
  1782. private loopCheckingCurrent;
  1783. private loopCheckingTarget;
  1784. private loopCheckingTarget2;
  1785. private loopCheckingNewPos;
  1786. private alignPosition;
  1787. private alignByPage;
  1788. private updateTargetAndDuration;
  1789. private updateTargetAndDuration2;
  1790. private fixDuration;
  1791. private startTween;
  1792. private killTween;
  1793. private checkRefreshBar;
  1794. protected update(dt: number): boolean;
  1795. private runTween;
  1796. }
  1797. }
  1798. declare namespace fgui {
  1799. class Transition {
  1800. name: string;
  1801. private _owner;
  1802. private _ownerBaseX;
  1803. private _ownerBaseY;
  1804. private _items;
  1805. private _totalTimes;
  1806. private _totalTasks;
  1807. private _playing;
  1808. private _paused?;
  1809. private _onComplete?;
  1810. private _options;
  1811. private _reversed?;
  1812. private _totalDuration;
  1813. private _autoPlay?;
  1814. private _autoPlayTimes;
  1815. private _autoPlayDelay;
  1816. private _timeScale;
  1817. private _startTime;
  1818. private _endTime;
  1819. constructor(owner: GComponent);
  1820. play(onComplete?: () => void, times?: number, delay?: number, startTime?: number, endTime?: number): void;
  1821. playReverse(onComplete?: () => void, times?: number, delay?: number): void;
  1822. changePlayTimes(value: number): void;
  1823. setAutoPlay(value: boolean, times?: number, delay?: number): void;
  1824. private _play;
  1825. stop(setToComplete?: boolean, processCallback?: boolean): void;
  1826. private stopItem;
  1827. setPaused(paused: boolean): void;
  1828. dispose(): void;
  1829. get playing(): boolean;
  1830. setValue(label: string, ...args: any[]): void;
  1831. setHook(label: string, callback: (label?: string) => void): void;
  1832. clearHooks(): void;
  1833. setTarget(label: string, newTarget: GObject): void;
  1834. setDuration(label: string, value: number): void;
  1835. getLabelTime(label: string): number;
  1836. get timeScale(): number;
  1837. set timeScale(value: number);
  1838. updateFromRelations(targetId: string, dx: number, dy: number): void;
  1839. onEnable(): void;
  1840. onDisable(): void;
  1841. private onDelayedPlay;
  1842. private internalPlay;
  1843. private playItem;
  1844. private skipAnimations;
  1845. private onDelayedPlayItem;
  1846. private onTweenStart;
  1847. private onTweenUpdate;
  1848. private onTweenComplete;
  1849. private onPlayTransCompleted;
  1850. private callHook;
  1851. private checkAllComplete;
  1852. private applyValue;
  1853. setup(buffer: ByteBuffer): void;
  1854. private decodeValue;
  1855. }
  1856. }
  1857. declare namespace fgui {
  1858. class TranslationHelper {
  1859. static strings: {
  1860. [index: string]: {
  1861. [index: string]: string;
  1862. };
  1863. };
  1864. static loadFromXML(source: string): void;
  1865. static translateComponent(item: PackageItem): void;
  1866. }
  1867. }
  1868. declare namespace fgui {
  1869. class UIConfig {
  1870. constructor();
  1871. static defaultFont: string;
  1872. static windowModalWaiting: string;
  1873. static globalModalWaiting: string;
  1874. static modalLayerColor: cc.Color;
  1875. static buttonSound: string;
  1876. static buttonSoundVolumeScale: number;
  1877. static horizontalScrollBar: string;
  1878. static verticalScrollBar: string;
  1879. static defaultScrollStep: number;
  1880. static defaultScrollDecelerationRate: number;
  1881. static defaultScrollBarDisplay: number;
  1882. static defaultScrollTouchEffect: boolean;
  1883. static defaultScrollBounceEffect: boolean;
  1884. static popupMenu: string;
  1885. static popupMenu_seperator: string;
  1886. static loaderErrorSign: string;
  1887. static tooltipsWin: string;
  1888. static defaultComboBoxVisibleItemCount: number;
  1889. static touchScrollSensitivity: number;
  1890. static touchDragSensitivity: number;
  1891. static clickDragSensitivity: number;
  1892. static bringWindowToFrontOnClick: boolean;
  1893. static frameTimeForAsyncUIConstruction: number;
  1894. static linkUnderline: boolean;
  1895. static defaultUIGroup: string;
  1896. }
  1897. function addLoadHandler(ext?: string): void;
  1898. function registerFont(name: string, font: cc.Font | string): void;
  1899. function getFontByName(name: string): cc.Font;
  1900. }
  1901. declare namespace fgui {
  1902. class UIObjectFactory {
  1903. static counter: number;
  1904. static extensions: {
  1905. [index: string]: new () => GComponent;
  1906. };
  1907. static loaderType: new () => GLoader;
  1908. constructor();
  1909. static setExtension(url: string, type: new () => GComponent): void;
  1910. static setLoaderExtension(type: new () => GLoader): void;
  1911. static resolveExtension(pi: PackageItem): void;
  1912. static newObject(type: number | PackageItem, userClass?: new () => GObject): GObject;
  1913. }
  1914. }
  1915. declare namespace fgui {
  1916. type PackageDependency = {
  1917. id: string;
  1918. name: string;
  1919. };
  1920. export class UIPackage {
  1921. private _id;
  1922. private _name;
  1923. private _path;
  1924. private _items;
  1925. private _itemsById;
  1926. private _itemsByName;
  1927. private _sprites;
  1928. private _dependencies;
  1929. private _branches;
  1930. _branchIndex: number;
  1931. private _bundle;
  1932. static _constructing: number;
  1933. private static _instById;
  1934. private static _instByName;
  1935. private static _branch;
  1936. private static _vars;
  1937. constructor();
  1938. static get branch(): string;
  1939. static set branch(value: string);
  1940. static getVar(key: string): string;
  1941. static setVar(key: string, value: string): void;
  1942. static getById(id: string): UIPackage;
  1943. static getByName(name: string): UIPackage;
  1944. static addPackage(path: string): UIPackage;
  1945. static loadPackage(bundle: cc.AssetManager.Bundle, path: string, onComplete?: (error: any, pkg: UIPackage) => void): void;
  1946. static loadPackage(bundle: cc.AssetManager.Bundle, path: string, onProgress?: (finish: number, total: number, item: cc.AssetManager.RequestItem) => void, onComplete?: (error: any, pkg: UIPackage) => void): void;
  1947. static loadPackage(path: string, onComplete?: (error: any, pkg: UIPackage) => void): void;
  1948. static loadPackage(path: string, onProgress?: (finish: number, total: number, item: cc.AssetManager.RequestItem) => void, onComplete?: (error: any, pkg: UIPackage) => void): void;
  1949. static removePackage(packageIdOrName: string): void;
  1950. static createObject(pkgName: string, resName: string, userClass?: new () => GObject): GObject;
  1951. static createObjectFromURL(url: string, userClass?: new () => GObject): GObject;
  1952. static getItemURL(pkgName: string, resName: string): string;
  1953. static getItemByURL(url: string): PackageItem;
  1954. static normalizeURL(url: string): string;
  1955. static setStringsSource(source: string): void;
  1956. private loadPackage;
  1957. dispose(): void;
  1958. get id(): string;
  1959. get name(): string;
  1960. get path(): string;
  1961. get dependencies(): Array<PackageDependency>;
  1962. createObject(resName: string, userClass?: new () => GObject): GObject;
  1963. internalCreateObject(item: PackageItem, userClass?: new () => GObject): GObject;
  1964. getItemById(itemId: string): PackageItem;
  1965. getItemByName(resName: string): PackageItem;
  1966. getItemAssetByName(resName: string): cc.Asset;
  1967. getItemAsset(item: PackageItem): cc.Asset;
  1968. getItemAssetAsync(item: PackageItem, onComplete?: (err: Error, item: PackageItem) => void): void;
  1969. loadAllAssets(): void;
  1970. private loadMovieClip;
  1971. private loadFont;
  1972. private loadSpine;
  1973. private loadDragonBones;
  1974. }
  1975. export {};
  1976. }
  1977. declare namespace fgui {
  1978. class Window extends GComponent {
  1979. private _contentPane;
  1980. private _modalWaitPane;
  1981. private _closeButton;
  1982. private _dragArea;
  1983. private _contentArea;
  1984. private _frame;
  1985. private _modal;
  1986. private _uiSources?;
  1987. private _inited?;
  1988. private _loading?;
  1989. protected _requestingCmd: number;
  1990. bringToFontOnClick: boolean;
  1991. constructor();
  1992. addUISource(source: IUISource): void;
  1993. set contentPane(val: GComponent);
  1994. get contentPane(): GComponent;
  1995. get frame(): GComponent;
  1996. get closeButton(): GObject;
  1997. set closeButton(value: GObject);
  1998. get dragArea(): GObject;
  1999. set dragArea(value: GObject);
  2000. get contentArea(): GObject;
  2001. set contentArea(value: GObject);
  2002. show(): void;
  2003. showOn(root: GRoot): void;
  2004. hide(): void;
  2005. hideImmediately(): void;
  2006. centerOn(r: GRoot, restraint?: boolean): void;
  2007. toggleStatus(): void;
  2008. get isShowing(): boolean;
  2009. get isTop(): boolean;
  2010. get modal(): boolean;
  2011. set modal(val: boolean);
  2012. bringToFront(): void;
  2013. showModalWait(requestingCmd?: number): void;
  2014. protected layoutModalWaitPane(): void;
  2015. closeModalWait(requestingCmd?: number): boolean;
  2016. get modalWaiting(): boolean;
  2017. init(): void;
  2018. protected onInit(): void;
  2019. protected onShown(): void;
  2020. protected onHide(): void;
  2021. protected doShowAnimation(): void;
  2022. protected doHideAnimation(): void;
  2023. private __uiLoadComplete;
  2024. private _init;
  2025. dispose(): void;
  2026. protected closeEventHandler(evt: cc.Event): void;
  2027. protected onEnable(): void;
  2028. protected onDisable(): void;
  2029. private onTouchBegin_1;
  2030. private onDragStart_1;
  2031. }
  2032. }
  2033. declare namespace fgui {
  2034. class ControllerAction {
  2035. fromPage: string[];
  2036. toPage: string[];
  2037. static createAction(type: number): ControllerAction;
  2038. constructor();
  2039. run(controller: Controller, prevPage: string, curPage: string): void;
  2040. protected enter(controller: Controller): void;
  2041. protected leave(controller: Controller): void;
  2042. setup(buffer: ByteBuffer): void;
  2043. }
  2044. }
  2045. declare namespace fgui {
  2046. class ChangePageAction extends ControllerAction {
  2047. objectId: string;
  2048. controllerName: string;
  2049. targetPage: string;
  2050. constructor();
  2051. protected enter(controller: Controller): void;
  2052. setup(buffer: ByteBuffer): void;
  2053. }
  2054. }
  2055. declare namespace fgui {
  2056. class PlayTransitionAction extends ControllerAction {
  2057. transitionName: string;
  2058. playTimes: number;
  2059. delay: number;
  2060. stopOnExit: boolean;
  2061. private _currentTransition;
  2062. constructor();
  2063. protected enter(controller: Controller): void;
  2064. protected leave(controller: Controller): void;
  2065. setup(buffer: ByteBuffer): void;
  2066. }
  2067. }
  2068. declare namespace fgui {
  2069. enum BlendMode {
  2070. Normal = 0,
  2071. None = 1,
  2072. Add = 2,
  2073. Multiply = 3,
  2074. Screen = 4,
  2075. Erase = 5,
  2076. Mask = 6,
  2077. Below = 7,
  2078. Off = 8,
  2079. Custom1 = 9,
  2080. Custom2 = 10,
  2081. Custom3 = 11
  2082. }
  2083. class BlendModeUtils {
  2084. static apply(node: cc.Node, blendMode: BlendMode): void;
  2085. static override(blendMode: BlendMode, srcFactor: number, dstFactor: number): void;
  2086. }
  2087. }
  2088. declare namespace fgui {
  2089. class Image extends cc.Sprite {
  2090. private _flip;
  2091. private _fillMethod;
  2092. private _fillOrigin;
  2093. private _fillAmount;
  2094. private _fillClockwise;
  2095. private _grayed?;
  2096. private _graySpriteMaterial?;
  2097. private _spriteMaterial?;
  2098. constructor();
  2099. get flip(): FlipType;
  2100. set flip(value: FlipType);
  2101. get fillMethod(): FillMethod;
  2102. set fillMethod(value: FillMethod);
  2103. get fillOrigin(): FillOrigin;
  2104. set fillOrigin(value: FillOrigin);
  2105. get fillClockwise(): boolean;
  2106. set fillClockwise(value: boolean);
  2107. get fillAmount(): number;
  2108. set fillAmount(value: number);
  2109. private setupFill;
  2110. get grayed(): boolean;
  2111. set grayed(value: boolean);
  2112. }
  2113. }
  2114. declare namespace fgui {
  2115. interface Frame {
  2116. rect: cc.Rect;
  2117. addDelay: number;
  2118. texture?: cc.SpriteFrame;
  2119. }
  2120. class MovieClip extends Image {
  2121. interval: number;
  2122. swing: boolean;
  2123. repeatDelay: number;
  2124. timeScale: number;
  2125. private _playing;
  2126. private _frameCount;
  2127. private _frames;
  2128. private _frame;
  2129. private _start;
  2130. private _end;
  2131. private _times;
  2132. private _endAt;
  2133. private _status;
  2134. private _callback;
  2135. private _callbackObj;
  2136. private _smoothing;
  2137. private _frameElapsed;
  2138. private _reversed;
  2139. private _repeatedCount;
  2140. constructor();
  2141. get frames(): Array<Frame>;
  2142. set frames(value: Array<Frame>);
  2143. get frameCount(): number;
  2144. get frame(): number;
  2145. set frame(value: number);
  2146. get playing(): boolean;
  2147. set playing(value: boolean);
  2148. get smoothing(): boolean;
  2149. set smoothing(value: boolean);
  2150. rewind(): void;
  2151. syncStatus(anotherMc: MovieClip): void;
  2152. advance(timeInSeconds: number): void;
  2153. setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;
  2154. protected update(dt: number): void;
  2155. private drawFrame;
  2156. }
  2157. }
  2158. declare namespace fgui {
  2159. class Event extends cc.Event {
  2160. static TOUCH_BEGIN: string;
  2161. static TOUCH_MOVE: string;
  2162. static TOUCH_END: string;
  2163. static CLICK: string;
  2164. static ROLL_OVER: string;
  2165. static ROLL_OUT: string;
  2166. static MOUSE_WHEEL: string;
  2167. static DISPLAY: string;
  2168. static UNDISPLAY: string;
  2169. static GEAR_STOP: string;
  2170. static LINK: string;
  2171. static Submit: string;
  2172. static TEXT_CHANGE: string;
  2173. static STATUS_CHANGED: string;
  2174. static XY_CHANGED: string;
  2175. static SIZE_CHANGED: string;
  2176. static SIZE_DELAY_CHANGE: string;
  2177. static DRAG_START: string;
  2178. static DRAG_MOVE: string;
  2179. static DRAG_END: string;
  2180. static DROP: string;
  2181. static SCROLL: string;
  2182. static SCROLL_END: string;
  2183. static PULL_DOWN_RELEASE: string;
  2184. static PULL_UP_RELEASE: string;
  2185. static CLICK_ITEM: string;
  2186. initiator: GObject;
  2187. pos: cc.Vec2;
  2188. touch: cc.Touch;
  2189. touchId: number;
  2190. clickCount: number;
  2191. button: number;
  2192. keyModifiers: number;
  2193. mouseWheelDelta: number;
  2194. _processor: InputProcessor;
  2195. constructor(type: string, bubbles: boolean);
  2196. get isShiftDown(): boolean;
  2197. get isCtrlDown(): boolean;
  2198. captureTouch(): void;
  2199. static _borrow(type: string, bubbles?: boolean): Event;
  2200. static _return(evt: Event): void;
  2201. }
  2202. }
  2203. declare namespace fgui {
  2204. interface IHitTest {
  2205. hitTest(pt: cc.Vec2, globalPt: cc.Vec2): boolean;
  2206. }
  2207. class PixelHitTest implements IHitTest {
  2208. private _data;
  2209. offsetX: number;
  2210. offsetY: number;
  2211. scaleX: number;
  2212. scaleY: number;
  2213. constructor(data: PixelHitTestData, offsetX?: number, offsetY?: number);
  2214. hitTest(pt: cc.Vec2): boolean;
  2215. }
  2216. class PixelHitTestData {
  2217. pixelWidth: number;
  2218. scale: number;
  2219. pixels: Uint8Array;
  2220. constructor(ba: ByteBuffer);
  2221. }
  2222. class ChildHitArea implements IHitTest {
  2223. private _child;
  2224. constructor(child: GObject);
  2225. hitTest(pt: cc.Vec2, globalPt: cc.Vec2): boolean;
  2226. }
  2227. }
  2228. declare namespace fgui {
  2229. class InputProcessor extends cc.Component {
  2230. private _owner;
  2231. private _touchListener;
  2232. private _touchPos;
  2233. private _touches;
  2234. private _rollOutChain;
  2235. private _rollOverChain;
  2236. _captureCallback: (evt: Event) => void;
  2237. constructor();
  2238. onLoad(): void;
  2239. onEnable(): void;
  2240. onDisable(): void;
  2241. getAllTouches(touchIds?: Array<number>): Array<number>;
  2242. getTouchPosition(touchId?: number): cc.Vec2;
  2243. getTouchTarget(): GObject;
  2244. addTouchMonitor(touchId: number, target: GObject): void;
  2245. removeTouchMonitor(target: GObject): void;
  2246. cancelClick(touchId: number): void;
  2247. simulateClick(target: GObject): void;
  2248. private touchBeginHandler;
  2249. private touchMoveHandler;
  2250. private touchEndHandler;
  2251. private touchCancelHandler;
  2252. private mouseDownHandler;
  2253. private mouseUpHandler;
  2254. private mouseMoveHandler;
  2255. private mouseWheelHandler;
  2256. private updateInfo;
  2257. private getInfo;
  2258. private setBegin;
  2259. private setEnd;
  2260. private clickTest;
  2261. private handleRollOver;
  2262. private getEvent;
  2263. }
  2264. }
  2265. declare namespace fgui {
  2266. class GearBase {
  2267. static disableAllTweenEffect: boolean;
  2268. protected _owner: GObject;
  2269. protected _controller: Controller;
  2270. protected _tweenConfig?: GearTweenConfig;
  2271. static create(owner: GObject, index: number): GearBase;
  2272. constructor(owner: GObject);
  2273. dispose(): void;
  2274. get controller(): Controller;
  2275. set controller(val: Controller);
  2276. get tweenConfig(): GearTweenConfig;
  2277. setup(buffer: ByteBuffer): void;
  2278. updateFromRelations(dx: number, dy: number): void;
  2279. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2280. protected init(): void;
  2281. apply(): void;
  2282. updateState(): void;
  2283. }
  2284. class GearTweenConfig {
  2285. tween: boolean;
  2286. easeType: number;
  2287. duration: number;
  2288. delay: number;
  2289. _displayLockToken: number;
  2290. _tweener: GTweener;
  2291. constructor();
  2292. }
  2293. }
  2294. declare namespace fgui {
  2295. class GearAnimation extends GearBase {
  2296. private _storage;
  2297. private _default;
  2298. constructor(owner: GObject);
  2299. protected init(): void;
  2300. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2301. apply(): void;
  2302. updateState(): void;
  2303. }
  2304. }
  2305. declare namespace fgui {
  2306. class GearColor extends GearBase {
  2307. private _storage;
  2308. private _default;
  2309. constructor(owner: GObject);
  2310. protected init(): void;
  2311. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2312. apply(): void;
  2313. updateState(): void;
  2314. }
  2315. }
  2316. declare namespace fgui {
  2317. class GearDisplay extends GearBase {
  2318. pages: string[];
  2319. private _visible;
  2320. private _displayLockToken;
  2321. constructor(owner: GObject);
  2322. protected init(): void;
  2323. apply(): void;
  2324. addLock(): number;
  2325. releaseLock(token: number): void;
  2326. get connected(): boolean;
  2327. }
  2328. }
  2329. declare namespace fgui {
  2330. class GearDisplay2 extends GearBase {
  2331. pages: string[];
  2332. condition: number;
  2333. private _visible;
  2334. constructor(owner: GObject);
  2335. protected init(): void;
  2336. apply(): void;
  2337. evaluate(connected: boolean): boolean;
  2338. }
  2339. }
  2340. declare namespace fgui {
  2341. class GearFontSize extends GearBase {
  2342. private _storage;
  2343. private _default;
  2344. constructor(owner: GObject);
  2345. protected init(): void;
  2346. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2347. apply(): void;
  2348. updateState(): void;
  2349. }
  2350. }
  2351. declare namespace fgui {
  2352. class GearIcon extends GearBase {
  2353. private _storage;
  2354. private _default;
  2355. constructor(owner: GObject);
  2356. protected init(): void;
  2357. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2358. apply(): void;
  2359. updateState(): void;
  2360. }
  2361. }
  2362. declare namespace fgui {
  2363. class GearLook extends GearBase {
  2364. private _storage;
  2365. private _default;
  2366. constructor(owner: GObject);
  2367. protected init(): void;
  2368. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2369. apply(): void;
  2370. private __tweenUpdate;
  2371. private __tweenComplete;
  2372. updateState(): void;
  2373. }
  2374. }
  2375. declare namespace fgui {
  2376. class GearSize extends GearBase {
  2377. private _storage;
  2378. private _default;
  2379. constructor(owner: GObject);
  2380. protected init(): void;
  2381. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2382. apply(): void;
  2383. private __tweenUpdate;
  2384. private __tweenComplete;
  2385. updateState(): void;
  2386. updateFromRelations(dx: number, dy: number): void;
  2387. }
  2388. }
  2389. declare namespace fgui {
  2390. class GearText extends GearBase {
  2391. private _storage;
  2392. private _default;
  2393. constructor(owner: GObject);
  2394. protected init(): void;
  2395. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2396. apply(): void;
  2397. updateState(): void;
  2398. }
  2399. }
  2400. declare namespace fgui {
  2401. class GearXY extends GearBase {
  2402. positionsInPercent: boolean;
  2403. private _storage;
  2404. private _default;
  2405. constructor(owner: GObject);
  2406. protected init(): void;
  2407. protected addStatus(pageId: string, buffer: ByteBuffer): void;
  2408. addExtStatus(pageId: string, buffer: ByteBuffer): void;
  2409. apply(): void;
  2410. private __tweenUpdate;
  2411. private __tweenComplete;
  2412. updateState(): void;
  2413. updateFromRelations(dx: number, dy: number): void;
  2414. }
  2415. }
  2416. declare namespace fgui {
  2417. function evaluateEase(easeType: number, time: number, duration: number, overshootOrAmplitude: number, period: number): number;
  2418. }
  2419. declare namespace fgui {
  2420. class EaseType {
  2421. static Linear: number;
  2422. static SineIn: number;
  2423. static SineOut: number;
  2424. static SineInOut: number;
  2425. static QuadIn: number;
  2426. static QuadOut: number;
  2427. static QuadInOut: number;
  2428. static CubicIn: number;
  2429. static CubicOut: number;
  2430. static CubicInOut: number;
  2431. static QuartIn: number;
  2432. static QuartOut: number;
  2433. static QuartInOut: number;
  2434. static QuintIn: number;
  2435. static QuintOut: number;
  2436. static QuintInOut: number;
  2437. static ExpoIn: number;
  2438. static ExpoOut: number;
  2439. static ExpoInOut: number;
  2440. static CircIn: number;
  2441. static CircOut: number;
  2442. static CircInOut: number;
  2443. static ElasticIn: number;
  2444. static ElasticOut: number;
  2445. static ElasticInOut: number;
  2446. static BackIn: number;
  2447. static BackOut: number;
  2448. static BackInOut: number;
  2449. static BounceIn: number;
  2450. static BounceOut: number;
  2451. static BounceInOut: number;
  2452. static Custom: number;
  2453. }
  2454. }
  2455. declare namespace fgui {
  2456. class GPath {
  2457. private _segments;
  2458. private _points;
  2459. private _fullLength;
  2460. constructor();
  2461. get length(): number;
  2462. create(pt1: Array<GPathPoint> | GPathPoint, pt2?: GPathPoint, pt3?: GPathPoint, pt4?: GPathPoint): void;
  2463. private createSplineSegment;
  2464. clear(): void;
  2465. getPointAt(t: number, result?: cc.Vec2): cc.Vec2;
  2466. get segmentCount(): number;
  2467. getAnchorsInSegment(segmentIndex: number, points?: Array<cc.Vec2>): Array<cc.Vec2>;
  2468. getPointsInSegment(segmentIndex: number, t0: number, t1: number, points?: Array<cc.Vec2>, ts?: Array<number>, pointDensity?: number): Array<cc.Vec2>;
  2469. getAllPoints(points?: Array<cc.Vec2>, ts?: Array<number>, pointDensity?: number): Array<cc.Vec2>;
  2470. private onCRSplineCurve;
  2471. private onBezierCurve;
  2472. }
  2473. }
  2474. declare namespace fgui {
  2475. enum CurveType {
  2476. CRSpline = 0,
  2477. Bezier = 1,
  2478. CubicBezier = 2,
  2479. Straight = 3
  2480. }
  2481. class GPathPoint {
  2482. x: number;
  2483. y: number;
  2484. control1_x: number;
  2485. control1_y: number;
  2486. control2_x: number;
  2487. control2_y: number;
  2488. curveType: number;
  2489. constructor();
  2490. static newPoint(x?: number, y?: number, curveType?: number): GPathPoint;
  2491. static newBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number): GPathPoint;
  2492. static newCubicBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number, control2_x?: number, control2_y?: number): GPathPoint;
  2493. clone(): GPathPoint;
  2494. }
  2495. }
  2496. declare namespace fgui {
  2497. class GTween {
  2498. static catchCallbackExceptions: boolean;
  2499. static to(start: number, end: number, duration: number): GTweener;
  2500. static to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;
  2501. static to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;
  2502. static to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;
  2503. static toColor(start: number, end: number, duration: number): GTweener;
  2504. static delayedCall(delay: number): GTweener;
  2505. static shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;
  2506. static isTweening(target: any, propType?: any): Boolean;
  2507. static kill(target: any, complete?: boolean, propType?: any): void;
  2508. static getTween(target: any, propType?: any): GTweener;
  2509. }
  2510. }
  2511. declare namespace fgui {
  2512. class GTweener {
  2513. _target: any;
  2514. _propType: any;
  2515. _node: cc.Node;
  2516. _killed: boolean;
  2517. _paused: boolean;
  2518. private _delay;
  2519. private _duration;
  2520. private _breakpoint;
  2521. private _easeType;
  2522. private _easeOvershootOrAmplitude;
  2523. private _easePeriod;
  2524. private _repeat;
  2525. private _yoyo;
  2526. private _timeScale;
  2527. private _snapping;
  2528. private _userData;
  2529. private _path;
  2530. private _onUpdate;
  2531. private _onStart;
  2532. private _onComplete;
  2533. private _onUpdateCaller;
  2534. private _onStartCaller;
  2535. private _onCompleteCaller;
  2536. private _startValue;
  2537. private _endValue;
  2538. private _value;
  2539. private _deltaValue;
  2540. private _valueSize;
  2541. private _started;
  2542. private _ended;
  2543. private _elapsedTime;
  2544. private _normalizedTime;
  2545. constructor();
  2546. setDelay(value: number): GTweener;
  2547. get delay(): number;
  2548. setDuration(value: number): GTweener;
  2549. get duration(): number;
  2550. setBreakpoint(value: number): GTweener;
  2551. setEase(value: number): GTweener;
  2552. setEasePeriod(value: number): GTweener;
  2553. setEaseOvershootOrAmplitude(value: number): GTweener;
  2554. setRepeat(repeat: number, yoyo?: boolean): GTweener;
  2555. get repeat(): number;
  2556. setTimeScale(value: number): GTweener;
  2557. setSnapping(value: boolean): GTweener;
  2558. setTarget(value: any, propType?: any): GTweener;
  2559. get target(): any;
  2560. setPath(value: GPath): GTweener;
  2561. setUserData(value: any): GTweener;
  2562. get userData(): any;
  2563. onUpdate(callback: Function, target?: any): GTweener;
  2564. onStart(callback: Function, target?: any): GTweener;
  2565. onComplete(callback: Function, target?: any): GTweener;
  2566. get startValue(): TweenValue;
  2567. get endValue(): TweenValue;
  2568. get value(): TweenValue;
  2569. get deltaValue(): TweenValue;
  2570. get normalizedTime(): number;
  2571. get completed(): boolean;
  2572. get allCompleted(): boolean;
  2573. setPaused(paused: boolean): GTweener;
  2574. seek(time: number): void;
  2575. kill(complete?: boolean): void;
  2576. _to(start: number, end: number, duration: number): GTweener;
  2577. _to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;
  2578. _to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;
  2579. _to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;
  2580. _toColor(start: number, end: number, duration: number): GTweener;
  2581. _shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;
  2582. _init(): void;
  2583. _reset(): void;
  2584. _update(dt: number): void;
  2585. private update;
  2586. private callStartCallback;
  2587. private callUpdateCallback;
  2588. private callCompleteCallback;
  2589. }
  2590. }
  2591. declare namespace fgui {
  2592. class TweenManager {
  2593. static createTween(): GTweener;
  2594. static isTweening(target: any, propType?: any): boolean;
  2595. static killTweens(target: any, completed: boolean, propType?: any): boolean;
  2596. static getTween(target: any, propType?: any): GTweener;
  2597. private static update;
  2598. }
  2599. }
  2600. declare namespace fgui {
  2601. class TweenValue {
  2602. x: number;
  2603. y: number;
  2604. z: number;
  2605. w: number;
  2606. constructor();
  2607. get color(): number;
  2608. set color(value: number);
  2609. getField(index: number): number;
  2610. setField(index: number, value: number): void;
  2611. setZero(): void;
  2612. }
  2613. }
  2614. declare namespace fgui {
  2615. class ByteBuffer {
  2616. stringTable: Array<string>;
  2617. version: number;
  2618. littleEndian: boolean;
  2619. protected _view: DataView;
  2620. protected _bytes: Uint8Array;
  2621. protected _pos: number;
  2622. protected _length: number;
  2623. constructor(buffer: ArrayBuffer, offset?: number, length?: number);
  2624. get data(): Uint8Array;
  2625. get position(): number;
  2626. set position(value: number);
  2627. skip(count: number): void;
  2628. private validate;
  2629. readByte(): number;
  2630. readUbyte(): number;
  2631. readBool(): boolean;
  2632. readShort(): number;
  2633. readUshort(): number;
  2634. readInt(): number;
  2635. readUint(): number;
  2636. readFloat(): number;
  2637. readString(len?: number): string;
  2638. readS(): string;
  2639. readSArray(cnt: number): Array<string>;
  2640. writeS(value: string): void;
  2641. readColor(hasAlpha?: boolean): cc.Color;
  2642. readChar(): string;
  2643. readBuffer(): ByteBuffer;
  2644. seek(indexTablePos: number, blockIndex: number): boolean;
  2645. }
  2646. }
  2647. declare namespace fgui {
  2648. class ColorMatrix {
  2649. readonly matrix: Array<number>;
  2650. constructor(p_brightness?: number, p_contrast?: number, p_saturation?: number, p_hue?: number);
  2651. reset(): void;
  2652. invert(): void;
  2653. adjustColor(p_brightness: number, p_contrast: number, p_saturation: number, p_hue: number): void;
  2654. adjustBrightness(p_val: number): void;
  2655. adjustContrast(p_val: number): void;
  2656. adjustSaturation(p_val: number): void;
  2657. adjustHue(p_val: number): void;
  2658. concat(p_matrix: Array<number>): void;
  2659. clone(): ColorMatrix;
  2660. protected copyMatrix(p_matrix: Array<number>): void;
  2661. protected multiplyMatrix(p_matrix: Array<number>): void;
  2662. protected cleanValue(p_val: number, p_limit: number): number;
  2663. }
  2664. }
  2665. declare namespace fgui {
  2666. class UBBParser {
  2667. private _text;
  2668. private _readPos;
  2669. protected _handlers: {
  2670. [index: string]: (tagName: string, end: boolean, attr: string) => string;
  2671. };
  2672. lastColor: string;
  2673. lastSize: string;
  2674. linkUnderline: boolean;
  2675. linkColor: string;
  2676. static inst: UBBParser;
  2677. constructor();
  2678. protected onTag_URL(tagName: string, end: boolean, attr: string): string;
  2679. protected onTag_IMG(tagName: string, end: boolean, attr: string): string;
  2680. protected onTag_Simple(tagName: string, end: boolean, attr: string): string;
  2681. protected onTag_COLOR(tagName: string, end: boolean, attr: string): string;
  2682. protected onTag_FONT(tagName: string, end: boolean, attr: string): string;
  2683. protected onTag_SIZE(tagName: string, end: boolean, attr: string): string;
  2684. protected getTagText(remove?: boolean): string;
  2685. parse(text: string, remove?: boolean): string;
  2686. }
  2687. }
  2688. declare namespace fgui {
  2689. class ToolSet {
  2690. static startsWith(source: string, str: string, ignoreCase?: boolean): boolean;
  2691. static encodeHTML(str: string): string;
  2692. static clamp(value: number, min: number, max: number): number;
  2693. static clamp01(value: number): number;
  2694. static lerp(start: number, end: number, percent: number): number;
  2695. static getTime(): number;
  2696. static toGrayed(c: cc.Color): cc.Color;
  2697. static repeat(t: number, length: number): number;
  2698. static distance(x1: number, y1: number, x2: number, y2: number): number;
  2699. }
  2700. }
  2701. import fairygui = fgui;