egret.js 199 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250
  1. var egret;
  2. (function (c) {
  3. var d = function () {
  4. function b() {
  5. this._hashCode = b.hashCount++
  6. }
  7. Object.defineProperty(b.prototype, "hashCode", {
  8. get: function () {
  9. return this._hashCode
  10. }, enumerable: !0,
  11. configurable: !0
  12. });
  13. b.hashCount = 1;
  14. return b
  15. }();
  16. c.HashObject = d;
  17. d.prototype.__class__ = "egret.HashObject"
  18. })(egret || (egret = {}));
  19. var __extends = this.__extends || function (c, d) {
  20. function b() {
  21. this.constructor = c
  22. }
  23. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  24. b.prototype = d.prototype;
  25. c.prototype = new b
  26. };
  27. (function (c) {
  28. var d = function (b) {
  29. function a(e) {
  30. void 0 === e && (e = 300);
  31. b.call(this);
  32. this.objectPool = [];
  33. this._length = 0;
  34. 1 > e && (e = 1);
  35. this.autoDisposeTime = e;
  36. this.frameCount = 0
  37. }
  38. __extends(a, b);
  39. a.prototype._checkFrame = function () {
  40. this.frameCount--;
  41. 0 >= this.frameCount && this.dispose()
  42. };
  43. Object.defineProperty(a.prototype, "length", {
  44. get: function () {
  45. return this._length
  46. }, enumerable: !0,
  47. configurable: !0
  48. });
  49. a.prototype.push = function (e) {
  50. var l = this.objectPool; - 1 == l.indexOf(e) && (l.push(e), this._length++, 0 == this.frameCount && (this.frameCount =
  51. this.autoDisposeTime, a._callBackList.push(this)))
  52. };
  53. a.prototype.pop = function () {
  54. if (0 == this._length) return null;
  55. this._length--;
  56. return this.objectPool.pop()
  57. };
  58. a.prototype.dispose = function () {
  59. 0 < this._length && (this.objectPool = [], this._length = 0);
  60. this.frameCount = 0;
  61. var e = a._callBackList,
  62. l = e.indexOf(this); - 1 != l && e.splice(l, 1)
  63. };
  64. a._callBackList = [];
  65. return a
  66. }(c.HashObject);
  67. c.Recycler = d;
  68. d.prototype.__class__ = "egret.Recycler"
  69. })(egret || (egret = {}));
  70. (function (c) {
  71. c.__START_TIME;
  72. c.getTimer = function () {
  73. return Date.now() - c.__START_TIME
  74. }
  75. })(egret || (egret = {}));
  76. (function (c) {
  77. c.__callLaterFunctionList = [];
  78. c.__callLaterThisList = [];
  79. c.__callLaterArgsList = [];
  80. c.callLater = function (d, b) {
  81. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  82. c.__callLaterFunctionList.push(d);
  83. c.__callLaterThisList.push(b);
  84. c.__callLaterArgsList.push(a)
  85. };
  86. c.__callAsyncFunctionList = [];
  87. c.__callAsyncThisList = [];
  88. c.__callAsyncArgsList = [];
  89. c.__callAsync = function (d, b) {
  90. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  91. c.__callAsyncFunctionList.push(d);
  92. c.__callAsyncThisList.push(b);
  93. c.__callAsyncArgsList.push(a)
  94. }
  95. })(egret || (egret = {}));
  96. var egret_dom;
  97. (function (c) {
  98. function d() {
  99. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < a.length; e++)
  100. if (a[e] + "ransform" in b) return a[e];
  101. return a[0]
  102. }
  103. c.header = "";
  104. c.getHeader = d;
  105. c.getTrans = function (b) {
  106. "" == c.header && (c.header = d());
  107. return c.header + b.substring(1, b.length)
  108. }
  109. })(egret_dom || (egret_dom = {}));
  110. __extends = this.__extends || function (c, d) {
  111. function b() {
  112. this.constructor = c
  113. }
  114. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  115. b.prototype = d.prototype;
  116. c.prototype = new b
  117. };
  118. (function (c) {
  119. var d = function (b) {
  120. function a(e, a, q) {
  121. void 0 === a && (a = !1);
  122. void 0 === q && (q = !1);
  123. b.call(this);
  124. this._eventPhase = 2;
  125. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  126. this.isNew = !0;
  127. this._type = e;
  128. this._bubbles = a;
  129. this._cancelable = q
  130. }
  131. __extends(a, b);
  132. Object.defineProperty(a.prototype, "type", {
  133. get: function () {
  134. return this._type
  135. }, enumerable: !0,
  136. configurable: !0
  137. });
  138. Object.defineProperty(a.prototype, "bubbles", {
  139. get: function () {
  140. return this._bubbles
  141. }, enumerable: !0,
  142. configurable: !0
  143. });
  144. Object.defineProperty(a.prototype, "cancelable", {
  145. get: function () {
  146. return this._cancelable
  147. }, enumerable: !0,
  148. configurable: !0
  149. });
  150. Object.defineProperty(a.prototype, "eventPhase", {
  151. get: function () {
  152. return this._eventPhase
  153. }, enumerable: !0,
  154. configurable: !0
  155. });
  156. Object.defineProperty(a.prototype, "currentTarget", {
  157. get: function () {
  158. return this._currentTarget
  159. }, enumerable: !0,
  160. configurable: !0
  161. });
  162. Object.defineProperty(a.prototype, "target", {
  163. get: function () {
  164. return this._target
  165. }, enumerable: !0,
  166. configurable: !0
  167. });
  168. a.prototype.isDefaultPrevented =
  169. function () {
  170. return this._isDefaultPrevented
  171. };
  172. a.prototype.preventDefault = function () {
  173. this._cancelable && (this._isDefaultPrevented = !0)
  174. };
  175. a.prototype.stopPropagation = function () {
  176. this._bubbles && (this._isPropagationStopped = !0)
  177. };
  178. a.prototype.stopImmediatePropagation = function () {
  179. this._bubbles && (this._isPropagationImmediateStopped = !0)
  180. };
  181. a.prototype._reset = function () {
  182. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  183. null, this._eventPhase = 2)
  184. };
  185. a._dispatchByTarget = function (e, a, b, d, g, f) {
  186. void 0 === g && (g = !1);
  187. void 0 === f && (f = !1);
  188. var k = e.eventRecycler;
  189. k || (k = e.eventRecycler = new c.Recycler);
  190. var m = k.pop();
  191. m ? m._type = b : m = new e(b);
  192. m._bubbles = g;
  193. m._cancelable = f;
  194. if (d)
  195. for (var n in d) m[n] = d[n], null !== m[n] && (d[n] = null);
  196. e = a.dispatchEvent(m);
  197. k.push(m);
  198. return e
  199. };
  200. a._getPropertyData = function (e) {
  201. var a = e._props;
  202. a || (a = e._props = {});
  203. return a
  204. };
  205. a.dispatchEvent = function (e, l, b, c) {
  206. void 0 === b && (b = !1);
  207. var d = a._getPropertyData(a);
  208. c && (d.data = c);
  209. a._dispatchByTarget(a,
  210. e, l, d, b)
  211. };
  212. a.ADDED_TO_STAGE = "addedToStage";
  213. a.REMOVED_FROM_STAGE = "removedFromStage";
  214. a.ADDED = "added";
  215. a.REMOVED = "removed";
  216. a.COMPLETE = "complete";
  217. a.ENTER_FRAME = "enterFrame";
  218. a.RENDER = "render";
  219. a.FINISH_RENDER = "finishRender";
  220. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  221. a.LEAVE_STAGE = "leaveStage";
  222. a.RESIZE = "resize";
  223. a.CHANGE = "change";
  224. a.ACTIVATE = "activate";
  225. a.DEACTIVATE = "deactivate";
  226. a.CLOSE = "close";
  227. a.CONNECT = "connect";
  228. return a
  229. }(c.HashObject);
  230. c.Event = d;
  231. d.prototype.__class__ = "egret.Event"
  232. })(egret || (egret = {}));
  233. __extends = this.__extends || function (c, d) {
  234. function b() {
  235. this.constructor = c
  236. }
  237. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  238. b.prototype = d.prototype;
  239. c.prototype = new b
  240. };
  241. (function (c) {
  242. var d = function (b) {
  243. function a(e, a, q) {
  244. void 0 === a && (a = !1);
  245. void 0 === q && (q = !1);
  246. b.call(this, e, a, q);
  247. this._status = 0
  248. }
  249. __extends(a, b);
  250. Object.defineProperty(a.prototype, "status", {
  251. get: function () {
  252. return this._status
  253. }, enumerable: !0,
  254. configurable: !0
  255. });
  256. a.dispatchHTTPStatusEvent = function (e, l) {
  257. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  258. a.httpStatusEvent._status = l;
  259. e.dispatchEvent(a.httpStatusEvent)
  260. };
  261. a.HTTP_STATUS = "httpStatus";
  262. a.httpStatusEvent = null;
  263. return a
  264. }(c.Event);
  265. c.HTTPStatusEvent =
  266. d;
  267. d.prototype.__class__ = "egret.HTTPStatusEvent"
  268. })(egret || (egret = {}));
  269. __extends = this.__extends || function (c, d) {
  270. function b() {
  271. this.constructor = c
  272. }
  273. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  274. b.prototype = d.prototype;
  275. c.prototype = new b
  276. };
  277. (function (c) {
  278. var d = function (b) {
  279. function a(e, a, q) {
  280. void 0 === a && (a = !1);
  281. void 0 === q && (q = !1);
  282. b.call(this, e, a, q)
  283. }
  284. __extends(a, b);
  285. a.dispatchIOErrorEvent = function (e) {
  286. c.Event._dispatchByTarget(a, e, a.IO_ERROR)
  287. };
  288. a.IO_ERROR = "ioError";
  289. return a
  290. }(c.Event);
  291. c.IOErrorEvent = d;
  292. d.prototype.__class__ = "egret.IOErrorEvent"
  293. })(egret || (egret = {}));
  294. __extends = this.__extends || function (c, d) {
  295. function b() {
  296. this.constructor = c
  297. }
  298. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  299. b.prototype = d.prototype;
  300. c.prototype = new b
  301. };
  302. (function (c) {
  303. var d = function (b) {
  304. function a(e, a, q, c, d, f, k, m, n, p) {
  305. void 0 === a && (a = !0);
  306. void 0 === q && (q = !0);
  307. void 0 === c && (c = 0);
  308. void 0 === d && (d = 0);
  309. void 0 === f && (f = 0);
  310. void 0 === k && (k = !1);
  311. void 0 === m && (m = !1);
  312. void 0 === p && (p = !1);
  313. b.call(this, e, a, q);
  314. this._stageY = this._stageX = 0;
  315. this.touchPointID = c;
  316. this._stageX = d;
  317. this._stageY = f;
  318. this.ctrlKey = k;
  319. this.altKey = m;
  320. this.touchDown = p
  321. }
  322. __extends(a, b);
  323. Object.defineProperty(a.prototype, "stageX", {
  324. get: function () {
  325. return this._stageX
  326. }, enumerable: !0,
  327. configurable: !0
  328. });
  329. Object.defineProperty(a.prototype,
  330. "stageY", {
  331. get: function () {
  332. return this._stageY
  333. }, enumerable: !0,
  334. configurable: !0
  335. });
  336. Object.defineProperty(a.prototype, "localX", {
  337. get: function () {
  338. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
  339. }, enumerable: !0,
  340. configurable: !0
  341. });
  342. Object.defineProperty(a.prototype, "localY", {
  343. get: function () {
  344. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
  345. }, enumerable: !0,
  346. configurable: !0
  347. });
  348. a.dispatchTouchEvent = function (e, l, b, d, g, f, k, m, n) {
  349. void 0 === b && (b = 0);
  350. void 0 === d && (d = 0);
  351. void 0 === g && (g = 0);
  352. void 0 === f && (f = !1);
  353. void 0 === k && (k = !1);
  354. void 0 === m && (m = !1);
  355. void 0 === n && (n = !1);
  356. var p = c.Event._getPropertyData(a);
  357. p.touchPointID = b;
  358. p._stageX = d;
  359. p._stageY = g;
  360. p.ctrlKey = f;
  361. p.altKey = k;
  362. p.shiftKey = m;
  363. p.touchDown = n;
  364. c.Event._dispatchByTarget(a, e, l, p, !0, !0)
  365. };
  366. a.TOUCH_TAP = "touchTap";
  367. a.TOUCH_MOVE = "touchMove";
  368. a.TOUCH_BEGIN = "touchBegin";
  369. a.TOUCH_END = "touchEnd";
  370. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  371. a.TOUCH_ROLL_OUT = "touchRollOut";
  372. a.TOUCH_ROLL_OVER = "touchRollOver";
  373. a.TOUCH_OUT =
  374. "touchOut";
  375. a.TOUCH_OVER = "touchOver";
  376. return a
  377. }(c.Event);
  378. c.TouchEvent = d;
  379. d.prototype.__class__ = "egret.TouchEvent"
  380. })(egret || (egret = {}));
  381. __extends = this.__extends || function (c, d) {
  382. function b() {
  383. this.constructor = c
  384. }
  385. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  386. b.prototype = d.prototype;
  387. c.prototype = new b
  388. };
  389. (function (c) {
  390. var d = function (b) {
  391. function a(e, a, c) {
  392. void 0 === a && (a = !1);
  393. void 0 === c && (c = !1);
  394. b.call(this, e, a, c)
  395. }
  396. __extends(a, b);
  397. a.dispatchTimerEvent = function (e, l) {
  398. c.Event._dispatchByTarget(a, e, l)
  399. };
  400. a.TIMER = "timer";
  401. a.TIMER_COMPLETE = "timerComplete";
  402. return a
  403. }(c.Event);
  404. c.TimerEvent = d;
  405. d.prototype.__class__ = "egret.TimerEvent"
  406. })(egret || (egret = {}));
  407. __extends = this.__extends || function (c, d) {
  408. function b() {
  409. this.constructor = c
  410. }
  411. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  412. b.prototype = d.prototype;
  413. c.prototype = new b
  414. };
  415. (function (c) {
  416. var d = function (b) {
  417. function a(e, a, c, d, g) {
  418. void 0 === a && (a = !1);
  419. void 0 === c && (c = !1);
  420. void 0 === d && (d = 0);
  421. void 0 === g && (g = 0);
  422. b.call(this, e, a, c);
  423. this.bytesLoaded = d;
  424. this.bytesTotal = g
  425. }
  426. __extends(a, b);
  427. a.dispatchProgressEvent = function (e, l, b, d) {
  428. void 0 === b && (b = 0);
  429. void 0 === d && (d = 0);
  430. c.Event._dispatchByTarget(a, e, l, {
  431. bytesLoaded: b,
  432. bytesTotal: d
  433. })
  434. };
  435. a.PROGRESS = "progress";
  436. a.SOCKET_DATA = "socketData";
  437. return a
  438. }(c.Event);
  439. c.ProgressEvent = d;
  440. d.prototype.__class__ = "egret.ProgressEvent"
  441. })(egret || (egret = {}));
  442. (function (c) {
  443. var d = function () {
  444. function b() {}
  445. b.CAPTURING_PHASE = 1;
  446. b.AT_TARGET = 2;
  447. b.BUBBLING_PHASE = 3;
  448. return b
  449. }();
  450. c.EventPhase = d;
  451. d.prototype.__class__ = "egret.EventPhase"
  452. })(egret || (egret = {}));
  453. __extends = this.__extends || function (c, d) {
  454. function b() {
  455. this.constructor = c
  456. }
  457. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  458. b.prototype = d.prototype;
  459. c.prototype = new b
  460. };
  461. (function (c) {
  462. var d = function (b) {
  463. function a(e) {
  464. void 0 === e && (e = null);
  465. b.call(this);
  466. this._eventTarget = e ? e : this
  467. }
  468. __extends(a, b);
  469. a.prototype.addEventListener = function (e, a, b, d, g) {
  470. void 0 === d && (d = !1);
  471. void 0 === g && (g = 0);
  472. "undefined" === typeof d && (d = !1);
  473. "undefined" === typeof g && (g = 0);
  474. a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  475. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  476. var f = d[e];
  477. f || (f = d[e] = []);
  478. this._insertEventBin(f, a, b, g)
  479. };
  480. a.prototype._insertEventBin = function (e, a, b, c, d) {
  481. void 0 === d && (d = void 0);
  482. for (var f = -1, k = e.length, m = 0; m < k; m++) {
  483. var n = e[m];
  484. if (n.listener === a && n.thisObject === b && n.display === d) return !1; - 1 == f && n.priority < c && (f = m)
  485. }
  486. a = {
  487. listener: a,
  488. thisObject: b,
  489. priority: c
  490. };
  491. d && (a.display = d); - 1 != f ? e.splice(f, 0, a) : e.push(a);
  492. return !0
  493. };
  494. a.prototype.removeEventListener = function (e, a, b, c) {
  495. void 0 === c && (c = !1);
  496. if (c = c ? this._captureEventsMap : this._eventsMap) {
  497. var d = c[e];
  498. d && (this._removeEventBin(d,
  499. a, b), 0 == d.length && delete c[e])
  500. }
  501. };
  502. a.prototype._removeEventBin = function (e, a, b, c) {
  503. void 0 === c && (c = void 0);
  504. for (var d = e.length, f = 0; f < d; f++) {
  505. var k = e[f];
  506. if (k.listener === a && k.thisObject === b && k.display === c) return e.splice(f, 1), !0
  507. }
  508. return !1
  509. };
  510. a.prototype.hasEventListener = function (e) {
  511. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  512. };
  513. a.prototype.willTrigger = function (e) {
  514. return this.hasEventListener(e)
  515. };
  516. a.prototype.dispatchEvent = function (e) {
  517. e._reset();
  518. e._target = this._eventTarget;
  519. e._currentTarget = this._eventTarget;
  520. return this._notifyListener(e)
  521. };
  522. a.prototype._notifyListener = function (e) {
  523. var a = 1 == e._eventPhase ? this._captureEventsMap : this._eventsMap;
  524. if (!a) return !0;
  525. a = a[e._type];
  526. if (!a) return !0;
  527. var b = a.length;
  528. if (0 == b) return !0;
  529. for (var a = a.concat(), c = 0; c < b; c++) {
  530. var d = a[c];
  531. d.listener.call(d.thisObject, e);
  532. if (e._isPropagationImmediateStopped) break
  533. }
  534. return !e._isDefaultPrevented
  535. };
  536. a.prototype.dispatchEventWith = function (e, a, b) {
  537. void 0 === a && (a = !1);
  538. c.Event.dispatchEvent(this, e, a, b)
  539. };
  540. return a
  541. }(c.HashObject);
  542. c.EventDispatcher = d;
  543. d.prototype.__class__ = "egret.EventDispatcher"
  544. })(egret || (egret = {}));
  545. __extends = this.__extends || function (c, d) {
  546. function b() {
  547. this.constructor = c
  548. }
  549. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  550. b.prototype = d.prototype;
  551. c.prototype = new b
  552. };
  553. (function (c) {
  554. var d = function (b) {
  555. function a() {
  556. b.call(this);
  557. this.reuseEvent = new c.Event("")
  558. }
  559. __extends(a, b);
  560. a.prototype.run = function () {
  561. c.Ticker.getInstance().run();
  562. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  563. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  564. this.touchContext.run()
  565. };
  566. a.prototype.renderLoop = function (e) {
  567. if (0 < c.__callLaterFunctionList.length) {
  568. var l = c.__callLaterFunctionList;
  569. c.__callLaterFunctionList = [];
  570. var b = c.__callLaterThisList;
  571. c.__callLaterThisList = [];
  572. var d = c.__callLaterArgsList;
  573. c.__callLaterArgsList = []
  574. }
  575. e = this.stage;
  576. var g = a.cachedEvent;
  577. g._type = c.Event.RENDER;
  578. this.dispatchEvent(g);
  579. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  580. l && this.doCallLaterList(l, b, d);
  581. 0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
  582. l = this.rendererContext;
  583. l.onRenderStart();
  584. l.clearScreen();
  585. e._updateTransform();
  586. g._type = c.Event.FINISH_UPDATE_TRANSFORM;
  587. this.dispatchEvent(g);
  588. e._draw(l);
  589. g._type = c.Event.FINISH_RENDER;
  590. this.dispatchEvent(g);
  591. l.onRenderFinish()
  592. };
  593. a.prototype.broadcastEnterFrame = function (e) {
  594. e = this.reuseEvent;
  595. e._type = c.Event.ENTER_FRAME;
  596. this.dispatchEvent(e);
  597. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), b = a.length, d = 0; d < b; d++) {
  598. var g = a[d];
  599. e._target = g.display;
  600. e._currentTarget = g.display;
  601. g.listener.call(g.thisObject, e)
  602. }
  603. a = c.Recycler._callBackList;
  604. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  605. };
  606. a.prototype.broadcastRender = function () {
  607. var e = this.reuseEvent;
  608. e._type = c.Event.RENDER;
  609. for (var a = c.DisplayObject._renderCallBackList.concat(),
  610. b = a.length, d = 0; d < b; d++) {
  611. var g = a[d],
  612. f = g.display;
  613. e._target = f;
  614. e._currentTarget = f;
  615. g.listener.call(g.thisObject, e)
  616. }
  617. };
  618. a.prototype.doCallLaterList = function (e, a, b) {
  619. for (var c = e.length, d = 0; d < c; d++) {
  620. var f = e[d];
  621. null != f && f.apply(a[d], b[d])
  622. }
  623. };
  624. a.prototype.doCallAsyncList = function () {
  625. var e = c.__callAsyncFunctionList.concat(),
  626. a = c.__callAsyncThisList.concat(),
  627. b = c.__callAsyncArgsList.concat();
  628. c.__callAsyncFunctionList.length = 0;
  629. c.__callAsyncThisList.length = 0;
  630. for (var d = c.__callAsyncArgsList.length = 0; d < e.length; d++) {
  631. var g =
  632. e[d];
  633. null != g && g.apply(a[d], b[d])
  634. }
  635. };
  636. a.DEVICE_PC = "web";
  637. a.DEVICE_MOBILE = "native";
  638. a.RUNTIME_HTML5 = "runtime_html5";
  639. a.RUNTIME_NATIVE = "runtime_native";
  640. a.cachedEvent = new c.Event("");
  641. return a
  642. }(c.EventDispatcher);
  643. c.MainContext = d;
  644. d.prototype.__class__ = "egret.MainContext"
  645. })(egret || (egret = {}));
  646. var testDeviceType = function () {
  647. if (!this.navigator) return !0;
  648. var c = navigator.userAgent.toLowerCase();
  649. return -1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  650. },
  651. testRuntimeType = function () {
  652. return this.navigator ? !0 : !1
  653. };
  654. egret.MainContext.instance = new egret.MainContext;
  655. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  656. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  657. delete testDeviceType;
  658. delete testRuntimeType;
  659. (function (c) {
  660. var d = function () {
  661. function b() {
  662. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  663. this._maxDeltaTime = 500;
  664. this._totalDeltaTime = 0
  665. }
  666. b.getInstance = function () {
  667. null == b.instance && (b.instance = new b);
  668. return b.instance
  669. };
  670. b.prototype.run = function () {
  671. c.Ticker.getInstance().register(this.update, this);
  672. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, c.MainContext.instance.stage.addChild(this._txt));
  673. var a = c.MainContext.instance;
  674. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  675. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  676. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  677. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  678. };
  679. b.prototype.onEnterFrame = function (a) {
  680. this._lastTime = c.getTimer()
  681. };
  682. b.prototype.onStartRender = function (a) {
  683. a = c.getTimer();
  684. this._logicPerformanceCost = a - this._lastTime;
  685. this._lastTime = a
  686. };
  687. b.prototype.onFinishUpdateTransform =
  688. function (a) {
  689. a = c.getTimer();
  690. this._updateTransformPerformanceCost = a - this._lastTime;
  691. this._lastTime = a
  692. };
  693. b.prototype.onFinishRender = function (a) {
  694. a = c.getTimer();
  695. this._renderPerformanceCost = a - this._lastTime;
  696. this._lastTime = a
  697. };
  698. b.prototype.update = function (a) {
  699. this._tick++;
  700. this._totalDeltaTime += a;
  701. if (this._totalDeltaTime >= this._maxDeltaTime) {
  702. a = (this._preDrawCount - 1).toString();
  703. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  704. "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  705. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  706. this._tick = this._totalDeltaTime = 0
  707. }
  708. this._preDrawCount = 0
  709. };
  710. b.prototype.onDrawImage = function () {
  711. this._preDrawCount++
  712. };
  713. return b
  714. }();
  715. c.Profiler = d;
  716. d.prototype.__class__ = "egret.Profiler"
  717. })(egret || (egret = {}));
  718. __extends = this.__extends || function (c, d) {
  719. function b() {
  720. this.constructor = c
  721. }
  722. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  723. b.prototype = d.prototype;
  724. c.prototype = new b
  725. };
  726. (function (c) {
  727. var d = function (b) {
  728. function a() {
  729. b.apply(this, arguments);
  730. this._timeScale = 1;
  731. this._paused = !1;
  732. this.callBackList = []
  733. }
  734. __extends(a, b);
  735. a.prototype.run = function () {
  736. c.__START_TIME = (new Date).getTime();
  737. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  738. };
  739. a.prototype.update = function (e) {
  740. var a = this.callBackList.concat(),
  741. b = a.length;
  742. e *= this._timeScale;
  743. e *= this._timeScale;
  744. for (var c = 0; c < b; c++) {
  745. var d = a[c];
  746. d.listener.call(d.thisObject, e)
  747. }
  748. };
  749. a.prototype.register = function (e, a, b) {
  750. void 0 === b &&
  751. (b = 0);
  752. this._insertEventBin(this.callBackList, e, a, b)
  753. };
  754. a.prototype.unregister = function (e, a) {
  755. this._removeEventBin(this.callBackList, e, a)
  756. };
  757. a.prototype.setTimeout = function (e, a, b) {
  758. for (var d = [], g = 3; g < arguments.length; g++) d[g - 3] = arguments[g];
  759. c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  760. c.setTimeout.apply(null, [e, a, b].concat(d))
  761. };
  762. a.prototype.setTimeScale = function (e) {
  763. this._timeScale = e
  764. };
  765. a.prototype.getTimeScale = function () {
  766. return this._timeScale
  767. };
  768. a.prototype.pause = function () {
  769. this._paused = !0
  770. };
  771. a.prototype.resume = function () {
  772. this._paused = !1
  773. };
  774. a.getInstance = function () {
  775. null == a.instance && (a.instance = new a);
  776. return a.instance
  777. };
  778. return a
  779. }(c.EventDispatcher);
  780. c.Ticker = d;
  781. d.prototype.__class__ = "egret.Ticker"
  782. })(egret || (egret = {}));
  783. (function (c) {
  784. var d = function () {
  785. function b() {}
  786. b.LEFT = "left";
  787. b.RIGHT = "right";
  788. b.CENTER = "center";
  789. b.JUSTIFY = "justify";
  790. b.CONTENT_JUSTIFY = "contentJustify";
  791. return b
  792. }();
  793. c.HorizontalAlign = d;
  794. d.prototype.__class__ = "egret.HorizontalAlign"
  795. })(egret || (egret = {}));
  796. (function (c) {
  797. var d = function () {
  798. function b() {}
  799. b.TOP = "top";
  800. b.BOTTOM = "bottom";
  801. b.MIDDLE = "middle";
  802. b.JUSTIFY = "justify";
  803. b.CONTENT_JUSTIFY = "contentJustify";
  804. return b
  805. }();
  806. c.VerticalAlign = d;
  807. d.prototype.__class__ = "egret.VerticalAlign"
  808. })(egret || (egret = {}));
  809. __extends = this.__extends || function (c, d) {
  810. function b() {
  811. this.constructor = c
  812. }
  813. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  814. b.prototype = d.prototype;
  815. c.prototype = new b
  816. };
  817. (function (c) {
  818. var d = function (b) {
  819. function a(e, a) {
  820. void 0 === a && (a = 0);
  821. b.call(this);
  822. this._currentCount = 0;
  823. this.delay = e;
  824. this.repeatCount = a
  825. }
  826. __extends(a, b);
  827. a.prototype.currentCount = function () {
  828. return this._currentCount
  829. };
  830. Object.defineProperty(a.prototype, "running", {
  831. get: function () {
  832. return this._running
  833. }, enumerable: !0,
  834. configurable: !0
  835. });
  836. a.prototype.reset = function () {
  837. this.stop();
  838. this._currentCount = 0
  839. };
  840. a.prototype.start = function () {
  841. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
  842. 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  843. };
  844. a.prototype.stop = function () {
  845. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  846. };
  847. a.prototype.onEnterFrame = function (e) {
  848. e = c.getTimer();
  849. e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  850. };
  851. return a
  852. }(c.EventDispatcher);
  853. c.Timer = d;
  854. d.prototype.__class__ = "egret.Timer"
  855. })(egret || (egret = {}));
  856. (function (c) {
  857. function d(b) {
  858. b = b.prototype ? b.prototype : b.__proto__;
  859. if (b.hasOwnProperty("__class__")) return b.__class__;
  860. var a = b.constructor.toString(),
  861. e = a.indexOf("("),
  862. a = a.substring(9, e);
  863. Object.defineProperty(b, "__class__", {
  864. value: a,
  865. enumerable: !1,
  866. writable: !0
  867. });
  868. return a
  869. }
  870. c.getQualifiedClassName = d;
  871. c.getQualifiedSuperclassName = function (b) {
  872. b = b.prototype ? b.prototype : b.__proto__;
  873. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  874. var a = Object.getPrototypeOf(b);
  875. if (null == a) return null;
  876. a = d(a.constructor);
  877. if (!a) return null;
  878. Object.defineProperty(b, "__superclass__", {
  879. value: a,
  880. enumerable: !1,
  881. writable: !0
  882. });
  883. return a
  884. }
  885. })(egret || (egret = {}));
  886. (function (c) {
  887. var d = {};
  888. c.getDefinitionByName = function (b) {
  889. if (!b) return null;
  890. var a = d[b];
  891. if (a) return a;
  892. for (var e = b.split("."), l = e.length, a = __global, c = 0; c < l; c++)
  893. if (a = a[e[c]], !a) return null;
  894. return d[b] = a
  895. }
  896. })(egret || (egret = {}));
  897. var __global = __global || this;
  898. (function (c) {
  899. function d(e) {
  900. for (var a in b) {
  901. var c = b[a];
  902. c.delay -= e;
  903. 0 >= c.delay && (c.listener.apply(c.thisObject, c.params), delete b[a])
  904. }
  905. }
  906. var b = {},
  907. a = 0;
  908. c.setTimeout = function (e, l, q) {
  909. for (var h = [], g = 3; g < arguments.length; g++) h[g - 3] = arguments[g];
  910. h = {
  911. listener: e,
  912. thisObject: l,
  913. delay: q,
  914. params: h
  915. };
  916. 0 == a && c.Ticker.getInstance().register(d, null);
  917. a++;
  918. b[a] = h;
  919. return a
  920. };
  921. c.clearTimeout = function (e) {
  922. delete b[e]
  923. }
  924. })(egret || (egret = {}));
  925. (function (c) {
  926. c.hasDefinition = function (d) {
  927. return c.getDefinitionByName(d) ? !0 : !1
  928. }
  929. })(egret || (egret = {}));
  930. (function (c) {
  931. c.toColorString = function (c) {
  932. if (isNaN(c) || 0 > c) c = 0;
  933. 16777215 < c && (c = 16777215);
  934. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  935. return "#" + c
  936. }
  937. })(egret || (egret = {}));
  938. __extends = this.__extends || function (c, d) {
  939. function b() {
  940. this.constructor = c
  941. }
  942. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  943. b.prototype = d.prototype;
  944. c.prototype = new b
  945. };
  946. (function (c) {
  947. var d = function (b) {
  948. function a(e, a, c, d, g, f) {
  949. void 0 === e && (e = 1);
  950. void 0 === a && (a = 0);
  951. void 0 === c && (c = 0);
  952. void 0 === d && (d = 1);
  953. void 0 === g && (g = 0);
  954. void 0 === f && (f = 0);
  955. b.call(this);
  956. this.a = e;
  957. this.b = a;
  958. this.c = c;
  959. this.d = d;
  960. this.tx = g;
  961. this.ty = f
  962. }
  963. __extends(a, b);
  964. a.prototype.prepend = function (e, a, b, c, d, f) {
  965. var k = this.tx;
  966. if (1 != e || 0 != a || 0 != b || 1 != c) {
  967. var m = this.a,
  968. n = this.c;
  969. this.a = m * e + this.b * b;
  970. this.b = m * a + this.b * c;
  971. this.c = n * e + this.d * b;
  972. this.d = n * a + this.d * c
  973. }
  974. this.tx = k * e + this.ty * b + d;
  975. this.ty = k * a + this.ty * c + f;
  976. return this
  977. };
  978. a.prototype.append =
  979. function (e, a, b, c, d, f) {
  980. var k = this.a,
  981. m = this.b,
  982. n = this.c,
  983. p = this.d;
  984. if (1 != e || 0 != a || 0 != b || 1 != c) this.a = e * k + a * n, this.b = e * m + a * p, this.c = b * k + c * n, this.d = b * m + c * p;
  985. this.tx = d * k + f * n + this.tx;
  986. this.ty = d * m + f * p + this.ty;
  987. return this
  988. };
  989. a.prototype.prependTransform = function (e, l, b, c, d, f, k, m, n) {
  990. if (d % 360) {
  991. var p = d * a.DEG_TO_RAD;
  992. d = Math.cos(p);
  993. p = Math.sin(p)
  994. } else d = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n;
  995. f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(d * b, p * b, -p * c, d * c, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f),
  996. e, l)) : this.prepend(d * b, p * b, -p * c, d * c, e, l);
  997. return this
  998. };
  999. a.prototype.appendTransform = function (e, l, b, c, d, f, k, m, n) {
  1000. if (d % 360) {
  1001. var p = d * a.DEG_TO_RAD;
  1002. d = Math.cos(p);
  1003. p = Math.sin(p)
  1004. } else d = 1, p = 0;
  1005. f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f), e, l), this.append(d * b, p * b, -p * c, d * c, 0, 0)) : this.append(d * b, p * b, -p * c, d * c, e, l);
  1006. if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
  1007. return this
  1008. };
  1009. a.prototype.rotate = function (e) {
  1010. var a = Math.cos(e);
  1011. e = Math.sin(e);
  1012. var b = this.a,
  1013. c = this.c,
  1014. d = this.tx;
  1015. this.a = b * a - this.b * e;
  1016. this.b = b * e + this.b * a;
  1017. this.c = c * a - this.d * e;
  1018. this.d = c * e + this.d * a;
  1019. this.tx = d * a - this.ty * e;
  1020. this.ty = d * e + this.ty * a;
  1021. return this
  1022. };
  1023. a.prototype.skew = function (e, l) {
  1024. e *= a.DEG_TO_RAD;
  1025. l *= a.DEG_TO_RAD;
  1026. this.append(Math.cos(l), Math.sin(l), -Math.sin(e), Math.cos(e), 0, 0);
  1027. return this
  1028. };
  1029. a.prototype.scale = function (e, a) {
  1030. this.a *= e;
  1031. this.d *= a;
  1032. this.c *= e;
  1033. this.b *= a;
  1034. this.tx *= e;
  1035. this.ty *= a;
  1036. return this
  1037. };
  1038. a.prototype.translate = function (e, a) {
  1039. this.tx += e;
  1040. this.ty += a;
  1041. return this
  1042. };
  1043. a.prototype.identity = function () {
  1044. this.a =
  1045. this.d = 1;
  1046. this.b = this.c = this.tx = this.ty = 0;
  1047. return this
  1048. };
  1049. a.prototype.identityMatrix = function (e) {
  1050. this.a = e.a;
  1051. this.b = e.b;
  1052. this.c = e.c;
  1053. this.d = e.d;
  1054. this.tx = e.tx;
  1055. this.ty = e.ty;
  1056. return this
  1057. };
  1058. a.prototype.invert = function () {
  1059. var e = this.a,
  1060. a = this.b,
  1061. b = this.c,
  1062. c = this.d,
  1063. d = this.tx,
  1064. f = e * c - a * b;
  1065. this.a = c / f;
  1066. this.b = -a / f;
  1067. this.c = -b / f;
  1068. this.d = e / f;
  1069. this.tx = (b * this.ty - c * d) / f;
  1070. this.ty = -(e * this.ty - a * d) / f;
  1071. return this
  1072. };
  1073. a.transformCoords = function (e, a, b) {
  1074. var d = c.Point.identity;
  1075. d.x = e.a * a + e.c * b + e.tx;
  1076. d.y = e.d * b + e.b * a + e.ty;
  1077. return d
  1078. };
  1079. a.prototype.toArray =
  1080. function (e) {
  1081. this.array || (this.array = new Float32Array(9));
  1082. e ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1083. this.array[8] = 1;
  1084. return this.array
  1085. };
  1086. a.identity = new a;
  1087. a.DEG_TO_RAD = Math.PI / 180;
  1088. return a
  1089. }(c.HashObject);
  1090. c.Matrix = d;
  1091. d.prototype.__class__ =
  1092. "egret.Matrix"
  1093. })(egret || (egret = {}));
  1094. __extends = this.__extends || function (c, d) {
  1095. function b() {
  1096. this.constructor = c
  1097. }
  1098. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1099. b.prototype = d.prototype;
  1100. c.prototype = new b
  1101. };
  1102. (function (c) {
  1103. var d = function (b) {
  1104. function a(e, a) {
  1105. void 0 === e && (e = 0);
  1106. void 0 === a && (a = 0);
  1107. b.call(this);
  1108. this.x = e;
  1109. this.y = a
  1110. }
  1111. __extends(a, b);
  1112. a.prototype.clone = function () {
  1113. return new a(this.x, this.y)
  1114. };
  1115. a.prototype.equals = function (e) {
  1116. return this.x == e.x && this.y == e.y
  1117. };
  1118. a.distance = function (e, a) {
  1119. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  1120. };
  1121. a.identity = new a(0, 0);
  1122. return a
  1123. }(c.HashObject);
  1124. c.Point = d;
  1125. d.prototype.__class__ = "egret.Point"
  1126. })(egret || (egret = {}));
  1127. __extends = this.__extends || function (c, d) {
  1128. function b() {
  1129. this.constructor = c
  1130. }
  1131. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1132. b.prototype = d.prototype;
  1133. c.prototype = new b
  1134. };
  1135. (function (c) {
  1136. var d = function (b) {
  1137. function a(e, a, c, d) {
  1138. void 0 === e && (e = 0);
  1139. void 0 === a && (a = 0);
  1140. void 0 === c && (c = 0);
  1141. void 0 === d && (d = 0);
  1142. b.call(this);
  1143. this.x = e;
  1144. this.y = a;
  1145. this.width = c;
  1146. this.height = d
  1147. }
  1148. __extends(a, b);
  1149. Object.defineProperty(a.prototype, "right", {
  1150. get: function () {
  1151. return this.x + this.width
  1152. }, set: function (e) {
  1153. this.width = e - this.x
  1154. }, enumerable: !0,
  1155. configurable: !0
  1156. });
  1157. Object.defineProperty(a.prototype, "bottom", {
  1158. get: function () {
  1159. return this.y + this.height
  1160. }, set: function (e) {
  1161. this.height = e - this.y
  1162. }, enumerable: !0,
  1163. configurable: !0
  1164. });
  1165. a.prototype.initialize = function (e, a, b, c) {
  1166. this.x = e;
  1167. this.y = a;
  1168. this.width = b;
  1169. this.height = c;
  1170. return this
  1171. };
  1172. a.prototype.contains = function (e, a) {
  1173. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1174. };
  1175. a.prototype.intersects = function (e) {
  1176. var a = e.right,
  1177. b = e.bottom,
  1178. c = this.right,
  1179. d = this.bottom;
  1180. return this.contains(e.x, e.y) || this.contains(e.x, b) || this.contains(a, e.y) || this.contains(a, b) || e.contains(this.x, this.y) || e.contains(this.x, d) || e.contains(c, this.y) || e.contains(c, d) ? !0 : !1
  1181. };
  1182. a.prototype.clone =
  1183. function () {
  1184. return new a(this.x, this.y, this.width, this.height)
  1185. };
  1186. a.prototype.containsPoint = function (e) {
  1187. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1188. };
  1189. a.identity = new a(0, 0, 0, 0);
  1190. return a
  1191. }(c.HashObject);
  1192. c.Rectangle = d;
  1193. d.prototype.__class__ = "egret.Rectangle"
  1194. })(egret || (egret = {}));
  1195. (function (c) {
  1196. var d = function () {
  1197. function b() {}
  1198. b.fatal = function (a, e) {
  1199. void 0 === e && (e = null);
  1200. c.Logger.traceToConsole("Fatal", a, e);
  1201. throw Error(c.Logger.getTraceCode("Fatal", a, e));
  1202. };
  1203. b.info = function (a, e) {
  1204. void 0 === e && (e = null);
  1205. c.Logger.traceToConsole("Info", a, e)
  1206. };
  1207. b.warning = function (a, e) {
  1208. void 0 === e && (e = null);
  1209. c.Logger.traceToConsole("Warning", a, e)
  1210. };
  1211. b.traceToConsole = function (a, e, l) {
  1212. console.log(c.Logger.getTraceCode(a, e, l))
  1213. };
  1214. b.getTraceCode = function (a, e, l) {
  1215. return "[" + a + "]" + e + ":" + (null == l ? "" : l)
  1216. };
  1217. return b
  1218. }();
  1219. c.Logger =
  1220. d;
  1221. d.prototype.__class__ = "egret.Logger"
  1222. })(egret || (egret = {}));
  1223. __extends = this.__extends || function (c, d) {
  1224. function b() {
  1225. this.constructor = c
  1226. }
  1227. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1228. b.prototype = d.prototype;
  1229. c.prototype = new b
  1230. };
  1231. (function (c) {
  1232. var d = function (b) {
  1233. function a() {
  1234. b.call(this);
  1235. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1236. this._xmlDict = {};
  1237. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1238. }
  1239. __extends(a, b);
  1240. a.getInstance = function () {
  1241. a._instance || (a._instance = new a);
  1242. return a._instance
  1243. };
  1244. a.prototype.parserXML = function (e) {
  1245. for (var a = 0;
  1246. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1247. 0 != a && (e = e.substring(a, e.length));
  1248. this._isSupportDOMParser ?
  1249. a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1250. null == a && c.Logger.info("xml not found!");
  1251. return a
  1252. };
  1253. a._instance = null;
  1254. return a
  1255. }(c.HashObject);
  1256. c.SAXParser = d;
  1257. d.prototype.__class__ = "egret.SAXParser"
  1258. })(egret || (egret = {}));
  1259. __extends = this.__extends || function (c, d) {
  1260. function b() {
  1261. this.constructor = c
  1262. }
  1263. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1264. b.prototype = d.prototype;
  1265. c.prototype = new b
  1266. };
  1267. (function (c) {
  1268. var d = function (e) {
  1269. function l() {
  1270. e.call(this);
  1271. this._designHeight = this._designWidth = 0;
  1272. this._scaleY = this._scaleX = 1;
  1273. this._stageHeight = this._stageWidth = this._offSetY = 0
  1274. }
  1275. __extends(l, e);
  1276. l.getInstance = function () {
  1277. null == l.instance && (a.initialize(), l.instance = new l);
  1278. return l.instance
  1279. };
  1280. l.prototype.setDesignSize = function (e, a, l) {
  1281. this._designWidth = e;
  1282. this._designHeight = a;
  1283. l && (c.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1284. this._setResolutionPolicy(l))
  1285. };
  1286. l.prototype._setResolutionPolicy = function (e) {
  1287. this._resolutionPolicy = e;
  1288. e.init(this);
  1289. e._apply(this, this._designWidth, this._designHeight)
  1290. };
  1291. l.prototype.getScaleX = function () {
  1292. return this._scaleX
  1293. };
  1294. l.prototype.getScaleY = function () {
  1295. return this._scaleY
  1296. };
  1297. l.prototype.getOffSetY = function () {
  1298. return this._offSetY
  1299. };
  1300. l.canvas_name = "egretCanvas";
  1301. l.canvas_div_name = "gameDiv";
  1302. return l
  1303. }(c.HashObject);
  1304. c.StageDelegate = d;
  1305. d.prototype.__class__ = "egret.StageDelegate";
  1306. var b = function () {
  1307. function e(a,
  1308. l) {
  1309. this._containerStrategy = a;
  1310. this._contentStrategy = l
  1311. }
  1312. e.prototype.init = function (e) {
  1313. this._containerStrategy.init(e);
  1314. this._contentStrategy.init(e)
  1315. };
  1316. e.prototype._apply = function (e, a, l) {
  1317. this._containerStrategy._apply(e, a, l);
  1318. this._contentStrategy._apply(e, a, l)
  1319. };
  1320. return e
  1321. }();
  1322. c.ResolutionPolicy = b;
  1323. b.prototype.__class__ = "egret.ResolutionPolicy";
  1324. var a = function () {
  1325. function a() {}
  1326. a.initialize = function () {
  1327. a.EQUAL_TO_FRAME = new e
  1328. };
  1329. a.prototype.init = function (e) {};
  1330. a.prototype._apply = function (e, a, l) {};
  1331. a.prototype._setupContainer =
  1332. function () {
  1333. var e = document.body,
  1334. a;
  1335. e && (a = e.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1336. };
  1337. return a
  1338. }();
  1339. c.ContainerStrategy = a;
  1340. a.prototype.__class__ = "egret.ContainerStrategy";
  1341. var e = function (e) {
  1342. function a() {
  1343. e.apply(this, arguments)
  1344. }
  1345. __extends(a, e);
  1346. a.prototype._apply = function (e) {
  1347. this._setupContainer()
  1348. };
  1349. return a
  1350. }(a);
  1351. c.EqualToFrame = e;
  1352. e.prototype.__class__ = "egret.EqualToFrame";
  1353. b = function () {
  1354. function e() {}
  1355. e.prototype.init = function (e) {};
  1356. e.prototype._apply = function (e, a, l) {};
  1357. e.prototype.setEgretSize = function (e, a, l, b, q, n) {
  1358. void 0 === n && (n = 0);
  1359. c.StageDelegate.getInstance()._stageWidth = Math.round(e);
  1360. c.StageDelegate.getInstance()._stageHeight =
  1361. Math.round(a);
  1362. e = document.getElementById(d.canvas_div_name);
  1363. e.style.width = l + "px";
  1364. e.style.height = b + "px";
  1365. e.style.top = n + "px"
  1366. };
  1367. e.prototype._getClientWidth = function () {
  1368. return document.documentElement.clientWidth
  1369. };
  1370. e.prototype._getClientHeight = function () {
  1371. return document.documentElement.clientHeight
  1372. };
  1373. return e
  1374. }();
  1375. c.ContentStrategy = b;
  1376. b.prototype.__class__ = "egret.ContentStrategy";
  1377. var l = function (e) {
  1378. function a(l) {
  1379. void 0 === l && (l = 0);
  1380. e.call(this);
  1381. this.minWidth = l
  1382. }
  1383. __extends(a, e);
  1384. a.prototype._apply = function (e, a, l) {
  1385. a =
  1386. this._getClientWidth();
  1387. var b = this._getClientHeight(),
  1388. c = b / l,
  1389. q = a / c,
  1390. d = 1;
  1391. 0 != this.minWidth && (d = Math.min(1, q / this.minWidth));
  1392. this.setEgretSize(q / d, l, a, b * d);
  1393. e._scaleX = c * d;
  1394. e._scaleY = c * d
  1395. };
  1396. return a
  1397. }(b);
  1398. c.FixedHeight = l;
  1399. l.prototype.__class__ = "egret.FixedHeight";
  1400. l = function (e) {
  1401. function a(l) {
  1402. void 0 === l && (l = 0);
  1403. e.call(this);
  1404. this.minHeight = l
  1405. }
  1406. __extends(a, e);
  1407. a.prototype._apply = function (e, a, l) {
  1408. l = this._getClientWidth();
  1409. var b = this._getClientHeight(),
  1410. c = l / a,
  1411. q = b / c,
  1412. d = 1;
  1413. 0 != this.minHeight && (d = Math.min(1, q / this.minHeight));
  1414. this.setEgretSize(a,
  1415. q / d, l * d, b, l * (1 - d) / 2);
  1416. e._scaleX = c * d;
  1417. e._scaleY = c * d
  1418. };
  1419. return a
  1420. }(b);
  1421. c.FixedWidth = l;
  1422. l.prototype.__class__ = "egret.FixedWidth";
  1423. l = function (e) {
  1424. function a(l, b) {
  1425. e.call(this);
  1426. this.width = l;
  1427. this.height = b
  1428. }
  1429. __extends(a, e);
  1430. a.prototype._apply = function (e, a, l) {
  1431. l = this.width;
  1432. var b = this.height,
  1433. c = l / a;
  1434. this.setEgretSize(a, b / c, l, b);
  1435. e._scaleX = c;
  1436. e._scaleY = c
  1437. };
  1438. return a
  1439. }(b);
  1440. c.FixedSize = l;
  1441. l.prototype.__class__ = "egret.FixedSize";
  1442. l = function (e) {
  1443. function a() {
  1444. e.call(this)
  1445. }
  1446. __extends(a, e);
  1447. a.prototype._apply = function (e, a, l) {
  1448. this.setEgretSize(a,
  1449. l, a, l, Math.floor((a - a) / 2));
  1450. e._scaleX = 1;
  1451. e._scaleY = 1
  1452. };
  1453. return a
  1454. }(b);
  1455. c.NoScale = l;
  1456. l.prototype.__class__ = "egret.NoScale";
  1457. l = function (e) {
  1458. function a() {
  1459. e.call(this)
  1460. }
  1461. __extends(a, e);
  1462. a.prototype._apply = function (e, a, l) {
  1463. var b = this._getClientWidth(),
  1464. c = this._getClientHeight(),
  1465. q = b,
  1466. d = c,
  1467. h = q / a < d / l ? q / a : d / l,
  1468. q = a * h,
  1469. d = l * h,
  1470. b = Math.floor((b - q) / 2);
  1471. e._offSetY = Math.floor((c - d) / 2);
  1472. this.setEgretSize(a, l / 1, 1 * q, d, b, e._offSetY);
  1473. e._scaleX = 1 * h;
  1474. e._scaleY = 1 * h
  1475. };
  1476. return a
  1477. }(b);
  1478. c.ShowAll = l;
  1479. l.prototype.__class__ = "egret.ShowAll";
  1480. b = function (e) {
  1481. function a() {
  1482. e.call(this)
  1483. }
  1484. __extends(a, e);
  1485. a.prototype._apply = function (e, a, l) {
  1486. var b = this._getClientWidth(),
  1487. c = this._getClientHeight(),
  1488. b = b / a,
  1489. c = c / l;
  1490. this.setEgretSize(a, l, a * b, l * c);
  1491. e._scaleX = b;
  1492. e._scaleY = c
  1493. };
  1494. return a
  1495. }(b);
  1496. c.FullScreen = b;
  1497. b.prototype.__class__ = "egret.FullScreen"
  1498. })(egret || (egret = {}));
  1499. __extends = this.__extends || function (c, d) {
  1500. function b() {
  1501. this.constructor = c
  1502. }
  1503. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1504. b.prototype = d.prototype;
  1505. c.prototype = new b
  1506. };
  1507. (function (c) {
  1508. var d = function (b) {
  1509. function a() {
  1510. b.call(this);
  1511. this._originalData = {};
  1512. this._drawAreaList = []
  1513. }
  1514. __extends(a, b);
  1515. a.getInstance = function () {
  1516. null == a.instance && (a.instance = new a);
  1517. return a.instance
  1518. };
  1519. a.prototype.addDrawArea = function (e) {
  1520. this._drawAreaList.push(e)
  1521. };
  1522. a.prototype.clearDrawArea = function () {
  1523. this._drawAreaList = []
  1524. };
  1525. a.prototype.drawImage = function (e, a, b, d, g, f, k, m, n, p, r) {
  1526. void 0 === r && (r = void 0);
  1527. k = k || 0;
  1528. m = m || 0;
  1529. var s = a._texture_to_render;
  1530. if (null != s && 0 != f && 0 != g && 0 != n && 0 != p)
  1531. if (0 != this._drawAreaList.length &&
  1532. c.MainContext.instance.rendererContext._cacheCanvasContext) {
  1533. var t = c.DisplayObject.getTransformBounds(a._getSize(c.Rectangle.identity), a._worldTransform);
  1534. a._worldBounds.initialize(t.x, t.y, t.width, t.height);
  1535. t = this._originalData;
  1536. t.sourceX = b;
  1537. t.sourceY = d;
  1538. t.sourceWidth = g;
  1539. t.sourceHeight = f;
  1540. t.destX = k;
  1541. t.destY = m;
  1542. t.destWidth = n;
  1543. t.destHeight = p;
  1544. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1545. if (!this.ignoreRender(a, u[v], t.destX, t.destY)) {
  1546. e.drawImage(s, b, d, g, f, k, m, n, p, r);
  1547. break
  1548. }
  1549. } else e.drawImage(s, b, d, g, f, k, m,
  1550. n, p, r)
  1551. };
  1552. a.prototype.ignoreRender = function (e, a, b, c) {
  1553. var d = e._worldBounds;
  1554. b *= e._worldTransform.a;
  1555. c *= e._worldTransform.d;
  1556. return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + c <= a.y || d.y + c >= a.y + a.height ? !0 : !1
  1557. };
  1558. a.prototype.getDrawAreaList = function () {
  1559. var e;
  1560. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)], c.MainContext.instance.stage.addEventListener(c.Event.RESIZE,
  1561. this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1562. return e
  1563. };
  1564. a.prototype.onResize = function () {
  1565. c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
  1566. this._defaultDrawAreaList = null
  1567. };
  1568. return a
  1569. }(c.HashObject);
  1570. c.RenderFilter = d;
  1571. d.prototype.__class__ = "egret.RenderFilter"
  1572. })(egret || (egret = {}));
  1573. (function (c) {
  1574. var d = function () {
  1575. function b() {}
  1576. b.mapClass = function (a, e, l) {
  1577. void 0 === l && (l = "");
  1578. a = this.getKey(a) + "#" + l;
  1579. this.mapClassDic[a] = e
  1580. };
  1581. b.getKey = function (a) {
  1582. return "string" == typeof a ? a : c.getQualifiedClassName(a)
  1583. };
  1584. b.mapValue = function (a, e, l) {
  1585. void 0 === l && (l = "");
  1586. a = this.getKey(a) + "#" + l;
  1587. this.mapValueDic[a] = e
  1588. };
  1589. b.hasMapRule = function (a, e) {
  1590. void 0 === e && (e = "");
  1591. var l = this.getKey(a) + "#" + e;
  1592. return this.mapValueDic[l] || this.mapClassDic[l] ? !0 : !1
  1593. };
  1594. b.getInstance = function (a, e) {
  1595. void 0 === e && (e = "");
  1596. var l = this.getKey(a) + "#" +
  1597. e;
  1598. if (this.mapValueDic[l]) return this.mapValueDic[l];
  1599. var b = this.mapClassDic[l];
  1600. if (b) return b = new b, this.mapValueDic[l] = b, delete this.mapClassDic[l], b;
  1601. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + l + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1602. };
  1603. b.mapClassDic = {};
  1604. b.mapValueDic = {};
  1605. return b
  1606. }();
  1607. c.Injector = d;
  1608. d.prototype.__class__ = "egret.Injector"
  1609. })(egret ||
  1610. (egret = {}));
  1611. (function (c) {
  1612. var d = function () {
  1613. function b() {}
  1614. b.NORMAL = "normal";
  1615. b.ADD = "add";
  1616. return b
  1617. }();
  1618. c.BlendMode = d;
  1619. d.prototype.__class__ = "egret.BlendMode"
  1620. })(egret || (egret = {}));
  1621. __extends = this.__extends || function (c, d) {
  1622. function b() {
  1623. this.constructor = c
  1624. }
  1625. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1626. b.prototype = d.prototype;
  1627. c.prototype = new b
  1628. };
  1629. (function (c) {
  1630. var d = function (b) {
  1631. function a() {
  1632. b.call(this);
  1633. this.__hack_local_matrix = null;
  1634. this._sizeDirty = this._normalDirty = !0;
  1635. this._parent = this._texture_to_render = null;
  1636. this._y = this._x = 0;
  1637. this._scaleY = this._scaleX = 1;
  1638. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1639. this._visible = !0;
  1640. this._rotation = 0;
  1641. this._alpha = 1;
  1642. this._skewY = this._skewX = 0;
  1643. this._touchEnabled = !1;
  1644. this._scrollRect = this.blendMode = null;
  1645. this._hasHeightSet = this._hasWidthSet = !1;
  1646. this._worldBounds = this.mask = null;
  1647. this.worldAlpha =
  1648. 1;
  1649. this._rectH = this._rectW = 0;
  1650. this._stage = null;
  1651. this._cacheDirty = this._cacheAsBitmap = !1;
  1652. this._colorTransform = null;
  1653. this._worldTransform = new c.Matrix;
  1654. this._worldBounds = new c.Rectangle(0, 0, 0, 0);
  1655. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1656. }
  1657. __extends(a, b);
  1658. a.prototype._setDirty = function () {
  1659. this._normalDirty = !0
  1660. };
  1661. a.prototype.getDirty = function () {
  1662. return this._normalDirty || this._sizeDirty
  1663. };
  1664. a.prototype._setParentSizeDirty = function () {
  1665. var e = this._parent;
  1666. !e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
  1667. };
  1668. a.prototype._setSizeDirty =
  1669. function () {
  1670. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1671. };
  1672. a.prototype._clearDirty = function () {
  1673. this._normalDirty = !1
  1674. };
  1675. a.prototype._clearSizeDirty = function () {
  1676. this._sizeDirty = !1
  1677. };
  1678. Object.defineProperty(a.prototype, "parent", {
  1679. get: function () {
  1680. return this._parent
  1681. }, enumerable: !0,
  1682. configurable: !0
  1683. });
  1684. a.prototype._parentChanged = function (e) {
  1685. this._parent = e
  1686. };
  1687. Object.defineProperty(a.prototype, "x", {
  1688. get: function () {
  1689. return this._x
  1690. }, set: function (e) {
  1691. this._setX(e)
  1692. }, enumerable: !0,
  1693. configurable: !0
  1694. });
  1695. a.prototype._setX = function (e) {
  1696. c.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1697. };
  1698. Object.defineProperty(a.prototype, "y", {
  1699. get: function () {
  1700. return this._y
  1701. }, set: function (e) {
  1702. this._setY(e)
  1703. }, enumerable: !0,
  1704. configurable: !0
  1705. });
  1706. a.prototype._setY = function (e) {
  1707. c.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1708. };
  1709. Object.defineProperty(a.prototype, "scaleX", {
  1710. get: function () {
  1711. return this._scaleX
  1712. }, set: function (e) {
  1713. c.NumberUtils.isNumber(e) &&
  1714. this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1715. }, enumerable: !0,
  1716. configurable: !0
  1717. });
  1718. Object.defineProperty(a.prototype, "scaleY", {
  1719. get: function () {
  1720. return this._scaleY
  1721. }, set: function (e) {
  1722. c.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1723. }, enumerable: !0,
  1724. configurable: !0
  1725. });
  1726. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1727. get: function () {
  1728. return this._anchorOffsetX
  1729. }, set: function (e) {
  1730. c.NumberUtils.isNumber(e) && this._anchorOffsetX !=
  1731. e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1732. }, enumerable: !0,
  1733. configurable: !0
  1734. });
  1735. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1736. get: function () {
  1737. return this._anchorOffsetY
  1738. }, set: function (e) {
  1739. c.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1740. }, enumerable: !0,
  1741. configurable: !0
  1742. });
  1743. Object.defineProperty(a.prototype, "anchorX", {
  1744. get: function () {
  1745. return this._anchorX
  1746. }, set: function (e) {
  1747. this._setAnchorX(e)
  1748. }, enumerable: !0,
  1749. configurable: !0
  1750. });
  1751. a.prototype._setAnchorX = function (e) {
  1752. c.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1753. };
  1754. Object.defineProperty(a.prototype, "anchorY", {
  1755. get: function () {
  1756. return this._anchorY
  1757. }, set: function (e) {
  1758. this._setAnchorY(e)
  1759. }, enumerable: !0,
  1760. configurable: !0
  1761. });
  1762. a.prototype._setAnchorY = function (e) {
  1763. c.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1764. };
  1765. Object.defineProperty(a.prototype, "visible", {
  1766. get: function () {
  1767. return this._visible
  1768. },
  1769. set: function (e) {
  1770. this._setVisible(e)
  1771. }, enumerable: !0,
  1772. configurable: !0
  1773. });
  1774. a.prototype._setVisible = function (e) {
  1775. this._visible != e && (this._visible = e, this._setSizeDirty())
  1776. };
  1777. Object.defineProperty(a.prototype, "rotation", {
  1778. get: function () {
  1779. return this._rotation
  1780. }, set: function (e) {
  1781. c.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setSizeDirty())
  1782. }, enumerable: !0,
  1783. configurable: !0
  1784. });
  1785. Object.defineProperty(a.prototype, "alpha", {
  1786. get: function () {
  1787. return this._alpha
  1788. }, set: function (e) {
  1789. c.NumberUtils.isNumber(e) &&
  1790. this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
  1791. }, enumerable: !0,
  1792. configurable: !0
  1793. });
  1794. Object.defineProperty(a.prototype, "skewX", {
  1795. get: function () {
  1796. return this._skewX
  1797. }, set: function (e) {
  1798. c.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setSizeDirty())
  1799. }, enumerable: !0,
  1800. configurable: !0
  1801. });
  1802. Object.defineProperty(a.prototype, "skewY", {
  1803. get: function () {
  1804. return this._skewY
  1805. }, set: function (e) {
  1806. c.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setSizeDirty())
  1807. }, enumerable: !0,
  1808. configurable: !0
  1809. });
  1810. Object.defineProperty(a.prototype, "touchEnabled", {
  1811. get: function () {
  1812. return this._touchEnabled
  1813. }, set: function (e) {
  1814. this._setTouchEnabled(e)
  1815. }, enumerable: !0,
  1816. configurable: !0
  1817. });
  1818. a.prototype._setTouchEnabled = function (e) {
  1819. this._touchEnabled = e
  1820. };
  1821. Object.defineProperty(a.prototype, "scrollRect", {
  1822. get: function () {
  1823. return this._scrollRect
  1824. }, set: function (e) {
  1825. this._setScrollRect(e)
  1826. }, enumerable: !0,
  1827. configurable: !0
  1828. });
  1829. a.prototype._setScrollRect = function (e) {
  1830. this._scrollRect = e;
  1831. this._setSizeDirty()
  1832. };
  1833. Object.defineProperty(a.prototype,
  1834. "measuredWidth", {
  1835. get: function () {
  1836. return this._measureBounds().width
  1837. }, enumerable: !0,
  1838. configurable: !0
  1839. });
  1840. Object.defineProperty(a.prototype, "measuredHeight", {
  1841. get: function () {
  1842. return this._measureBounds().height
  1843. }, enumerable: !0,
  1844. configurable: !0
  1845. });
  1846. Object.defineProperty(a.prototype, "explicitWidth", {
  1847. get: function () {
  1848. return this._explicitWidth
  1849. }, enumerable: !0,
  1850. configurable: !0
  1851. });
  1852. Object.defineProperty(a.prototype, "explicitHeight", {
  1853. get: function () {
  1854. return this._explicitHeight
  1855. }, enumerable: !0,
  1856. configurable: !0
  1857. });
  1858. Object.defineProperty(a.prototype,
  1859. "width", {
  1860. get: function () {
  1861. return this._getSize(c.Rectangle.identity).width
  1862. }, set: function (e) {
  1863. this._setWidth(e)
  1864. }, enumerable: !0,
  1865. configurable: !0
  1866. });
  1867. Object.defineProperty(a.prototype, "height", {
  1868. get: function () {
  1869. return this._getSize(c.Rectangle.identity).height
  1870. }, set: function (e) {
  1871. this._setHeight(e)
  1872. }, enumerable: !0,
  1873. configurable: !0
  1874. });
  1875. a.prototype._setWidth = function (e) {
  1876. this._setSizeDirty();
  1877. this._setCacheDirty();
  1878. this._explicitWidth = e;
  1879. this._hasWidthSet = c.NumberUtils.isNumber(e)
  1880. };
  1881. a.prototype._setHeight = function (e) {
  1882. this._setSizeDirty();
  1883. this._setCacheDirty();
  1884. this._explicitHeight = e;
  1885. this._hasHeightSet = c.NumberUtils.isNumber(e)
  1886. };
  1887. a.prototype._draw = function (e) {
  1888. if (this._visible && !this.drawCacheTexture(e)) {
  1889. this._colorTransform && e.setGlobalColorTransform(this._colorTransform.matrix);
  1890. e.setAlpha(this.worldAlpha, this.blendMode);
  1891. e.setTransform(this._worldTransform);
  1892. var a = this.mask || this._scrollRect;
  1893. a && e.pushMask(a);
  1894. this._render(e);
  1895. a && e.popMask();
  1896. this._colorTransform && e.setGlobalColorTransform(null)
  1897. }
  1898. this.destroyCacheBounds()
  1899. };
  1900. a.prototype.drawCacheTexture =
  1901. function (e) {
  1902. if (!1 == this._cacheAsBitmap) return !1;
  1903. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight)) this._cacheDirty = !this._makeBitmapCache();
  1904. if (null == this._texture_to_render) return !1;
  1905. var a = this._texture_to_render,
  1906. b = a._offsetX,
  1907. d = a._offsetY,
  1908. g = a._textureWidth,
  1909. a = a._textureHeight;
  1910. this._updateTransform();
  1911. e.setAlpha(this.worldAlpha, this.blendMode);
  1912. e.setTransform(this._worldTransform);
  1913. var f = c.MainContext.instance.rendererContext.texture_scale_factor;
  1914. c.RenderFilter.getInstance().drawImage(e, this, 0, 0, g * f, a * f, b, d, g, a);
  1915. return !0
  1916. };
  1917. a.prototype._updateTransform = function () {
  1918. this._calculateWorldTransform()
  1919. };
  1920. a.prototype._calculateWorldTransform = function () {
  1921. var e = this._worldTransform,
  1922. a = this._parent;
  1923. e.identityMatrix(a._worldTransform);
  1924. this._getMatrix(e);
  1925. var b = this._scrollRect;
  1926. b && e.append(1, 0, 0, 1, -b.x, -b.y);
  1927. this.worldAlpha = a.worldAlpha * this._alpha
  1928. };
  1929. a.prototype._render = function (e) {};
  1930. a.prototype.getBounds =
  1931. function (e, a) {
  1932. void 0 === a && (a = !0);
  1933. var b = this._measureBounds(),
  1934. d = this._hasWidthSet ? this._explicitWidth : b.width,
  1935. g = this._hasHeightSet ? this._explicitHeight : b.height;
  1936. this._rectW = b.width;
  1937. this._rectH = b.height;
  1938. this._clearSizeDirty();
  1939. var f = b.x,
  1940. b = b.y,
  1941. k = 0,
  1942. m = 0;
  1943. a && (0 != this._anchorX || 0 != this._anchorY ? (k = d * this._anchorX, m = g * this._anchorY) : (k = this._anchorOffsetX, m = this._anchorOffsetY));
  1944. this._cacheBounds.initialize(f - k, b - m, d, g);
  1945. d = this._cacheBounds;
  1946. e || (e = new c.Rectangle);
  1947. return e.initialize(d.x, d.y, d.width, d.height)
  1948. };
  1949. a.prototype.destroyCacheBounds = function () {
  1950. this._cacheBounds.x = 0;
  1951. this._cacheBounds.y = 0;
  1952. this._cacheBounds.width = 0;
  1953. this._cacheBounds.height = 0
  1954. };
  1955. a.prototype._getConcatenatedMatrix = function () {
  1956. for (var e = a.identityMatrixForGetConcatenated.identity(), l = this; null != l;) {
  1957. if (0 != l._anchorX || 0 != l._anchorY) {
  1958. var b = l._getSize(c.Rectangle.identity);
  1959. e.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, b.width * l._anchorX, b.height * l._anchorY)
  1960. } else e.prependTransform(l._x, l._y, l._scaleX, l._scaleY,
  1961. l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
  1962. l = l._parent
  1963. }
  1964. return e
  1965. };
  1966. a.prototype.localToGlobal = function (e, a, b) {
  1967. void 0 === e && (e = 0);
  1968. void 0 === a && (a = 0);
  1969. var d = this._getConcatenatedMatrix();
  1970. d.append(1, 0, 0, 1, e, a);
  1971. b || (b = new c.Point);
  1972. b.x = d.tx;
  1973. b.y = d.ty;
  1974. return b
  1975. };
  1976. a.prototype.globalToLocal = function (e, a, b) {
  1977. void 0 === e && (e = 0);
  1978. void 0 === a && (a = 0);
  1979. var d = this._getConcatenatedMatrix();
  1980. d.invert();
  1981. d.append(1, 0, 0, 1, e, a);
  1982. b || (b = new c.Point);
  1983. b.x = d.tx;
  1984. b.y = d.ty;
  1985. return b
  1986. };
  1987. a.prototype.hitTest = function (e, a, b) {
  1988. void 0 ===
  1989. b && (b = !1);
  1990. if (!this._visible || !b && !this._touchEnabled) return null;
  1991. b = this._getSize(c.Rectangle.identity);
  1992. return 0 <= e && e < b.width && 0 <= a && a < b.height ? this.mask || this._scrollRect ? this._scrollRect && e > this._scrollRect.x && a > this._scrollRect.y && e < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
  1993. };
  1994. a.prototype.hitTestPoint = function (e, a, b) {
  1995. e = this.globalToLocal(e,
  1996. a);
  1997. return b ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), b = this._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  1998. };
  1999. a.prototype._getMatrix = function (e) {
  2000. e || (e = c.Matrix.identity.identity());
  2001. var a, b;
  2002. b = this._getOffsetPoint();
  2003. a = b.x;
  2004. b = b.y;
  2005. var d = this.__hack_local_matrix;
  2006. d ? (e.append(d.a, d.b, d.c, d.d, d.tx, d.ty), e.append(1, 0, 0, 1, -a, -b)) : e.appendTransform(this._x,
  2007. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, b);
  2008. return e
  2009. };
  2010. a.prototype._getSize = function (e) {
  2011. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(e)
  2012. };
  2013. a.prototype._measureSize = function (e) {
  2014. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  2015. e.x = 0;
  2016. e.y = 0;
  2017. return e
  2018. };
  2019. a.prototype._measureBounds = function () {
  2020. return c.Rectangle.identity.initialize(0,
  2021. 0, 0, 0)
  2022. };
  2023. a.prototype._getOffsetPoint = function () {
  2024. var e = this._anchorOffsetX,
  2025. a = this._anchorOffsetY;
  2026. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity), e = this._anchorX * a.width, a = this._anchorY * a.height;
  2027. var b = c.Point.identity;
  2028. b.x = e;
  2029. b.y = a;
  2030. return b
  2031. };
  2032. a.prototype._onAddToStage = function () {
  2033. this._stage = c.MainContext.instance.stage;
  2034. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2035. };
  2036. a.prototype._onRemoveFromStage = function () {
  2037. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2038. };
  2039. Object.defineProperty(a.prototype, "stage", {
  2040. get: function () {
  2041. return this._stage
  2042. }, enumerable: !0,
  2043. configurable: !0
  2044. });
  2045. a.prototype.addEventListener = function (e, l, d, h, g) {
  2046. void 0 === h && (h = !1);
  2047. void 0 === g && (g = 0);
  2048. b.prototype.addEventListener.call(this, e, l, d, h, g);
  2049. ((h = e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._insertEventBin(h ? a._enterFrameCallBackList : a._renderCallBackList, l, d, g, this)
  2050. };
  2051. a.prototype.removeEventListener = function (e, l, d, h) {
  2052. void 0 === h && (h = !1);
  2053. b.prototype.removeEventListener.call(this, e, l, d, h);
  2054. ((h =
  2055. e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._removeEventBin(h ? a._enterFrameCallBackList : a._renderCallBackList, l, d, this)
  2056. };
  2057. a.prototype.dispatchEvent = function (e) {
  2058. if (!e._bubbles) return b.prototype.dispatchEvent.call(this, e);
  2059. for (var a = [], c = this; c;) a.push(c), c = c._parent;
  2060. e._reset();
  2061. this._dispatchPropagationEvent(e, a);
  2062. return !e._isDefaultPrevented
  2063. };
  2064. a.prototype._dispatchPropagationEvent = function (e, a, b) {
  2065. b = a.length;
  2066. for (var c = 1, d = b - 1; 0 <= d; d--) {
  2067. var f = a[d];
  2068. e._currentTarget = f;
  2069. e._target = this;
  2070. e._eventPhase = c;
  2071. f._notifyListener(e);
  2072. if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
  2073. }
  2074. f = a[0];
  2075. e._currentTarget = f;
  2076. e._target = this;
  2077. e._eventPhase = 2;
  2078. f._notifyListener(e);
  2079. if (!e._isPropagationStopped && !e._isPropagationImmediateStopped)
  2080. for (c = 3, d = 1; d < b && (f = a[d], e._currentTarget = f, e._target = this, e._eventPhase = c, f._notifyListener(e), !e._isPropagationStopped && !e._isPropagationImmediateStopped); d++);
  2081. };
  2082. a.prototype.willTrigger = function (e) {
  2083. for (var a = this; a;) {
  2084. if (a.hasEventListener(e)) return !0;
  2085. a = a._parent
  2086. }
  2087. return !1
  2088. };
  2089. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2090. get: function () {
  2091. return this._cacheAsBitmap
  2092. }, set: function (e) {
  2093. (this._cacheAsBitmap = e) ? c.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2094. }, enumerable: !0,
  2095. configurable: !0
  2096. });
  2097. a.prototype._makeBitmapCache = function () {
  2098. this.renderTexture || (this.renderTexture = new c.RenderTexture);
  2099. var e = this.renderTexture.drawToTexture(this);
  2100. this._texture_to_render = e ? this.renderTexture : null;
  2101. return e
  2102. };
  2103. a.prototype._setCacheDirty = function (e) {
  2104. void 0 === e && (e = !0);
  2105. this._cacheDirty =
  2106. e
  2107. };
  2108. a.getTransformBounds = function (e, a) {
  2109. var b = e.x,
  2110. c = e.y,
  2111. d = e.width,
  2112. f = e.height;
  2113. (b || c) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2114. var k = d * a.a,
  2115. d = d * a.b,
  2116. m = f * a.c,
  2117. f = f * a.d,
  2118. n = a.tx,
  2119. p = a.ty,
  2120. r = n,
  2121. s = n,
  2122. t = p,
  2123. u = p;
  2124. (b = k + n) < r ? r = b : b > s && (s = b);
  2125. (b = k + m + n) < r ? r = b : b > s && (s = b);
  2126. (b = m + n) < r ? r = b : b > s && (s = b);
  2127. (c = d + p) < t ? t = c : c > u && (u = c);
  2128. (c = d + f + p) < t ? t = c : c > u && (u = c);
  2129. (c = f + p) < t ? t = c : c > u && (u = c);
  2130. return e.initialize(r, t, s - r, u - t)
  2131. };
  2132. Object.defineProperty(a.prototype, "colorTransform", {
  2133. get: function () {
  2134. return this._colorTransform
  2135. }, set: function (e) {
  2136. this._colorTransform =
  2137. e
  2138. }, enumerable: !0,
  2139. configurable: !0
  2140. });
  2141. a.identityMatrixForGetConcatenated = new c.Matrix;
  2142. a._enterFrameCallBackList = [];
  2143. a._renderCallBackList = [];
  2144. return a
  2145. }(c.EventDispatcher);
  2146. c.DisplayObject = d;
  2147. d.prototype.__class__ = "egret.DisplayObject";
  2148. d = function () {
  2149. function b() {
  2150. this.matrix = null
  2151. }
  2152. b.prototype.updateColor = function (a, e, b, c, d, g, f, k) {};
  2153. return b
  2154. }();
  2155. c.ColorTransform = d;
  2156. d.prototype.__class__ = "egret.ColorTransform"
  2157. })(egret || (egret = {}));
  2158. __extends = this.__extends || function (c, d) {
  2159. function b() {
  2160. this.constructor = c
  2161. }
  2162. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2163. b.prototype = d.prototype;
  2164. c.prototype = new b
  2165. };
  2166. (function (c) {
  2167. var d = function (b) {
  2168. function a() {
  2169. b.call(this);
  2170. this._touchChildren = !0;
  2171. this._children = []
  2172. }
  2173. __extends(a, b);
  2174. Object.defineProperty(a.prototype, "touchChildren", {
  2175. get: function () {
  2176. return this._touchChildren
  2177. }, set: function (e) {
  2178. this._touchChildren = e
  2179. }, enumerable: !0,
  2180. configurable: !0
  2181. });
  2182. Object.defineProperty(a.prototype, "numChildren", {
  2183. get: function () {
  2184. return this._children.length
  2185. }, enumerable: !0,
  2186. configurable: !0
  2187. });
  2188. a.prototype.setChildIndex = function (e, a) {
  2189. this.doSetChildIndex(e, a)
  2190. };
  2191. a.prototype.doSetChildIndex = function (e,
  2192. a) {
  2193. var b = this._children.indexOf(e);
  2194. 0 > b && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2195. this._children.splice(b, 1);
  2196. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2197. };
  2198. a.prototype.addChild = function (e) {
  2199. var a = this._children.length;
  2200. e._parent == this && a--;
  2201. return this._doAddChild(e, a)
  2202. };
  2203. a.prototype.addChildAt = function (e, a) {
  2204. return this._doAddChild(e, a)
  2205. };
  2206. a.prototype._doAddChild = function (e, b, d) {
  2207. void 0 === d && (d = !0);
  2208. if (e == this) return e;
  2209. if (0 > b || b > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2210. e;
  2211. var h = e._parent;
  2212. if (h == this) return this.doSetChildIndex(e, b), e;
  2213. h && (b = h._children.indexOf(e), 0 <= b && h._doRemoveChild(b));
  2214. this._children.splice(b, 0, e);
  2215. e._parentChanged(this);
  2216. d && e.dispatchEventWith(c.Event.ADDED, !0);
  2217. if (this._stage)
  2218. for (e._onAddToStage(), b = a.__EVENT__ADD_TO_STAGE_LIST; 0 < b.length;) b.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  2219. e._setDirty();
  2220. this._setSizeDirty();
  2221. return e
  2222. };
  2223. a.prototype.removeChild = function (e) {
  2224. e = this._children.indexOf(e);
  2225. if (0 <= e) return this._doRemoveChild(e);
  2226. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2227. return null
  2228. };
  2229. a.prototype.removeChildAt = function (e) {
  2230. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2231. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2232. return null
  2233. };
  2234. a.prototype._doRemoveChild = function (e, b) {
  2235. void 0 === b && (b = !0);
  2236. var d = this._children,
  2237. h = d[e];
  2238. b && h.dispatchEventWith(c.Event.REMOVED, !0);
  2239. if (this._stage) {
  2240. h._onRemoveFromStage();
  2241. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2242. var f = g.shift();
  2243. f.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
  2244. f._stage = null
  2245. }
  2246. }
  2247. h._parentChanged(null);
  2248. d.splice(e, 1);
  2249. this._setSizeDirty();
  2250. return h
  2251. };
  2252. a.prototype.getChildAt = function (e) {
  2253. if (0 <= e && e < this._children.length) return this._children[e];
  2254. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2255. return null
  2256. };
  2257. a.prototype.contains = function (e) {
  2258. for (; e;) {
  2259. if (e == this) return !0;
  2260. e = e._parent
  2261. }
  2262. return !1
  2263. };
  2264. a.prototype.swapChildrenAt = function (e, a) {
  2265. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2266. };
  2267. a.prototype.swapChildren = function (e, a) {
  2268. var b = this._children.indexOf(e),
  2269. d = this._children.indexOf(a); - 1 == b || -1 == d ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(b, d)
  2270. };
  2271. a.prototype._swapChildrenAt = function (e, a) {
  2272. if (e != a) {
  2273. var b = this._children,
  2274. c = b[e];
  2275. b[e] = b[a];
  2276. b[a] = c
  2277. }
  2278. };
  2279. a.prototype.getChildIndex = function (e) {
  2280. return this._children.indexOf(e)
  2281. };
  2282. a.prototype.removeChildren = function () {
  2283. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2284. };
  2285. a.prototype._updateTransform =
  2286. function () {
  2287. if (this._visible) {
  2288. b.prototype._updateTransform.call(this);
  2289. for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2290. }
  2291. };
  2292. a.prototype._render = function (e) {
  2293. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._draw(e)
  2294. };
  2295. a.prototype._measureBounds = function () {
  2296. for (var e = 0, a = 0, b = 0, d = 0, g = this._children.length, f = 0; f < g; f++) {
  2297. var k = this._children[f];
  2298. if (k._visible) {
  2299. var m = k.getBounds(c.Rectangle.identity, !1),
  2300. n = m.x,
  2301. p = m.y,
  2302. r = m.width,
  2303. m = m.height,
  2304. k = k._getMatrix(),
  2305. k = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(n,
  2306. p, r, m), k),
  2307. n = k.x,
  2308. p = k.y,
  2309. r = k.width + k.x,
  2310. k = k.height + k.y;
  2311. if (n < e || 0 == f) e = n;
  2312. if (r > a || 0 == f) a = r;
  2313. if (p < b || 0 == f) b = p;
  2314. if (k > d || 0 == f) d = k
  2315. }
  2316. }
  2317. return c.Rectangle.identity.initialize(e, b, a - e, d - b)
  2318. };
  2319. a.prototype.hitTest = function (e, a, d) {
  2320. void 0 === d && (d = !1);
  2321. var h;
  2322. if (!this._visible) return null;
  2323. if (this._scrollRect) {
  2324. if (e < this._scrollRect.x || a < this._scrollRect.y || e > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2325. } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y >
  2326. a || a > this.mask.y + this.mask.height)) return null;
  2327. for (var g = this._children, f = this._touchChildren, k = g.length - 1; 0 <= k; k--) {
  2328. var m = g[k],
  2329. n = m._getMatrix(),
  2330. p = m._scrollRect;
  2331. p && n.append(1, 0, 0, 1, -p.x, -p.y);
  2332. n.invert();
  2333. n = c.Matrix.transformCoords(n, e, a);
  2334. if (m = m.hitTest(n.x, n.y, !0)) {
  2335. if (!f) return this;
  2336. if (m._touchEnabled && f) return m;
  2337. h = this
  2338. }
  2339. }
  2340. return h ? h : this._texture_to_render || this.graphics ? b.prototype.hitTest.call(this, e, a, d) : null
  2341. };
  2342. a.prototype._onAddToStage = function () {
  2343. b.prototype._onAddToStage.call(this);
  2344. for (var e = this._children.length,
  2345. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2346. };
  2347. a.prototype._onRemoveFromStage = function () {
  2348. b.prototype._onRemoveFromStage.call(this);
  2349. for (var e = this._children.length, a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
  2350. };
  2351. a.prototype.getChildByName = function (e) {
  2352. for (var a = this._children, b = a.length, c, d = 0; d < b; d++)
  2353. if (c = a[d], c.name == e) return c;
  2354. return null
  2355. };
  2356. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2357. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2358. return a
  2359. }(c.DisplayObject);
  2360. c.DisplayObjectContainer = d;
  2361. d.prototype.__class__ = "egret.DisplayObjectContainer"
  2362. })(egret ||
  2363. (egret = {}));
  2364. __extends = this.__extends || function (c, d) {
  2365. function b() {
  2366. this.constructor = c
  2367. }
  2368. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2369. b.prototype = d.prototype;
  2370. c.prototype = new b
  2371. };
  2372. (function (c) {
  2373. var d = function (b) {
  2374. function a(e, a) {
  2375. void 0 === e && (e = 480);
  2376. void 0 === a && (a = 800);
  2377. b.call(this);
  2378. this.touchEnabled = !0;
  2379. this._stage = this;
  2380. this._stageWidth = e;
  2381. this._stageHeight = a
  2382. }
  2383. __extends(a, b);
  2384. a.prototype.invalidate = function () {
  2385. a._invalidateRenderFlag = !0
  2386. };
  2387. Object.defineProperty(a.prototype, "scaleMode", {
  2388. get: function () {
  2389. return this._scaleMode
  2390. }, set: function (e) {
  2391. this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
  2392. }, enumerable: !0,
  2393. configurable: !0
  2394. });
  2395. a.prototype.changeSize = function () {
  2396. this.setResolutionPolicy();
  2397. this.dispatchEventWith(c.Event.RESIZE)
  2398. };
  2399. a.prototype.setResolutionPolicy = function () {
  2400. var e = {};
  2401. e[c.StageScaleMode.NO_SCALE] = new c.NoScale;
  2402. e[c.StageScaleMode.SHOW_ALL] = new c.ShowAll;
  2403. e[c.StageScaleMode.NO_BORDER] = new c.FixedWidth;
  2404. e[c.StageScaleMode.EXACT_FIT] = new c.FullScreen;
  2405. e = e[this._scaleMode];
  2406. if (!e) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2407. var a = new c.EqualToFrame,
  2408. e = new c.ResolutionPolicy(a, e);
  2409. c.StageDelegate.getInstance()._setResolutionPolicy(e);
  2410. this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
  2411. this._stageHeight = c.StageDelegate.getInstance()._stageHeight
  2412. };
  2413. Object.defineProperty(a.prototype, "stageWidth", {
  2414. get: function () {
  2415. return this._stageWidth
  2416. }, enumerable: !0,
  2417. configurable: !0
  2418. });
  2419. Object.defineProperty(a.prototype, "stageHeight", {
  2420. get: function () {
  2421. return this._stageHeight
  2422. }, enumerable: !0,
  2423. configurable: !0
  2424. });
  2425. a.prototype.hitTest = function (e, a, b) {
  2426. if (!this._touchEnabled) return null;
  2427. var d;
  2428. if (!this._touchChildren) return this;
  2429. b = this._children;
  2430. for (var g = b.length - 1; 0 <= g; g--) {
  2431. d = b[g];
  2432. var f = d._getMatrix(),
  2433. k = d._scrollRect;
  2434. k && f.append(1, 0, 0, 1, -k.x, -k.y);
  2435. f.invert();
  2436. f = c.Matrix.transformCoords(f, e, a);
  2437. if ((d = d.hitTest(f.x, f.y, !0)) && d._touchEnabled) return d
  2438. }
  2439. return this
  2440. };
  2441. a.prototype.getBounds = function (e) {
  2442. e || (e = new c.Rectangle);
  2443. return e.initialize(0, 0, this._stageWidth, this._stageHeight)
  2444. };
  2445. a.prototype._updateTransform = function () {
  2446. for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2447. };
  2448. Object.defineProperty(a.prototype, "focus", {
  2449. get: function () {
  2450. return null
  2451. }, enumerable: !0,
  2452. configurable: !0
  2453. });
  2454. a._invalidateRenderFlag = !1;
  2455. return a
  2456. }(c.DisplayObjectContainer);
  2457. c.Stage = d;
  2458. d.prototype.__class__ = "egret.Stage"
  2459. })(egret || (egret = {}));
  2460. (function (c) {
  2461. var d = function () {
  2462. function b() {}
  2463. b.NO_BORDER = "noBorder";
  2464. b.NO_SCALE = "noScale";
  2465. b.SHOW_ALL = "showAll";
  2466. b.EXACT_FIT = "exactFit";
  2467. return b
  2468. }();
  2469. c.StageScaleMode = d;
  2470. d.prototype.__class__ = "egret.StageScaleMode"
  2471. })(egret || (egret = {}));
  2472. __extends = this.__extends || function (c, d) {
  2473. function b() {
  2474. this.constructor = c
  2475. }
  2476. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2477. b.prototype = d.prototype;
  2478. c.prototype = new b
  2479. };
  2480. (function (c) {
  2481. var d = function (b) {
  2482. function a(e) {
  2483. void 0 === e && (e = null);
  2484. b.call(this);
  2485. this._lastTouchPosition = new c.Point(0, 0);
  2486. this._lastTouchTime = 0;
  2487. this._lastTouchEvent = null;
  2488. this._velocitys = [];
  2489. this._content = null;
  2490. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2491. this._scrollTop = this._scrollLeft = 0;
  2492. this._vCanScroll = this._hCanScroll = !1;
  2493. this.touchEnabled = !0;
  2494. e && this.setContent(e)
  2495. }
  2496. __extends(a, b);
  2497. a.prototype.setContent = function (e) {
  2498. this._content && (this._removeEvents(), b.prototype.removeChildAt.call(this,
  2499. 0));
  2500. this._content = e;
  2501. b.prototype.addChild.call(this, e);
  2502. this._addEvents();
  2503. this._explicitWidth || this._getContentWidth();
  2504. this._explicitHeight || this._getContentHeight()
  2505. };
  2506. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2507. get: function () {
  2508. return this._verticalScrollPolicy
  2509. }, set: function (e) {
  2510. e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
  2511. }, enumerable: !0,
  2512. configurable: !0
  2513. });
  2514. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2515. get: function () {
  2516. return this._horizontalScrollPolicy
  2517. }, set: function (e) {
  2518. e !=
  2519. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
  2520. }, enumerable: !0,
  2521. configurable: !0
  2522. });
  2523. Object.defineProperty(a.prototype, "scrollLeft", {
  2524. get: function () {
  2525. return this._scrollLeft
  2526. }, set: function (e) {
  2527. e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
  2528. }, enumerable: !0,
  2529. configurable: !0
  2530. });
  2531. Object.defineProperty(a.prototype, "scrollTop", {
  2532. get: function () {
  2533. return this._scrollTop
  2534. }, set: function (e) {
  2535. e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
  2536. }, enumerable: !0,
  2537. configurable: !0
  2538. });
  2539. a.prototype.setScrollPosition = function (e, a, b) {
  2540. void 0 === b && (b = !1);
  2541. if (!b || 0 != e || 0 != a)
  2542. if (b || this._scrollTop != e || this._scrollLeft != a) {
  2543. if (b) {
  2544. b = this._isOnTheEdge(!0);
  2545. var c = this._isOnTheEdge(!1);
  2546. this._scrollTop += b ? e / 2 : e;
  2547. this._scrollLeft += c ? a / 2 : a
  2548. } else this._scrollTop = e, this._scrollLeft = a;
  2549. this._validatePosition(!0, !0);
  2550. this._updateContentPosition()
  2551. }
  2552. };
  2553. a.prototype._isOnTheEdge = function (e) {
  2554. void 0 === e && (e = !0);
  2555. var a = this._scrollTop,
  2556. b = this._scrollLeft;
  2557. return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2558. };
  2559. a.prototype._validatePosition = function (e, a) {
  2560. void 0 === e && (e = !1);
  2561. void 0 === a && (a = !1);
  2562. if (e) {
  2563. var b = this.height,
  2564. c = this._getContentHeight();
  2565. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2566. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : c / 2)
  2567. }
  2568. a && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : c / 2))
  2569. };
  2570. a.prototype._setWidth = function (e) {
  2571. this._explicitWidth !=
  2572. e && (b.prototype._setWidth.call(this, e), this._updateContentPosition())
  2573. };
  2574. a.prototype._setHeight = function (e) {
  2575. this._explicitHeight != e && (b.prototype._setHeight.call(this, e), this._updateContentPosition())
  2576. };
  2577. a.prototype._updateContentPosition = function () {
  2578. var e = this.getBounds(c.Rectangle.identity);
  2579. this.scrollRect = new c.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
  2580. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  2581. };
  2582. a.prototype._checkScrollPolicy = function () {
  2583. var e = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2584. this._getContentWidth(), this.width);
  2585. this._hCanScroll = e;
  2586. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2587. this._vCanScroll = a;
  2588. return e || a
  2589. };
  2590. a.prototype.__checkScrollPolicy = function (e, a, b) {
  2591. return "on" == e ? !0 : "off" == e ? !1 : a > b
  2592. };
  2593. a.prototype._addEvents = function () {
  2594. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2595. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2596. this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2597. this, !0)
  2598. };
  2599. a.prototype._removeEvents = function () {
  2600. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2601. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2602. this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2603. };
  2604. a.prototype._onTouchBegin = function (e) {
  2605. e._isDefaultPrevented || (c.Tween.removeTweens(this), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END,
  2606. this._onTouchEnd, this), this.stage.addEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(e), e.preventDefault())
  2607. };
  2608. a.prototype._onTouchBeginCapture = function (e) {
  2609. var b = this._checkScrollPolicy();
  2610. if (b) {
  2611. for (var d = e.target; d != this;) {
  2612. if (d instanceof a && (b = d._checkScrollPolicy())) return;
  2613. d = d.parent
  2614. }
  2615. e.stopPropagation();
  2616. this.delayTouchBeginEvent = this.cloneTouchEvent(e);
  2617. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100,
  2618. 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2619. this.touchBeginTimer.start();
  2620. this._onTouchBegin(e)
  2621. }
  2622. };
  2623. a.prototype._onTouchEndCapture = function (e) {
  2624. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2625. };
  2626. a.prototype._onTouchBeginTimer = function () {
  2627. this.touchBeginTimer.stop();
  2628. var e = this.delayTouchBeginEvent;
  2629. this.delayTouchBeginEvent = null;
  2630. this.dispatchPropagationEvent(e)
  2631. };
  2632. a.prototype.dispatchPropagationEvent = function (e) {
  2633. for (var a = [], b = e._target; b;) a.push(b),
  2634. b = b.parent;
  2635. for (var c = this._content, d = 1;; d += 2) {
  2636. b = a[d];
  2637. if (!b || b === c) break;
  2638. a.unshift(b)
  2639. }
  2640. this._dispatchPropagationEvent(e, a)
  2641. };
  2642. a.prototype._dispatchPropagationEvent = function (e, a, b) {
  2643. for (var c = a.length, d = 0; d < c; d++) {
  2644. var f = a[d];
  2645. e._currentTarget = f;
  2646. e._target = this;
  2647. e._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  2648. f._notifyListener(e);
  2649. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  2650. }
  2651. };
  2652. a.prototype._onTouchMove = function (e) {
  2653. if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
  2654. this.delayTouchBeginEvent &&
  2655. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2656. this.touchChildren = !1;
  2657. var a = this._getPointChange(e);
  2658. this.setScrollPosition(a.y, a.x, !0);
  2659. this._calcVelocitys(e);
  2660. this._logTouchEvent(e)
  2661. }
  2662. };
  2663. a.prototype._onTouchEnd = function (e) {
  2664. this.touchChildren = !0;
  2665. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2666. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2667. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE,
  2668. this._onTouchEnd, this);
  2669. this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
  2670. this._moveAfterTouchEnd()
  2671. };
  2672. a.prototype._onEnterFrame = function (e) {
  2673. e = c.getTimer();
  2674. 100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2675. };
  2676. a.prototype._logTouchEvent = function (e) {
  2677. this._lastTouchPosition.x = e.stageX;
  2678. this._lastTouchPosition.y = e.stageY;
  2679. this._lastTouchEvent = this.cloneTouchEvent(e);
  2680. this._lastTouchTime = c.getTimer()
  2681. };
  2682. a.prototype._getPointChange = function (e) {
  2683. return {
  2684. x: !1 ===
  2685. this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
  2686. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
  2687. }
  2688. };
  2689. a.prototype._calcVelocitys = function (e) {
  2690. var a = c.getTimer();
  2691. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  2692. else {
  2693. var b = this._getPointChange(e),
  2694. a = a - this._lastTouchTime;
  2695. b.x /= a;
  2696. b.y /= a;
  2697. this._velocitys.push(b);
  2698. 5 < this._velocitys.length && this._velocitys.shift();
  2699. this._lastTouchPosition.x = e.stageX;
  2700. this._lastTouchPosition.y = e.stageY
  2701. }
  2702. };
  2703. a.prototype._getContentWidth = function () {
  2704. return this._content.explicitWidth ||
  2705. this._content.width
  2706. };
  2707. a.prototype._getContentHeight = function () {
  2708. return this._content.explicitHeight || this._content.height
  2709. };
  2710. a.prototype.getMaxScrollLeft = function () {
  2711. var e = this._getContentWidth() - this.width;
  2712. return Math.max(0, e)
  2713. };
  2714. a.prototype.getMaxScrollTop = function () {
  2715. var e = this._getContentHeight() - this.height;
  2716. return Math.max(0, e)
  2717. };
  2718. a.prototype._moveAfterTouchEnd = function () {
  2719. if (0 != this._velocitys.length) {
  2720. for (var e = 0, b = 0, c = 0, d = 0; d < this._velocitys.length; d++) var g = this._velocitys[d],
  2721. f = a.weight[d],
  2722. e = e + g.x * f,
  2723. b = b + g.y * f,
  2724. c = c + f;
  2725. this._velocitys.length = 0;
  2726. e /= c;
  2727. b /= c;
  2728. g = Math.abs(e);
  2729. c = Math.abs(b);
  2730. f = this.getMaxScrollLeft();
  2731. d = this.getMaxScrollTop();
  2732. e = 0.02 < g ? this.getAnimationDatas(e, this._scrollLeft, f) : {
  2733. position: this._scrollLeft,
  2734. duration: 1
  2735. };
  2736. b = 0.02 < c ? this.getAnimationDatas(b, this._scrollTop, d) : {
  2737. position: this._scrollTop,
  2738. duration: 1
  2739. };
  2740. this.setScrollLeft(e.position, e.duration);
  2741. this.setScrollTop(b.position, b.duration)
  2742. }
  2743. };
  2744. a.prototype.setScrollTop = function (e, a) {
  2745. void 0 === a && (a = 0);
  2746. var b = Math.min(this.getMaxScrollTop(), Math.max(e,
  2747. 0));
  2748. if (0 == a) return this.scrollTop = b, null;
  2749. var d = c.Tween.get(this).to({
  2750. scrollTop: e
  2751. }, a, c.Ease.quartOut);
  2752. b != e && d.to({
  2753. scrollTop: b
  2754. }, 300, c.Ease.quintOut)
  2755. };
  2756. a.prototype.setScrollLeft = function (e, a) {
  2757. void 0 === a && (a = 0);
  2758. var b = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
  2759. if (0 == a) return this.scrollLeft = b, null;
  2760. var d = c.Tween.get(this).to({
  2761. scrollLeft: e
  2762. }, a, c.Ease.quartOut);
  2763. b != e && d.to({
  2764. scrollLeft: b
  2765. }, 300, c.Ease.quintOut)
  2766. };
  2767. a.prototype.getAnimationDatas = function (e, a, b) {
  2768. var c = Math.abs(e),
  2769. d = 0,
  2770. f = a + 500 * e;
  2771. if (0 > f || f > b)
  2772. for (f =
  2773. a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e, e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e, d++;
  2774. else d = 500 * -Math.log(0.02 / c);
  2775. return {
  2776. position: Math.min(b + 50, Math.max(f, -50)),
  2777. duration: d
  2778. }
  2779. };
  2780. a.prototype.cloneTouchEvent = function (e) {
  2781. var a = new c.TouchEvent(e._type, e._bubbles, e.cancelable);
  2782. a.touchPointID = e.touchPointID;
  2783. a._stageX = e._stageX;
  2784. a._stageY = e._stageY;
  2785. a.ctrlKey = e.ctrlKey;
  2786. a.altKey = e.altKey;
  2787. a.shiftKey = e.shiftKey;
  2788. a.touchDown = e.touchDown;
  2789. a._isDefaultPrevented = !1;
  2790. a._target = e._target;
  2791. return a
  2792. };
  2793. a.prototype.throwNotSupportedError =
  2794. function () {
  2795. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  2796. };
  2797. a.prototype.addChild = function (a) {
  2798. this.throwNotSupportedError();
  2799. return null
  2800. };
  2801. a.prototype.addChildAt = function (a, b) {
  2802. this.throwNotSupportedError();
  2803. return null
  2804. };
  2805. a.prototype.removeChild = function (a) {
  2806. this.throwNotSupportedError();
  2807. return null
  2808. };
  2809. a.prototype.removeChildAt = function (a) {
  2810. this.throwNotSupportedError();
  2811. return null
  2812. };
  2813. a.prototype.setChildIndex = function (a, b) {
  2814. this.throwNotSupportedError()
  2815. };
  2816. a.prototype.swapChildren = function (a,
  2817. b) {
  2818. this.throwNotSupportedError()
  2819. };
  2820. a.prototype.swapChildrenAt = function (a, b) {
  2821. this.throwNotSupportedError()
  2822. };
  2823. a.weight = [1, 1.33, 1.66, 2, 2.33];
  2824. return a
  2825. }(c.DisplayObjectContainer);
  2826. c.ScrollView = d;
  2827. d.prototype.__class__ = "egret.ScrollView"
  2828. })(egret || (egret = {}));
  2829. __extends = this.__extends || function (c, d) {
  2830. function b() {
  2831. this.constructor = c
  2832. }
  2833. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2834. b.prototype = d.prototype;
  2835. c.prototype = new b
  2836. };
  2837. (function (c) {
  2838. var d = function (b) {
  2839. function a(a, l, d) {
  2840. void 0 === l && (l = NaN);
  2841. void 0 === d && (d = NaN);
  2842. b.call(this, a);
  2843. this.content = a;
  2844. this.width = NaN == l ? this._getContentWidth() : l;
  2845. this.height = NaN == d ? this._getContentHeight() : d;
  2846. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView")
  2847. }
  2848. __extends(a, b);
  2849. Object.defineProperty(a.prototype, "scrollXEnabled", {
  2850. get: function () {
  2851. return "off" != this.horizontalScrollPolicy
  2852. }, set: function (a) {
  2853. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  2854. this.horizontalScrollPolicy = a ? "auto" : "off"
  2855. }, enumerable: !0,
  2856. configurable: !0
  2857. });
  2858. Object.defineProperty(a.prototype, "scrollYEnabled", {
  2859. get: function () {
  2860. return "off" != this.verticalScrollPolicy
  2861. }, set: function (a) {
  2862. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  2863. this.verticalScrollPolicy = a ? "auto" : "off"
  2864. }, enumerable: !0,
  2865. configurable: !0
  2866. });
  2867. return a
  2868. }(c.ScrollView);
  2869. c.Scroller = d;
  2870. d.prototype.__class__ = "egret.Scroller"
  2871. })(egret || (egret = {}));
  2872. (function (c) {
  2873. var d = function () {
  2874. function b() {}
  2875. b.REPEAT = "repeat";
  2876. b.SCALE = "scale";
  2877. return b
  2878. }();
  2879. c.BitmapFillMode = d;
  2880. d.prototype.__class__ = "egret.BitmapFillMode"
  2881. })(egret || (egret = {}));
  2882. __extends = this.__extends || function (c, d) {
  2883. function b() {
  2884. this.constructor = c
  2885. }
  2886. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2887. b.prototype = d.prototype;
  2888. c.prototype = new b
  2889. };
  2890. (function (c) {
  2891. var d = function (b) {
  2892. function a(a) {
  2893. b.call(this);
  2894. this.debug = 1;
  2895. this.debugColor = 16711680;
  2896. this.scale9Grid = null;
  2897. this.fillMode = "scale";
  2898. a && (this._texture = a, this._setSizeDirty())
  2899. }
  2900. __extends(a, b);
  2901. Object.defineProperty(a.prototype, "texture", {
  2902. get: function () {
  2903. return this._texture
  2904. }, set: function (a) {
  2905. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2906. }, enumerable: !0,
  2907. configurable: !0
  2908. });
  2909. a.prototype._render = function (e) {
  2910. var b = this._texture;
  2911. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth :
  2912. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2913. };
  2914. a._drawBitmap = function (e, b, c, d) {
  2915. var g = d._texture_to_render;
  2916. if (g) {
  2917. var f = g._textureWidth,
  2918. k = g._textureHeight;
  2919. if ("scale" == d.fillMode) {
  2920. var m = d.scale9Grid || g.scale9Grid;
  2921. if (m && f - m.width < b && k - m.height < c) a.drawScale9GridImage(e, d, m, b, c);
  2922. else {
  2923. var m = g._offsetX,
  2924. n = g._offsetY,
  2925. p = g._bitmapWidth || f,
  2926. r = g._bitmapHeight || k;
  2927. b /= f;
  2928. m = Math.round(m * b);
  2929. b = Math.round(p * b);
  2930. c /= k;
  2931. n = Math.round(n * c);
  2932. c = Math.round(r * c);
  2933. a.renderFilter.drawImage(e,
  2934. d, g._bitmapX, g._bitmapY, p, r, m, n, b, c)
  2935. }
  2936. } else a.drawRepeatImage(e, d, b, c, d.fillMode)
  2937. }
  2938. };
  2939. a.drawRepeatImage = function (a, b, d, h, g) {
  2940. var f = b._texture_to_render;
  2941. if (f) {
  2942. var k = f._textureWidth,
  2943. m = f._textureHeight,
  2944. n = f._bitmapX,
  2945. p = f._bitmapY,
  2946. k = f._bitmapWidth || k,
  2947. m = f._bitmapHeight || m,
  2948. r = f._offsetX,
  2949. f = f._offsetY;
  2950. c.RenderFilter.getInstance().drawImage(a, b, n, p, k, m, r, f, d, h, g)
  2951. }
  2952. };
  2953. a.drawScale9GridImage = function (a, b, d, h, g) {
  2954. var f = b._texture_to_render;
  2955. if (f && d) {
  2956. var k = c.RenderFilter.getInstance(),
  2957. m = f._textureWidth,
  2958. n = f._textureHeight,
  2959. p = f._bitmapX,
  2960. r = f._bitmapY,
  2961. s = f._bitmapWidth || m,
  2962. t = f._bitmapHeight || n,
  2963. u = f._offsetX,
  2964. f = f._offsetY;
  2965. d = c.Rectangle.identity.initialize(d.x - Math.round(u), d.y - Math.round(u), d.width, d.height);
  2966. u = Math.round(u);
  2967. f = Math.round(f);
  2968. h -= m - s;
  2969. g -= n - t;
  2970. d.y == d.bottom && (d.bottom < t ? d.bottom++ : d.y--);
  2971. d.x == d.right && (d.right < s ? d.right++ : d.x--);
  2972. var m = p + d.x,
  2973. n = p + d.right,
  2974. v = s - d.right,
  2975. x = r + d.y,
  2976. y = r + d.bottom,
  2977. w = t - d.bottom,
  2978. z = u + d.x,
  2979. A = f + d.y,
  2980. t = g - (t - d.bottom),
  2981. s = h - (s - d.right);
  2982. k.drawImage(a, b, p, r, d.x, d.y, u, f, d.x, d.y);
  2983. k.drawImage(a, b, m, r, d.width,
  2984. d.y, z, f, s - d.x, d.y);
  2985. k.drawImage(a, b, n, r, v, d.y, u + s, f, h - s, d.y);
  2986. k.drawImage(a, b, p, x, d.x, d.height, u, A, d.x, t - d.y);
  2987. k.drawImage(a, b, m, x, d.width, d.height, z, A, s - d.x, t - d.y);
  2988. k.drawImage(a, b, n, x, v, d.height, u + s, A, h - s, t - d.y);
  2989. k.drawImage(a, b, p, y, d.x, w, u, f + t, d.x, g - t);
  2990. k.drawImage(a, b, m, y, d.width, w, z, f + t, s - d.x, g - t);
  2991. k.drawImage(a, b, n, y, v, w, u + s, f + t, h - s, g - t)
  2992. }
  2993. };
  2994. a.prototype._measureBounds = function () {
  2995. var a = this._texture;
  2996. return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : b.prototype._measureBounds.call(this)
  2997. };
  2998. a.debug = 1;
  2999. a.renderFilter = c.RenderFilter.getInstance();
  3000. return a
  3001. }(c.DisplayObject);
  3002. c.Bitmap = d;
  3003. d.prototype.__class__ = "egret.Bitmap"
  3004. })(egret || (egret = {}));
  3005. __extends = this.__extends || function (c, d) {
  3006. function b() {
  3007. this.constructor = c
  3008. }
  3009. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3010. b.prototype = d.prototype;
  3011. c.prototype = new b
  3012. };
  3013. (function (c) {
  3014. var d = function (b) {
  3015. function a() {
  3016. b.call(this);
  3017. this._text = "";
  3018. this._textChanged = !1;
  3019. this._bitmapPool = []
  3020. }
  3021. __extends(a, b);
  3022. Object.defineProperty(a.prototype, "text", {
  3023. get: function () {
  3024. return this._text
  3025. }, set: function (a) {
  3026. this._textChanged = !0;
  3027. this._text = a;
  3028. this._setSizeDirty()
  3029. }, enumerable: !0,
  3030. configurable: !0
  3031. });
  3032. a.prototype._updateTransform = function () {
  3033. this.visible && (this._textChanged && this._renderText(), b.prototype._updateTransform.call(this))
  3034. };
  3035. a.prototype._renderText = function (a) {
  3036. var b = a = 0;
  3037. this._textChanged &&
  3038. this.removeChildren();
  3039. for (var d = 0, h = this.text.length; d < h; d++) {
  3040. var g = this.text.charAt(d),
  3041. f = this.spriteSheet.getTexture(g);
  3042. if (null == f) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + g);
  3043. else {
  3044. var g = f._offsetX,
  3045. k = f._offsetY,
  3046. m = f._textureWidth;
  3047. if (this._textChanged) {
  3048. var n = this._bitmapPool[d];
  3049. n || (n = new c.Bitmap, this._bitmapPool.push(n));
  3050. n.texture = f;
  3051. this.addChild(n);
  3052. n.x = a
  3053. }
  3054. a += m + g;
  3055. k + f._textureHeight > b && (b = k + f._textureHeight)
  3056. }
  3057. }
  3058. this._textChanged = !1;
  3059. return c.Rectangle.identity.initialize(0, 0,
  3060. a, b)
  3061. };
  3062. a.prototype._measureBounds = function () {
  3063. return this._renderText(!0)
  3064. };
  3065. return a
  3066. }(c.DisplayObjectContainer);
  3067. c.BitmapText = d;
  3068. d.prototype.__class__ = "egret.BitmapText"
  3069. })(egret || (egret = {}));
  3070. (function (c) {
  3071. var d = function () {
  3072. function b() {
  3073. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3074. this.commandQueue = []
  3075. }
  3076. b.prototype.beginFill = function (a, e) {};
  3077. b.prototype._setStyle = function (a) {};
  3078. b.prototype.drawRect = function (a, e, b, c) {
  3079. this.checkRect(a, e, b, c)
  3080. };
  3081. b.prototype.drawCircle = function (a, e, b) {
  3082. this.checkRect(a - b, e - b, 2 * b, 2 * b)
  3083. };
  3084. b.prototype.drawRoundRect = function (a, e, b, c, d, g) {
  3085. this.checkRect(a, e, b, c)
  3086. };
  3087. b.prototype.drawEllipse = function (a, e, b, c) {
  3088. this.checkRect(a - b, e - c, 2 * b, 2 * c)
  3089. };
  3090. b.prototype.lineStyle =
  3091. function (a, e, b, c, d, g, f, k) {};
  3092. b.prototype.lineTo = function (a, e) {
  3093. this.checkPoint(a, e)
  3094. };
  3095. b.prototype.curveTo = function (a, e, b, c) {
  3096. this.checkPoint(a, e);
  3097. this.checkPoint(b, c)
  3098. };
  3099. b.prototype.moveTo = function (a, e) {
  3100. this.checkPoint(a, e)
  3101. };
  3102. b.prototype.clear = function () {
  3103. this._maxY = this._maxX = this._minY = this._minX = 0
  3104. };
  3105. b.prototype.endFill = function () {};
  3106. b.prototype._draw = function (a) {};
  3107. b.prototype.checkRect = function (a, e, b, c) {
  3108. this._minX = Math.min(this._minX, a);
  3109. this._minY = Math.min(this._minY, e);
  3110. this._maxX = Math.max(this._maxX, a +
  3111. b);
  3112. this._maxY = Math.max(this._maxY, e + c)
  3113. };
  3114. b.prototype.checkPoint = function (a, e) {
  3115. this._minX = Math.min(this._minX, a);
  3116. this._minY = Math.min(this._minY, e);
  3117. this._maxX = Math.max(this._maxX, a);
  3118. this._maxY = Math.max(this._maxY, e);
  3119. this._lastX = a;
  3120. this._lastY = e
  3121. };
  3122. return b
  3123. }();
  3124. c.Graphics = d;
  3125. d.prototype.__class__ = "egret.Graphics";
  3126. (function () {
  3127. return function (b, a, e) {
  3128. this.method = b;
  3129. this.thisObject = a;
  3130. this.args = e
  3131. }
  3132. })().prototype.__class__ = "egret.Command"
  3133. })(egret || (egret = {}));
  3134. __extends = this.__extends || function (c, d) {
  3135. function b() {
  3136. this.constructor = c
  3137. }
  3138. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3139. b.prototype = d.prototype;
  3140. c.prototype = new b
  3141. };
  3142. (function (c) {
  3143. var d = function (b) {
  3144. function a() {
  3145. b.call(this)
  3146. }
  3147. __extends(a, b);
  3148. Object.defineProperty(a.prototype, "graphics", {
  3149. get: function () {
  3150. this._graphics || (this._graphics = new c.Graphics);
  3151. return this._graphics
  3152. }, enumerable: !0,
  3153. configurable: !0
  3154. });
  3155. a.prototype._render = function (a) {
  3156. this._graphics && this._graphics._draw(a)
  3157. };
  3158. return a
  3159. }(c.DisplayObject);
  3160. c.Shape = d;
  3161. d.prototype.__class__ = "egret.Shape"
  3162. })(egret || (egret = {}));
  3163. __extends = this.__extends || function (c, d) {
  3164. function b() {
  3165. this.constructor = c
  3166. }
  3167. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3168. b.prototype = d.prototype;
  3169. c.prototype = new b
  3170. };
  3171. (function (c) {
  3172. var d = function (b) {
  3173. function a() {
  3174. b.call(this)
  3175. }
  3176. __extends(a, b);
  3177. Object.defineProperty(a.prototype, "graphics", {
  3178. get: function () {
  3179. this._graphics || (this._graphics = new c.Graphics);
  3180. return this._graphics
  3181. }, enumerable: !0,
  3182. configurable: !0
  3183. });
  3184. a.prototype._render = function (a) {
  3185. this._graphics && this._graphics._draw(a);
  3186. b.prototype._render.call(this, a)
  3187. };
  3188. return a
  3189. }(c.DisplayObjectContainer);
  3190. c.Sprite = d;
  3191. d.prototype.__class__ = "egret.Sprite"
  3192. })(egret || (egret = {}));
  3193. __extends = this.__extends || function (c, d) {
  3194. function b() {
  3195. this.constructor = c
  3196. }
  3197. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3198. b.prototype = d.prototype;
  3199. c.prototype = new b
  3200. };
  3201. (function (c) {
  3202. var d = function (b) {
  3203. function a() {
  3204. b.call(this);
  3205. this._inputEnabled = !1;
  3206. this._text = this._type = "";
  3207. this._displayAsPassword = !1;
  3208. this._fontFamily = a.default_fontFamily;
  3209. this._size = 30;
  3210. this._textColorString = "#FFFFFF";
  3211. this._textColor = 16777215;
  3212. this._strokeColorString = "#000000";
  3213. this._stroke = this._strokeColor = 0;
  3214. this._textAlign = "left";
  3215. this._verticalAlign = "top";
  3216. this._maxChars = 0;
  3217. this._scrollV = -1;
  3218. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3219. this._isFlow = this._multiline = !1;
  3220. this._textArr = [];
  3221. this._isArrayChanged = !1;
  3222. this._textMaxHeight = this._textMaxWidth = 0;
  3223. this._linesArr = []
  3224. }
  3225. __extends(a, b);
  3226. a.prototype.isInput = function () {
  3227. return this._type == c.TextFieldType.INPUT
  3228. };
  3229. a.prototype._setTouchEnabled = function (a) {
  3230. b.prototype._setTouchEnabled.call(this, a);
  3231. this.isInput() && (this._inputEnabled = !0)
  3232. };
  3233. Object.defineProperty(a.prototype, "type", {
  3234. get: function () {
  3235. return this._type
  3236. }, set: function (a) {
  3237. this._setType(a)
  3238. }, enumerable: !0,
  3239. configurable: !0
  3240. });
  3241. a.prototype._setType = function (a) {
  3242. this._type != a && (this._type = a, this._type == c.TextFieldType.INPUT ?
  3243. (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3244. };
  3245. Object.defineProperty(a.prototype, "text", {
  3246. get: function () {
  3247. return this._getText()
  3248. }, set: function (a) {
  3249. this._setText(a)
  3250. }, enumerable: !0,
  3251. configurable: !0
  3252. });
  3253. a.prototype._getText = function () {
  3254. return this._type ==
  3255. c.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3256. };
  3257. a.prototype._setSizeDirty = function () {
  3258. b.prototype._setSizeDirty.call(this);
  3259. this._isArrayChanged = !0
  3260. };
  3261. a.prototype._setTextDirty = function () {
  3262. this._setSizeDirty()
  3263. };
  3264. a.prototype._setBaseText = function (a) {
  3265. null == a && (a = "");
  3266. this._isFlow = !1;
  3267. if (this._text != a || this._displayAsPassword) this._setTextDirty(), this._text = a, a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3268. text: a
  3269. }])
  3270. };
  3271. a.prototype._setText = function (a) {
  3272. null ==
  3273. a && (a = "");
  3274. this._setBaseText(a);
  3275. this._inputUtils && this._inputUtils._setText(this._text)
  3276. };
  3277. Object.defineProperty(a.prototype, "displayAsPassword", {
  3278. get: function () {
  3279. return this._displayAsPassword
  3280. }, set: function (a) {
  3281. this._setDisplayAsPassword(a)
  3282. }, enumerable: !0,
  3283. configurable: !0
  3284. });
  3285. a.prototype._setDisplayAsPassword = function (a) {
  3286. this._displayAsPassword != a && (this._displayAsPassword = a, this._setText(this._text))
  3287. };
  3288. Object.defineProperty(a.prototype, "fontFamily", {
  3289. get: function () {
  3290. return this._fontFamily
  3291. }, set: function (a) {
  3292. this._setFontFamily(a)
  3293. },
  3294. enumerable: !0,
  3295. configurable: !0
  3296. });
  3297. a.prototype._setFontFamily = function (a) {
  3298. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  3299. };
  3300. Object.defineProperty(a.prototype, "size", {
  3301. get: function () {
  3302. return this._size
  3303. }, set: function (a) {
  3304. this._setSize(a)
  3305. }, enumerable: !0,
  3306. configurable: !0
  3307. });
  3308. a.prototype._setSize = function (a) {
  3309. this._size != a && (this._setTextDirty(), this._size = a)
  3310. };
  3311. Object.defineProperty(a.prototype, "italic", {
  3312. get: function () {
  3313. return this._italic
  3314. }, set: function (a) {
  3315. this._setItalic(a)
  3316. }, enumerable: !0,
  3317. configurable: !0
  3318. });
  3319. a.prototype._setItalic = function (a) {
  3320. this._italic != a && (this._setTextDirty(), this._italic = a)
  3321. };
  3322. Object.defineProperty(a.prototype, "bold", {
  3323. get: function () {
  3324. return this._bold
  3325. }, set: function (a) {
  3326. this._setBold(a)
  3327. }, enumerable: !0,
  3328. configurable: !0
  3329. });
  3330. a.prototype._setBold = function (a) {
  3331. this._bold != a && (this._setTextDirty(), this._bold = a)
  3332. };
  3333. Object.defineProperty(a.prototype, "textColor", {
  3334. get: function () {
  3335. return this._textColor
  3336. }, set: function (a) {
  3337. this._setTextColor(a)
  3338. }, enumerable: !0,
  3339. configurable: !0
  3340. });
  3341. a.prototype._setTextColor =
  3342. function (a) {
  3343. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = c.toColorString(a))
  3344. };
  3345. Object.defineProperty(a.prototype, "strokeColor", {
  3346. get: function () {
  3347. return this._strokeColor
  3348. }, set: function (a) {
  3349. this._setStrokeColor(a)
  3350. }, enumerable: !0,
  3351. configurable: !0
  3352. });
  3353. a.prototype._setStrokeColor = function (a) {
  3354. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = c.toColorString(a))
  3355. };
  3356. Object.defineProperty(a.prototype, "stroke", {
  3357. get: function () {
  3358. return this._stroke
  3359. },
  3360. set: function (a) {
  3361. this._setStroke(a)
  3362. }, enumerable: !0,
  3363. configurable: !0
  3364. });
  3365. a.prototype._setStroke = function (a) {
  3366. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  3367. };
  3368. Object.defineProperty(a.prototype, "textAlign", {
  3369. get: function () {
  3370. return this._textAlign
  3371. }, set: function (a) {
  3372. this._setTextAlign(a)
  3373. }, enumerable: !0,
  3374. configurable: !0
  3375. });
  3376. a.prototype._setTextAlign = function (a) {
  3377. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  3378. };
  3379. Object.defineProperty(a.prototype, "verticalAlign", {
  3380. get: function () {
  3381. return this._verticalAlign
  3382. },
  3383. set: function (a) {
  3384. this._setVerticalAlign(a)
  3385. }, enumerable: !0,
  3386. configurable: !0
  3387. });
  3388. a.prototype._setVerticalAlign = function (a) {
  3389. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  3390. };
  3391. Object.defineProperty(a.prototype, "maxChars", {
  3392. get: function () {
  3393. return this._maxChars
  3394. }, set: function (a) {
  3395. this._setMaxChars(a)
  3396. }, enumerable: !0,
  3397. configurable: !0
  3398. });
  3399. a.prototype._setMaxChars = function (a) {
  3400. this._maxChars != a && (this._maxChars = a)
  3401. };
  3402. Object.defineProperty(a.prototype, "scrollV", {
  3403. set: function (a) {
  3404. this._scrollV = a;
  3405. this._setDirty()
  3406. },
  3407. enumerable: !0,
  3408. configurable: !0
  3409. });
  3410. Object.defineProperty(a.prototype, "maxScrollV", {
  3411. get: function () {
  3412. return this._maxScrollV
  3413. }, enumerable: !0,
  3414. configurable: !0
  3415. });
  3416. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3417. get: function () {
  3418. return 0
  3419. }, enumerable: !0,
  3420. configurable: !0
  3421. });
  3422. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3423. get: function () {
  3424. return 0
  3425. }, enumerable: !0,
  3426. configurable: !0
  3427. });
  3428. Object.defineProperty(a.prototype, "caretIndex", {
  3429. get: function () {
  3430. return 0
  3431. }, enumerable: !0,
  3432. configurable: !0
  3433. });
  3434. a.prototype._setSelection =
  3435. function (a, b) {};
  3436. Object.defineProperty(a.prototype, "lineSpacing", {
  3437. get: function () {
  3438. return this._lineSpacing
  3439. }, set: function (a) {
  3440. this._setLineSpacing(a)
  3441. }, enumerable: !0,
  3442. configurable: !0
  3443. });
  3444. a.prototype._setLineSpacing = function (a) {
  3445. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  3446. };
  3447. a.prototype._getLineHeight = function () {
  3448. return this._lineSpacing + this._size
  3449. };
  3450. Object.defineProperty(a.prototype, "numLines", {
  3451. get: function () {
  3452. return this._numLines
  3453. }, enumerable: !0,
  3454. configurable: !0
  3455. });
  3456. Object.defineProperty(a.prototype,
  3457. "multiline", {
  3458. get: function () {
  3459. return this._multiline
  3460. }, set: function (a) {
  3461. this._setMultiline(a)
  3462. }, enumerable: !0,
  3463. configurable: !0
  3464. });
  3465. a.prototype._setMultiline = function (a) {
  3466. this._multiline = a;
  3467. this._setDirty()
  3468. };
  3469. a.prototype.setFocus = function () {
  3470. c.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3471. };
  3472. a.prototype._onRemoveFromStage = function () {
  3473. b.prototype._onRemoveFromStage.call(this);
  3474. this._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3475. };
  3476. a.prototype._onAddToStage = function () {
  3477. b.prototype._onAddToStage.call(this);
  3478. this._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
  3479. };
  3480. a.prototype._updateBaseTransform = function () {
  3481. b.prototype._updateTransform.call(this)
  3482. };
  3483. a.prototype._updateTransform = function () {
  3484. this._type == c.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3485. };
  3486. a.prototype._render = function (a) {
  3487. this.drawText(a);
  3488. this._clearDirty()
  3489. };
  3490. a.prototype._measureBounds = function () {
  3491. return this.measureText()
  3492. };
  3493. Object.defineProperty(a.prototype, "textFlow", {
  3494. set: function (a) {
  3495. this._isFlow = !0;
  3496. for (var b = "", c = 0; c < a.length; c++) b += a[c].text;
  3497. this._displayAsPassword ? this._setBaseText(b) : (this._text = b, this.setMiddleStyle(a))
  3498. }, enumerable: !0,
  3499. configurable: !0
  3500. });
  3501. a.prototype.changeToPassText = function (a) {
  3502. if (this._displayAsPassword) {
  3503. for (var b = "", c = 0, d = a.length; c < d; c++) switch (a.charAt(c)) {
  3504. case "\n":
  3505. b += "\n";
  3506. break;
  3507. case "\r":
  3508. break;
  3509. default:
  3510. b += "*"
  3511. }
  3512. return b
  3513. }
  3514. return a
  3515. };
  3516. a.prototype.setMiddleStyle = function (a) {
  3517. this._isArrayChanged = !0;
  3518. this._textArr = a;
  3519. this._setSizeDirty()
  3520. };
  3521. Object.defineProperty(a.prototype, "textWidth", {
  3522. get: function () {
  3523. return this._textMaxWidth
  3524. }, enumerable: !0,
  3525. configurable: !0
  3526. });
  3527. Object.defineProperty(a.prototype, "textHeight", {
  3528. get: function () {
  3529. return this._textMaxHeight
  3530. }, enumerable: !0,
  3531. configurable: !0
  3532. });
  3533. a.prototype.appendText = function (a) {
  3534. this.appendElement({
  3535. text: a
  3536. })
  3537. };
  3538. a.prototype.appendElement = function (a) {
  3539. this._textArr.push(a);
  3540. this.setMiddleStyle(this._textArr)
  3541. };
  3542. a.prototype._getLinesArr = function () {
  3543. if (!this._isArrayChanged) return this._linesArr;
  3544. this._isArrayChanged = !1;
  3545. var a = this._textArr,
  3546. b = c.MainContext.instance.rendererContext;
  3547. this._linesArr = [];
  3548. this._textMaxWidth = this._textMaxHeight = 0;
  3549. var d = this._linesArr,
  3550. h = 0,
  3551. g = 0,
  3552. f = 0,
  3553. k;
  3554. this._isFlow || b.setupFont(this);
  3555. for (var m = 0; m < a.length; m++) {
  3556. var n = a[m];
  3557. n.style = n.style || {};
  3558. for (var p = n.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < p.length; r++) {
  3559. null == d[f] && (k = {
  3560. width: 0,
  3561. height: 0,
  3562. elements: []
  3563. }, d[f] = k, g = h = 0);
  3564. g = this._type == c.TextFieldType.INPUT ? this._size : Math.max(g, n.style.size || this._size);
  3565. if ("" != p[r]) {
  3566. this._isFlow &&
  3567. b.setupFont(this, n.style);
  3568. var s = b.measureText(p[r]);
  3569. if (this._hasWidthSet)
  3570. if (h + s <= this._explicitWidth) k.elements.push({
  3571. width: s,
  3572. text: p[r],
  3573. style: n.style
  3574. }), h += s;
  3575. else {
  3576. for (var t = 0, u = 0, v = p[r]; t < v.length; t++) {
  3577. s = b.measureText(v.charAt(t));
  3578. if (h + s > this._explicitWidth) break;
  3579. u += s;
  3580. h += s
  3581. }
  3582. 0 < t && (k.elements.push({
  3583. width: u,
  3584. text: v.substring(0, t),
  3585. style: n.style
  3586. }), p[r] = v.substring(t));
  3587. r--
  3588. } else h += s, k.elements.push({
  3589. width: s,
  3590. text: p[r],
  3591. style: n.style
  3592. })
  3593. }
  3594. if (r < p.length - 1) {
  3595. k.width = h;
  3596. k.height = g;
  3597. this._textMaxWidth = Math.max(this._textMaxWidth,
  3598. h);
  3599. this._textMaxHeight += g;
  3600. if (this._type == c.TextFieldType.INPUT && !this._multiline) return this._numLines = d.length, d;
  3601. f++
  3602. }
  3603. }
  3604. m == a.length - 1 && k && (k.width = h, k.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, h), this._textMaxHeight += g)
  3605. }
  3606. this._numLines = d.length;
  3607. return d
  3608. };
  3609. a.prototype.measureText = function () {
  3610. return this._getLinesArr() ? c.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) *
  3611. this._lineSpacing) : c.Rectangle.identity.initialize(0, 0, 0, 0)
  3612. };
  3613. a.prototype.drawText = function (a) {
  3614. var b = this._getLinesArr();
  3615. if (b) {
  3616. this._isFlow || a.setupFont(this);
  3617. var d = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3618. h = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  3619. g = 0,
  3620. f = 0;
  3621. if (this._hasHeightSet)
  3622. if (h < this._explicitHeight) {
  3623. var k = 0;
  3624. this._verticalAlign == c.VerticalAlign.MIDDLE ? k = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (k = 1);
  3625. g += k * (this._explicitHeight - h)
  3626. } else h > this._explicitHeight &&
  3627. (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3628. g = Math.round(g);
  3629. h = 0;
  3630. this._textAlign == c.HorizontalAlign.CENTER ? h = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (h = 1);
  3631. for (k = 0; f < this._numLines; f++) {
  3632. var m = b[f],
  3633. n = m.height,
  3634. g = g + n / 2;
  3635. if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
  3636. for (var k = Math.round((d - m.width) * h), p = 0; p < m.elements.length; p++) {
  3637. var r = m.elements[p],
  3638. s = r.style.size || this._size;
  3639. this._type == c.TextFieldType.INPUT ? a.drawText(this, r.text, k, g + (n - s) / 2, r.width) : (this._isFlow &&
  3640. a.setupFont(this, r.style), a.drawText(this, r.text, k, g + (n - s) / 2, r.width, r.style));
  3641. k += r.width
  3642. }
  3643. g += n / 2 + this._lineSpacing
  3644. }
  3645. }
  3646. };
  3647. a.default_fontFamily = "Arial";
  3648. return a
  3649. }(c.DisplayObject);
  3650. c.TextField = d;
  3651. d.prototype.__class__ = "egret.TextField"
  3652. })(egret || (egret = {}));
  3653. (function (c) {
  3654. var d = function () {
  3655. function b() {
  3656. this.resutlArr = []
  3657. }
  3658. b.prototype.parser = function (a) {
  3659. this.stackArray = [];
  3660. this.resutlArr = [];
  3661. for (var e = 0, b = a.length; e < b;) {
  3662. var c = a.indexOf("<", e);
  3663. 0 > c ? (this.addToResultArr(a.substring(e)), e = b) : (this.addToResultArr(a.substring(e, c)), e = a.indexOf(">", c), "/" == a.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(a.substring(c + 1, e)), e += 1)
  3664. }
  3665. return this.resutlArr
  3666. };
  3667. b.prototype.addToResultArr = function (a) {
  3668. if ("" != a) {
  3669. var e = [];
  3670. e.push(["&lt;", "<"]);
  3671. e.push(["&gt;", ">"]);
  3672. e.push(["&amp;",
  3673. "&"
  3674. ]);
  3675. e.push(["&quot;", '"']);
  3676. e.push(["&apos;;", "'"]);
  3677. for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
  3678. 0 < this.stackArray.length ? this.resutlArr.push({
  3679. text: a,
  3680. style: this.stackArray[this.stackArray.length - 1]
  3681. }) : this.resutlArr.push({
  3682. text: a
  3683. })
  3684. }
  3685. };
  3686. b.prototype.changeStringToObject = function (a) {
  3687. var e = {};
  3688. a = a.replace(/( )+/g, " ").split(" ");
  3689. for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
  3690. return e
  3691. };
  3692. b.prototype.addProperty = function (a, e) {
  3693. var b = e.replace(/( )*=( )*/g, "=").split("=");
  3694. b[1] && (b[1] =
  3695. b[1].replace(/(\"|\')/g, ""));
  3696. switch (b[0].toLowerCase()) {
  3697. case "color":
  3698. a.textColor = parseInt(b[1]);
  3699. break;
  3700. case "b":
  3701. a.bold = "true" == (b[1] || "true");
  3702. break;
  3703. case "i":
  3704. a.italic = "true" == (b[1] || "true");
  3705. break;
  3706. case "size":
  3707. a.size = parseInt(b[1]);
  3708. break;
  3709. case "fontFamily":
  3710. a.fontFamily = b[1]
  3711. }
  3712. };
  3713. b.prototype.addToArray = function (a) {
  3714. a = this.changeStringToObject(a);
  3715. if (0 != this.stackArray.length) {
  3716. var e = this.stackArray[this.stackArray.length - 1],
  3717. b;
  3718. for (b in e) null == a[b] && (a[b] = e[b])
  3719. }
  3720. this.stackArray.push(a)
  3721. };
  3722. return b
  3723. }();
  3724. c.HtmlTextParser =
  3725. d;
  3726. d.prototype.__class__ = "egret.HtmlTextParser"
  3727. })(egret || (egret = {}));
  3728. (function (c) {
  3729. var d = function () {
  3730. function b() {}
  3731. b.DYNAMIC = "dynamic";
  3732. b.INPUT = "input";
  3733. return b
  3734. }();
  3735. c.TextFieldType = d;
  3736. d.prototype.__class__ = "egret.TextFieldType"
  3737. })(egret || (egret = {}));
  3738. __extends = this.__extends || function (c, d) {
  3739. function b() {
  3740. this.constructor = c
  3741. }
  3742. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3743. b.prototype = d.prototype;
  3744. c.prototype = new b
  3745. };
  3746. (function (c) {
  3747. var d = function (b) {
  3748. function a(a) {
  3749. b.call(this);
  3750. var c = a.bitmapData;
  3751. this.bitmapData = c;
  3752. this._textureMap = {};
  3753. this._sourceWidth = c.width;
  3754. this._sourceHeight = c.height;
  3755. this._bitmapX = a._bitmapX - a._offsetX;
  3756. this._bitmapY = a._bitmapY - a._offsetY
  3757. }
  3758. __extends(a, b);
  3759. a.prototype.getTexture = function (a) {
  3760. return this._textureMap[a]
  3761. };
  3762. a.prototype.createTexture = function (a, b, d, h, g, f, k, m, n) {
  3763. void 0 === f && (f = 0);
  3764. void 0 === k && (k = 0);
  3765. "undefined" === typeof m && (m = f + h);
  3766. "undefined" === typeof n && (n = k + g);
  3767. var p = new c.Texture;
  3768. p._bitmapData =
  3769. this.bitmapData;
  3770. p._bitmapX = this._bitmapX + b;
  3771. p._bitmapY = this._bitmapY + d;
  3772. p._bitmapWidth = h;
  3773. p._bitmapHeight = g;
  3774. p._offsetX = f;
  3775. p._offsetY = k;
  3776. p._textureWidth = m;
  3777. p._textureHeight = n;
  3778. p._sourceWidth = this._sourceWidth;
  3779. p._sourceHeight = this._sourceHeight;
  3780. return this._textureMap[a] = p
  3781. };
  3782. return a
  3783. }(c.HashObject);
  3784. c.SpriteSheet = d;
  3785. d.prototype.__class__ = "egret.SpriteSheet"
  3786. })(egret || (egret = {}));
  3787. __extends = this.__extends || function (c, d) {
  3788. function b() {
  3789. this.constructor = c
  3790. }
  3791. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3792. b.prototype = d.prototype;
  3793. c.prototype = new b
  3794. };
  3795. (function (c) {
  3796. var d = function (b) {
  3797. function a() {
  3798. b.call(this);
  3799. c.Logger.warning("TextInput \u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextField\u4ee3\u66ff\uff0c\u5e76\u8bbe\u7f6etype\u4e3aTextFieldType.INPUT");
  3800. this.type = c.TextFieldType.INPUT
  3801. }
  3802. __extends(a, b);
  3803. a.prototype.setText = function (a) {
  3804. c.Logger.warning("TextField.setText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u8bbe\u7f6e");
  3805. this.text = a
  3806. };
  3807. a.prototype.getText = function () {
  3808. c.Logger.warning("TextField.getText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u83b7\u53d6");
  3809. return this.text
  3810. };
  3811. a.prototype.setTextType = function (a) {
  3812. c.Logger.warning("TextField.setTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u8bbe\u7f6e");
  3813. this.displayAsPassword = "password" == a
  3814. };
  3815. a.prototype.getTextType = function () {
  3816. c.Logger.warning("TextField.getTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u83b7\u53d6");
  3817. return this.displayAsPassword ? "password" : "text"
  3818. };
  3819. return a
  3820. }(c.TextField);
  3821. c.TextInput = d;
  3822. d.prototype.__class__ = "egret.TextInput"
  3823. })(egret ||
  3824. (egret = {}));
  3825. __extends = this.__extends || function (c, d) {
  3826. function b() {
  3827. this.constructor = c
  3828. }
  3829. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3830. b.prototype = d.prototype;
  3831. c.prototype = new b
  3832. };
  3833. (function (c) {
  3834. var d = function (b) {
  3835. function a() {
  3836. b.call(this);
  3837. this._isFocus = !1;
  3838. this._isFirst = this._isFirst = !0
  3839. }
  3840. __extends(a, b);
  3841. a.prototype.init = function (a) {
  3842. this._text = a;
  3843. this.stageText = c.StageText.create();
  3844. a = this._text.localToGlobal();
  3845. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  3846. };
  3847. a.prototype._addStageText = function () {
  3848. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3849. this.stageText._add();
  3850. this.stageText._addListeners();
  3851. this.stageText.addEventListener("blur", this.onBlurHandler,
  3852. this);
  3853. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3854. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3855. this._text.addEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3856. c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3857. };
  3858. a.prototype._removeStageText = function () {
  3859. this.stageText._remove();
  3860. this.stageText._removeListeners();
  3861. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3862. this.stageText.removeEventListener("blur",
  3863. this.onBlurHandler, this);
  3864. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3865. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3866. this._text.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3867. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3868. };
  3869. a.prototype._getText = function () {
  3870. return this.stageText._getText()
  3871. };
  3872. a.prototype._setText = function (a) {
  3873. this.stageText._setText(a)
  3874. };
  3875. a.prototype.onFocusHandler =
  3876. function (a) {
  3877. this.hideText()
  3878. };
  3879. a.prototype.onBlurHandler = function (a) {
  3880. this.showText()
  3881. };
  3882. a.prototype.onMouseDownHandler = function (a) {
  3883. a.stopPropagation();
  3884. this._text._visible && this.stageText._show()
  3885. };
  3886. a.prototype.onStageDownHandler = function (a) {
  3887. this.stageText._hide();
  3888. this.showText()
  3889. };
  3890. a.prototype.showText = function () {
  3891. this._isFocus && (this._isFocus = !1, this.resetText())
  3892. };
  3893. a.prototype.hideText = function () {
  3894. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  3895. };
  3896. a.prototype.updateTextHandler = function (a) {
  3897. this.resetText();
  3898. this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
  3899. };
  3900. a.prototype.resetText = function () {
  3901. this._text._setBaseText(this.stageText._getText())
  3902. };
  3903. a.prototype._updateTransform = function () {
  3904. var a = this._text._worldTransform.a,
  3905. b = this._text._worldTransform.b,
  3906. d = this._text._worldTransform.c,
  3907. h = this._text._worldTransform.d,
  3908. g = this._text._worldTransform.tx,
  3909. f = this._text._worldTransform.ty;
  3910. this._text._updateBaseTransform();
  3911. var k = this._text._worldTransform;
  3912. if (this._isFirst || a != k.a || b != k.b || d != k.c || h != k.d || g != k.tx || f !=
  3913. k.ty) {
  3914. this._isFirst = !1;
  3915. a = this._text.localToGlobal();
  3916. this.stageText.changePosition(a.x, a.y);
  3917. var m = this;
  3918. c.callLater(function () {
  3919. m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
  3920. }, this)
  3921. }
  3922. };
  3923. a.prototype._updateProperties = function () {
  3924. var a = this._text._stage;
  3925. if (null == a) this.stageText._setVisible(!1);
  3926. else {
  3927. for (var b = this._text, d = b._visible; d;) {
  3928. b = b.parent;
  3929. if (b == a) break;
  3930. d = b._visible
  3931. }
  3932. this.stageText._setVisible(d)
  3933. }
  3934. this.stageText._setMultiline(this._text._multiline);
  3935. this.stageText._setMaxChars(this._text._maxChars);
  3936. this.stageText._setSize(this._text._size);
  3937. this.stageText._setTextColor(this._text._textColorString);
  3938. this.stageText._setTextFontFamily(this._text._fontFamily);
  3939. this.stageText._setBold(this._text._bold);
  3940. this.stageText._setItalic(this._text._italic);
  3941. this.stageText._setTextAlign(this._text._textAlign);
  3942. this.stageText._setWidth(this._text._getSize(c.Rectangle.identity).width);
  3943. this.stageText._setHeight(this._text._getSize(c.Rectangle.identity).height);
  3944. this.stageText._setTextType(this._text._displayAsPassword ?
  3945. "password" : "text");
  3946. this.stageText._setText(this._text._text);
  3947. this.stageText._resetStageText();
  3948. this._updateTransform()
  3949. };
  3950. return a
  3951. }(c.HashObject);
  3952. c.InputController = d;
  3953. d.prototype.__class__ = "egret.InputController"
  3954. })(egret || (egret = {}));
  3955. __extends = this.__extends || function (c, d) {
  3956. function b() {
  3957. this.constructor = c
  3958. }
  3959. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3960. b.prototype = d.prototype;
  3961. c.prototype = new b
  3962. };
  3963. (function (c) {
  3964. var d = function (b) {
  3965. function a(a, c) {
  3966. b.call(this, a);
  3967. this.charList = this.parseConfig(c)
  3968. }
  3969. __extends(a, b);
  3970. a.prototype.getTexture = function (a) {
  3971. var b = this._textureMap[a];
  3972. if (!b) {
  3973. b = this.charList[a];
  3974. if (!b) return null;
  3975. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  3976. this._textureMap[a] = b
  3977. }
  3978. return b
  3979. };
  3980. a.prototype.parseConfig = function (a) {
  3981. a = a.split("\r\n").join("\n");
  3982. a = a.split("\n");
  3983. for (var b = this.getConfigByKey(a[3], "count"), c = {}, d = 4; d < 4 + b; d++) {
  3984. var g = a[d],
  3985. f = String.fromCharCode(this.getConfigByKey(g,
  3986. "id")),
  3987. k = {};
  3988. c[f] = k;
  3989. k.x = this.getConfigByKey(g, "x");
  3990. k.y = this.getConfigByKey(g, "y");
  3991. k.width = this.getConfigByKey(g, "width");
  3992. k.height = this.getConfigByKey(g, "height");
  3993. k.offsetX = this.getConfigByKey(g, "xoffset");
  3994. k.offsetY = this.getConfigByKey(g, "yoffset")
  3995. }
  3996. return c
  3997. };
  3998. a.prototype.getConfigByKey = function (a, b) {
  3999. for (var c = a.split(" "), d = 0, g = c.length; d < g; d++) {
  4000. var f = c[d];
  4001. if (b == f.substring(0, b.length)) return c = f.substring(b.length + 1), parseInt(c)
  4002. }
  4003. return 0
  4004. };
  4005. return a
  4006. }(c.SpriteSheet);
  4007. c.BitmapTextSpriteSheet = d;
  4008. d.prototype.__class__ =
  4009. "egret.BitmapTextSpriteSheet"
  4010. })(egret || (egret = {}));
  4011. __extends = this.__extends || function (c, d) {
  4012. function b() {
  4013. this.constructor = c
  4014. }
  4015. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4016. b.prototype = d.prototype;
  4017. c.prototype = new b
  4018. };
  4019. (function (c) {
  4020. var d = function (a) {
  4021. function e(e, d) {
  4022. a.call(this);
  4023. this.frameRate = 60;
  4024. e instanceof b ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new b(e, d);
  4025. this.delegate.setMovieClip(this)
  4026. }
  4027. __extends(e, a);
  4028. e.prototype.gotoAndPlay = function (a) {
  4029. this.delegate.gotoAndPlay(a)
  4030. };
  4031. e.prototype.gotoAndStop = function (a) {
  4032. this.delegate.gotoAndStop(a)
  4033. };
  4034. e.prototype.stop =
  4035. function () {
  4036. this.delegate.stop()
  4037. };
  4038. e.prototype.dispose = function () {
  4039. this.delegate.dispose()
  4040. };
  4041. e.prototype.release = function () {
  4042. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4043. this.dispose()
  4044. };
  4045. e.prototype.getCurrentFrameIndex = function () {
  4046. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4047. return this.delegate._currentFrameIndex
  4048. };
  4049. e.prototype.getTotalFrame = function () {
  4050. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4051. return this.delegate._totalFrame
  4052. };
  4053. e.prototype.setInterval = function (a) {
  4054. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4055. this.frameRate = 60 / a
  4056. };
  4057. e.prototype.getIsPlaying = function () {
  4058. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4059. return this.delegate.isPlaying
  4060. };
  4061. return e
  4062. }(c.DisplayObjectContainer);
  4063. c.MovieClip = d;
  4064. d.prototype.__class__ = "egret.MovieClip";
  4065. var b = function () {
  4066. function a(a, b) {
  4067. this.data = a;
  4068. this._currentFrameIndex = this._passTime =
  4069. this._totalFrame = 0;
  4070. this._isPlaying = !1;
  4071. this._frameData = a;
  4072. this._spriteSheet = new c.SpriteSheet(b)
  4073. }
  4074. a.prototype.setMovieClip = function (a) {
  4075. this.movieClip = a;
  4076. this.bitmap = new c.Bitmap;
  4077. this.movieClip.addChild(this.bitmap)
  4078. };
  4079. a.prototype.gotoAndPlay = function (a) {
  4080. this.checkHasFrame(a);
  4081. this._isPlaying = !0;
  4082. this._currentFrameIndex = 0;
  4083. this._currentFrameName = a;
  4084. this._totalFrame = this._frameData.frames[a].totalFrame;
  4085. this.playNextFrame();
  4086. this._passTime = 0;
  4087. c.Ticker.getInstance().register(this.update, this)
  4088. };
  4089. a.prototype.gotoAndStop =
  4090. function (a) {
  4091. this.checkHasFrame(a);
  4092. this.stop();
  4093. this._currentFrameIndex = this._passTime = 0;
  4094. this._currentFrameName = a;
  4095. this._totalFrame = this._frameData.frames[a].totalFrame;
  4096. this.playNextFrame()
  4097. };
  4098. a.prototype.stop = function () {
  4099. this._isPlaying = !1;
  4100. c.Ticker.getInstance().unregister(this.update, this)
  4101. };
  4102. a.prototype.dispose = function () {};
  4103. a.prototype.checkHasFrame = function (a) {
  4104. void 0 == this._frameData.frames[a] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  4105. };
  4106. a.prototype.update = function (a) {
  4107. for (var b =
  4108. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  4109. this._passTime += a
  4110. };
  4111. a.prototype.playNextFrame = function (a) {
  4112. void 0 === a && (a = !0);
  4113. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4114. if (a) {
  4115. a = this.getTexture(b.res);
  4116. var d = this.bitmap;
  4117. d.x = b.x;
  4118. d.y = b.y;
  4119. d.texture = a
  4120. }
  4121. null != b.action && this.movieClip.dispatchEventWith(b.action);
  4122. this._currentFrameIndex++;
  4123. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4124. 0, b.action != c.Event.COMPLETE && this.movieClip.dispatchEventWith(c.Event.COMPLETE))
  4125. };
  4126. a.prototype.getTexture = function (a) {
  4127. var b = this._frameData.res[a],
  4128. c = this._spriteSheet.getTexture(a);
  4129. c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4130. return c
  4131. };
  4132. return a
  4133. }();
  4134. c.DefaultMovieClipDelegate = b;
  4135. b.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4136. })(egret || (egret = {}));
  4137. __extends = this.__extends || function (c, d) {
  4138. function b() {
  4139. this.constructor = c
  4140. }
  4141. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4142. b.prototype = d.prototype;
  4143. c.prototype = new b
  4144. };
  4145. (function (c) {
  4146. var d = function (b) {
  4147. function a() {
  4148. b.call(this);
  4149. this._scaleY = this._scaleX = 1;
  4150. this._size = 30;
  4151. this._color = "#FFFFFF";
  4152. this._fontFamily = "Arial";
  4153. this._italic = this._bold = !1;
  4154. this._textAlign = "left";
  4155. this._multiline = this._visible = !1;
  4156. this._maxChars = 0
  4157. }
  4158. __extends(a, b);
  4159. a.prototype._getText = function () {
  4160. return null
  4161. };
  4162. a.prototype._setText = function (a) {};
  4163. a.prototype._setTextType = function (a) {};
  4164. a.prototype._getTextType = function () {
  4165. return null
  4166. };
  4167. a.prototype._open = function (a, b, c, d) {};
  4168. a.prototype._show = function () {};
  4169. a.prototype._add =
  4170. function () {};
  4171. a.prototype._remove = function () {};
  4172. a.prototype._hide = function () {};
  4173. a.prototype._addListeners = function () {};
  4174. a.prototype._removeListeners = function () {};
  4175. a.prototype._setScale = function (a, b) {
  4176. this._scaleX = a;
  4177. this._scaleY = b
  4178. };
  4179. a.prototype.changePosition = function (a, b) {};
  4180. a.prototype._setSize = function (a) {
  4181. this._size = a
  4182. };
  4183. a.prototype._setTextColor = function (a) {
  4184. this._color = a
  4185. };
  4186. a.prototype._setTextFontFamily = function (a) {
  4187. this._fontFamily = a
  4188. };
  4189. a.prototype._setBold = function (a) {
  4190. this._bold = a
  4191. };
  4192. a.prototype._setItalic =
  4193. function (a) {
  4194. this._italic = a
  4195. };
  4196. a.prototype._setTextAlign = function (a) {
  4197. this._textAlign = a
  4198. };
  4199. a.prototype._setVisible = function (a) {
  4200. this._visible = a
  4201. };
  4202. a.prototype._setWidth = function (a) {};
  4203. a.prototype._setHeight = function (a) {};
  4204. a.prototype._setMultiline = function (a) {
  4205. this._multiline = a
  4206. };
  4207. a.prototype._setMaxChars = function (a) {
  4208. this._maxChars = a
  4209. };
  4210. a.prototype._resetStageText = function () {};
  4211. a.create = function () {
  4212. return null
  4213. };
  4214. return a
  4215. }(c.EventDispatcher);
  4216. c.StageText = d;
  4217. d.prototype.__class__ = "egret.StageText"
  4218. })(egret || (egret = {}));
  4219. (function (c) {
  4220. var d = function () {
  4221. function b() {}
  4222. b.GET = "get";
  4223. b.POST = "post";
  4224. return b
  4225. }();
  4226. c.URLRequestMethod = d;
  4227. d.prototype.__class__ = "egret.URLRequestMethod"
  4228. })(egret || (egret = {}));
  4229. (function (c) {
  4230. var d = function () {
  4231. function b() {}
  4232. b.BINARY = "binary";
  4233. b.TEXT = "text";
  4234. b.VARIABLES = "variables";
  4235. b.TEXTURE = "texture";
  4236. b.SOUND = "sound";
  4237. return b
  4238. }();
  4239. c.URLLoaderDataFormat = d;
  4240. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  4241. })(egret || (egret = {}));
  4242. __extends = this.__extends || function (c, d) {
  4243. function b() {
  4244. this.constructor = c
  4245. }
  4246. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4247. b.prototype = d.prototype;
  4248. c.prototype = new b
  4249. };
  4250. (function (c) {
  4251. var d = function (b) {
  4252. function a(a) {
  4253. void 0 === a && (a = null);
  4254. b.call(this);
  4255. null !== a && this.decode(a)
  4256. }
  4257. __extends(a, b);
  4258. a.prototype.decode = function (a) {
  4259. this.variables || (this.variables = {});
  4260. a = a.split("+").join(" ");
  4261. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  4262. };
  4263. a.prototype.toString = function () {
  4264. if (!this.variables) return "";
  4265. var a = this.variables,
  4266. b = "",
  4267. c = !0,
  4268. d;
  4269. for (d in a) c ? c = !1 : b += "&", b += d + "=" + a[d];
  4270. return b
  4271. };
  4272. return a
  4273. }(c.HashObject);
  4274. c.URLVariables =
  4275. d;
  4276. d.prototype.__class__ = "egret.URLVariables"
  4277. })(egret || (egret = {}));
  4278. __extends = this.__extends || function (c, d) {
  4279. function b() {
  4280. this.constructor = c
  4281. }
  4282. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4283. b.prototype = d.prototype;
  4284. c.prototype = new b
  4285. };
  4286. (function (c) {
  4287. var d = function (b) {
  4288. function a(a) {
  4289. void 0 === a && (a = null);
  4290. b.call(this);
  4291. this.method = c.URLRequestMethod.GET;
  4292. this.url = a
  4293. }
  4294. __extends(a, b);
  4295. return a
  4296. }(c.HashObject);
  4297. c.URLRequest = d;
  4298. d.prototype.__class__ = "egret.URLRequest"
  4299. })(egret || (egret = {}));
  4300. __extends = this.__extends || function (c, d) {
  4301. function b() {
  4302. this.constructor = c
  4303. }
  4304. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4305. b.prototype = d.prototype;
  4306. c.prototype = new b
  4307. };
  4308. (function (c) {
  4309. var d = function (b) {
  4310. function a(a) {
  4311. void 0 === a && (a = null);
  4312. b.call(this);
  4313. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  4314. this._status = -1;
  4315. a && this.load(a)
  4316. }
  4317. __extends(a, b);
  4318. a.prototype.load = function (a) {
  4319. this._request = a;
  4320. this.data = null;
  4321. c.MainContext.instance.netContext.proceed(this)
  4322. };
  4323. return a
  4324. }(c.EventDispatcher);
  4325. c.URLLoader = d;
  4326. d.prototype.__class__ = "egret.URLLoader"
  4327. })(egret || (egret = {}));
  4328. __extends = this.__extends || function (c, d) {
  4329. function b() {
  4330. this.constructor = c
  4331. }
  4332. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4333. b.prototype = d.prototype;
  4334. c.prototype = new b
  4335. };
  4336. (function (c) {
  4337. var d = function (b) {
  4338. function a() {
  4339. b.call(this);
  4340. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4341. }
  4342. __extends(a, b);
  4343. Object.defineProperty(a.prototype, "textureWidth", {
  4344. get: function () {
  4345. return this._textureWidth
  4346. }, enumerable: !0,
  4347. configurable: !0
  4348. });
  4349. Object.defineProperty(a.prototype, "textureHeight", {
  4350. get: function () {
  4351. return this._textureHeight
  4352. }, enumerable: !0,
  4353. configurable: !0
  4354. });
  4355. Object.defineProperty(a.prototype, "bitmapData", {
  4356. get: function () {
  4357. return this._bitmapData
  4358. }, enumerable: !0,
  4359. configurable: !0
  4360. });
  4361. a.prototype._setBitmapData = function (a) {
  4362. var b = c.MainContext.instance.rendererContext.texture_scale_factor;
  4363. this._bitmapData = a;
  4364. this._sourceWidth = a.width;
  4365. this._sourceHeight = a.height;
  4366. this._textureWidth = this._sourceWidth * b;
  4367. this._textureHeight = this._sourceHeight * b;
  4368. this._bitmapWidth = this._textureWidth;
  4369. this._bitmapHeight = this._textureHeight;
  4370. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4371. };
  4372. a.prototype.getPixel32 = function (a, b) {
  4373. return this._bitmapData.getContext("2d").getImageData(a,
  4374. b, 1, 1).data
  4375. };
  4376. return a
  4377. }(c.HashObject);
  4378. c.Texture = d;
  4379. d.prototype.__class__ = "egret.Texture"
  4380. })(egret || (egret = {}));
  4381. __extends = this.__extends || function (c, d) {
  4382. function b() {
  4383. this.constructor = c
  4384. }
  4385. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4386. b.prototype = d.prototype;
  4387. c.prototype = new b
  4388. };
  4389. (function (c) {
  4390. var d = function (b) {
  4391. function a() {
  4392. b.call(this);
  4393. this._bitmapData = document.createElement("canvas");
  4394. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  4395. }
  4396. __extends(a, b);
  4397. a.prototype.drawToTexture = function (e) {
  4398. var b = this._bitmapData,
  4399. d = e.getBounds(c.Rectangle.identity);
  4400. if (0 == d.width || 0 == d.height) return c.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4401. d.width = Math.floor(d.width);
  4402. d.height = Math.floor(d.height);
  4403. b.width = d.width;
  4404. b.height = d.height;
  4405. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = d.width, this.renderContext._cacheCanvas.height = d.height);
  4406. a.identityRectangle.width = d.width;
  4407. a.identityRectangle.height = d.height;
  4408. e._worldTransform.identity();
  4409. e.worldAlpha = 1;
  4410. if (e instanceof c.DisplayObjectContainer) {
  4411. var b = e._anchorOffsetX,
  4412. h = e._anchorOffsetY;
  4413. if (0 != e._anchorX || 0 != e._anchorY) b = e._anchorX * d.width, h = e._anchorY * d.height;
  4414. this._offsetX = d.x + b;
  4415. this._offsetY = d.y +
  4416. h;
  4417. e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4418. d = e._children;
  4419. b = 0;
  4420. for (h = d.length; b < h; b++) d[b]._updateTransform()
  4421. }
  4422. d = c.RenderFilter.getInstance();
  4423. b = d._drawAreaList.concat();
  4424. d._drawAreaList.length = 0;
  4425. this.renderContext.clearScreen();
  4426. this.renderContext.onRenderStart();
  4427. this.webGLTexture = null;
  4428. (h = e.mask || e._scrollRect) && this.renderContext.pushMask(h);
  4429. e._render(this.renderContext);
  4430. h && this.renderContext.popMask();
  4431. d.addDrawArea(a.identityRectangle);
  4432. this.renderContext.onRenderFinish();
  4433. d._drawAreaList =
  4434. b;
  4435. this._textureWidth = this._bitmapData.width;
  4436. this._textureHeight = this._bitmapData.height;
  4437. this._sourceWidth = this._textureWidth;
  4438. this._sourceHeight = this._textureHeight;
  4439. return !0
  4440. };
  4441. a.identityRectangle = new c.Rectangle;
  4442. return a
  4443. }(c.Texture);
  4444. c.RenderTexture = d;
  4445. d.prototype.__class__ = "egret.RenderTexture"
  4446. })(egret || (egret = {}));
  4447. __extends = this.__extends || function (c, d) {
  4448. function b() {
  4449. this.constructor = c
  4450. }
  4451. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4452. b.prototype = d.prototype;
  4453. c.prototype = new b
  4454. };
  4455. (function (c) {
  4456. var d = function (b) {
  4457. function a() {
  4458. b.call(this);
  4459. this.renderCost = 0;
  4460. this.texture_scale_factor = 1;
  4461. this.profiler = c.Profiler.getInstance()
  4462. }
  4463. __extends(a, b);
  4464. a.prototype.clearScreen = function () {};
  4465. a.prototype.clearRect = function (a, b, c, d) {};
  4466. a.prototype.drawImage = function (a, b, c, d, g, f, k, m, n, p) {
  4467. this.profiler.onDrawImage()
  4468. };
  4469. a.prototype.setTransform = function (a) {};
  4470. a.prototype.setAlpha = function (a, b) {};
  4471. a.prototype.setupFont = function (a, b) {};
  4472. a.prototype.measureText = function (a) {
  4473. return 0
  4474. };
  4475. a.prototype.drawText = function (a,
  4476. b, c, d, g, f) {
  4477. this.profiler.onDrawImage()
  4478. };
  4479. a.prototype.strokeRect = function (a, b, c, d, g) {};
  4480. a.prototype.pushMask = function (a) {};
  4481. a.prototype.popMask = function () {};
  4482. a.prototype.onRenderStart = function () {};
  4483. a.prototype.onRenderFinish = function () {};
  4484. a.prototype.setGlobalColorTransform = function (a) {};
  4485. a.createRendererContext = function (a) {
  4486. return null
  4487. };
  4488. a.imageSmoothingEnabled = !0;
  4489. return a
  4490. }(c.HashObject);
  4491. c.RendererContext = d;
  4492. d.prototype.__class__ = "egret.RendererContext"
  4493. })(egret || (egret = {}));
  4494. (function (c) {
  4495. var d = function () {
  4496. function b() {}
  4497. b.MOUSE = "mouse";
  4498. b.TOUCH = "touch";
  4499. b.mode = "touch";
  4500. return b
  4501. }();
  4502. c.InteractionMode = d;
  4503. d.prototype.__class__ = "egret.InteractionMode"
  4504. })(egret || (egret = {}));
  4505. __extends = this.__extends || function (c, d) {
  4506. function b() {
  4507. this.constructor = c
  4508. }
  4509. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4510. b.prototype = d.prototype;
  4511. c.prototype = new b
  4512. };
  4513. (function (c) {
  4514. var d = function (b) {
  4515. function a() {
  4516. b.call(this);
  4517. this._currentTouchTarget = {};
  4518. this.maxTouches = 2;
  4519. this.touchDownTarget = {};
  4520. this.touchingIdentifiers = [];
  4521. this.lastTouchY = this.lastTouchX = -1
  4522. }
  4523. __extends(a, b);
  4524. a.prototype.run = function () {};
  4525. a.prototype.getTouchData = function (a, b, c) {
  4526. var d = this._currentTouchTarget[a];
  4527. null == d && (d = {}, this._currentTouchTarget[a] = d);
  4528. d.stageX = b;
  4529. d.stageY = c;
  4530. d.identifier = a;
  4531. return d
  4532. };
  4533. a.prototype.dispatchEvent = function (a, b) {
  4534. c.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX,
  4535. b.stageY, !1, !1, !1, !0 == this.touchDownTarget[b.identifier])
  4536. };
  4537. a.prototype.onTouchBegan = function (a, b, d) {
  4538. if (this.touchingIdentifiers.length != this.maxTouches) {
  4539. var h = c.MainContext.instance.stage.hitTest(a, b);
  4540. h && (a = this.getTouchData(d, a, b), this.touchDownTarget[d] = !0, a.target = h, a.beginTarget = h, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
  4541. this.touchingIdentifiers.push(d)
  4542. }
  4543. };
  4544. a.prototype.onTouchMove = function (a, b, d) {
  4545. if (-1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || b != this.lastTouchY)) {
  4546. this.lastTouchX =
  4547. a;
  4548. this.lastTouchY = b;
  4549. var h = c.MainContext.instance.stage.hitTest(a, b);
  4550. h && (a = this.getTouchData(d, a, b), a.target = h, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
  4551. }
  4552. };
  4553. a.prototype.onTouchEnd = function (a, b, d) {
  4554. var h = this.touchingIdentifiers.indexOf(d); - 1 != h && (this.touchingIdentifiers.splice(h, 1), h = c.MainContext.instance.stage.hitTest(a, b)) && (a = this.getTouchData(d, a, b), delete this.touchDownTarget[d], d = a.beginTarget, a.target = h, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), d == h ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP,
  4555. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4556. };
  4557. return a
  4558. }(c.HashObject);
  4559. c.TouchContext = d;
  4560. d.prototype.__class__ = "egret.TouchContext"
  4561. })(egret || (egret = {}));
  4562. __extends = this.__extends || function (c, d) {
  4563. function b() {
  4564. this.constructor = c
  4565. }
  4566. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4567. b.prototype = d.prototype;
  4568. c.prototype = new b
  4569. };
  4570. (function (c) {
  4571. var d = function (b) {
  4572. function a() {
  4573. b.call(this)
  4574. }
  4575. __extends(a, b);
  4576. a.prototype.proceed = function (a) {};
  4577. a._getUrl = function (a) {
  4578. var b = a.url; - 1 == b.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (b = b + "?" + a.data.toString());
  4579. return b
  4580. };
  4581. a.prototype.getChangeList = function () {
  4582. return []
  4583. };
  4584. return a
  4585. }(c.HashObject);
  4586. c.NetContext = d;
  4587. d.prototype.__class__ = "egret.NetContext"
  4588. })(egret || (egret = {}));
  4589. __extends = this.__extends || function (c, d) {
  4590. function b() {
  4591. this.constructor = c
  4592. }
  4593. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4594. b.prototype = d.prototype;
  4595. c.prototype = new b
  4596. };
  4597. (function (c) {
  4598. var d = function (b) {
  4599. function a() {
  4600. b.call(this);
  4601. this.frameRate = 60
  4602. }
  4603. __extends(a, b);
  4604. a.prototype.executeMainLoop = function (a, b) {};
  4605. return a
  4606. }(c.HashObject);
  4607. c.DeviceContext = d;
  4608. d.prototype.__class__ = "egret.DeviceContext"
  4609. })(egret || (egret = {}));
  4610. (function (c) {
  4611. var d = function () {
  4612. function b() {}
  4613. b.call = function (a, e) {};
  4614. b.addCallback = function (a, e) {};
  4615. return b
  4616. }();
  4617. c.ExternalInterface = d;
  4618. d.prototype.__class__ = "egret.ExternalInterface"
  4619. })(egret || (egret = {}));
  4620. __extends = this.__extends || function (c, d) {
  4621. function b() {
  4622. this.constructor = c
  4623. }
  4624. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4625. b.prototype = d.prototype;
  4626. c.prototype = new b
  4627. };
  4628. (function (c) {
  4629. var d = function (b) {
  4630. function a() {
  4631. b.call(this);
  4632. this.ua = navigator.userAgent.toLowerCase();
  4633. this.trans = this._getTrans()
  4634. }
  4635. __extends(a, b);
  4636. a.getInstance = function () {
  4637. null == a.instance && (a.instance = new a);
  4638. return a.instance
  4639. };
  4640. Object.defineProperty(a.prototype, "isMobile", {
  4641. get: function () {
  4642. c.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  4643. return c.MainContext.deviceType ==
  4644. c.MainContext.DEVICE_MOBILE
  4645. }, enumerable: !0,
  4646. configurable: !0
  4647. });
  4648. a.prototype._getHeader = function (a) {
  4649. if ("transform" in a) return "";
  4650. for (var b = ["webkit", "ms", "Moz", "O"], c = 0; c < b.length; c++)
  4651. if (b[c] + "Transform" in a) return b[c];
  4652. return ""
  4653. };
  4654. a.prototype._getTrans = function () {
  4655. var a = document.createElement("div").style,
  4656. a = this._getHeader(a);
  4657. return "" == a ? "transform" : a + "Transform"
  4658. };
  4659. a.prototype.$new = function (a) {
  4660. return this.$(document.createElement(a))
  4661. };
  4662. a.prototype.$ = function (e) {
  4663. var b = document;
  4664. if (e = e instanceof HTMLElement ?
  4665. e : b.querySelector(e)) e.find = e.find || this.$, e.hasClass = e.hasClass || function (a) {
  4666. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4667. }, e.addClass = e.addClass || function (a) {
  4668. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4669. return this
  4670. }, e.removeClass = e.removeClass || function (a) {
  4671. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4672. return this
  4673. }, e.remove = e.remove || function () {}, e.appendTo = e.appendTo || function (a) {
  4674. a.appendChild(this);
  4675. return this
  4676. }, e.prependTo = e.prependTo ||
  4677. function (a) {
  4678. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4679. return this
  4680. }, e.transforms = e.transforms || function () {
  4681. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  4682. return this
  4683. }, e.position = e.position || {
  4684. x: 0,
  4685. y: 0
  4686. }, e.rotation = e.rotation || 0, e.scale = e.scale || {
  4687. x: 1,
  4688. y: 1
  4689. }, e.skew = e.skew || {
  4690. x: 0,
  4691. y: 0
  4692. }, e.translates = function (a, e) {
  4693. this.position.x = a;
  4694. this.position.y = e -
  4695. c.MainContext.instance.stage.stageHeight;
  4696. this.transforms();
  4697. return this
  4698. }, e.rotate = function (a) {
  4699. this.rotation = a;
  4700. this.transforms();
  4701. return this
  4702. }, e.resize = function (a, e) {
  4703. this.scale.x = a;
  4704. this.scale.y = e;
  4705. this.transforms();
  4706. return this
  4707. }, e.setSkew = function (a, e) {
  4708. this.skew.x = a;
  4709. this.skew.y = e;
  4710. this.transforms();
  4711. return this
  4712. };
  4713. return e
  4714. };
  4715. a.prototype.translate = function (a) {
  4716. return "translate(" + a.x + "px, " + a.y + "px) "
  4717. };
  4718. a.prototype.rotate = function (a) {
  4719. return "rotate(" + a + "deg) "
  4720. };
  4721. a.prototype.scale = function (a) {
  4722. return "scale(" + a.x + ", " +
  4723. a.y + ") "
  4724. };
  4725. a.prototype.skew = function (a) {
  4726. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4727. };
  4728. return a
  4729. }(c.HashObject);
  4730. c.Browser = d;
  4731. d.prototype.__class__ = "egret.Browser"
  4732. })(egret || (egret = {}));
  4733. (function (c) {
  4734. (function (c) {
  4735. c.getItem = function (b) {
  4736. return null
  4737. };
  4738. c.setItem = function (b, a) {
  4739. return !1
  4740. };
  4741. c.removeItem = function (b) {};
  4742. c.clear = function () {}
  4743. })(c.localStorage || (c.localStorage = {}))
  4744. })(egret || (egret = {}));
  4745. (function (c) {
  4746. var d = function () {
  4747. function b() {}
  4748. b.parse = function (a) {
  4749. a = c.SAXParser.getInstance().parserXML(a);
  4750. if (!a || !a.childNodes) return null;
  4751. for (var e = a.childNodes.length, d = !1, q = 0; q < e; q++) {
  4752. var h = a.childNodes[q];
  4753. if (1 == h.nodeType) {
  4754. d = !0;
  4755. break
  4756. }
  4757. }
  4758. return d ? b.parseNode(h) : null
  4759. };
  4760. b.parseNode = function (a) {
  4761. if (!a || 1 != a.nodeType) return null;
  4762. var e = {};
  4763. e.localName = a.localName;
  4764. e.name = a.nodeName;
  4765. a.namespaceURI && (e.namespace = a.namespaceURI);
  4766. a.prefix && (e.prefix = a.prefix);
  4767. for (var c = a.attributes, d = c.length, h = 0; h < d; h++) {
  4768. var g =
  4769. c[h],
  4770. f = g.name;
  4771. 0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
  4772. }
  4773. c = a.childNodes;
  4774. d = c.length;
  4775. for (h = 0; h < d; h++)
  4776. if (g = b.parseNode(c[h])) e.children || (e.children = []), g.parent = e, e.children.push(g);
  4777. !e.children && (a = a.textContent.trim()) && (e.text = a);
  4778. return e
  4779. };
  4780. b.findChildren = function (a, e, c) {
  4781. c ? c.length = 0 : c = [];
  4782. b.findByPath(a, e, c);
  4783. return c
  4784. };
  4785. b.findByPath = function (a, e, c) {
  4786. var d = e.indexOf("."),
  4787. h; - 1 == d ? (h = e, d = !0) : (h = e.substring(0, d), e = e.substring(d + 1), d = !1);
  4788. if (a = a.children)
  4789. for (var g = a.length, f = 0; f < g; f++) {
  4790. var k = a[f];
  4791. k.localName ==
  4792. h && (d ? c.push(k) : b.findByPath(k, e, c))
  4793. }
  4794. };
  4795. b.getAttributes = function (a, e) {
  4796. e ? e.length = 0 : e = [];
  4797. for (var b in a) "$" == b.charAt(0) && e.push(b.substring(1));
  4798. return e
  4799. };
  4800. return b
  4801. }();
  4802. c.XML = d;
  4803. d.prototype.__class__ = "egret.XML"
  4804. })(egret || (egret = {}));
  4805. (function (c) {
  4806. var d = function () {
  4807. function a() {}
  4808. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  4809. a.BIG_ENDIAN = "BIG_ENDIAN";
  4810. return a
  4811. }();
  4812. c.Endian = d;
  4813. d.prototype.__class__ = "egret.Endian";
  4814. var b = function () {
  4815. function a() {
  4816. this.length = this.position = 0;
  4817. this._mode = "";
  4818. this.maxlength = 0;
  4819. this._endian = d.LITTLE_ENDIAN;
  4820. this.isLittleEndian = !1;
  4821. this._mode = "Typed array";
  4822. this.maxlength = 4;
  4823. this.arraybytes = new ArrayBuffer(this.maxlength);
  4824. this.unalignedarraybytestemp = new ArrayBuffer(16);
  4825. this.endian = a.DEFAULT_ENDIAN
  4826. }
  4827. Object.defineProperty(a.prototype,
  4828. "endian", {
  4829. get: function () {
  4830. return this._endian
  4831. }, set: function (a) {
  4832. this._endian = a;
  4833. this.isLittleEndian = a == d.LITTLE_ENDIAN
  4834. }, enumerable: !0,
  4835. configurable: !0
  4836. });
  4837. a.prototype.ensureWriteableSpace = function (a) {
  4838. this.ensureSpace(a + this.position)
  4839. };
  4840. a.prototype.setArrayBuffer = function (a) {
  4841. this.ensureSpace(a.byteLength);
  4842. this.length = a.byteLength;
  4843. a = new Int8Array(a);
  4844. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  4845. this.position = 0
  4846. };
  4847. Object.defineProperty(a.prototype, "bytesAvailable", {
  4848. get: function () {
  4849. return this.length - this.position
  4850. },
  4851. enumerable: !0,
  4852. configurable: !0
  4853. });
  4854. a.prototype.ensureSpace = function (a) {
  4855. if (a > this.maxlength) {
  4856. a = a + 255 & -256;
  4857. var b = new ArrayBuffer(a),
  4858. c = new Uint8Array(this.arraybytes, 0, this.length);
  4859. (new Uint8Array(b, 0, this.length)).set(c);
  4860. this.arraybytes = b;
  4861. this.maxlength = a
  4862. }
  4863. };
  4864. a.prototype.writeByte = function (a) {
  4865. this.ensureWriteableSpace(1);
  4866. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  4867. this.position > this.length && (this.length = this.position)
  4868. };
  4869. a.prototype.readByte = function () {
  4870. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  4871. this.position + ", Length=" + this.length;
  4872. return (new Int8Array(this.arraybytes))[this.position++]
  4873. };
  4874. a.prototype.readBytes = function (a, b, c) {
  4875. void 0 === b && (b = 0);
  4876. void 0 === c && (c = 0);
  4877. null == c && (c = a.length);
  4878. a.ensureWriteableSpace(b + c);
  4879. var d = new Int8Array(a.arraybytes),
  4880. g = new Int8Array(this.arraybytes);
  4881. d.set(g.subarray(this.position, this.position + c), b);
  4882. this.position += c;
  4883. c + b > a.length && (a.length += c + b - a.length)
  4884. };
  4885. a.prototype.writeUnsignedByte = function (a) {
  4886. this.ensureWriteableSpace(1);
  4887. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  4888. this.position > this.length && (this.length = this.position)
  4889. };
  4890. a.prototype.readUnsignedByte = function () {
  4891. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  4892. return (new Uint8Array(this.arraybytes))[this.position++]
  4893. };
  4894. a.prototype.writeUnsignedShort = function (a) {
  4895. this.ensureWriteableSpace(2);
  4896. if (0 == (this.position & 1)) {
  4897. var b = new Uint16Array(this.arraybytes);
  4898. b[this.position >> 1] = ~~a & 65535
  4899. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  4900. this.position += 2;
  4901. this.position > this.length && (this.length = this.position)
  4902. };
  4903. a.prototype.readUTFBytes = function (a) {
  4904. var b = "";
  4905. a = this.position + a;
  4906. for (var c = new DataView(this.arraybytes); this.position < a;) {
  4907. var d = c.getUint8(this.position++);
  4908. if (128 > d) {
  4909. if (0 == d) break;
  4910. b += String.fromCharCode(d)
  4911. } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | c.getUint8(this.position++) & 127);
  4912. else if (240 > d) var g = c.getUint8(this.position++),
  4913. b = b + String.fromCharCode((d & 31) << 12 | (g & 127) << 6 | c.getUint8(this.position++) & 127);
  4914. else var g = c.getUint8(this.position++),
  4915. f = c.getUint8(this.position++),
  4916. b = b + String.fromCharCode((d & 15) << 18 | (g & 127) << 12 | f << 6 & 127 | c.getUint8(this.position++) & 127)
  4917. }
  4918. return b
  4919. };
  4920. a.prototype.readInt = function () {
  4921. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  4922. this.position += 4;
  4923. return a
  4924. };
  4925. a.prototype.readShort = function () {
  4926. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  4927. this.position += 2;
  4928. return a
  4929. };
  4930. a.prototype.readDouble = function () {
  4931. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  4932. this.position += 8;
  4933. return a
  4934. };
  4935. a.prototype.readUnsignedShort = function () {
  4936. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4937. if (0 == (this.position & 1)) {
  4938. var a = new Uint16Array(this.arraybytes),
  4939. b = this.position >> 1;
  4940. this.position += 2;
  4941. return a[b]
  4942. }
  4943. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  4944. b = new Uint8Array(this.arraybytes,
  4945. this.position, 2);
  4946. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  4947. this.position += 2;
  4948. return a[0]
  4949. };
  4950. a.prototype.writeUnsignedInt = function (a) {
  4951. this.ensureWriteableSpace(4);
  4952. if (0 == (this.position & 3)) {
  4953. var b = new Uint32Array(this.arraybytes);
  4954. b[this.position >> 2] = ~~a & 4294967295
  4955. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  4956. this.position += 4;
  4957. this.position > this.length &&
  4958. (this.length = this.position)
  4959. };
  4960. a.prototype.readUnsignedInt = function () {
  4961. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4962. if (0 == (this.position & 3)) {
  4963. var a = new Uint32Array(this.arraybytes),
  4964. b = this.position >> 2;
  4965. this.position += 4;
  4966. return a[b]
  4967. }
  4968. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  4969. b = new Uint8Array(this.arraybytes, this.position, 4);
  4970. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  4971. this.position += 4;
  4972. return a[0]
  4973. };
  4974. a.prototype.writeFloat =
  4975. function (a) {
  4976. this.ensureWriteableSpace(4);
  4977. if (0 == (this.position & 3)) {
  4978. var b = new Float32Array(this.arraybytes);
  4979. b[this.position >> 2] = a
  4980. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  4981. this.position += 4;
  4982. this.position > this.length && (this.length = this.position)
  4983. };
  4984. a.prototype.readFloat = function () {
  4985. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  4986. this.length;
  4987. if (0 == (this.position & 3)) {
  4988. var a = new Float32Array(this.arraybytes),
  4989. b = this.position >> 2;
  4990. this.position += 4;
  4991. return a[b]
  4992. }
  4993. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  4994. b = new Uint8Array(this.arraybytes, this.position, 4);
  4995. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  4996. this.position += 4;
  4997. return a[0]
  4998. };
  4999. a.DEFAULT_ENDIAN = d.BIG_ENDIAN;
  5000. return a
  5001. }();
  5002. c.ByteArray = b;
  5003. b.prototype.__class__ = "egret.ByteArray"
  5004. })(egret || (egret = {}));
  5005. __extends = this.__extends || function (c, d) {
  5006. function b() {
  5007. this.constructor = c
  5008. }
  5009. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  5010. b.prototype = d.prototype;
  5011. c.prototype = new b
  5012. };
  5013. (function (c) {
  5014. var d = function (b) {
  5015. function a(a, c, d) {
  5016. b.call(this);
  5017. this._target = null;
  5018. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5019. this._actions = this._steps = this.pluginData = null;
  5020. this.paused = !1;
  5021. this.duration = 0;
  5022. this._prevPos = -1;
  5023. this.position = null;
  5024. this._stepPosition = this._prevPosition = 0;
  5025. this.passive = !1;
  5026. this.initialize(a, c, d)
  5027. }
  5028. __extends(a, b);
  5029. a.get = function (e, b, c, d) {
  5030. void 0 === b && (b = null);
  5031. void 0 === c && (c = null);
  5032. void 0 === d && (d = !1);
  5033. d && a.removeTweens(e);
  5034. return new a(e, b, c)
  5035. };
  5036. a.removeTweens = function (e) {
  5037. if (e.tween_count) {
  5038. for (var b =
  5039. a._tweens, c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
  5040. e.tween_count = 0
  5041. }
  5042. };
  5043. a.pauseTweens = function (a) {
  5044. if (a.tween_count)
  5045. for (var b = c.Tween._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !0)
  5046. };
  5047. a.resumeTweens = function (a) {
  5048. if (a.tween_count)
  5049. for (var b = c.Tween._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !1)
  5050. };
  5051. a.tick = function (e, b) {
  5052. void 0 === b && (b = !1);
  5053. for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  5054. var g = c[d];
  5055. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
  5056. 1 : e)
  5057. }
  5058. };
  5059. a._register = function (e, b) {
  5060. var d = e._target,
  5061. h = a._tweens;
  5062. if (b) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), h.push(e), a._inited || (c.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5063. else
  5064. for (d && d.tween_count--, d = h.length; d--;)
  5065. if (h[d] == e) {
  5066. h.splice(d, 1);
  5067. break
  5068. }
  5069. };
  5070. a.removeAllTweens = function () {
  5071. for (var e = a._tweens, b = 0, c = e.length; b < c; b++) {
  5072. var d = e[b];
  5073. d.paused = !0;
  5074. d._target.tweenjs_count = 0
  5075. }
  5076. e.length = 0
  5077. };
  5078. a.prototype.initialize = function (e, b, c) {
  5079. this._target = e;
  5080. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  5081. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
  5082. this.pluginData = c || {};
  5083. this._curQueueProps = {};
  5084. this._initQueueProps = {};
  5085. this._steps = [];
  5086. this._actions = [];
  5087. b && b.paused ? this.paused = !0 : a._register(this, !0);
  5088. b && null != b.position && this.setPosition(b.position, a.NONE)
  5089. };
  5090. a.prototype.setPosition = function (a, b) {
  5091. void 0 === b && (b = 1);
  5092. 0 > a && (a = 0);
  5093. var c = a,
  5094. d = !1;
  5095. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  5096. if (c == this._prevPos) return d;
  5097. var g = this._prevPos;
  5098. this.position = this._prevPos = c;
  5099. this._prevPosition = a;
  5100. if (this._target)
  5101. if (d) this._updateTargetProps(null, 1);
  5102. else if (0 < this._steps.length) {
  5103. for (var f = 0, k = this._steps.length; f < k && !(this._steps[f].t > c); f++);
  5104. f = this._steps[f - 1];
  5105. this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
  5106. }
  5107. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, c, !0)) : this._runActions(g, c));
  5108. d && this.setPaused(!0);
  5109. this.dispatchEventWith("change");
  5110. return d
  5111. };
  5112. a.prototype._runActions = function (a, b, c) {
  5113. void 0 === c && (c = !1);
  5114. var d = a,
  5115. g = b,
  5116. f = -1,
  5117. k = this._actions.length,
  5118. m = 1;
  5119. a > b && (d = b, g = a, f = k, k = m = -1);
  5120. for (;
  5121. (f += m) != k;) {
  5122. b = this._actions[f];
  5123. var n = b.t;
  5124. (n == g || n > d && n < g || c && n == a) && b.f.apply(b.o, b.p)
  5125. }
  5126. };
  5127. a.prototype._updateTargetProps = function (b, c) {
  5128. var d, h, g, f;
  5129. if (b || 1 != c) {
  5130. if (this.passive = !!b.v) return;
  5131. b.e && (c = b.e(c, 0, 1, 1));
  5132. d = b.p0;
  5133. h = b.p1
  5134. } else this.passive = !1, d = h = this._curQueueProps;
  5135. for (var k in this._initQueueProps) {
  5136. null == (g = d[k]) && (d[k] = g = this._initQueueProps[k]);
  5137. null ==
  5138. (f = h[k]) && (h[k] = f = g);
  5139. g = g == f || 0 == c || 1 == c || "number" != typeof g ? 1 == c ? f : g : g + (f - g) * c;
  5140. var m = !1;
  5141. if (f = a._plugins[k])
  5142. for (var n = 0, p = f.length; n < p; n++) {
  5143. var r = f[n].tween(this, k, g, d, h, c, !!b && d == h, !b);
  5144. r == a.IGNORE ? m = !0 : g = r
  5145. }
  5146. m || (this._target[k] = g)
  5147. }
  5148. };
  5149. a.prototype.setPaused = function (b) {
  5150. this.paused = b;
  5151. a._register(this, !b);
  5152. return this
  5153. };
  5154. a.prototype._cloneProps = function (a) {
  5155. var b = {},
  5156. c;
  5157. for (c in a) b[c] = a[c];
  5158. return b
  5159. };
  5160. a.prototype._addStep = function (a) {
  5161. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5162. return this
  5163. };
  5164. a.prototype._appendQueueProps = function (b) {
  5165. var c, d, h, g, f, k;
  5166. for (k in b)
  5167. if (void 0 === this._initQueueProps[k]) {
  5168. d = this._target[k];
  5169. if (c = a._plugins[k])
  5170. for (h = 0, g = c.length; h < g; h++) d = c[h].init(this, k, d);
  5171. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  5172. }
  5173. for (k in b) {
  5174. d = this._curQueueProps[k];
  5175. if (c = a._plugins[k])
  5176. for (f = f || {}, h = 0, g = c.length; h < g; h++) c[h].step && c[h].step(this, k, d, b[k], f);
  5177. this._curQueueProps[k] = b[k]
  5178. }
  5179. f && this._appendQueueProps(f);
  5180. return this._curQueueProps
  5181. };
  5182. a.prototype._addAction = function (a) {
  5183. a.t =
  5184. this.duration;
  5185. this._actions.push(a);
  5186. return this
  5187. };
  5188. a.prototype._set = function (a, b) {
  5189. for (var c in a) b[c] = a[c]
  5190. };
  5191. a.prototype.wait = function (a, b) {
  5192. if (null == a || 0 >= a) return this;
  5193. var c = this._cloneProps(this._curQueueProps);
  5194. return this._addStep({
  5195. d: a,
  5196. p0: c,
  5197. p1: c,
  5198. v: b
  5199. })
  5200. };
  5201. a.prototype.to = function (a, b, c) {
  5202. void 0 === c && (c = void 0);
  5203. if (isNaN(b) || 0 > b) b = 0;
  5204. return this._addStep({
  5205. d: b || 0,
  5206. p0: this._cloneProps(this._curQueueProps),
  5207. e: c,
  5208. p1: this._cloneProps(this._appendQueueProps(a))
  5209. })
  5210. };
  5211. a.prototype.call = function (a, b, c) {
  5212. void 0 === b && (b = void 0);
  5213. void 0 === c && (c = void 0);
  5214. return this._addAction({
  5215. f: a,
  5216. p: c ? c : [],
  5217. o: b ? b : this._target
  5218. })
  5219. };
  5220. a.prototype.set = function (a, b) {
  5221. void 0 === b && (b = null);
  5222. return this._addAction({
  5223. f: this._set,
  5224. o: this,
  5225. p: [a, b ? b : this._target]
  5226. })
  5227. };
  5228. a.prototype.play = function (a) {
  5229. a || (a = this);
  5230. return this.call(a.setPaused, a, [!1])
  5231. };
  5232. a.prototype.pause = function (a) {
  5233. a || (a = this);
  5234. return this.call(a.setPaused, a, [!0])
  5235. };
  5236. a.prototype.tick = function (a) {
  5237. this.paused || this.setPosition(this._prevPosition + a)
  5238. };
  5239. a.NONE = 0;
  5240. a.LOOP = 1;
  5241. a.REVERSE = 2;
  5242. a._tweens = [];
  5243. a.IGNORE = {};
  5244. a._plugins = {};
  5245. a._inited = !1;
  5246. return a
  5247. }(c.EventDispatcher);
  5248. c.Tween = d;
  5249. d.prototype.__class__ = "egret.Tween"
  5250. })(egret || (egret = {}));