game-min.js 391 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047
  1. var egret;
  2. var aperture; (function(b) { (function(b) {
  3. var g = function() {
  4. function b() {}
  5. b.encode = function(a) {
  6. for (var f = new Uint8Array(3 * a.length), c = 0, d = 0; d < a.length; d++) for (var e = a.charCodeAt(d), e = 127 >= e ? [e] : 2047 >= e ? [192 | e >> 6, 128 | e & 63] : [224 | e >> 12, 128 | (e & 4032) >> 6, 128 | e & 63], b = 0; b < e.length; b++) f[c] = e[b],
  7. ++c;
  8. a = [];
  9. for (d = 0; d < f.length; d++) a.push(f[d]);
  10. for (d = a.length - 1; 0 < d; d--) 0 == a[d] && a.splice(d, 1);
  11. return a
  12. };
  13. b.decode = function(a) {
  14. for (var b = a.length - 1; 0 < b; b--) 0 == a[b] && a.splice(b, 1);
  15. a = new Uint8Array(a);
  16. for (var b = [], c = 0, d = 0, e = a.length; c < e;) 128 > a[c] ? (d = a[c], c += 1) : 224 > a[c] ? (d = ((a[c] & 63) << 6) + (a[c + 1] & 63), c += 2) : (d = ((a[c] & 15) << 12) + ((a[c + 1] & 63) << 6) + (a[c + 2] & 63), c += 3),
  17. b.push(d);
  18. a = String.fromCharCode.apply(null, b);
  19. a.replace(" ", "");
  20. return a
  21. };
  22. return b
  23. } ();
  24. b.SimpleEncode = g;
  25. g.prototype.__class__ = "aperture.encrypt.SimpleEncode"
  26. })(b.encrypt || (b.encrypt = {}))
  27. })(aperture || (aperture = {}));
  28. (function(b) {
  29. b.egret_string_code = {};
  30. b.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  31. b.egret_string_code[1E3] = "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";
  32. b.egret_string_code[1001] = "\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";
  33. b.egret_string_code[1002] = "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
  34. b.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  35. b.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  36. b.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  37. b.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  38. b.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  39. b.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  40. b.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  41. b.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  42. b.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  43. b.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  44. b.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  45. b.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  46. b.egret_string_code[1015] = "xml not found!";
  47. b.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  48. b.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  49. b.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  50. b.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  51. b.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  52. b.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  53. b.egret_string_code[1022] = "{0} ArgumentError";
  54. b.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  55. b.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  56. b.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  57. b.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
  58. b.egret_string_code[1027] = "DecodingError";
  59. b.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\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";
  60. b.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  61. b.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  62. b.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  63. b.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  64. b.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  65. b.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  66. b.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  67. b.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  68. b.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  69. b.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  70. b.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  71. b.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  72. b.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  73. b.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  74. b.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  75. b.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  76. b.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  77. b.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
  78. b.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  79. b.egret_string_code[4001] = "Abstract class can not be instantiated!";
  80. b.egret_string_code[4002] = "Unnamed data!";
  81. b.egret_string_code[4003] = "Nonsupport version!";
  82. b.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  83. b.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  84. b.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
  85. })(egret || (egret = {})); (function(b) {
  86. function d(a) {
  87. for (var e = [], m = 1; m < arguments.length; m++) e[m - 1] = arguments[m];
  88. if (m = b.egret_string_code[a]) for (var k = e.length,
  89. h = 0; h < k; h++) m = m.replace("{" + h + "}", e[h]);
  90. return m
  91. }
  92. var c = function() {
  93. function a() {}
  94. a.fatal = function(e, a) {
  95. void 0 === a && (a = null);
  96. b.Logger.traceToConsole("Fatal", e, a);
  97. throw Error(b.Logger.getTraceCode("Fatal", e, a));
  98. };
  99. a.info = function(e, a) {
  100. void 0 === a && (a = null);
  101. b.Logger.traceToConsole("Info", e, a)
  102. };
  103. a.warning = function(e, a) {
  104. void 0 === a && (a = null);
  105. b.Logger.traceToConsole("Warning", e, a)
  106. };
  107. a.fatalWithErrorId = function(e) {
  108. for (var m = [], b = 1; b < arguments.length; b++) m[b - 1] = arguments[b];
  109. m.unshift(e); (m = d.apply(null, m)) ? a.fatal(m) : a.warning(d( - 1, e))
  110. };
  111. a.infoWithErrorId = function(e) {
  112. for (var m = [], b = 1; b < arguments.length; b++) m[b - 1] = arguments[b];
  113. m.unshift(e); (m = d.apply(null, m)) ? a.info(m) : a.warning(d( - 1, e))
  114. };
  115. a.warningWithErrorId = function(e) {
  116. for (var m = [], b = 1; b < arguments.length; b++) m[b - 1] = arguments[b];
  117. m.unshift(e); (m = d.apply(null, m)) ? a.warning(m) : a.warning(d( - 1, e))
  118. };
  119. a.traceToConsole = function(e, a, k) {
  120. console.log(b.Logger.getTraceCode(e, a, k))
  121. };
  122. a.getTraceCode = function(e, a, b) {
  123. return "[" + e + "]" + a + (null == b ? "": ":" + b)
  124. };
  125. return a
  126. } ();
  127. b.Logger = c;
  128. c.prototype.__class__ = "egret.Logger";
  129. b.getString = d
  130. })(egret || (egret = {})); (function(b) {
  131. var d = function() {
  132. function b() {
  133. this._hashCode = b.hashCount++
  134. }
  135. Object.defineProperty(b.prototype, "hashCode", {
  136. get: function() {
  137. return this._hashCode
  138. },
  139. enumerable: !0,
  140. configurable: !0
  141. });
  142. b.hashCount = 1;
  143. return b
  144. } ();
  145. b.HashObject = d;
  146. d.prototype.__class__ = "egret.HashObject"
  147. })(egret || (egret = {}));
  148. var __extends = this.__extends ||
  149. function(b, d) {
  150. function c() {
  151. this.constructor = b
  152. }
  153. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  154. c.prototype = d.prototype;
  155. b.prototype = new c
  156. }; (function(b) {
  157. var d = function(b) {
  158. function a(e) {
  159. void 0 === e && (e = 300);
  160. b.call(this);
  161. this.objectPool = [];
  162. this._length = 0;
  163. 1 > e && (e = 1);
  164. this.autoDisposeTime = e;
  165. this.frameCount = 0
  166. }
  167. __extends(a, b);
  168. a.prototype._checkFrame = function() {
  169. this.frameCount--;
  170. 0 >= this.frameCount && this.dispose()
  171. };
  172. Object.defineProperty(a.prototype, "length", {
  173. get: function() {
  174. return this._length
  175. },
  176. enumerable: !0,
  177. configurable: !0
  178. });
  179. a.prototype.push = function(e) {
  180. var m = this.objectPool; - 1 == m.indexOf(e) && (m.push(e), e.__recycle && e.__recycle(), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  181. };
  182. a.prototype.pop = function() {
  183. if (0 == this._length) return null;
  184. this._length--;
  185. return this.objectPool.pop()
  186. };
  187. a.prototype.dispose = function() {
  188. 0 < this._length && (this.objectPool = [], this._length = 0);
  189. this.frameCount = 0;
  190. var e = a._callBackList,
  191. m = e.indexOf(this); - 1 != m && e.splice(m, 1)
  192. };
  193. a._callBackList = [];
  194. return a
  195. } (b.HashObject);
  196. b.Recycler = d;
  197. d.prototype.__class__ = "egret.Recycler"
  198. })(egret || (egret = {})); (function(b) {
  199. b.__START_TIME;
  200. b.getTimer = function() {
  201. return Date.now() - b.__START_TIME
  202. }
  203. })(egret || (egret = {})); (function(b) {
  204. b.__callLaterFunctionList = [];
  205. b.__callLaterThisList = [];
  206. b.__callLaterArgsList = [];
  207. b.callLater = function(d, c) {
  208. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  209. b.__callLaterFunctionList.push(d);
  210. b.__callLaterThisList.push(c);
  211. b.__callLaterArgsList.push(a)
  212. };
  213. b.__callAsyncFunctionList = [];
  214. b.__callAsyncThisList = [];
  215. b.__callAsyncArgsList = [];
  216. b.__callAsync = function(d, c) {
  217. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  218. b.__callAsyncFunctionList.push(d);
  219. b.__callAsyncThisList.push(c);
  220. b.__callAsyncArgsList.push(a)
  221. }
  222. })(egret || (egret = {})); (function(b) {
  223. var d = function() {
  224. function c() {}
  225. c.prototype.call = function(a) {
  226. this.callback && this.callback.call(this.thisObject, a)
  227. };
  228. c.prototype.dispose = function() {
  229. this.thisObject = this.callback = null;
  230. c.__freeList.push(this)
  231. };
  232. c.push = function(a, e) {
  233. var m;
  234. m = c.__freeList.length ? c.__freeList.pop() : new b.RenderCommand;
  235. m.callback = a;
  236. m.thisObject = e;
  237. b.MainContext.__DRAW_COMMAND_LIST.push(m)
  238. };
  239. c.__freeList = [];
  240. return c
  241. } ();
  242. b.RenderCommand = d;
  243. d.prototype.__class__ = "egret.RenderCommand"
  244. })(egret || (egret = {}));
  245. __extends = this.__extends ||
  246. function(b, d) {
  247. function c() {
  248. this.constructor = b
  249. }
  250. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  251. c.prototype = d.prototype;
  252. b.prototype = new c
  253. }; (function(b) {
  254. var d = function(c) {
  255. function a(e, a, b) {
  256. void 0 === a && (a = !1);
  257. void 0 === b && (b = !1);
  258. c.call(this);
  259. this.data = null;
  260. this._type = "";
  261. this._cancelable = this._bubbles = !1;
  262. this._eventPhase = 2;
  263. this._target = this._currentTarget = null;
  264. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  265. this.isNew = !0;
  266. this._type = e;
  267. this._bubbles = a;
  268. this._cancelable = b
  269. }
  270. __extends(a, c);
  271. Object.defineProperty(a.prototype, "type", {
  272. get: function() {
  273. return this._type
  274. },
  275. enumerable: !0,
  276. configurable: !0
  277. });
  278. Object.defineProperty(a.prototype, "bubbles", {
  279. get: function() {
  280. return this._bubbles
  281. },
  282. enumerable: !0,
  283. configurable: !0
  284. });
  285. Object.defineProperty(a.prototype, "cancelable", {
  286. get: function() {
  287. return this._cancelable
  288. },
  289. enumerable: !0,
  290. configurable: !0
  291. });
  292. Object.defineProperty(a.prototype, "eventPhase", {
  293. get: function() {
  294. return this._eventPhase
  295. },
  296. enumerable: !0,
  297. configurable: !0
  298. });
  299. Object.defineProperty(a.prototype, "currentTarget", {
  300. get: function() {
  301. return this._currentTarget
  302. },
  303. enumerable: !0,
  304. configurable: !0
  305. });
  306. Object.defineProperty(a.prototype, "target", {
  307. get: function() {
  308. return this._target
  309. },
  310. enumerable: !0,
  311. configurable: !0
  312. });
  313. a.prototype.isDefaultPrevented = function() {
  314. return this._isDefaultPrevented
  315. };
  316. a.prototype.preventDefault = function() {
  317. this._cancelable && (this._isDefaultPrevented = !0)
  318. };
  319. a.prototype.stopPropagation = function() {
  320. this._bubbles && (this._isPropagationStopped = !0)
  321. };
  322. a.prototype.stopImmediatePropagation = function() {
  323. this._bubbles && (this._isPropagationImmediateStopped = !0)
  324. };
  325. a.prototype._reset = function() {
  326. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  327. };
  328. a.prototype.__recycle = function() {
  329. this.data = this._target = this._currentTarget = null
  330. };
  331. a._dispatchByTarget = function(e, a, k, h, c, d) {
  332. void 0 === c && (c = !1);
  333. void 0 === d && (d = !1);
  334. var l = e.eventRecycler;
  335. l || (l = e.eventRecycler = new b.Recycler);
  336. var n = l.pop();
  337. n ? n._type = k: n = new e(k);
  338. n._bubbles = c;
  339. n._cancelable = d;
  340. if (h) for (var p in h) n[p] = h[p],
  341. null !== n[p] && (h[p] = null);
  342. e = a.dispatchEvent(n);
  343. l.push(n);
  344. return e
  345. };
  346. a._getPropertyData = function(e) {
  347. var a = e._props;
  348. a || (a = e._props = {});
  349. return a
  350. };
  351. a.dispatchEvent = function(e, m, b, h) {
  352. void 0 === b && (b = !1);
  353. var c = a._getPropertyData(a);
  354. h && (c.data = h);
  355. a._dispatchByTarget(a, e, m, c, b)
  356. };
  357. a.ADDED_TO_STAGE = "addedToStage";
  358. a.REMOVED_FROM_STAGE = "removedFromStage";
  359. a.ADDED = "added";
  360. a.REMOVED = "removed";
  361. a.COMPLETE = "complete";
  362. a.LOOP_COMPLETE = "loopcomplete";
  363. a.ENTER_FRAME = "enterFrame";
  364. a.RENDER = "render";
  365. a.FINISH_RENDER = "finishRender";
  366. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  367. a.LEAVE_STAGE = "leaveStage";
  368. a.RESIZE = "resize";
  369. a.CHANGE = "change";
  370. a.ACTIVATE = "activate";
  371. a.DEACTIVATE = "deactivate";
  372. a.CLOSE = "close";
  373. a.CONNECT = "connect";
  374. return a
  375. } (b.HashObject);
  376. b.Event = d;
  377. d.prototype.__class__ = "egret.Event"
  378. })(egret || (egret = {}));
  379. __extends = this.__extends ||
  380. function(b, d) {
  381. function c() {
  382. this.constructor = b
  383. }
  384. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  385. c.prototype = d.prototype;
  386. b.prototype = new c
  387. }; (function(b) {
  388. var d = function(b) {
  389. function a(e, a, k) {
  390. void 0 === a && (a = !1);
  391. void 0 === k && (k = !1);
  392. b.call(this, e, a, k);
  393. this._status = 0
  394. }
  395. __extends(a, b);
  396. Object.defineProperty(a.prototype, "status", {
  397. get: function() {
  398. return this._status
  399. },
  400. enumerable: !0,
  401. configurable: !0
  402. });
  403. a.dispatchHTTPStatusEvent = function(e, m) {
  404. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  405. a.httpStatusEvent._status = m;
  406. e.dispatchEvent(a.httpStatusEvent)
  407. };
  408. a.HTTP_STATUS = "httpStatus";
  409. a.httpStatusEvent = null;
  410. return a
  411. } (b.Event);
  412. b.HTTPStatusEvent = d;
  413. d.prototype.__class__ = "egret.HTTPStatusEvent"
  414. })(egret || (egret = {}));
  415. __extends = this.__extends ||
  416. function(b, d) {
  417. function c() {
  418. this.constructor = b
  419. }
  420. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  421. c.prototype = d.prototype;
  422. b.prototype = new c
  423. }; (function(b) {
  424. var d = function(c) {
  425. function a(e, a, b) {
  426. void 0 === a && (a = !1);
  427. void 0 === b && (b = !1);
  428. c.call(this, e, a, b)
  429. }
  430. __extends(a, c);
  431. a.dispatchIOErrorEvent = function(e) {
  432. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  433. };
  434. a.IO_ERROR = "ioError";
  435. return a
  436. } (b.Event);
  437. b.IOErrorEvent = d;
  438. d.prototype.__class__ = "egret.IOErrorEvent"
  439. })(egret || (egret = {}));
  440. __extends = this.__extends ||
  441. function(b, d) {
  442. function c() {
  443. this.constructor = b
  444. }
  445. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  446. c.prototype = d.prototype;
  447. b.prototype = new c
  448. }; (function(b) {
  449. var d = function(c) {
  450. function a(e, a, b, h, d, f, l, n, p, q) {
  451. void 0 === a && (a = !0);
  452. void 0 === b && (b = !0);
  453. void 0 === h && (h = 0);
  454. void 0 === d && (d = 0);
  455. void 0 === f && (f = 0);
  456. void 0 === l && (l = !1);
  457. void 0 === n && (n = !1);
  458. void 0 === q && (q = !1);
  459. c.call(this, e, a, b);
  460. this._stageY = this._stageX = 0;
  461. this.touchPointID = NaN;
  462. this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
  463. this.touchPointID = h;
  464. this._stageX = d;
  465. this._stageY = f;
  466. this.ctrlKey = l;
  467. this.altKey = n;
  468. this.touchDown = q
  469. }
  470. __extends(a, c);
  471. Object.defineProperty(a.prototype, "stageX", {
  472. get: function() {
  473. return this._stageX
  474. },
  475. enumerable: !0,
  476. configurable: !0
  477. });
  478. Object.defineProperty(a.prototype, "stageY", {
  479. get: function() {
  480. return this._stageY
  481. },
  482. enumerable: !0,
  483. configurable: !0
  484. });
  485. Object.defineProperty(a.prototype, "localX", {
  486. get: function() {
  487. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  488. },
  489. enumerable: !0,
  490. configurable: !0
  491. });
  492. Object.defineProperty(a.prototype, "localY", {
  493. get: function() {
  494. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  495. },
  496. enumerable: !0,
  497. configurable: !0
  498. });
  499. a.dispatchTouchEvent = function(e, m, k, h, c, d, l, n, p) {
  500. void 0 === k && (k = 0);
  501. void 0 === h && (h = 0);
  502. void 0 === c && (c = 0);
  503. void 0 === d && (d = !1);
  504. void 0 === l && (l = !1);
  505. void 0 === n && (n = !1);
  506. void 0 === p && (p = !1);
  507. var q = b.Event._getPropertyData(a);
  508. q.touchPointID = k;
  509. q._stageX = h;
  510. q._stageY = c;
  511. q.ctrlKey = d;
  512. q.altKey = l;
  513. q.shiftKey = n;
  514. q.touchDown = p;
  515. b.Event._dispatchByTarget(a, e, m, q, !0, !0)
  516. };
  517. a.TOUCH_TAP = "touchTap";
  518. a.TOUCH_MOVE = "touchMove";
  519. a.TOUCH_BEGIN = "touchBegin";
  520. a.TOUCH_END = "touchEnd";
  521. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  522. a.TOUCH_ROLL_OUT = "touchRollOut";
  523. a.TOUCH_ROLL_OVER = "touchRollOver";
  524. a.TOUCH_OUT = "touchOut";
  525. a.TOUCH_OVER = "touchOver";
  526. return a
  527. } (b.Event);
  528. b.TouchEvent = d;
  529. d.prototype.__class__ = "egret.TouchEvent"
  530. })(egret || (egret = {}));
  531. __extends = this.__extends ||
  532. function(b, d) {
  533. function c() {
  534. this.constructor = b
  535. }
  536. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  537. c.prototype = d.prototype;
  538. b.prototype = new c
  539. }; (function(b) {
  540. var d = function(c) {
  541. function a(e, a, b) {
  542. void 0 === a && (a = !1);
  543. void 0 === b && (b = !1);
  544. c.call(this, e, a, b)
  545. }
  546. __extends(a, c);
  547. a.dispatchTimerEvent = function(e, m) {
  548. b.Event._dispatchByTarget(a, e, m)
  549. };
  550. a.TIMER = "timer";
  551. a.TIMER_COMPLETE = "timerComplete";
  552. return a
  553. } (b.Event);
  554. b.TimerEvent = d;
  555. d.prototype.__class__ = "egret.TimerEvent"
  556. })(egret || (egret = {}));
  557. __extends = this.__extends ||
  558. function(b, d) {
  559. function c() {
  560. this.constructor = b
  561. }
  562. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  563. c.prototype = d.prototype;
  564. b.prototype = new c
  565. }; (function(b) {
  566. var d = function(c) {
  567. function a(e, a, b, h) {
  568. void 0 === a && (a = !1);
  569. void 0 === b && (b = !1);
  570. void 0 === h && (h = "");
  571. c.call(this, e, a, b);
  572. this.text = h
  573. }
  574. __extends(a, c);
  575. a.dispatchTextEvent = function(e, m, k) {
  576. var h = b.Event._getPropertyData(a);
  577. h.text = k;
  578. b.Event._dispatchByTarget(a, e, m, h)
  579. };
  580. a.LINK = "link";
  581. return a
  582. } (b.Event);
  583. b.TextEvent = d;
  584. d.prototype.__class__ = "egret.TextEvent"
  585. })(egret || (egret = {}));
  586. __extends = this.__extends ||
  587. function(b, d) {
  588. function c() {
  589. this.constructor = b
  590. }
  591. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  592. c.prototype = d.prototype;
  593. b.prototype = new c
  594. }; (function(b) {
  595. var d = function(c) {
  596. function a(e, a, b, h, d) {
  597. void 0 === a && (a = !1);
  598. void 0 === b && (b = !1);
  599. void 0 === h && (h = 0);
  600. void 0 === d && (d = 0);
  601. c.call(this, e, a, b);
  602. this.bytesTotal = this.bytesLoaded = 0;
  603. this.bytesLoaded = h;
  604. this.bytesTotal = d
  605. }
  606. __extends(a, c);
  607. a.dispatchProgressEvent = function(e, m, k, h) {
  608. void 0 === k && (k = 0);
  609. void 0 === h && (h = 0);
  610. b.Event._dispatchByTarget(a, e, m, {
  611. bytesLoaded: k,
  612. bytesTotal: h
  613. })
  614. };
  615. a.PROGRESS = "progress";
  616. a.SOCKET_DATA = "socketData";
  617. return a
  618. } (b.Event);
  619. b.ProgressEvent = d;
  620. d.prototype.__class__ = "egret.ProgressEvent"
  621. })(egret || (egret = {})); (function(b) {
  622. var d = function() {
  623. function b() {}
  624. b.CAPTURING_PHASE = 1;
  625. b.AT_TARGET = 2;
  626. b.BUBBLING_PHASE = 3;
  627. return b
  628. } ();
  629. b.EventPhase = d;
  630. d.prototype.__class__ = "egret.EventPhase"
  631. })(egret || (egret = {}));
  632. __extends = this.__extends ||
  633. function(b, d) {
  634. function c() {
  635. this.constructor = b
  636. }
  637. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  638. c.prototype = d.prototype;
  639. b.prototype = new c
  640. }; (function(b) {
  641. var d = function(c) {
  642. function a(e) {
  643. void 0 === e && (e = null);
  644. c.call(this);
  645. this._captureEventsMap = this._eventsMap = this._eventTarget = null;
  646. this._eventTarget = e ? e: this
  647. }
  648. __extends(a, c);
  649. a.prototype.addEventListener = function(e, a, k, h, c) {
  650. void 0 === h && (h = !1);
  651. void 0 === c && (c = 0);
  652. "undefined" === typeof h && (h = !1);
  653. "undefined" === typeof c && (c = 0);
  654. a || b.Logger.fatalWithErrorId(1010);
  655. h ? (this._captureEventsMap || (this._captureEventsMap = {}), h = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), h = this._eventsMap);
  656. var d = h[e];
  657. d || (d = h[e] = []);
  658. this._insertEventBin(d, a, k, c)
  659. };
  660. a.prototype._insertEventBin = function(e, a, b, h, c) {
  661. void 0 === c && (c = void 0);
  662. for (var d = -1,
  663. l = e.length,
  664. n = 0; n < l; n++) {
  665. var p = e[n];
  666. if (p.listener === a && p.thisObject === b && p.display === c) return ! 1; - 1 == d && p.priority < h && (d = n)
  667. }
  668. a = {
  669. listener: a,
  670. thisObject: b,
  671. priority: h
  672. };
  673. c && (a.display = c); - 1 != d ? e.splice(d, 0, a) : e.push(a);
  674. return ! 0
  675. };
  676. a.prototype.removeEventListener = function(e, a, b, h) {
  677. void 0 === h && (h = !1);
  678. if (h = h ? this._captureEventsMap: this._eventsMap) {
  679. var c = h[e];
  680. c && (this._removeEventBin(c, a, b), 0 == c.length && delete h[e])
  681. }
  682. };
  683. a.prototype._removeEventBin = function(e, a, b, h, c) {
  684. void 0 === h && (h = void 0);
  685. void 0 === c && (c = 0);
  686. for (var d = e.length; c < d; c++) {
  687. var l = e[c];
  688. if (l.listener === a && l.thisObject === b && l.display == h) return e.splice(c, 1),
  689. !0
  690. }
  691. return ! 1
  692. };
  693. a.prototype.hasEventListener = function(e) {
  694. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  695. };
  696. a.prototype.willTrigger = function(e) {
  697. return this.hasEventListener(e)
  698. };
  699. a.prototype.dispatchEvent = function(e) {
  700. e._reset();
  701. e._target = this._eventTarget;
  702. e._currentTarget = this._eventTarget;
  703. return this._notifyListener(e)
  704. };
  705. a.prototype._notifyListener = function(e) {
  706. var a = 1 == e._eventPhase ? this._captureEventsMap: this._eventsMap;
  707. if (!a) return ! 0;
  708. a = a[e._type];
  709. if (!a) return ! 0;
  710. var b = a.length;
  711. if (0 == b) return ! 0;
  712. for (var a = a.concat(), c = 0; c < b; c++) {
  713. var d = a[c];
  714. d.listener.call(d.thisObject, e);
  715. if (e._isPropagationImmediateStopped) break
  716. }
  717. return ! e._isDefaultPrevented
  718. };
  719. a.prototype.dispatchEventWith = function(e, a, k) {
  720. void 0 === a && (a = !1);
  721. b.Event.dispatchEvent(this, e, a, k)
  722. };
  723. return a
  724. } (b.HashObject);
  725. b.EventDispatcher = d;
  726. d.prototype.__class__ = "egret.EventDispatcher"
  727. })(egret || (egret = {}));
  728. __extends = this.__extends ||
  729. function(b, d) {
  730. function c() {
  731. this.constructor = b
  732. }
  733. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  734. c.prototype = d.prototype;
  735. b.prototype = new c
  736. }; (function(b) {
  737. var d = function(c) {
  738. function a() {
  739. c.call(this);
  740. this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
  741. this.reuseEvent = new b.Event("")
  742. }
  743. __extends(a, c);
  744. a.prototype.run = function() {
  745. b.Ticker.getInstance().run();
  746. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  747. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  748. this.touchContext.run();
  749. this._profileInstance = b.Profiler.getInstance()
  750. };
  751. a.prototype.renderLoop = function(e) {
  752. if (0 < b.__callLaterFunctionList.length) {
  753. var m = b.__callLaterFunctionList;
  754. b.__callLaterFunctionList = [];
  755. var k = b.__callLaterThisList;
  756. b.__callLaterThisList = [];
  757. var c = b.__callLaterArgsList;
  758. b.__callLaterArgsList = []
  759. }
  760. e = this.stage;
  761. var d = a.cachedEvent;
  762. d._type = b.Event.RENDER;
  763. this.dispatchEvent(d);
  764. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  765. m && this.doCallLaterList(m, k, c);
  766. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  767. m = this.rendererContext;
  768. m.onRenderStart();
  769. m.clearScreen();
  770. a.__DRAW_COMMAND_LIST = [];
  771. a._renderLoopPhase = "updateTransform";
  772. e._updateTransform();
  773. a._renderLoopPhase = "draw";
  774. d._type = b.Event.FINISH_UPDATE_TRANSFORM;
  775. this.dispatchEvent(d);
  776. a.__use_new_draw ? this._draw(m) : e._draw(m);
  777. d._type = b.Event.FINISH_RENDER;
  778. this.dispatchEvent(d);
  779. this._profileInstance._isRunning && this._profileInstance._drawProfiler();
  780. m.onRenderFinish()
  781. };
  782. a.prototype._draw = function(e) {
  783. for (var m = a.__DRAW_COMMAND_LIST,
  784. b = m.length,
  785. c = 0; c < b; c++) {
  786. var d = m[c];
  787. d.call(e);
  788. d.dispose()
  789. }
  790. };
  791. a.prototype.broadcastEnterFrame = function(e) {
  792. e = this.reuseEvent;
  793. e._type = b.Event.ENTER_FRAME;
  794. this.dispatchEvent(e);
  795. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), k = a.length, c = 0; c < k; c++) {
  796. var d = a[c];
  797. e._target = d.display;
  798. e._currentTarget = d.display;
  799. d.listener.call(d.thisObject, e)
  800. }
  801. a = b.Recycler._callBackList;
  802. for (c = a.length - 1; 0 <= c; c--) a[c]._checkFrame()
  803. };
  804. a.prototype.broadcastRender = function() {
  805. var e = this.reuseEvent;
  806. e._type = b.Event.RENDER;
  807. for (var a = b.DisplayObject._renderCallBackList.concat(), k = a.length, c = 0; c < k; c++) {
  808. var d = a[c],
  809. f = d.display;
  810. e._target = f;
  811. e._currentTarget = f;
  812. d.listener.call(d.thisObject, e)
  813. }
  814. };
  815. a.prototype.doCallLaterList = function(e, a, b) {
  816. for (var c = e.length,
  817. d = 0; d < c; d++) {
  818. var f = e[d];
  819. null != f && f.apply(a[d], b[d])
  820. }
  821. };
  822. a.prototype.doCallAsyncList = function() {
  823. var e = b.__callAsyncFunctionList.concat(),
  824. a = b.__callAsyncThisList.concat(),
  825. k = b.__callAsyncArgsList.concat();
  826. b.__callAsyncFunctionList.length = 0;
  827. b.__callAsyncThisList.length = 0;
  828. for (var c = b.__callAsyncArgsList.length = 0; c < e.length; c++) {
  829. var d = e[c];
  830. null != d && d.apply(a[c], k[c])
  831. }
  832. };
  833. a.deviceType = null;
  834. a.DEVICE_PC = "web";
  835. a.DEVICE_MOBILE = "native";
  836. a.RUNTIME_HTML5 = "runtime_html5";
  837. a.RUNTIME_NATIVE = "runtime_native";
  838. a.__DRAW_COMMAND_LIST = [];
  839. a.__use_new_draw = !0;
  840. a.cachedEvent = new b.Event("");
  841. return a
  842. } (b.EventDispatcher);
  843. b.MainContext = d;
  844. d.prototype.__class__ = "egret.MainContext"
  845. })(egret || (egret = {}));
  846. var testDeviceType = function() {
  847. if (!this.navigator) return ! 0;
  848. var b = navigator.userAgent.toLowerCase();
  849. return - 1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  850. },
  851. testRuntimeType = function() {
  852. return this.navigator ? !0 : !1
  853. };
  854. egret.MainContext.instance = new egret.MainContext;
  855. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC;
  856. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5: egret.MainContext.RUNTIME_NATIVE;
  857. delete testDeviceType;
  858. delete testRuntimeType; (function(b) {
  859. var d = function() {
  860. function c() {
  861. this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  862. this._txt = null;
  863. this._tick = 0;
  864. this._maxDeltaTime = 500;
  865. this._totalDeltaTime = 0;
  866. this._isRunning = !1
  867. }
  868. c.getInstance = function() {
  869. null == c.instance && (c.instance = new c);
  870. return c.instance
  871. };
  872. c.prototype.stop = function() {
  873. if (this._isRunning) {
  874. this._isRunning = !1;
  875. b.Ticker.getInstance().unregister(this.update, this);
  876. var a = b.MainContext.instance;
  877. a.removeEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  878. a.removeEventListener(b.Event.RENDER, this.onStartRender, this);
  879. a.removeEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  880. a.removeEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  881. }
  882. };
  883. c.prototype.run = function() {
  884. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._parent = new b.DisplayObjectContainer);
  885. if (!this._isRunning) {
  886. this._isRunning = !0;
  887. b.Ticker.getInstance().register(this.update, this);
  888. var a = b.MainContext.instance;
  889. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  890. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  891. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  892. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  893. }
  894. };
  895. c.prototype._drawProfiler = function() {
  896. this._txt._updateTransform();
  897. this._txt._draw(b.MainContext.instance.rendererContext)
  898. };
  899. c.prototype._setTxtFontSize = function(a) {
  900. this._txt.size = a
  901. };
  902. c.prototype.onEnterFrame = function(a) {
  903. this._lastTime = b.getTimer()
  904. };
  905. c.prototype.onStartRender = function(a) {
  906. a = b.getTimer();
  907. this._logicPerformanceCost = a - this._lastTime;
  908. this._lastTime = a
  909. };
  910. c.prototype.onFinishUpdateTransform = function(a) {
  911. a = b.getTimer();
  912. this._updateTransformPerformanceCost = a - this._lastTime;
  913. this._lastTime = a
  914. };
  915. c.prototype.onFinishRender = function(a) {
  916. a = b.getTimer();
  917. this._renderPerformanceCost = a - this._lastTime;
  918. this._lastTime = a
  919. };
  920. c.prototype.update = function(a) {
  921. this._tick++;
  922. this._totalDeltaTime += a;
  923. if (this._totalDeltaTime >= this._maxDeltaTime) {
  924. a = (this._preDrawCount - 3).toString();
  925. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  926. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  927. this._tick = this._totalDeltaTime = 0
  928. }
  929. this._preDrawCount = 0
  930. };
  931. c.prototype.onDrawImage = function() {
  932. this._preDrawCount++
  933. };
  934. return c
  935. } ();
  936. b.Profiler = d;
  937. d.prototype.__class__ = "egret.Profiler"
  938. })(egret || (egret = {}));
  939. __extends = this.__extends ||
  940. function(b, d) {
  941. function c() {
  942. this.constructor = b
  943. }
  944. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  945. c.prototype = d.prototype;
  946. b.prototype = new c
  947. }; (function(b) {
  948. var d = function(c) {
  949. function a() {
  950. c.call(this);
  951. this._timeScale = 1;
  952. this._paused = !1;
  953. this._callIndex = -1;
  954. this.callBackList = [];
  955. null != a.instance && b.Logger.fatalWithErrorId(1002)
  956. }
  957. __extends(a, c);
  958. a.prototype.run = function() {
  959. b.__START_TIME = (new Date).getTime();
  960. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  961. };
  962. a.prototype.update = function(e) {
  963. if (!this._paused) {
  964. e *= this._timeScale;
  965. e *= this._timeScale;
  966. this._callList = this.callBackList.concat();
  967. for (this._callIndex = 0; this._callIndex < this._callList.length; this._callIndex++) {
  968. var a = this._callList[this._callIndex];
  969. a.listener.call(a.thisObject, e)
  970. }
  971. this._callIndex = -1;
  972. this._callList = null
  973. }
  974. };
  975. a.prototype.register = function(e, a, b) {
  976. void 0 === b && (b = 0);
  977. this._insertEventBin(this.callBackList, e, a, b)
  978. };
  979. a.prototype.unregister = function(e, a) {
  980. this._removeEventBin(this.callBackList, e, a);
  981. this._callList && -1 < this._callIndex && this._removeEventBin(this._callList, e, a, null, this._callIndex + 1)
  982. };
  983. a.prototype.setTimeout = function(e, a, k) {
  984. for (var c = [], d = 3; d < arguments.length; d++) c[d - 3] = arguments[d];
  985. b.Logger.warningWithErrorId(1003);
  986. b.setTimeout.apply(null, [e, a, k].concat(c))
  987. };
  988. a.prototype.setTimeScale = function(e) {
  989. this._timeScale = e
  990. };
  991. a.prototype.getTimeScale = function() {
  992. return this._timeScale
  993. };
  994. a.prototype.pause = function() {
  995. this._paused = !0
  996. };
  997. a.prototype.resume = function() {
  998. this._paused = !1
  999. };
  1000. a.getInstance = function() {
  1001. null == a.instance && (a.instance = new a);
  1002. return a.instance
  1003. };
  1004. return a
  1005. } (b.EventDispatcher);
  1006. b.Ticker = d;
  1007. d.prototype.__class__ = "egret.Ticker"
  1008. })(egret || (egret = {})); (function(b) {
  1009. var d = function() {
  1010. function b() {}
  1011. b.LEFT = "left";
  1012. b.RIGHT = "right";
  1013. b.CENTER = "center";
  1014. b.JUSTIFY = "justify";
  1015. b.CONTENT_JUSTIFY = "contentJustify";
  1016. return b
  1017. } ();
  1018. b.HorizontalAlign = d;
  1019. d.prototype.__class__ = "egret.HorizontalAlign"
  1020. })(egret || (egret = {})); (function(b) {
  1021. var d = function() {
  1022. function b() {}
  1023. b.TOP = "top";
  1024. b.BOTTOM = "bottom";
  1025. b.MIDDLE = "middle";
  1026. b.JUSTIFY = "justify";
  1027. b.CONTENT_JUSTIFY = "contentJustify";
  1028. return b
  1029. } ();
  1030. b.VerticalAlign = d;
  1031. d.prototype.__class__ = "egret.VerticalAlign"
  1032. })(egret || (egret = {}));
  1033. __extends = this.__extends ||
  1034. function(b, d) {
  1035. function c() {
  1036. this.constructor = b
  1037. }
  1038. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1039. c.prototype = d.prototype;
  1040. b.prototype = new c
  1041. }; (function(b) {
  1042. var d = function(c) {
  1043. function a(e, a) {
  1044. void 0 === a && (a = 0);
  1045. c.call(this);
  1046. this._currentCount = 0;
  1047. this._running = !1;
  1048. this.lastTime = 0;
  1049. this.delay = e;
  1050. this.repeatCount = a
  1051. }
  1052. __extends(a, c);
  1053. Object.defineProperty(a.prototype, "currentCount", {
  1054. get: function() {
  1055. return this._currentCount
  1056. },
  1057. enumerable: !0,
  1058. configurable: !0
  1059. });
  1060. Object.defineProperty(a.prototype, "running", {
  1061. get: function() {
  1062. return this._running
  1063. },
  1064. enumerable: !0,
  1065. configurable: !0
  1066. });
  1067. a.prototype.reset = function() {
  1068. this.stop();
  1069. this._currentCount = 0
  1070. };
  1071. a.prototype.start = function() {
  1072. this._running || (this.lastTime = b.getTimer(), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  1073. };
  1074. a.prototype.stop = function() {
  1075. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  1076. };
  1077. a.prototype.onEnterFrame = function(e) {
  1078. e = b.getTimer();
  1079. e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER_COMPLETE)))
  1080. };
  1081. return a
  1082. } (b.EventDispatcher);
  1083. b.Timer = d;
  1084. d.prototype.__class__ = "egret.Timer"
  1085. })(egret || (egret = {})); (function(b) {
  1086. function d(b) {
  1087. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1088. if (b.hasOwnProperty("__class__")) return b.__class__;
  1089. var a = b.constructor.toString(),
  1090. e = a.indexOf("("),
  1091. a = a.substring(9, e);
  1092. Object.defineProperty(b, "__class__", {
  1093. value: a,
  1094. enumerable: !1,
  1095. writable: !0
  1096. });
  1097. return a
  1098. }
  1099. b.getQualifiedClassName = d;
  1100. b.getQualifiedSuperclassName = function(b) {
  1101. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1102. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  1103. var a = Object.getPrototypeOf(b);
  1104. if (null == a) return null;
  1105. a = d(a.constructor);
  1106. if (!a) return null;
  1107. Object.defineProperty(b, "__superclass__", {
  1108. value: a,
  1109. enumerable: !1,
  1110. writable: !0
  1111. });
  1112. return a
  1113. }
  1114. })(egret || (egret = {})); (function(b) {
  1115. var d = {};
  1116. b.getDefinitionByName = function(b) {
  1117. if (!b) return null;
  1118. var a = d[b];
  1119. if (a) return a;
  1120. for (var e = b.split("."), m = e.length, a = __global, k = 0; k < m; k++) if (a = a[e[k]], !a) return null;
  1121. return d[b] = a
  1122. }
  1123. })(egret || (egret = {}));
  1124. var __global = __global || this; (function(b) {
  1125. function d(e) {
  1126. for (var a in c) {
  1127. var b = c[a];
  1128. b.delay -= e;
  1129. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete c[a])
  1130. }
  1131. }
  1132. var c = {},
  1133. a = 0;
  1134. b.setTimeout = function(e, m, k) {
  1135. for (var h = [], g = 3; g < arguments.length; g++) h[g - 3] = arguments[g];
  1136. h = {
  1137. listener: e,
  1138. thisObject: m,
  1139. delay: k,
  1140. params: h
  1141. };
  1142. 0 == a && b.Ticker.getInstance().register(d, null);
  1143. a++;
  1144. c[a] = h;
  1145. return a
  1146. };
  1147. b.clearTimeout = function(e) {
  1148. delete c[e]
  1149. }
  1150. })(egret || (egret = {})); (function(b) {
  1151. b.hasDefinition = function(d) {
  1152. return b.getDefinitionByName(d) ? !0 : !1
  1153. }
  1154. })(egret || (egret = {})); (function(b) {
  1155. b.toColorString = function(b) {
  1156. if (isNaN(b) || 0 > b) b = 0;
  1157. 16777215 < b && (b = 16777215);
  1158. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  1159. return "#" + b
  1160. }
  1161. })(egret || (egret = {}));
  1162. __extends = this.__extends ||
  1163. function(b, d) {
  1164. function c() {
  1165. this.constructor = b
  1166. }
  1167. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1168. c.prototype = d.prototype;
  1169. b.prototype = new c
  1170. }; (function(b) {
  1171. var d = function(c) {
  1172. function a(e, a, b, h, d, f) {
  1173. void 0 === e && (e = 1);
  1174. void 0 === a && (a = 0);
  1175. void 0 === b && (b = 0);
  1176. void 0 === h && (h = 1);
  1177. void 0 === d && (d = 0);
  1178. void 0 === f && (f = 0);
  1179. c.call(this);
  1180. this.a = e;
  1181. this.b = a;
  1182. this.c = b;
  1183. this.d = h;
  1184. this.tx = d;
  1185. this.ty = f
  1186. }
  1187. __extends(a, c);
  1188. a.prototype.prepend = function(e, a, b, c, d, f) {
  1189. var l = this.tx;
  1190. if (1 != e || 0 != a || 0 != b || 1 != c) {
  1191. var n = this.a,
  1192. p = this.c;
  1193. this.a = n * e + this.b * b;
  1194. this.b = n * a + this.b * c;
  1195. this.c = p * e + this.d * b;
  1196. this.d = p * a + this.d * c
  1197. }
  1198. this.tx = l * e + this.ty * b + d;
  1199. this.ty = l * a + this.ty * c + f;
  1200. return this
  1201. };
  1202. a.prototype.append = function(e, a, b, c, d, f) {
  1203. var l = this.a,
  1204. n = this.b,
  1205. p = this.c,
  1206. q = this.d;
  1207. if (1 != e || 0 != a || 0 != b || 1 != c) this.a = e * l + a * p,
  1208. this.b = e * n + a * q,
  1209. this.c = b * l + c * p,
  1210. this.d = b * n + c * q;
  1211. this.tx = d * l + f * p + this.tx;
  1212. this.ty = d * n + f * q + this.ty;
  1213. return this
  1214. };
  1215. a.prototype.prependTransform = function(e, a, k, c, d, f, l, n, p) {
  1216. if (d % 360) {
  1217. var q = b.NumberUtils.cos(d);
  1218. d = b.NumberUtils.sin(d)
  1219. } else q = 1,
  1220. d = 0;
  1221. if (n || p) this.tx -= n,
  1222. this.ty -= p;
  1223. f || l ? (this.prepend(q * k, d * k, -d * c, q * c, 0, 0), this.prepend(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a)) : this.prepend(q * k, d * k, -d * c, q * c, e, a);
  1224. return this
  1225. };
  1226. a.prototype.appendTransform = function(e, a, k, c, d, f, l, n, p) {
  1227. if (d % 360) {
  1228. var q = b.NumberUtils.cos(d);
  1229. d = b.NumberUtils.sin(d)
  1230. } else q = 1,
  1231. d = 0;
  1232. f || l ? (this.append(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a), this.append(q * k, d * k, -d * c, q * c, 0, 0)) : this.append(q * k, d * k, -d * c, q * c, e, a);
  1233. if (n || p) this.tx -= n * this.a + p * this.c,
  1234. this.ty -= n * this.b + p * this.d;
  1235. return this
  1236. };
  1237. a.prototype.rotate = function(e) {
  1238. var a = Math.cos(e);
  1239. e = Math.sin(e);
  1240. var b = this.a,
  1241. c = this.c,
  1242. d = this.tx;
  1243. this.a = b * a - this.b * e;
  1244. this.b = b * e + this.b * a;
  1245. this.c = c * a - this.d * e;
  1246. this.d = c * e + this.d * a;
  1247. this.tx = d * a - this.ty * e;
  1248. this.ty = d * e + this.ty * a;
  1249. return this
  1250. };
  1251. a.prototype.skew = function(e, a) {
  1252. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(e), b.NumberUtils.cos(e), 0, 0);
  1253. return this
  1254. };
  1255. a.prototype.scale = function(e, a) {
  1256. this.a *= e;
  1257. this.d *= a;
  1258. this.c *= e;
  1259. this.b *= a;
  1260. this.tx *= e;
  1261. this.ty *= a;
  1262. return this
  1263. };
  1264. a.prototype.translate = function(e, a) {
  1265. this.tx += e;
  1266. this.ty += a;
  1267. return this
  1268. };
  1269. a.prototype.identity = function() {
  1270. this.a = this.d = 1;
  1271. this.b = this.c = this.tx = this.ty = 0;
  1272. return this
  1273. };
  1274. a.prototype.identityMatrix = function(e) {
  1275. this.a = e.a;
  1276. this.b = e.b;
  1277. this.c = e.c;
  1278. this.d = e.d;
  1279. this.tx = e.tx;
  1280. this.ty = e.ty;
  1281. return this
  1282. };
  1283. a.prototype.invert = function() {
  1284. var e = this.a,
  1285. a = this.b,
  1286. b = this.c,
  1287. c = this.d,
  1288. d = this.tx,
  1289. f = e * c - a * b;
  1290. this.a = c / f;
  1291. this.b = -a / f;
  1292. this.c = -b / f;
  1293. this.d = e / f;
  1294. this.tx = (b * this.ty - c * d) / f;
  1295. this.ty = -(e * this.ty - a * d) / f;
  1296. return this
  1297. };
  1298. a.transformCoords = function(e, a, k) {
  1299. var c = b.Point.identity;
  1300. c.x = e.a * a + e.c * k + e.tx;
  1301. c.y = e.d * k + e.b * a + e.ty;
  1302. return c
  1303. };
  1304. a.prototype.toArray = function(e) {
  1305. this.array || (this.array = new Float32Array(9));
  1306. 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);
  1307. this.array[8] = 1;
  1308. return this.array
  1309. };
  1310. a.identity = new a;
  1311. a.DEG_TO_RAD = Math.PI / 180;
  1312. return a
  1313. } (b.HashObject);
  1314. b.Matrix = d;
  1315. d.prototype.__class__ = "egret.Matrix"
  1316. })(egret || (egret = {}));
  1317. __extends = this.__extends ||
  1318. function(b, d) {
  1319. function c() {
  1320. this.constructor = b
  1321. }
  1322. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1323. c.prototype = d.prototype;
  1324. b.prototype = new c
  1325. }; (function(b) {
  1326. var d = function(b) {
  1327. function a(e, a) {
  1328. void 0 === e && (e = 0);
  1329. void 0 === a && (a = 0);
  1330. b.call(this);
  1331. this.x = e;
  1332. this.y = a
  1333. }
  1334. __extends(a, b);
  1335. a.prototype.clone = function() {
  1336. return new a(this.x, this.y)
  1337. };
  1338. a.prototype.equals = function(e) {
  1339. return this.x == e.x && this.y == e.y
  1340. };
  1341. a.distance = function(e, a) {
  1342. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  1343. };
  1344. a.identity = new a(0, 0);
  1345. return a
  1346. } (b.HashObject);
  1347. b.Point = d;
  1348. d.prototype.__class__ = "egret.Point"
  1349. })(egret || (egret = {}));
  1350. __extends = this.__extends ||
  1351. function(b, d) {
  1352. function c() {
  1353. this.constructor = b
  1354. }
  1355. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1356. c.prototype = d.prototype;
  1357. b.prototype = new c
  1358. }; (function(b) {
  1359. var d = function(b) {
  1360. function a(e, a, k, d) {
  1361. void 0 === e && (e = 0);
  1362. void 0 === a && (a = 0);
  1363. void 0 === k && (k = 0);
  1364. void 0 === d && (d = 0);
  1365. b.call(this);
  1366. this.x = e;
  1367. this.y = a;
  1368. this.width = k;
  1369. this.height = d
  1370. }
  1371. __extends(a, b);
  1372. Object.defineProperty(a.prototype, "right", {
  1373. get: function() {
  1374. return this.x + this.width
  1375. },
  1376. set: function(e) {
  1377. this.width = e - this.x
  1378. },
  1379. enumerable: !0,
  1380. configurable: !0
  1381. });
  1382. Object.defineProperty(a.prototype, "bottom", {
  1383. get: function() {
  1384. return this.y + this.height
  1385. },
  1386. set: function(e) {
  1387. this.height = e - this.y
  1388. },
  1389. enumerable: !0,
  1390. configurable: !0
  1391. });
  1392. a.prototype.initialize = function(e, a, b, c) {
  1393. this.x = e;
  1394. this.y = a;
  1395. this.width = b;
  1396. this.height = c;
  1397. return this
  1398. };
  1399. a.prototype.contains = function(e, a) {
  1400. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1401. };
  1402. a.prototype.intersects = function(e) {
  1403. return Math.max(this.x, e.x) <= Math.min(this.right, e.right) && Math.max(this.y, e.y) <= Math.min(this.bottom, e.bottom)
  1404. };
  1405. a.prototype.setEmpty = function() {
  1406. this.height = this.width = this.y = this.x = 0
  1407. };
  1408. a.prototype.clone = function() {
  1409. return new a(this.x, this.y, this.width, this.height)
  1410. };
  1411. a.prototype.containsPoint = function(e) {
  1412. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1413. };
  1414. a.identity = new a(0, 0, 0, 0);
  1415. return a
  1416. } (b.HashObject);
  1417. b.Rectangle = d;
  1418. d.prototype.__class__ = "egret.Rectangle"
  1419. })(egret || (egret = {}));
  1420. __extends = this.__extends ||
  1421. function(b, d) {
  1422. function c() {
  1423. this.constructor = b
  1424. }
  1425. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1426. c.prototype = d.prototype;
  1427. b.prototype = new c
  1428. }; (function(b) {
  1429. var d = function(c) {
  1430. function a() {
  1431. c.call(this);
  1432. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1433. this._xmlDict = {};
  1434. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1435. }
  1436. __extends(a, c);
  1437. a.getInstance = function() {
  1438. a._instance || (a._instance = new a);
  1439. return a._instance
  1440. };
  1441. a.prototype.parserXML = function(e) {
  1442. for (var a = 0;
  1443. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1444. 0 != a && (e = e.substring(a, e.length));
  1445. this._isSupportDOMParser ? a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1446. null == a && b.Logger.infoWithErrorId(1015);
  1447. return a
  1448. };
  1449. a._instance = null;
  1450. return a
  1451. } (b.HashObject);
  1452. b.SAXParser = d;
  1453. d.prototype.__class__ = "egret.SAXParser"
  1454. })(egret || (egret = {}));
  1455. __extends = this.__extends ||
  1456. function(b, d) {
  1457. function c() {
  1458. this.constructor = b
  1459. }
  1460. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1461. c.prototype = d.prototype;
  1462. b.prototype = new c
  1463. }; (function(b) {
  1464. var d = function(e) {
  1465. function m() {
  1466. e.call(this);
  1467. this._designHeight = this._designWidth = 0;
  1468. this._scaleY = this._scaleX = 1;
  1469. this._stageHeight = this._stageWidth = this._offSetY = 0
  1470. }
  1471. __extends(m, e);
  1472. m.getInstance = function() {
  1473. null == m.instance && (a.initialize(), m.instance = new m);
  1474. return m.instance
  1475. };
  1476. m.prototype.setDesignSize = function(e, a, m) {
  1477. this._designWidth = e;
  1478. this._designHeight = a;
  1479. m && (b.Logger.warningWithErrorId(1001), this._setResolutionPolicy(m))
  1480. };
  1481. m.prototype._setResolutionPolicy = function(e) {
  1482. this._resolutionPolicy = e;
  1483. e.init(this);
  1484. e._apply(this, this._designWidth, this._designHeight)
  1485. };
  1486. m.prototype.getScaleX = function() {
  1487. return this._scaleX
  1488. };
  1489. m.prototype.getScaleY = function() {
  1490. return this._scaleY
  1491. };
  1492. m.prototype.getOffSetY = function() {
  1493. return this._offSetY
  1494. };
  1495. m.canvas_name = "egretCanvas";
  1496. m.canvas_div_name = "gameDiv";
  1497. return m
  1498. } (b.HashObject);
  1499. b.StageDelegate = d;
  1500. d.prototype.__class__ = "egret.StageDelegate";
  1501. var c = function() {
  1502. function e(a, m) {
  1503. this._containerStrategy = a;
  1504. this._contentStrategy = m
  1505. }
  1506. e.prototype.init = function(e) {
  1507. this._containerStrategy.init(e);
  1508. this._contentStrategy.init(e)
  1509. };
  1510. e.prototype._apply = function(e, a, m) {
  1511. this._containerStrategy._apply(e, a, m);
  1512. this._contentStrategy._apply(e, a, m)
  1513. };
  1514. return e
  1515. } ();
  1516. b.ResolutionPolicy = c;
  1517. c.prototype.__class__ = "egret.ResolutionPolicy";
  1518. var a = function() {
  1519. function a() {}
  1520. a.initialize = function() {
  1521. a.EQUAL_TO_FRAME = new e
  1522. };
  1523. a.prototype.init = function(e) {};
  1524. a.prototype._apply = function(e, a, m) {};
  1525. a.prototype._setupContainer = function() {
  1526. var e = document.body,
  1527. a;
  1528. 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")
  1529. };
  1530. return a
  1531. } ();
  1532. b.ContainerStrategy = a;
  1533. a.prototype.__class__ = "egret.ContainerStrategy";
  1534. var e = function(e) {
  1535. function a() {
  1536. e.apply(this, arguments)
  1537. }
  1538. __extends(a, e);
  1539. a.prototype._apply = function(e) {
  1540. this._setupContainer()
  1541. };
  1542. return a
  1543. } (a);
  1544. b.EqualToFrame = e;
  1545. e.prototype.__class__ = "egret.EqualToFrame";
  1546. c = function() {
  1547. function e() {}
  1548. e.prototype.init = function(e) {};
  1549. e.prototype._apply = function(e, a, m) {};
  1550. e.prototype.setEgretSize = function(e, a, m, k, c, p) {
  1551. void 0 === p && (p = 0);
  1552. b.StageDelegate.getInstance()._stageWidth = Math.round(e);
  1553. b.StageDelegate.getInstance()._stageHeight = Math.round(a);
  1554. e = document.getElementById(d.canvas_div_name);
  1555. e.style.width = m + "px";
  1556. e.style.height = k + "px";
  1557. e.style.top = p + "px"
  1558. };
  1559. e.prototype._getClientWidth = function() {
  1560. return document.documentElement.clientWidth
  1561. };
  1562. e.prototype._getClientHeight = function() {
  1563. return document.documentElement.clientHeight
  1564. };
  1565. return e
  1566. } ();
  1567. b.ContentStrategy = c;
  1568. c.prototype.__class__ = "egret.ContentStrategy";
  1569. var m = function(e) {
  1570. function a(m) {
  1571. void 0 === m && (m = 0);
  1572. e.call(this);
  1573. this.minWidth = NaN;
  1574. this.minWidth = m
  1575. }
  1576. __extends(a, e);
  1577. a.prototype._apply = function(e, a, m) {
  1578. a = this._getClientWidth();
  1579. var b = this._getClientHeight(),
  1580. k = b / m,
  1581. c = a / k,
  1582. d = 1;
  1583. 0 != this.minWidth && (d = Math.min(1, c / this.minWidth));
  1584. this.setEgretSize(c / d, m, a, b * d);
  1585. e._scaleX = k * d;
  1586. e._scaleY = k * d
  1587. };
  1588. return a
  1589. } (c);
  1590. b.FixedHeight = m;
  1591. m.prototype.__class__ = "egret.FixedHeight";
  1592. m = function(e) {
  1593. function a(m) {
  1594. void 0 === m && (m = 0);
  1595. e.call(this);
  1596. this.minHeight = NaN;
  1597. this.minHeight = m
  1598. }
  1599. __extends(a, e);
  1600. a.prototype._apply = function(e, a, m) {
  1601. m = this._getClientWidth();
  1602. var b = this._getClientHeight(),
  1603. k = m / a,
  1604. c = b / k,
  1605. d = 1;
  1606. 0 != this.minHeight && (d = Math.min(1, c / this.minHeight));
  1607. this.setEgretSize(a, c / d, m * d, b, m * (1 - d) / 2);
  1608. e._scaleX = k * d;
  1609. e._scaleY = k * d
  1610. };
  1611. return a
  1612. } (c);
  1613. b.FixedWidth = m;
  1614. m.prototype.__class__ = "egret.FixedWidth";
  1615. m = function(e) {
  1616. function a(m, b) {
  1617. e.call(this);
  1618. this.width = m;
  1619. this.height = b
  1620. }
  1621. __extends(a, e);
  1622. a.prototype._apply = function(e, a, m) {
  1623. m = this.width;
  1624. var b = this.height,
  1625. k = m / a;
  1626. this.setEgretSize(a, b / k, m, b);
  1627. e._scaleX = k;
  1628. e._scaleY = k
  1629. };
  1630. return a
  1631. } (c);
  1632. b.FixedSize = m;
  1633. m.prototype.__class__ = "egret.FixedSize";
  1634. m = function(e) {
  1635. function a() {
  1636. e.call(this)
  1637. }
  1638. __extends(a, e);
  1639. a.prototype._apply = function(e, a, m) {
  1640. this.setEgretSize(a, m, a, m, Math.floor((a - a) / 2));
  1641. e._scaleX = 1;
  1642. e._scaleY = 1
  1643. };
  1644. return a
  1645. } (c);
  1646. b.NoScale = m;
  1647. m.prototype.__class__ = "egret.NoScale";
  1648. m = function(e) {
  1649. function a() {
  1650. e.call(this)
  1651. }
  1652. __extends(a, e);
  1653. a.prototype._apply = function(e, a, m) {
  1654. var b = this._getClientWidth(),
  1655. k = this._getClientHeight(),
  1656. c = b,
  1657. d = k,
  1658. h = c / a < d / m ? c / a: d / m,
  1659. c = a * h,
  1660. d = m * h,
  1661. b = Math.floor((b - c) / 2);
  1662. e._offSetY = Math.floor((k - d) / 2);
  1663. this.setEgretSize(a, m / 1, 1 * c, d, b, e._offSetY);
  1664. e._scaleX = 1 * h;
  1665. e._scaleY = 1 * h
  1666. };
  1667. return a
  1668. } (c);
  1669. b.ShowAll = m;
  1670. m.prototype.__class__ = "egret.ShowAll";
  1671. c = function(e) {
  1672. function a() {
  1673. e.call(this)
  1674. }
  1675. __extends(a, e);
  1676. a.prototype._apply = function(e, a, m) {
  1677. var b = this._getClientWidth(),
  1678. k = this._getClientHeight(),
  1679. b = b / a,
  1680. k = k / m;
  1681. this.setEgretSize(a, m, a * b, m * k);
  1682. e._scaleX = b;
  1683. e._scaleY = k
  1684. };
  1685. return a
  1686. } (c);
  1687. b.FullScreen = c;
  1688. c.prototype.__class__ = "egret.FullScreen"
  1689. })(egret || (egret = {}));
  1690. __extends = this.__extends ||
  1691. function(b, d) {
  1692. function c() {
  1693. this.constructor = b
  1694. }
  1695. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1696. c.prototype = d.prototype;
  1697. b.prototype = new c
  1698. }; (function(b) {
  1699. var d = function(c) {
  1700. function a() {
  1701. c.call(this);
  1702. this._originalData = {};
  1703. this._drawAreaList = []
  1704. }
  1705. __extends(a, c);
  1706. a.getInstance = function() {
  1707. null == a.instance && (a.instance = new a);
  1708. return a.instance
  1709. };
  1710. a.prototype.addDrawArea = function(e) {
  1711. this._drawAreaList.push(e)
  1712. };
  1713. a.prototype.clearDrawArea = function() {
  1714. this._drawAreaList = []
  1715. };
  1716. a.prototype.drawImage = function(e, m, k, c, d, f, l, n, p, q, r) {
  1717. void 0 === r && (r = void 0);
  1718. l = l || 0;
  1719. n = n || 0;
  1720. var t = m._texture_to_render;
  1721. if (null != t && 0 != f && 0 != d && 0 != p && 0 != q) {
  1722. var s = b.MainContext.instance.rendererContext._texture_scale_factor;
  1723. d /= s;
  1724. f /= s;
  1725. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1726. s = b.DisplayObject.getTransformBounds(m._getSize(a.identityRectangle), m._worldTransform);
  1727. m._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1728. s = this._originalData;
  1729. s.sourceX = k;
  1730. s.sourceY = c;
  1731. s.sourceWidth = d;
  1732. s.sourceHeight = f;
  1733. s.destX = l;
  1734. s.destY = n;
  1735. s.destWidth = p;
  1736. s.destHeight = q;
  1737. for (var u = this.getDrawAreaList(), w = 0; w < u.length; w++) if (!this.ignoreRender(m, u[w], s.destX, s.destY)) {
  1738. e.drawImage(t, k, c, d, f, l, n, p, q, r);
  1739. break
  1740. }
  1741. } else e.drawImage(t, k, c, d, f, l, n, p, q, r)
  1742. }
  1743. };
  1744. a.prototype.ignoreRender = function(e, a, b, c) {
  1745. var d = e._worldBounds;
  1746. b *= e._worldTransform.a;
  1747. c *= e._worldTransform.d;
  1748. 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
  1749. };
  1750. a.prototype.getDrawAreaList = function() {
  1751. var e;
  1752. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1753. return e
  1754. };
  1755. a.prototype.onResize = function() {
  1756. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1757. this._defaultDrawAreaList = null
  1758. };
  1759. a.identityRectangle = new b.Rectangle;
  1760. return a
  1761. } (b.HashObject);
  1762. b.RenderFilter = d;
  1763. d.prototype.__class__ = "egret.RenderFilter"
  1764. })(egret || (egret = {})); (function(b) {
  1765. var d = function() {
  1766. function c() {}
  1767. c.mapClass = function(a, e, m) {
  1768. void 0 === m && (m = "");
  1769. a = this.getKey(a) + "#" + m;
  1770. this.mapClassDic[a] = e
  1771. };
  1772. c.getKey = function(a) {
  1773. return "string" == typeof a ? a: b.getQualifiedClassName(a)
  1774. };
  1775. c.mapValue = function(a, e, m) {
  1776. void 0 === m && (m = "");
  1777. a = this.getKey(a) + "#" + m;
  1778. this.mapValueDic[a] = e
  1779. };
  1780. c.hasMapRule = function(a, e) {
  1781. void 0 === e && (e = "");
  1782. var m = this.getKey(a) + "#" + e;
  1783. return this.mapValueDic[m] || this.mapClassDic[m] ? !0 : !1
  1784. };
  1785. c.getInstance = function(a, e) {
  1786. void 0 === e && (e = "");
  1787. var m = this.getKey(a) + "#" + e;
  1788. if (this.mapValueDic[m]) return this.mapValueDic[m];
  1789. var k = this.mapClassDic[m];
  1790. if (k) return k = new k,
  1791. this.mapValueDic[m] = k,
  1792. delete this.mapClassDic[m],
  1793. k;
  1794. throw Error(b.getString(1028, m));
  1795. };
  1796. c.mapClassDic = {};
  1797. c.mapValueDic = {};
  1798. return c
  1799. } ();
  1800. b.Injector = d;
  1801. d.prototype.__class__ = "egret.Injector"
  1802. })(egret || (egret = {})); (function(b) {
  1803. var d = function() {
  1804. return function() {
  1805. this.type = null
  1806. }
  1807. } ();
  1808. b.Filter = d;
  1809. d.prototype.__class__ = "egret.Filter"
  1810. })(egret || (egret = {}));
  1811. __extends = this.__extends ||
  1812. function(b, d) {
  1813. function c() {
  1814. this.constructor = b
  1815. }
  1816. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1817. c.prototype = d.prototype;
  1818. b.prototype = new c
  1819. }; (function(b) {
  1820. var d = function(b) {
  1821. function a(e, a) {
  1822. b.call(this);
  1823. this.blurX = e;
  1824. this.blurY = a;
  1825. this.type = "blur"
  1826. }
  1827. __extends(a, b);
  1828. return a
  1829. } (b.Filter);
  1830. b.BlurFilter = d;
  1831. d.prototype.__class__ = "egret.BlurFilter"
  1832. })(egret || (egret = {})); (function(b) {
  1833. var d = function() {
  1834. function b() {}
  1835. b.NORMAL = "normal";
  1836. b.ADD = "add";
  1837. b.ERASE = "erase";
  1838. b.ERASE_REVERSE = "erase_reverse";
  1839. return b
  1840. } ();
  1841. b.BlendMode = d;
  1842. d.prototype.__class__ = "egret.BlendMode"
  1843. })(egret || (egret = {}));
  1844. __extends = this.__extends ||
  1845. function(b, d) {
  1846. function c() {
  1847. this.constructor = b
  1848. }
  1849. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1850. c.prototype = d.prototype;
  1851. b.prototype = new c
  1852. }; (function(b) {
  1853. var d = function(c) {
  1854. function a() {
  1855. c.call(this);
  1856. this.__hack_local_matrix = null;
  1857. this._sizeDirty = this._normalDirty = !0;
  1858. this._parent = this._texture_to_render = this.name = this._sizeChangeCallTarget = this._sizeChangeCallBack = null;
  1859. this._y = this._x = 0;
  1860. this._scaleY = this._scaleX = 1;
  1861. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1862. this._visible = !0;
  1863. this._rotation = 0;
  1864. this._alpha = 1;
  1865. this._skewY = this._skewX = 0;
  1866. this._touchEnabled = !1;
  1867. this._scrollRect = this.blendMode = null;
  1868. this._explicitHeight = this._explicitWidth = NaN;
  1869. this._hasHeightSet = this._hasWidthSet = !1;
  1870. this._worldBounds = this.mask = null;
  1871. this.worldAlpha = 1;
  1872. this.needDraw = this._isContainer = !1;
  1873. this._hitTestPointTexture = null;
  1874. this._rectH = this._rectW = 0;
  1875. this._stage = null;
  1876. this._cacheAsBitmap = !1;
  1877. this.renderTexture = null;
  1878. this._cacheDirty = !1;
  1879. this._filter = this._colorTransform = null;
  1880. this._worldTransform = new b.Matrix;
  1881. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1882. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1883. }
  1884. __extends(a, c);
  1885. a.prototype._setDirty = function() {
  1886. this._normalDirty = !0
  1887. };
  1888. a.prototype.getDirty = function() {
  1889. return this._normalDirty || this._sizeDirty
  1890. };
  1891. a.prototype._setParentSizeDirty = function() {
  1892. var e = this._parent; ! e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
  1893. };
  1894. a.prototype._setSizeDirty = function() {
  1895. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == this._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
  1896. };
  1897. a.prototype._clearDirty = function() {
  1898. this._normalDirty = !1
  1899. };
  1900. a.prototype._clearSizeDirty = function() {
  1901. this._sizeDirty = !1
  1902. };
  1903. Object.defineProperty(a.prototype, "parent", {
  1904. get: function() {
  1905. return this._parent
  1906. },
  1907. enumerable: !0,
  1908. configurable: !0
  1909. });
  1910. a.prototype._parentChanged = function(e) {
  1911. this._parent = e
  1912. };
  1913. Object.defineProperty(a.prototype, "x", {
  1914. get: function() {
  1915. return this._x
  1916. },
  1917. set: function(e) {
  1918. this._setX(e)
  1919. },
  1920. enumerable: !0,
  1921. configurable: !0
  1922. });
  1923. a.prototype._setX = function(e) {
  1924. b.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1925. };
  1926. Object.defineProperty(a.prototype, "y", {
  1927. get: function() {
  1928. return this._y
  1929. },
  1930. set: function(e) {
  1931. this._setY(e)
  1932. },
  1933. enumerable: !0,
  1934. configurable: !0
  1935. });
  1936. a.prototype._setY = function(e) {
  1937. b.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1938. };
  1939. Object.defineProperty(a.prototype, "scaleX", {
  1940. get: function() {
  1941. return this._scaleX
  1942. },
  1943. set: function(e) {
  1944. b.NumberUtils.isNumber(e) && this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1945. },
  1946. enumerable: !0,
  1947. configurable: !0
  1948. });
  1949. Object.defineProperty(a.prototype, "scaleY", {
  1950. get: function() {
  1951. return this._scaleY
  1952. },
  1953. set: function(e) {
  1954. b.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1955. },
  1956. enumerable: !0,
  1957. configurable: !0
  1958. });
  1959. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1960. get: function() {
  1961. return this._anchorOffsetX
  1962. },
  1963. set: function(e) {
  1964. b.NumberUtils.isNumber(e) && this._anchorOffsetX != e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1965. },
  1966. enumerable: !0,
  1967. configurable: !0
  1968. });
  1969. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1970. get: function() {
  1971. return this._anchorOffsetY
  1972. },
  1973. set: function(e) {
  1974. b.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1975. },
  1976. enumerable: !0,
  1977. configurable: !0
  1978. });
  1979. Object.defineProperty(a.prototype, "anchorX", {
  1980. get: function() {
  1981. return this._anchorX
  1982. },
  1983. set: function(e) {
  1984. this._setAnchorX(e)
  1985. },
  1986. enumerable: !0,
  1987. configurable: !0
  1988. });
  1989. a.prototype._setAnchorX = function(e) {
  1990. b.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1991. };
  1992. Object.defineProperty(a.prototype, "anchorY", {
  1993. get: function() {
  1994. return this._anchorY
  1995. },
  1996. set: function(e) {
  1997. this._setAnchorY(e)
  1998. },
  1999. enumerable: !0,
  2000. configurable: !0
  2001. });
  2002. a.prototype._setAnchorY = function(e) {
  2003. b.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  2004. };
  2005. Object.defineProperty(a.prototype, "visible", {
  2006. get: function() {
  2007. return this._visible
  2008. },
  2009. set: function(e) {
  2010. this._setVisible(e)
  2011. },
  2012. enumerable: !0,
  2013. configurable: !0
  2014. });
  2015. a.prototype._setVisible = function(e) {
  2016. this._visible != e && (this._visible = e, this._setSizeDirty())
  2017. };
  2018. Object.defineProperty(a.prototype, "rotation", {
  2019. get: function() {
  2020. return this._rotation
  2021. },
  2022. set: function(e) {
  2023. b.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setDirty(), this._setParentSizeDirty())
  2024. },
  2025. enumerable: !0,
  2026. configurable: !0
  2027. });
  2028. Object.defineProperty(a.prototype, "alpha", {
  2029. get: function() {
  2030. return this._alpha
  2031. },
  2032. set: function(e) {
  2033. b.NumberUtils.isNumber(e) && this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
  2034. },
  2035. enumerable: !0,
  2036. configurable: !0
  2037. });
  2038. Object.defineProperty(a.prototype, "skewX", {
  2039. get: function() {
  2040. return this._skewX
  2041. },
  2042. set: function(e) {
  2043. b.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setDirty(), this._setParentSizeDirty())
  2044. },
  2045. enumerable: !0,
  2046. configurable: !0
  2047. });
  2048. Object.defineProperty(a.prototype, "skewY", {
  2049. get: function() {
  2050. return this._skewY
  2051. },
  2052. set: function(e) {
  2053. b.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setDirty(), this._setParentSizeDirty())
  2054. },
  2055. enumerable: !0,
  2056. configurable: !0
  2057. });
  2058. Object.defineProperty(a.prototype, "touchEnabled", {
  2059. get: function() {
  2060. return this._touchEnabled
  2061. },
  2062. set: function(e) {
  2063. this._setTouchEnabled(e)
  2064. },
  2065. enumerable: !0,
  2066. configurable: !0
  2067. });
  2068. a.prototype._setTouchEnabled = function(e) {
  2069. this._touchEnabled = e
  2070. };
  2071. Object.defineProperty(a.prototype, "scrollRect", {
  2072. get: function() {
  2073. return this._scrollRect
  2074. },
  2075. set: function(e) {
  2076. this._setScrollRect(e)
  2077. },
  2078. enumerable: !0,
  2079. configurable: !0
  2080. });
  2081. a.prototype._setScrollRect = function(e) {
  2082. this._scrollRect = e;
  2083. this._setSizeDirty()
  2084. };
  2085. Object.defineProperty(a.prototype, "measuredWidth", {
  2086. get: function() {
  2087. return this._measureBounds().width
  2088. },
  2089. enumerable: !0,
  2090. configurable: !0
  2091. });
  2092. Object.defineProperty(a.prototype, "measuredHeight", {
  2093. get: function() {
  2094. return this._measureBounds().height
  2095. },
  2096. enumerable: !0,
  2097. configurable: !0
  2098. });
  2099. Object.defineProperty(a.prototype, "explicitWidth", {
  2100. get: function() {
  2101. return this._explicitWidth
  2102. },
  2103. enumerable: !0,
  2104. configurable: !0
  2105. });
  2106. Object.defineProperty(a.prototype, "explicitHeight", {
  2107. get: function() {
  2108. return this._explicitHeight
  2109. },
  2110. enumerable: !0,
  2111. configurable: !0
  2112. });
  2113. Object.defineProperty(a.prototype, "width", {
  2114. get: function() {
  2115. return this._getWidth()
  2116. },
  2117. set: function(e) {
  2118. this._setWidth(e)
  2119. },
  2120. enumerable: !0,
  2121. configurable: !0
  2122. });
  2123. a.prototype._getWidth = function() {
  2124. return this._getSize(b.Rectangle.identity).width
  2125. };
  2126. Object.defineProperty(a.prototype, "height", {
  2127. get: function() {
  2128. return this._getHeight()
  2129. },
  2130. set: function(e) {
  2131. this._setHeight(e)
  2132. },
  2133. enumerable: !0,
  2134. configurable: !0
  2135. });
  2136. a.prototype._getHeight = function() {
  2137. return this._getSize(b.Rectangle.identity).height
  2138. };
  2139. a.prototype._setWidth = function(e) {
  2140. this._setSizeDirty();
  2141. this._setCacheDirty();
  2142. this._explicitWidth = e;
  2143. this._hasWidthSet = b.NumberUtils.isNumber(e)
  2144. };
  2145. a.prototype._setHeight = function(e) {
  2146. this._setSizeDirty();
  2147. this._setCacheDirty();
  2148. this._explicitHeight = e;
  2149. this._hasHeightSet = b.NumberUtils.isNumber(e)
  2150. };
  2151. a.prototype._draw = function(e) {
  2152. if (this._visible && !this.drawCacheTexture(e)) {
  2153. var a = b.MainContext.__use_new_draw && this._isContainer;
  2154. this._filter && !a && e.setGlobalFilter(this._filter);
  2155. this._colorTransform && !a && e.setGlobalColorTransform(this._colorTransform.matrix);
  2156. e.setAlpha(this.worldAlpha, this.blendMode);
  2157. e.setTransform(this._worldTransform);
  2158. var k = this.mask || this._scrollRect;
  2159. k && !a && e.pushMask(k);
  2160. this._render(e);
  2161. k && !a && e.popMask();
  2162. this._colorTransform && !a && e.setGlobalColorTransform(null);
  2163. this._filter && !a && e.setGlobalFilter(null)
  2164. }
  2165. this.destroyCacheBounds()
  2166. };
  2167. a.prototype._setGlobalFilter = function(e) {
  2168. e.setGlobalFilter(this._filter)
  2169. };
  2170. a.prototype._removeGlobalFilter = function(e) {
  2171. e.setGlobalFilter(null)
  2172. };
  2173. a.prototype._setGlobalColorTransform = function(e) {
  2174. e.setGlobalColorTransform(this._colorTransform.matrix)
  2175. };
  2176. a.prototype._removeGlobalColorTransform = function(e) {
  2177. e.setGlobalColorTransform(null)
  2178. };
  2179. a.prototype._pushMask = function(e) {
  2180. e.setTransform(this._worldTransform);
  2181. var a = this.mask || this._scrollRect;
  2182. a && e.pushMask(a)
  2183. };
  2184. a.prototype._popMask = function(e) {
  2185. e.popMask()
  2186. };
  2187. a.prototype.drawCacheTexture = function(e) {
  2188. if (!1 == this._cacheAsBitmap) return ! 1;
  2189. var a = this.getBounds(b.Rectangle.identity),
  2190. k = b.MainContext.instance.rendererContext._texture_scale_factor;
  2191. if (this._cacheDirty || null == this._texture_to_render || Math.round(a.width) != Math.round(this._texture_to_render._sourceWidth * k) || Math.round(a.height) != Math.round(this._texture_to_render._sourceHeight * k)) this._cacheDirty = !this._makeBitmapCache();
  2192. if (null == this._texture_to_render) return ! 1;
  2193. var c = this._texture_to_render,
  2194. a = c._offsetX,
  2195. k = c._offsetY,
  2196. d = c._textureWidth,
  2197. c = c._textureHeight;
  2198. this._updateTransform();
  2199. e.setAlpha(this.worldAlpha, this.blendMode);
  2200. e.setTransform(this._worldTransform);
  2201. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, d, c, a, k, d, c);
  2202. return ! 0
  2203. };
  2204. a.prototype._updateTransform = function() {
  2205. this._visible && (this._calculateWorldTransform(), "updateTransform" == b.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || this._cacheAsBitmap) && b.RenderCommand.push(this._draw, this))
  2206. };
  2207. a.prototype._calculateWorldTransform = function() {
  2208. var e = this._worldTransform,
  2209. a = this._parent;
  2210. e.identityMatrix(a._worldTransform);
  2211. this._getMatrix(e);
  2212. var b = this._scrollRect;
  2213. b && e.append(1, 0, 0, 1, -b.x, -b.y);
  2214. this.worldAlpha = a.worldAlpha * this._alpha
  2215. };
  2216. a.prototype._render = function(e) {};
  2217. a.prototype.getBounds = function(e, a) {
  2218. void 0 === a && (a = !0);
  2219. var k = this._measureBounds(),
  2220. c = this._hasWidthSet ? this._explicitWidth: k.width,
  2221. d = this._hasHeightSet ? this._explicitHeight: k.height;
  2222. this._rectW = k.width;
  2223. this._rectH = k.height;
  2224. this._clearSizeDirty();
  2225. var f = k.x,
  2226. k = k.y,
  2227. l = 0,
  2228. n = 0;
  2229. a && (0 != this._anchorX || 0 != this._anchorY ? (l = c * this._anchorX, n = d * this._anchorY) : (l = this._anchorOffsetX, n = this._anchorOffsetY));
  2230. this._cacheBounds.initialize(f - l, k - n, c, d);
  2231. c = this._cacheBounds;
  2232. e || (e = new b.Rectangle);
  2233. return e.initialize(c.x, c.y, c.width, c.height)
  2234. };
  2235. a.prototype.destroyCacheBounds = function() {
  2236. this._cacheBounds.x = 0;
  2237. this._cacheBounds.y = 0;
  2238. this._cacheBounds.width = 0;
  2239. this._cacheBounds.height = 0
  2240. };
  2241. a.prototype._getConcatenatedMatrix = function() {
  2242. for (var e = a.identityMatrixForGetConcatenated.identity(), m = this; null != m;) {
  2243. if (0 != m._anchorX || 0 != m._anchorY) {
  2244. var k = m._getSize(b.Rectangle.identity);
  2245. e.prependTransform(m._x, m._y, m._scaleX, m._scaleY, m._rotation, m._skewX, m._skewY, k.width * m._anchorX, k.height * m._anchorY)
  2246. } else e.prependTransform(m._x, m._y, m._scaleX, m._scaleY, m._rotation, m._skewX, m._skewY, m._anchorOffsetX, m._anchorOffsetY);
  2247. m._scrollRect && e.prepend(1, 0, 0, 1, -m._scrollRect.x, -m._scrollRect.y);
  2248. m = m._parent
  2249. }
  2250. return e
  2251. };
  2252. a.prototype.localToGlobal = function(e, a, k) {
  2253. void 0 === e && (e = 0);
  2254. void 0 === a && (a = 0);
  2255. var c = this._getConcatenatedMatrix();
  2256. c.append(1, 0, 0, 1, e, a);
  2257. k || (k = new b.Point);
  2258. k.x = c.tx;
  2259. k.y = c.ty;
  2260. return k
  2261. };
  2262. a.prototype.globalToLocal = function(e, a, k) {
  2263. void 0 === e && (e = 0);
  2264. void 0 === a && (a = 0);
  2265. var c = this._getConcatenatedMatrix();
  2266. c.invert();
  2267. c.append(1, 0, 0, 1, e, a);
  2268. k || (k = new b.Point);
  2269. k.x = c.tx;
  2270. k.y = c.ty;
  2271. return k
  2272. };
  2273. a.prototype.hitTest = function(e, a, k) {
  2274. void 0 === k && (k = !1);
  2275. if (!this._visible || !k && !this._touchEnabled) return null;
  2276. k = this.getBounds(b.Rectangle.identity, !1);
  2277. e -= k.x;
  2278. a -= k.y;
  2279. return 0 <= e && e < k.width && 0 <= a && a < k.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
  2280. };
  2281. a.prototype.hitTestPoint = function(e, a, k) {
  2282. e = this.globalToLocal(e, a);
  2283. return k ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), k = this._hitTestPointTexture, k.drawToTexture(this), 0 != k.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  2284. };
  2285. a.prototype._getMatrix = function(e) {
  2286. e || (e = b.Matrix.identity.identity());
  2287. var a, k;
  2288. k = this._getOffsetPoint();
  2289. a = k.x;
  2290. k = k.y;
  2291. var c = this.__hack_local_matrix;
  2292. c ? (e.append(c.a, c.b, c.c, c.d, c.tx, c.ty), e.append(1, 0, 0, 1, -a, -k)) : e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, k);
  2293. return e
  2294. };
  2295. a.prototype._getSize = function(e) {
  2296. if (this._hasHeightSet && this._hasWidthSet) return this._clearSizeDirty(),
  2297. e.initialize(0, 0, this._explicitWidth, this._explicitHeight);
  2298. this._measureSize(e);
  2299. this._hasWidthSet && (e.width = this._explicitWidth);
  2300. this._hasHeightSet && (e.height = this._explicitHeight);
  2301. return e
  2302. };
  2303. a.prototype._measureSize = function(e) {
  2304. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  2305. e.x = 0;
  2306. e.y = 0;
  2307. return e
  2308. };
  2309. a.prototype._measureBounds = function() {
  2310. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2311. };
  2312. a.prototype._getOffsetPoint = function() {
  2313. var e = this._anchorOffsetX,
  2314. a = this._anchorOffsetY;
  2315. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity),
  2316. e = this._anchorX * a.width,
  2317. a = this._anchorY * a.height;
  2318. var k = b.Point.identity;
  2319. k.x = e;
  2320. k.y = a;
  2321. return k
  2322. };
  2323. a.prototype._onAddToStage = function() {
  2324. this._stage = b.MainContext.instance.stage;
  2325. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2326. };
  2327. a.prototype._onRemoveFromStage = function() {
  2328. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2329. };
  2330. Object.defineProperty(a.prototype, "stage", {
  2331. get: function() {
  2332. return this._stage
  2333. },
  2334. enumerable: !0,
  2335. configurable: !0
  2336. });
  2337. a.prototype.addEventListener = function(e, m, k, d, g) {
  2338. void 0 === d && (d = !1);
  2339. void 0 === g && (g = 0);
  2340. c.prototype.addEventListener.call(this, e, m, k, d, g); ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(d ? a._enterFrameCallBackList: a._renderCallBackList, m, k, g, this)
  2341. };
  2342. a.prototype.removeEventListener = function(e, m, k, d) {
  2343. void 0 === d && (d = !1);
  2344. c.prototype.removeEventListener.call(this, e, m, k, d); ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(d ? a._enterFrameCallBackList: a._renderCallBackList, m, k, this)
  2345. };
  2346. a.prototype.dispatchEvent = function(e) {
  2347. if (!e._bubbles) return c.prototype.dispatchEvent.call(this, e);
  2348. for (var a = [], b = this; b;) a.push(b),
  2349. b = b._parent;
  2350. e._reset();
  2351. this._dispatchPropagationEvent(e, a);
  2352. return ! e._isDefaultPrevented
  2353. };
  2354. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2355. b = a.length;
  2356. for (var c = 1,
  2357. d = b - 1; 0 <= d; d--) {
  2358. var f = a[d];
  2359. e._currentTarget = f;
  2360. e._target = this;
  2361. e._eventPhase = c;
  2362. f._notifyListener(e);
  2363. if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
  2364. }
  2365. f = a[0];
  2366. e._currentTarget = f;
  2367. e._target = this;
  2368. e._eventPhase = 2;
  2369. f._notifyListener(e);
  2370. if (!e._isPropagationStopped && !e._isPropagationImmediateStopped) 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++);
  2371. };
  2372. a.prototype.willTrigger = function(e) {
  2373. for (var a = this; a;) {
  2374. if (a.hasEventListener(e)) return ! 0;
  2375. a = a._parent
  2376. }
  2377. return ! 1
  2378. };
  2379. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2380. get: function() {
  2381. return this._cacheAsBitmap
  2382. },
  2383. set: function(e) { (this._cacheAsBitmap = e) ? b.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2384. },
  2385. enumerable: !0,
  2386. configurable: !0
  2387. });
  2388. a.prototype._makeBitmapCache = function() {
  2389. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2390. var e = this.renderTexture.drawToTexture(this);
  2391. this._texture_to_render = e ? this.renderTexture: null;
  2392. return e
  2393. };
  2394. a.prototype._setCacheDirty = function(e) {
  2395. void 0 === e && (e = !0);
  2396. this._cacheDirty = e
  2397. };
  2398. a.getTransformBounds = function(e, a) {
  2399. var b = e.x,
  2400. c = e.y,
  2401. d = e.width,
  2402. f = e.height; (b || c) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2403. var l = d * a.a,
  2404. d = d * a.b,
  2405. n = f * a.c,
  2406. f = f * a.d,
  2407. p = a.tx,
  2408. q = a.ty,
  2409. r = p,
  2410. t = p,
  2411. s = q,
  2412. u = q; (b = l + p) < r ? r = b: b > t && (t = b); (b = l + n + p) < r ? r = b: b > t && (t = b); (b = n + p) < r ? r = b: b > t && (t = b); (c = d + q) < s ? s = c: c > u && (u = c); (c = d + f + q) < s ? s = c: c > u && (u = c); (c = f + q) < s ? s = c: c > u && (u = c);
  2413. return e.initialize(r, s, t - r, u - s)
  2414. };
  2415. Object.defineProperty(a.prototype, "colorTransform", {
  2416. get: function() {
  2417. return this._colorTransform
  2418. },
  2419. set: function(e) {
  2420. this._colorTransform = e
  2421. },
  2422. enumerable: !0,
  2423. configurable: !0
  2424. });
  2425. Object.defineProperty(a.prototype, "filter", {
  2426. get: function() {
  2427. return this._filter
  2428. },
  2429. set: function(e) {
  2430. this._filter = e
  2431. },
  2432. enumerable: !0,
  2433. configurable: !0
  2434. });
  2435. a.identityMatrixForGetConcatenated = new b.Matrix;
  2436. a._enterFrameCallBackList = [];
  2437. a._renderCallBackList = [];
  2438. return a
  2439. } (b.EventDispatcher);
  2440. b.DisplayObject = d;
  2441. d.prototype.__class__ = "egret.DisplayObject";
  2442. d = function() {
  2443. function b() {
  2444. this.matrix = null
  2445. }
  2446. b.prototype.updateColor = function(a, e, b, k, c, d, f, l) {};
  2447. return b
  2448. } ();
  2449. b.ColorTransform = d;
  2450. d.prototype.__class__ = "egret.ColorTransform"
  2451. })(egret || (egret = {}));
  2452. __extends = this.__extends ||
  2453. function(b, d) {
  2454. function c() {
  2455. this.constructor = b
  2456. }
  2457. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2458. c.prototype = d.prototype;
  2459. b.prototype = new c
  2460. }; (function(b) {
  2461. var d = function(c) {
  2462. function a() {
  2463. c.call(this);
  2464. this._touchChildren = !0;
  2465. this._children = [];
  2466. this._isContainer = !0
  2467. }
  2468. __extends(a, c);
  2469. Object.defineProperty(a.prototype, "touchChildren", {
  2470. get: function() {
  2471. return this._touchChildren
  2472. },
  2473. set: function(e) {
  2474. this._touchChildren = e
  2475. },
  2476. enumerable: !0,
  2477. configurable: !0
  2478. });
  2479. Object.defineProperty(a.prototype, "numChildren", {
  2480. get: function() {
  2481. return this._children.length
  2482. },
  2483. enumerable: !0,
  2484. configurable: !0
  2485. });
  2486. a.prototype.setChildIndex = function(e, a) {
  2487. this.doSetChildIndex(e, a)
  2488. };
  2489. a.prototype.doSetChildIndex = function(e, a) {
  2490. var k = this._children.indexOf(e);
  2491. 0 > k && b.Logger.fatalWithErrorId(1006);
  2492. this._children.splice(k, 1);
  2493. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2494. };
  2495. a.prototype.addChild = function(e) {
  2496. var a = this._children.length;
  2497. e._parent == this && a--;
  2498. return this._doAddChild(e, a)
  2499. };
  2500. a.prototype.addChildAt = function(e, a) {
  2501. return this._doAddChild(e, a)
  2502. };
  2503. a.prototype._doAddChild = function(e, m, k) {
  2504. void 0 === k && (k = !0);
  2505. if (e == this) return e;
  2506. if (0 > m || m > this._children.length) return b.Logger.fatalWithErrorId(1007),
  2507. e;
  2508. var c = e._parent;
  2509. if (c == this) return this.doSetChildIndex(e, m),
  2510. e;
  2511. if (c) {
  2512. var d = c._children.indexOf(e);
  2513. 0 <= d && c._doRemoveChild(d)
  2514. }
  2515. this._children.splice(m, 0, e);
  2516. e._parentChanged(this);
  2517. k && e.dispatchEventWith(b.Event.ADDED, !0);
  2518. if (this._stage) for (e._onAddToStage(), m = a.__EVENT__ADD_TO_STAGE_LIST; 0 < m.length;) c = m.shift(),
  2519. k && c.dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2520. e._setDirty();
  2521. this._setSizeDirty();
  2522. return e
  2523. };
  2524. a.prototype.removeChild = function(e) {
  2525. e = this._children.indexOf(e);
  2526. if (0 <= e) return this._doRemoveChild(e);
  2527. b.Logger.fatalWithErrorId(1008);
  2528. return null
  2529. };
  2530. a.prototype.removeChildAt = function(e) {
  2531. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2532. b.Logger.fatalWithErrorId(1007);
  2533. return null
  2534. };
  2535. a.prototype._doRemoveChild = function(e, m) {
  2536. void 0 === m && (m = !0);
  2537. var k = this._children,
  2538. c = k[e];
  2539. m && c.dispatchEventWith(b.Event.REMOVED, !0);
  2540. if (this._stage) {
  2541. c._onRemoveFromStage();
  2542. for (var d = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < d.length;) {
  2543. var f = d.shift();
  2544. m && f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2545. f._stage = null
  2546. }
  2547. }
  2548. c._parentChanged(null);
  2549. k.splice(e, 1);
  2550. this._setSizeDirty();
  2551. return c
  2552. };
  2553. a.prototype.getChildAt = function(e) {
  2554. if (0 <= e && e < this._children.length) return this._children[e];
  2555. b.Logger.fatalWithErrorId(1007);
  2556. return null
  2557. };
  2558. a.prototype.contains = function(e) {
  2559. for (; e;) {
  2560. if (e == this) return ! 0;
  2561. e = e._parent
  2562. }
  2563. return ! 1
  2564. };
  2565. a.prototype.swapChildrenAt = function(e, a) {
  2566. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatalWithErrorId(1007)
  2567. };
  2568. a.prototype.swapChildren = function(e, a) {
  2569. var k = this._children.indexOf(e),
  2570. c = this._children.indexOf(a); - 1 == k || -1 == c ? b.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(k, c)
  2571. };
  2572. a.prototype._swapChildrenAt = function(e, a) {
  2573. if (e != a) {
  2574. var b = this._children,
  2575. c = b[e];
  2576. b[e] = b[a];
  2577. b[a] = c
  2578. }
  2579. };
  2580. a.prototype.getChildIndex = function(e) {
  2581. return this._children.indexOf(e)
  2582. };
  2583. a.prototype.removeChildren = function() {
  2584. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2585. };
  2586. a.prototype._updateTransform = function() {
  2587. if (this._visible) {
  2588. this._filter && b.RenderCommand.push(this._setGlobalFilter, this);
  2589. this._colorTransform && b.RenderCommand.push(this._setGlobalColorTransform, this);
  2590. var e = this.mask || this._scrollRect;
  2591. e && b.RenderCommand.push(this._pushMask, this);
  2592. c.prototype._updateTransform.call(this);
  2593. if (!this._cacheAsBitmap || !this._texture_to_render) for (var a = 0,
  2594. k = this._children,
  2595. d = k.length; a < d; a++) k[a]._updateTransform();
  2596. e && b.RenderCommand.push(this._popMask, this);
  2597. this._colorTransform && b.RenderCommand.push(this._removeGlobalColorTransform, this);
  2598. this._filter && b.RenderCommand.push(this._removeGlobalFilter, this)
  2599. }
  2600. };
  2601. a.prototype._render = function(e) {
  2602. if (!b.MainContext.__use_new_draw) for (var a = 0,
  2603. k = this._children,
  2604. c = k.length; a < c; a++) k[a]._draw(e)
  2605. };
  2606. a.prototype._measureBounds = function() {
  2607. for (var e = 0,
  2608. a = 0,
  2609. k = 0,
  2610. c = 0,
  2611. d = this._children,
  2612. f = d.length,
  2613. l = 0; l < f; l++) {
  2614. var n = d[l];
  2615. if (n._visible) {
  2616. var p = n.getBounds(b.Rectangle.identity, !1),
  2617. q = p.x,
  2618. r = p.y,
  2619. t = p.width,
  2620. p = p.height,
  2621. n = n._getMatrix(),
  2622. n = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(q, r, t, p), n),
  2623. q = n.x,
  2624. r = n.y,
  2625. t = n.width + n.x,
  2626. n = n.height + n.y;
  2627. if (q < e || 0 == l) e = q;
  2628. if (t > a || 0 == l) a = t;
  2629. if (r < k || 0 == l) k = r;
  2630. if (n > c || 0 == l) c = n
  2631. }
  2632. }
  2633. return b.Rectangle.identity.initialize(e, k, a - e, c - k)
  2634. };
  2635. a.prototype.hitTest = function(e, a, k) {
  2636. void 0 === k && (k = !1);
  2637. var d;
  2638. if (!this._visible) return null;
  2639. if (this._scrollRect) {
  2640. 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
  2641. } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  2642. for (var g = this._children,
  2643. f = this._touchChildren,
  2644. l = g.length - 1; 0 <= l; l--) {
  2645. var n = g[l],
  2646. p = n._getMatrix(),
  2647. q = n._scrollRect;
  2648. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2649. p.invert();
  2650. p = b.Matrix.transformCoords(p, e, a);
  2651. if (n = n.hitTest(p.x, p.y, !0)) {
  2652. if (!f) return this;
  2653. if (n._touchEnabled && f) return n;
  2654. d = this
  2655. }
  2656. }
  2657. return d ? d: this._texture_to_render ? c.prototype.hitTest.call(this, e, a, k) : null
  2658. };
  2659. a.prototype._onAddToStage = function() {
  2660. c.prototype._onAddToStage.call(this);
  2661. for (var e = this._children.length,
  2662. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2663. };
  2664. a.prototype._onRemoveFromStage = function() {
  2665. c.prototype._onRemoveFromStage.call(this);
  2666. for (var e = this._children,
  2667. a = e.length,
  2668. b = 0; b < a; b++) e[b]._onRemoveFromStage()
  2669. };
  2670. a.prototype.getChildByName = function(e) {
  2671. for (var a = this._children,
  2672. b = a.length,
  2673. c, d = 0; d < b; d++) if (c = a[d], c.name == e) return c;
  2674. return null
  2675. };
  2676. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2677. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2678. return a
  2679. } (b.DisplayObject);
  2680. b.DisplayObjectContainer = d;
  2681. d.prototype.__class__ = "egret.DisplayObjectContainer"
  2682. })(egret || (egret = {})); (function(b) {
  2683. var d = function() {
  2684. function b() {}
  2685. b.NO_BORDER = "noBorder";
  2686. b.NO_SCALE = "noScale";
  2687. b.SHOW_ALL = "showAll";
  2688. b.EXACT_FIT = "exactFit";
  2689. return b
  2690. } ();
  2691. b.StageScaleMode = d;
  2692. d.prototype.__class__ = "egret.StageScaleMode"
  2693. })(egret || (egret = {}));
  2694. __extends = this.__extends ||
  2695. function(b, d) {
  2696. function c() {
  2697. this.constructor = b
  2698. }
  2699. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2700. c.prototype = d.prototype;
  2701. b.prototype = new c
  2702. }; (function(b) {
  2703. var d = function(c) {
  2704. function a(e, a) {
  2705. void 0 === e && (e = 480);
  2706. void 0 === a && (a = 800);
  2707. c.call(this);
  2708. this._changeSizeDispatchFlag = !0;
  2709. this._scaleMode = "";
  2710. this._stageHeight = this._stageWidth = NaN;
  2711. this.touchEnabled = !0;
  2712. this._stage = this;
  2713. this._stageWidth = e;
  2714. this._stageHeight = a
  2715. }
  2716. __extends(a, c);
  2717. a.prototype.invalidate = function() {
  2718. a._invalidateRenderFlag = !0
  2719. };
  2720. Object.defineProperty(a.prototype, "scaleMode", {
  2721. get: function() {
  2722. return this._scaleMode
  2723. },
  2724. set: function(e) {
  2725. this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
  2726. },
  2727. enumerable: !0,
  2728. configurable: !0
  2729. });
  2730. a.prototype.changeSize = function() {
  2731. this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(b.Event.RESIZE))
  2732. };
  2733. a.prototype.setResolutionPolicy = function() {
  2734. var e = a.SCALE_MODE_ENUM[this._scaleMode];
  2735. if (!e) throw Error(b.getString(1024));
  2736. var m = new b.EqualToFrame,
  2737. e = new b.ResolutionPolicy(m, e);
  2738. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  2739. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2740. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2741. };
  2742. Object.defineProperty(a.prototype, "stageWidth", {
  2743. get: function() {
  2744. return this._stageWidth
  2745. },
  2746. enumerable: !0,
  2747. configurable: !0
  2748. });
  2749. Object.defineProperty(a.prototype, "stageHeight", {
  2750. get: function() {
  2751. return this._stageHeight
  2752. },
  2753. enumerable: !0,
  2754. configurable: !0
  2755. });
  2756. a.prototype.hitTest = function(e, a, k) {
  2757. if (!this._touchEnabled) return null;
  2758. var c;
  2759. if (!this._touchChildren) return this;
  2760. k = this._children;
  2761. for (var d = k.length - 1; 0 <= d; d--) {
  2762. c = k[d];
  2763. var f = c._getMatrix(),
  2764. l = c._scrollRect;
  2765. l && f.append(1, 0, 0, 1, -l.x, -l.y);
  2766. f.invert();
  2767. f = b.Matrix.transformCoords(f, e, a);
  2768. if ((c = c.hitTest(f.x, f.y, !0)) && c._touchEnabled) return c
  2769. }
  2770. return this
  2771. };
  2772. a.prototype.getBounds = function(e) {
  2773. e || (e = new b.Rectangle);
  2774. return e.initialize(0, 0, this._stageWidth, this._stageHeight)
  2775. };
  2776. a.prototype._updateTransform = function() {
  2777. for (var e = 0,
  2778. a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2779. };
  2780. Object.defineProperty(a.prototype, "focus", {
  2781. get: function() {
  2782. return null
  2783. },
  2784. enumerable: !0,
  2785. configurable: !0
  2786. });
  2787. a.registerScaleMode = function(e, m, k) {
  2788. a.SCALE_MODE_ENUM[e] && !k ? b.Logger.warningWithErrorId(1009, e) : a.SCALE_MODE_ENUM[e] = m
  2789. };
  2790. a._invalidateRenderFlag = !1;
  2791. a.SCALE_MODE_ENUM = {};
  2792. return a
  2793. } (b.DisplayObjectContainer);
  2794. b.Stage = d;
  2795. d.prototype.__class__ = "egret.Stage"
  2796. })(egret || (egret = {}));
  2797. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
  2798. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
  2799. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
  2800. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen;
  2801. __extends = this.__extends ||
  2802. function(b, d) {
  2803. function c() {
  2804. this.constructor = b
  2805. }
  2806. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2807. c.prototype = d.prototype;
  2808. b.prototype = new c
  2809. }; (function(b) {
  2810. var d = function(c) {
  2811. function a(e) {
  2812. void 0 === e && (e = null);
  2813. c.call(this);
  2814. this._lastTouchPosition = new b.Point(0, 0);
  2815. this._touchStartPosition = new b.Point(0, 0);
  2816. this._scrollStarted = !1;
  2817. this._lastTouchTime = 0;
  2818. this._lastTouchEvent = null;
  2819. this._velocitys = [];
  2820. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  2821. this._vScrollTween = this._hScrollTween = null;
  2822. this.scrollBeginThreshold = 10;
  2823. this.scrollSpeed = 1;
  2824. this._content = null;
  2825. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2826. this._scrollTop = this._scrollLeft = 0;
  2827. this._vCanScroll = this._hCanScroll = !1;
  2828. this.touchBeginTimer = this.delayTouchBeginEvent = null;
  2829. this.touchEnabled = !0;
  2830. e && this.setContent(e)
  2831. }
  2832. __extends(a, c);
  2833. a.prototype.setContent = function(e) {
  2834. this._content !== e && (this.removeContent(), e && (this._content = e, c.prototype.addChild.call(this, e), this._addEvents()))
  2835. };
  2836. a.prototype.removeContent = function() {
  2837. this._content && (this._removeEvents(), c.prototype.removeChildAt.call(this, 0));
  2838. this._content = null
  2839. };
  2840. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2841. get: function() {
  2842. return this._verticalScrollPolicy
  2843. },
  2844. set: function(e) {
  2845. e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
  2846. },
  2847. enumerable: !0,
  2848. configurable: !0
  2849. });
  2850. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2851. get: function() {
  2852. return this._horizontalScrollPolicy
  2853. },
  2854. set: function(e) {
  2855. e != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
  2856. },
  2857. enumerable: !0,
  2858. configurable: !0
  2859. });
  2860. Object.defineProperty(a.prototype, "scrollLeft", {
  2861. get: function() {
  2862. return this._scrollLeft
  2863. },
  2864. set: function(e) {
  2865. e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
  2866. },
  2867. enumerable: !0,
  2868. configurable: !0
  2869. });
  2870. Object.defineProperty(a.prototype, "scrollTop", {
  2871. get: function() {
  2872. return this._scrollTop
  2873. },
  2874. set: function(e) {
  2875. e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
  2876. },
  2877. enumerable: !0,
  2878. configurable: !0
  2879. });
  2880. a.prototype.setScrollPosition = function(e, a, b) {
  2881. void 0 === b && (b = !1);
  2882. if (!b || 0 != e || 0 != a) if (b || this._scrollTop != e || this._scrollLeft != a) {
  2883. if (b) {
  2884. b = this._isOnTheEdge(!0);
  2885. var c = this._isOnTheEdge(!1);
  2886. this._scrollTop += b ? e / 2 : e;
  2887. this._scrollLeft += c ? a / 2 : a
  2888. } else this._scrollTop = e,
  2889. this._scrollLeft = a;
  2890. this._validatePosition(!0, !0);
  2891. this._updateContentPosition()
  2892. }
  2893. };
  2894. a.prototype._isOnTheEdge = function(e) {
  2895. void 0 === e && (e = !0);
  2896. var a = this._scrollTop,
  2897. b = this._scrollLeft;
  2898. return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2899. };
  2900. a.prototype._validatePosition = function(e, a) {
  2901. void 0 === e && (e = !1);
  2902. void 0 === a && (a = !1);
  2903. if (e) {
  2904. var b = this.height,
  2905. c = this._getContentHeight();
  2906. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2907. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : b / 2)
  2908. }
  2909. 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 : b / 2))
  2910. };
  2911. a.prototype._setWidth = function(e) {
  2912. this._explicitWidth != e && (c.prototype._setWidth.call(this, e), this._updateContentPosition())
  2913. };
  2914. a.prototype._setHeight = function(e) {
  2915. this._explicitHeight != e && (c.prototype._setHeight.call(this, e), this._updateContentPosition())
  2916. };
  2917. a.prototype._updateContentPosition = function() {
  2918. var e = this.getBounds(b.Rectangle.identity);
  2919. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
  2920. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2921. };
  2922. a.prototype._checkScrollPolicy = function() {
  2923. var e = this.__checkScrollPolicy(this._horizontalScrollPolicy, this._getContentWidth(), this.width);
  2924. this._hCanScroll = e;
  2925. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2926. this._vCanScroll = a;
  2927. return e || a
  2928. };
  2929. a.prototype.__checkScrollPolicy = function(e, a, b) {
  2930. return "on" == e ? !0 : "off" == e ? !1 : a > b
  2931. };
  2932. a.prototype._addEvents = function() {
  2933. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2934. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2935. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2936. };
  2937. a.prototype._removeEvents = function() {
  2938. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2939. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2940. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2941. };
  2942. a.prototype._onTouchBegin = function(e) { ! e._isDefaultPrevented && this._checkScrollPolicy() && (this._touchStartPosition.x = e.stageX, this._touchStartPosition.y = e.stageY, (this._isHTweenPlaying || this._isVTweenPlaying) && this._onScrollFinished(), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(e), e.preventDefault())
  2943. };
  2944. a.prototype._onTouchBeginCapture = function(e) {
  2945. var a = this._checkScrollPolicy();
  2946. if (a) {
  2947. for (var k = e.target; k != this;) {
  2948. if ("_checkScrollPolicy" in k && (a = k._checkScrollPolicy())) return;
  2949. k = k.parent
  2950. }
  2951. e.stopPropagation();
  2952. this.delayTouchBeginEvent = this.cloneTouchEvent(e);
  2953. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100, 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2954. this.touchBeginTimer.start();
  2955. this._onTouchBegin(e)
  2956. }
  2957. };
  2958. a.prototype._onTouchEndCapture = function(e) {
  2959. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2960. };
  2961. a.prototype._onTouchBeginTimer = function() {
  2962. this.touchBeginTimer.stop();
  2963. var e = this.delayTouchBeginEvent;
  2964. this.delayTouchBeginEvent = null;
  2965. this.stage && this.dispatchPropagationEvent(e)
  2966. };
  2967. a.prototype.dispatchPropagationEvent = function(e) {
  2968. for (var a = [], b = e._target, c = 0; b;) b == this && (c = a.length),
  2969. a.push(b),
  2970. b = b.parent;
  2971. b = a.slice(0, c);
  2972. b = b.reverse();
  2973. a = b.concat(a);
  2974. this._dispatchPropagationEvent(e, a, c)
  2975. };
  2976. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2977. for (var c = a.length,
  2978. d = 0; d < c; d++) {
  2979. var f = a[d];
  2980. e._currentTarget = f;
  2981. e._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  2982. f._notifyListener(e);
  2983. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  2984. }
  2985. };
  2986. a.prototype._onTouchMove = function(e) {
  2987. if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
  2988. if (!this._scrollStarted) {
  2989. var a = e.stageX - this._touchStartPosition.x,
  2990. b = e.stageY - this._touchStartPosition.y;
  2991. if (Math.sqrt(a * a + b * b) < this.scrollBeginThreshold) {
  2992. this._logTouchEvent(e);
  2993. return
  2994. }
  2995. }
  2996. this._scrollStarted = !0;
  2997. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2998. this.touchChildren = !1;
  2999. a = this._getPointChange(e);
  3000. this.setScrollPosition(a.y, a.x, !0);
  3001. this._calcVelocitys(e);
  3002. this._logTouchEvent(e)
  3003. }
  3004. };
  3005. a.prototype._onTouchEnd = function(e) {
  3006. this.touchChildren = !0;
  3007. this._scrollStarted = !1;
  3008. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  3009. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  3010. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  3011. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  3012. this._moveAfterTouchEnd()
  3013. };
  3014. a.prototype._onEnterFrame = function(e) {
  3015. e = b.getTimer();
  3016. 100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  3017. };
  3018. a.prototype._logTouchEvent = function(e) {
  3019. this._lastTouchPosition.x = e.stageX;
  3020. this._lastTouchPosition.y = e.stageY;
  3021. this._lastTouchEvent = this.cloneTouchEvent(e);
  3022. this._lastTouchTime = b.getTimer()
  3023. };
  3024. a.prototype._getPointChange = function(e) {
  3025. return {
  3026. x: !1 === this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
  3027. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
  3028. }
  3029. };
  3030. a.prototype._calcVelocitys = function(e) {
  3031. var a = b.getTimer();
  3032. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  3033. else {
  3034. var k = this._getPointChange(e),
  3035. a = a - this._lastTouchTime;
  3036. k.x /= a;
  3037. k.y /= a;
  3038. this._velocitys.push(k);
  3039. 5 < this._velocitys.length && this._velocitys.shift();
  3040. this._lastTouchPosition.x = e.stageX;
  3041. this._lastTouchPosition.y = e.stageY
  3042. }
  3043. };
  3044. a.prototype._getContentWidth = function() {
  3045. return this._content.explicitWidth || this._content.width
  3046. };
  3047. a.prototype._getContentHeight = function() {
  3048. return this._content.explicitHeight || this._content.height
  3049. };
  3050. a.prototype.getMaxScrollLeft = function() {
  3051. var e = this._getContentWidth() - this.width;
  3052. return Math.max(0, e)
  3053. };
  3054. a.prototype.getMaxScrollTop = function() {
  3055. var e = this._getContentHeight() - this.height;
  3056. return Math.max(0, e)
  3057. };
  3058. a.prototype._moveAfterTouchEnd = function() {
  3059. if (0 != this._velocitys.length) {
  3060. for (var e = 0,
  3061. b = 0,
  3062. k = 0,
  3063. c = 0; c < this._velocitys.length; c++) var d = this._velocitys[c],
  3064. f = a.weight[c],
  3065. e = e + d.x * f,
  3066. b = b + d.y * f,
  3067. k = k + f;
  3068. this._velocitys.length = 0;
  3069. 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
  3070. e = e / k * this.scrollSpeed;
  3071. b = b / k * this.scrollSpeed;
  3072. d = Math.abs(e);
  3073. k = Math.abs(b);
  3074. f = this.getMaxScrollLeft();
  3075. c = this.getMaxScrollTop();
  3076. e = 0.02 < d ? this.getAnimationDatas(e, this._scrollLeft, f) : {
  3077. position: this._scrollLeft,
  3078. duration: 1
  3079. };
  3080. b = 0.02 < k ? this.getAnimationDatas(b, this._scrollTop, c) : {
  3081. position: this._scrollTop,
  3082. duration: 1
  3083. };
  3084. this.setScrollLeft(e.position, e.duration);
  3085. this.setScrollTop(b.position, b.duration)
  3086. }
  3087. };
  3088. a.prototype._onTweenFinished = function(e) {
  3089. e == this._vScrollTween && (this._isVTweenPlaying = !1);
  3090. e == this._hScrollTween && (this._isHTweenPlaying = !1); ! 1 == this._isHTweenPlaying && !1 == this._isVTweenPlaying && this._onScrollFinished()
  3091. };
  3092. a.prototype._onScrollStarted = function() {};
  3093. a.prototype._onScrollFinished = function() {
  3094. b.Tween.removeTweens(this);
  3095. this._vScrollTween = this._hScrollTween = null;
  3096. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  3097. this.dispatchEvent(new b.Event(b.Event.COMPLETE))
  3098. };
  3099. a.prototype.setScrollTop = function(e, a) {
  3100. void 0 === a && (a = 0);
  3101. var k = Math.min(this.getMaxScrollTop(), Math.max(e, 0));
  3102. if (0 == a) return this.scrollTop = k,
  3103. null;
  3104. var c = b.Tween.get(this).to({
  3105. scrollTop: e
  3106. },
  3107. a, b.Ease.quartOut);
  3108. k != e && c.to({
  3109. scrollTop: k
  3110. },
  3111. 300, b.Ease.quintOut);
  3112. this._isVTweenPlaying = !0;
  3113. this._vScrollTween = c;
  3114. c.call(this._onTweenFinished, this, [c]);
  3115. this._isHTweenPlaying || this._onScrollStarted();
  3116. return c
  3117. };
  3118. a.prototype.setScrollLeft = function(e, a) {
  3119. void 0 === a && (a = 0);
  3120. var k = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
  3121. if (0 == a) return this.scrollLeft = k,
  3122. null;
  3123. var c = b.Tween.get(this).to({
  3124. scrollLeft: e
  3125. },
  3126. a, b.Ease.quartOut);
  3127. k != e && c.to({
  3128. scrollLeft: k
  3129. },
  3130. 300, b.Ease.quintOut);
  3131. this._isHTweenPlaying = !0;
  3132. this._hScrollTween = c;
  3133. c.call(this._onTweenFinished, this, [c]);
  3134. this._isVTweenPlaying || this._onScrollStarted();
  3135. return c
  3136. };
  3137. a.prototype.getAnimationDatas = function(e, a, b) {
  3138. var c = Math.abs(e),
  3139. d = 0,
  3140. f = a + 500 * e;
  3141. if (0 > f || f > b) for (f = a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e,
  3142. e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e,
  3143. d++;
  3144. else d = 500 * -Math.log(0.02 / c);
  3145. return {
  3146. position: Math.min(b + 50, Math.max(f, -50)),
  3147. duration: d
  3148. }
  3149. };
  3150. a.prototype.cloneTouchEvent = function(e) {
  3151. var a = new b.TouchEvent(e._type, e._bubbles, e.cancelable);
  3152. a.touchPointID = e.touchPointID;
  3153. a._stageX = e._stageX;
  3154. a._stageY = e._stageY;
  3155. a.ctrlKey = e.ctrlKey;
  3156. a.altKey = e.altKey;
  3157. a.shiftKey = e.shiftKey;
  3158. a.touchDown = e.touchDown;
  3159. a._isDefaultPrevented = !1;
  3160. a._target = e._target;
  3161. return a
  3162. };
  3163. a.prototype.throwNotSupportedError = function() {
  3164. throw Error(b.getString(1023));
  3165. };
  3166. a.prototype.addChild = function(e) {
  3167. this.throwNotSupportedError();
  3168. return null
  3169. };
  3170. a.prototype.addChildAt = function(e, a) {
  3171. this.throwNotSupportedError();
  3172. return null
  3173. };
  3174. a.prototype.removeChild = function(e) {
  3175. this.throwNotSupportedError();
  3176. return null
  3177. };
  3178. a.prototype.removeChildAt = function(e) {
  3179. this.throwNotSupportedError();
  3180. return null
  3181. };
  3182. a.prototype.setChildIndex = function(e, a) {
  3183. this.throwNotSupportedError()
  3184. };
  3185. a.prototype.swapChildren = function(e, a) {
  3186. this.throwNotSupportedError()
  3187. };
  3188. a.prototype.swapChildrenAt = function(e, a) {
  3189. this.throwNotSupportedError()
  3190. };
  3191. a.prototype.hitTest = function(e, a, k) {
  3192. void 0 === k && (k = !1);
  3193. var d = c.prototype.hitTest.call(this, e, a, k);
  3194. return d ? d: b.DisplayObject.prototype.hitTest.call(this, e, a, k)
  3195. };
  3196. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3197. return a
  3198. } (b.DisplayObjectContainer);
  3199. b.ScrollView = d;
  3200. d.prototype.__class__ = "egret.ScrollView"
  3201. })(egret || (egret = {})); (function(b) {
  3202. var d = function() {
  3203. function b() {}
  3204. b.REPEAT = "repeat";
  3205. b.SCALE = "scale";
  3206. return b
  3207. } ();
  3208. b.BitmapFillMode = d;
  3209. d.prototype.__class__ = "egret.BitmapFillMode"
  3210. })(egret || (egret = {}));
  3211. __extends = this.__extends ||
  3212. function(b, d) {
  3213. function c() {
  3214. this.constructor = b
  3215. }
  3216. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3217. c.prototype = d.prototype;
  3218. b.prototype = new c
  3219. }; (function(b) {
  3220. var d = function(c) {
  3221. function a(e) {
  3222. c.call(this);
  3223. this.scale9Grid = this._texture = null;
  3224. this.fillMode = "scale";
  3225. e && (this._texture = e, this._setSizeDirty());
  3226. this.needDraw = !0
  3227. }
  3228. __extends(a, c);
  3229. Object.defineProperty(a.prototype, "texture", {
  3230. get: function() {
  3231. return this._texture
  3232. },
  3233. set: function(e) {
  3234. e != this._texture && (this._setSizeDirty(), this._texture = e)
  3235. },
  3236. enumerable: !0,
  3237. configurable: !0
  3238. });
  3239. a.prototype._render = function(e) {
  3240. var b = this._texture;
  3241. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth: b._textureWidth, this._hasHeightSet ? this._explicitHeight: b._textureHeight, this)) : this._texture_to_render = null
  3242. };
  3243. a._drawBitmap = function(e, b, k, c) {
  3244. var d = c._texture_to_render;
  3245. if (d) {
  3246. var f = d._textureWidth,
  3247. l = d._textureHeight;
  3248. if ("scale" == c.fillMode) {
  3249. var n = c.scale9Grid || d.scale9Grid;
  3250. if (n && f - n.width < b && l - n.height < k) a.drawScale9GridImage(e, c, n, b, k);
  3251. else {
  3252. var n = d._offsetX,
  3253. p = d._offsetY,
  3254. q = d._bitmapWidth || f,
  3255. r = d._bitmapHeight || l;
  3256. b /= f;
  3257. n = Math.round(n * b);
  3258. b = Math.round(q * b);
  3259. k /= l;
  3260. p = Math.round(p * k);
  3261. k = Math.round(r * k);
  3262. a.renderFilter.drawImage(e, c, d._bitmapX, d._bitmapY, q, r, n, p, b, k)
  3263. }
  3264. } else a.drawRepeatImage(e, c, b, k, c.fillMode)
  3265. }
  3266. };
  3267. a.drawRepeatImage = function(e, a, c, d, g) {
  3268. var f = a._texture_to_render;
  3269. if (f) {
  3270. var l = f._textureWidth,
  3271. n = f._textureHeight,
  3272. p = f._bitmapX,
  3273. q = f._bitmapY,
  3274. l = f._bitmapWidth || l,
  3275. n = f._bitmapHeight || n,
  3276. r = f._offsetX,
  3277. f = f._offsetY;
  3278. b.RenderFilter.getInstance().drawImage(e, a, p, q, l, n, r, f, c, d, g)
  3279. }
  3280. };
  3281. a.drawScale9GridImage = function(e, a, c, d, g) {
  3282. var f = b.MainContext.instance.rendererContext._texture_scale_factor,
  3283. l = a._texture_to_render;
  3284. if (l && c) {
  3285. var n = l._textureWidth,
  3286. p = l._textureHeight,
  3287. q = l._bitmapX,
  3288. r = l._bitmapY,
  3289. t = l._bitmapWidth || n,
  3290. s = l._bitmapHeight || p;
  3291. d -= n - t;
  3292. g -= p - s;
  3293. if (!e.drawImageScale9(l, q, r, t, s, l._offsetX, l._offsetY, d, g, c)) {
  3294. n = l._offsetX / f;
  3295. p = l._offsetY / f;
  3296. l = b.RenderFilter.getInstance();
  3297. c = b.Rectangle.identity.initialize(c.x - Math.round(n), c.y - Math.round(n), c.width, c.height);
  3298. n = Math.round(n);
  3299. p = Math.round(p);
  3300. c.y == c.bottom && (c.bottom < s ? c.bottom++:c.y--);
  3301. c.x == c.right && (c.right < t ? c.right++:c.x--);
  3302. var u = q + c.x / f,
  3303. w = q + c.right / f,
  3304. v = t - c.right,
  3305. y = r + c.y / f,
  3306. f = r + c.bottom / f,
  3307. x = s - c.bottom,
  3308. z = n + c.x,
  3309. A = p + c.y,
  3310. s = g - (s - c.bottom),
  3311. t = d - (t - c.right);
  3312. l.drawImage(e, a, q, r, c.x, c.y, n, p, c.x, c.y);
  3313. l.drawImage(e, a, u, r, c.width, c.y, z, p, t - c.x, c.y);
  3314. l.drawImage(e, a, w, r, v, c.y, n + t, p, d - t, c.y);
  3315. l.drawImage(e, a, q, y, c.x, c.height, n, A, c.x, s - c.y);
  3316. l.drawImage(e, a, u, y, c.width, c.height, z, A, t - c.x, s - c.y);
  3317. l.drawImage(e, a, w, y, v, c.height, n + t, A, d - t, s - c.y);
  3318. l.drawImage(e, a, q, f, c.x, x, n, p + s, c.x, g - s);
  3319. l.drawImage(e, a, u, f, c.width, x, z, p + s, t - c.x, g - s);
  3320. l.drawImage(e, a, w, f, v, x, n + t, p + s, d - t, g - s)
  3321. }
  3322. }
  3323. };
  3324. a.prototype._measureBounds = function() {
  3325. var e = this._texture;
  3326. return e ? b.Rectangle.identity.initialize(0, 0, e._textureWidth, e._textureHeight) : c.prototype._measureBounds.call(this)
  3327. };
  3328. a.renderFilter = b.RenderFilter.getInstance();
  3329. return a
  3330. } (b.DisplayObject);
  3331. b.Bitmap = d;
  3332. d.prototype.__class__ = "egret.Bitmap"
  3333. })(egret || (egret = {}));
  3334. __extends = this.__extends ||
  3335. function(b, d) {
  3336. function c() {
  3337. this.constructor = b
  3338. }
  3339. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3340. c.prototype = d.prototype;
  3341. b.prototype = new c
  3342. }; (function(b) {
  3343. var d = function(c) {
  3344. function a() {
  3345. c.call(this);
  3346. this._text = "";
  3347. this._textChanged = !1;
  3348. this._font = null;
  3349. this._fontChanged = !1;
  3350. this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = 0;
  3351. this.textLinesChange = !0;
  3352. this._lineHeights = [];
  3353. this.needDraw = this.cacheAsBitmap = !0
  3354. }
  3355. __extends(a, c);
  3356. Object.defineProperty(a.prototype, "text", {
  3357. get: function() {
  3358. return this._text
  3359. },
  3360. set: function(e) {
  3361. this._text != e && (this._textChanged = !0, this._text = e, this._setSizeDirty())
  3362. },
  3363. enumerable: !0,
  3364. configurable: !0
  3365. });
  3366. Object.defineProperty(a.prototype, "font", {
  3367. get: function() {
  3368. return this._font
  3369. },
  3370. set: function(e) {
  3371. this._font != e && (this._font = e, this._fontChanged = !0, this._setSizeDirty())
  3372. },
  3373. enumerable: !0,
  3374. configurable: !0
  3375. });
  3376. a.prototype._setSizeDirty = function() {
  3377. c.prototype._setSizeDirty.call(this);
  3378. this.textLinesChange = !0
  3379. };
  3380. a.prototype._render = function(e) {
  3381. var m = this._getTextLines(),
  3382. c = m.length;
  3383. if (0 != c) {
  3384. for (var d = this._font,
  3385. g = d._getFirstCharHeight(), g = Math.ceil(g * a.EMPTY_FACTOR), f = 0, l = this._hasHeightSet ? this._explicitHeight: Number.POSITIVE_INFINITY, n = this._lineHeights, p = 0; p < c; p++) {
  3386. var q = n[p];
  3387. if (0 < p && f + q > l) break;
  3388. for (var r = m[p], t = r.length, s = 0, u = 0; u < t; u++) {
  3389. var w = r.charAt(u),
  3390. v = d.getTexture(w);
  3391. if (v) {
  3392. var w = v._bitmapWidth || v._textureWidth,
  3393. y = v._bitmapHeight || v._textureHeight;
  3394. this._texture_to_render = v;
  3395. b.RenderFilter.getInstance().drawImage(e, this, v._bitmapX, v._bitmapY, w, y, s + v._offsetX, f + v._offsetY, w, y);
  3396. s += v._textureWidth
  3397. } else " " == w ? s += g: b.Logger.warningWithErrorId(1011, w)
  3398. }
  3399. f += q
  3400. }
  3401. this._texture_to_render = null
  3402. }
  3403. };
  3404. a.prototype._measureBounds = function() {
  3405. return 0 == this._getTextLines().length ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY)
  3406. };
  3407. a.prototype._getTextLines = function() {
  3408. if (!this.textLinesChange) return this._textLines;
  3409. var e = [];
  3410. this._textLines = e;
  3411. this.textLinesChange = !1;
  3412. var m = [];
  3413. this._lineHeights = m;
  3414. if (!this._text || !this._font) return e;
  3415. for (var c = 0,
  3416. d = 0,
  3417. g = 0,
  3418. f = 0,
  3419. l = this._hasWidthSet,
  3420. n = this._hasWidthSet ? this._explicitWidth: Number.POSITIVE_INFINITY, p = this._font, q = p._getFirstCharHeight(), r = Math.ceil(q * a.EMPTY_FACTOR), t = this._text.split(/(?:\r\n|\r|\n)/), s = t.length, u = !0, w = 0; w < s; w++) {
  3421. for (var v = t[w], y = v.length, x = 0, z = 0, A = !0, C = 0; C < y; C++) {
  3422. var B = v.charAt(C),
  3423. E,
  3424. F = 0,
  3425. G = 0,
  3426. D = p.getTexture(B);
  3427. if (D) B = D._textureWidth,
  3428. E = D._textureHeight,
  3429. F = D._offsetX,
  3430. G = D._offsetY;
  3431. else if (" " == B) B = r,
  3432. E = q;
  3433. else {
  3434. b.Logger.warningWithErrorId(1011, B);
  3435. A && (A = !1);
  3436. continue
  3437. }
  3438. A && (A = !1, g = Math.min(F, g));
  3439. u && (f = Math.min(G, f));
  3440. l && 0 < C && z + B > n ? (e.push(v.substring(0, C)), m.push(x), d += x, c = Math.max(z, c), v = v.substring(C), y = v.length, C = 0, z = B, x = E) : (z += B, x = Math.max(E, x))
  3441. }
  3442. u && (u = !1);
  3443. e.push(v);
  3444. m.push(x);
  3445. d += x;
  3446. c = Math.max(z, c)
  3447. }
  3448. this._textWidth = c;
  3449. this._textHeight = d;
  3450. this._textOffsetX = g;
  3451. this._textOffsetY = f;
  3452. return e
  3453. };
  3454. a.EMPTY_FACTOR = 0.33;
  3455. return a
  3456. } (b.DisplayObject);
  3457. b.BitmapText = d;
  3458. d.prototype.__class__ = "egret.BitmapText"
  3459. })(egret || (egret = {})); (function(b) {
  3460. var d = function() {
  3461. function c() {
  3462. this.fillStyleColor = this.strokeStyleColor = this.renderContext = this.commandQueue = this.canvasContext = null;
  3463. this._dirty = !1;
  3464. this.lineY = this.lineX = 0;
  3465. this._firstCheck = !0;
  3466. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3467. this.commandQueue = []
  3468. }
  3469. c.prototype.beginFill = function(a, e) {};
  3470. c.prototype._setStyle = function(a) {};
  3471. c.prototype.drawRect = function(a, e, b, c) {
  3472. this.checkRect(a, e, b, c)
  3473. };
  3474. c.prototype.drawCircle = function(a, e, b) {
  3475. this.checkRect(a - b, e - b, 2 * b, 2 * b)
  3476. };
  3477. c.prototype.drawRoundRect = function(a, e, b, c, d, g) {
  3478. this.checkRect(a, e, b, c)
  3479. };
  3480. c.prototype.drawEllipse = function(a, e, b, c) {
  3481. this.checkRect(a - b, e - c, 2 * b, 2 * c)
  3482. };
  3483. c.prototype.lineStyle = function(a, e, b, c, d, g, f, l) {};
  3484. c.prototype.lineTo = function(a, e) {
  3485. this.checkPoint(a, e)
  3486. };
  3487. c.prototype.curveTo = function(a, e, b, c) {
  3488. this.checkPoint(a, e);
  3489. this.checkPoint(b, c)
  3490. };
  3491. c.prototype.moveTo = function(a, e) {
  3492. this.checkPoint(a, e)
  3493. };
  3494. c.prototype.clear = function() {
  3495. this._maxY = this._maxX = this._minY = this._minX = 0;
  3496. this._firstCheck = !0
  3497. };
  3498. c.prototype.endFill = function() {};
  3499. c.prototype._draw = function(a) {};
  3500. c.prototype.checkRect = function(a, e, b, c) {
  3501. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = e, this._maxX = a + b, this._maxY = e + c) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, e), this._maxX = Math.max(this._maxX, a + b), this._maxY = Math.max(this._maxY, e + c))
  3502. };
  3503. c.prototype.checkPoint = function(a, e) {
  3504. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = e, this._maxX = a, this._maxY = e) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, e), this._maxX = Math.max(this._maxX, a), this._maxY = Math.max(this._maxY, e));
  3505. this._lastX = a;
  3506. this._lastY = e
  3507. };
  3508. c.prototype._measureBounds = function() {
  3509. return b.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
  3510. };
  3511. return c
  3512. } ();
  3513. b.Graphics = d;
  3514. d.prototype.__class__ = "egret.Graphics"; (function() {
  3515. return function(b, a, e) {
  3516. this.method = b;
  3517. this.thisObject = a;
  3518. this.args = e
  3519. }
  3520. })().prototype.__class__ = "egret.Command"
  3521. })(egret || (egret = {}));
  3522. __extends = this.__extends ||
  3523. function(b, d) {
  3524. function c() {
  3525. this.constructor = b
  3526. }
  3527. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3528. c.prototype = d.prototype;
  3529. b.prototype = new c
  3530. }; (function(b) {
  3531. var d = function(c) {
  3532. function a() {
  3533. c.call(this);
  3534. this._graphics = null
  3535. }
  3536. __extends(a, c);
  3537. Object.defineProperty(a.prototype, "graphics", {
  3538. get: function() {
  3539. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3540. return this._graphics
  3541. },
  3542. enumerable: !0,
  3543. configurable: !0
  3544. });
  3545. a.prototype._render = function(e) {
  3546. this._graphics && this._graphics._draw(e)
  3547. };
  3548. a.prototype._measureBounds = function() {
  3549. var e = this._graphics;
  3550. return e ? e._measureBounds() : c.prototype._measureBounds.call(this)
  3551. };
  3552. return a
  3553. } (b.DisplayObject);
  3554. b.Shape = d;
  3555. d.prototype.__class__ = "egret.Shape"
  3556. })(egret || (egret = {}));
  3557. __extends = this.__extends ||
  3558. function(b, d) {
  3559. function c() {
  3560. this.constructor = b
  3561. }
  3562. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3563. c.prototype = d.prototype;
  3564. b.prototype = new c
  3565. }; (function(b) {
  3566. var d = function(c) {
  3567. function a() {
  3568. c.call(this);
  3569. this._graphics = null
  3570. }
  3571. __extends(a, c);
  3572. Object.defineProperty(a.prototype, "graphics", {
  3573. get: function() {
  3574. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3575. return this._graphics
  3576. },
  3577. enumerable: !0,
  3578. configurable: !0
  3579. });
  3580. a.prototype._render = function(e) {
  3581. this._graphics && this._graphics._draw(e);
  3582. c.prototype._render.call(this, e)
  3583. };
  3584. a.prototype._measureBounds = function() {
  3585. for (var e = 0,
  3586. a = 0,
  3587. c = 0,
  3588. d = 0,
  3589. g = this._children.length,
  3590. f = 0; f < g; f++) {
  3591. var l = this._children[f];
  3592. if (l._visible) {
  3593. var n = l.getBounds(b.Rectangle.identity, !1),
  3594. p = n.x,
  3595. q = n.y,
  3596. r = n.width,
  3597. n = n.height,
  3598. l = l._getMatrix(),
  3599. l = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p, q, r, n), l),
  3600. p = l.x,
  3601. q = l.y,
  3602. r = l.width + l.x,
  3603. l = l.height + l.y;
  3604. if (p < e || 0 == f) e = p;
  3605. if (r > a || 0 == f) a = r;
  3606. if (q < c || 0 == f) c = q;
  3607. if (l > d || 0 == f) d = l
  3608. }
  3609. }
  3610. if (this._graphics) {
  3611. g = this._graphics._measureBounds();
  3612. p = g.x;
  3613. q = g.y;
  3614. r = g.width + g.x;
  3615. l = g.height + g.y;
  3616. if (p < e || 0 == f) e = p;
  3617. if (r > a || 0 == f) a = r;
  3618. if (q < c || 0 == f) c = q;
  3619. if (l > d || 0 == f) d = l
  3620. }
  3621. return b.Rectangle.identity.initialize(e, c, a - e, d - c)
  3622. };
  3623. a.prototype.hitTest = function(e, a, d) {
  3624. void 0 === d && (d = !1);
  3625. var h = c.prototype.hitTest.call(this, e, a, d);
  3626. return h ? h: this._graphics ? b.DisplayObject.prototype.hitTest.call(this, e, a, d) : null
  3627. };
  3628. return a
  3629. } (b.DisplayObjectContainer);
  3630. b.Sprite = d;
  3631. d.prototype.__class__ = "egret.Sprite"
  3632. })(egret || (egret = {}));
  3633. __extends = this.__extends ||
  3634. function(b, d) {
  3635. function c() {
  3636. this.constructor = b
  3637. }
  3638. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3639. c.prototype = d.prototype;
  3640. b.prototype = new c
  3641. }; (function(b) {
  3642. var d = function(c) {
  3643. function a() {
  3644. c.call(this);
  3645. this._inputEnabled = !1;
  3646. this._type = "";
  3647. this._inputUtils = null;
  3648. this._text = "";
  3649. this._displayAsPassword = !1;
  3650. this._fontFamily = a.default_fontFamily;
  3651. this._size = 30;
  3652. this._bold = this._italic = !1;
  3653. this._textColorString = "#FFFFFF";
  3654. this._textColor = 16777215;
  3655. this._strokeColorString = "#000000";
  3656. this._stroke = this._strokeColor = 0;
  3657. this._textAlign = "left";
  3658. this._verticalAlign = "top";
  3659. this._maxChars = 0;
  3660. this._scrollV = -1;
  3661. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3662. this._isFlow = this._multiline = !1;
  3663. this._textArr = [];
  3664. this._isArrayChanged = !1;
  3665. this._textMaxHeight = this._textMaxWidth = 0;
  3666. this._linesArr = [];
  3667. this.needDraw = !0
  3668. }
  3669. __extends(a, c);
  3670. a.prototype.isInput = function() {
  3671. return this._type == b.TextFieldType.INPUT
  3672. };
  3673. a.prototype._setTouchEnabled = function(e) {
  3674. c.prototype._setTouchEnabled.call(this, e);
  3675. this.isInput() && (this._inputEnabled = !0)
  3676. };
  3677. Object.defineProperty(a.prototype, "type", {
  3678. get: function() {
  3679. return this._type
  3680. },
  3681. set: function(e) {
  3682. this._setType(e)
  3683. },
  3684. enumerable: !0,
  3685. configurable: !0
  3686. });
  3687. a.prototype._setType = function(e) {
  3688. this._type != e && (this._type = e, this._type == b.TextFieldType.INPUT ? (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3689. };
  3690. Object.defineProperty(a.prototype, "text", {
  3691. get: function() {
  3692. return this._getText()
  3693. },
  3694. set: function(e) {
  3695. this._setText(e)
  3696. },
  3697. enumerable: !0,
  3698. configurable: !0
  3699. });
  3700. a.prototype._getText = function() {
  3701. return this._type == b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3702. };
  3703. a.prototype._setSizeDirty = function() {
  3704. c.prototype._setSizeDirty.call(this);
  3705. this._isArrayChanged = !0
  3706. };
  3707. a.prototype._setTextDirty = function() {
  3708. this._setSizeDirty()
  3709. };
  3710. a.prototype._setBaseText = function(e) {
  3711. null == e && (e = "");
  3712. this._isFlow = !1;
  3713. this._text != e && (this._setTextDirty(), this._text = e, e = "", e = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3714. text: e
  3715. }]))
  3716. };
  3717. a.prototype._setText = function(e) {
  3718. null == e && (e = "");
  3719. this._setBaseText(e);
  3720. this._inputUtils && this._inputUtils._setText(this._text)
  3721. };
  3722. Object.defineProperty(a.prototype, "displayAsPassword", {
  3723. get: function() {
  3724. return this._displayAsPassword
  3725. },
  3726. set: function(e) {
  3727. this._setDisplayAsPassword(e)
  3728. },
  3729. enumerable: !0,
  3730. configurable: !0
  3731. });
  3732. a.prototype._setDisplayAsPassword = function(e) {
  3733. this._displayAsPassword != e && (this._displayAsPassword = e, this._setTextDirty(), e = "", e = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3734. text: e
  3735. }]))
  3736. };
  3737. Object.defineProperty(a.prototype, "fontFamily", {
  3738. get: function() {
  3739. return this._fontFamily
  3740. },
  3741. set: function(e) {
  3742. this._setFontFamily(e)
  3743. },
  3744. enumerable: !0,
  3745. configurable: !0
  3746. });
  3747. a.prototype._setFontFamily = function(e) {
  3748. this._fontFamily != e && (this._setTextDirty(), this._fontFamily = e)
  3749. };
  3750. Object.defineProperty(a.prototype, "size", {
  3751. get: function() {
  3752. return this._size
  3753. },
  3754. set: function(e) {
  3755. this._setSize(e)
  3756. },
  3757. enumerable: !0,
  3758. configurable: !0
  3759. });
  3760. a.prototype._setSize = function(e) {
  3761. this._size != e && (this._setTextDirty(), this._size = e)
  3762. };
  3763. Object.defineProperty(a.prototype, "italic", {
  3764. get: function() {
  3765. return this._italic
  3766. },
  3767. set: function(e) {
  3768. this._setItalic(e)
  3769. },
  3770. enumerable: !0,
  3771. configurable: !0
  3772. });
  3773. a.prototype._setItalic = function(e) {
  3774. this._italic != e && (this._setTextDirty(), this._italic = e)
  3775. };
  3776. Object.defineProperty(a.prototype, "bold", {
  3777. get: function() {
  3778. return this._bold
  3779. },
  3780. set: function(e) {
  3781. this._setBold(e)
  3782. },
  3783. enumerable: !0,
  3784. configurable: !0
  3785. });
  3786. a.prototype._setBold = function(e) {
  3787. this._bold != e && (this._setTextDirty(), this._bold = e)
  3788. };
  3789. Object.defineProperty(a.prototype, "textColor", {
  3790. get: function() {
  3791. return this._textColor
  3792. },
  3793. set: function(e) {
  3794. this._setTextColor(e)
  3795. },
  3796. enumerable: !0,
  3797. configurable: !0
  3798. });
  3799. a.prototype._setTextColor = function(e) {
  3800. this._textColor != e && (this._setTextDirty(), this._textColor = e, this._textColorString = b.toColorString(e))
  3801. };
  3802. Object.defineProperty(a.prototype, "strokeColor", {
  3803. get: function() {
  3804. return this._strokeColor
  3805. },
  3806. set: function(e) {
  3807. this._setStrokeColor(e)
  3808. },
  3809. enumerable: !0,
  3810. configurable: !0
  3811. });
  3812. a.prototype._setStrokeColor = function(e) {
  3813. this._strokeColor != e && (this._setTextDirty(), this._strokeColor = e, this._strokeColorString = b.toColorString(e))
  3814. };
  3815. Object.defineProperty(a.prototype, "stroke", {
  3816. get: function() {
  3817. return this._stroke
  3818. },
  3819. set: function(e) {
  3820. this._setStroke(e)
  3821. },
  3822. enumerable: !0,
  3823. configurable: !0
  3824. });
  3825. a.prototype._setStroke = function(e) {
  3826. this._stroke != e && (this._setTextDirty(), this._stroke = e)
  3827. };
  3828. Object.defineProperty(a.prototype, "textAlign", {
  3829. get: function() {
  3830. return this._textAlign
  3831. },
  3832. set: function(e) {
  3833. this._setTextAlign(e)
  3834. },
  3835. enumerable: !0,
  3836. configurable: !0
  3837. });
  3838. a.prototype._setTextAlign = function(e) {
  3839. this._textAlign != e && (this._setTextDirty(), this._textAlign = e)
  3840. };
  3841. Object.defineProperty(a.prototype, "verticalAlign", {
  3842. get: function() {
  3843. return this._verticalAlign
  3844. },
  3845. set: function(e) {
  3846. this._setVerticalAlign(e)
  3847. },
  3848. enumerable: !0,
  3849. configurable: !0
  3850. });
  3851. a.prototype._setVerticalAlign = function(e) {
  3852. this._verticalAlign != e && (this._setTextDirty(), this._verticalAlign = e)
  3853. };
  3854. Object.defineProperty(a.prototype, "maxChars", {
  3855. get: function() {
  3856. return this._maxChars
  3857. },
  3858. set: function(e) {
  3859. this._setMaxChars(e)
  3860. },
  3861. enumerable: !0,
  3862. configurable: !0
  3863. });
  3864. a.prototype._setMaxChars = function(e) {
  3865. this._maxChars != e && (this._maxChars = e)
  3866. };
  3867. Object.defineProperty(a.prototype, "scrollV", {
  3868. set: function(e) {
  3869. this._scrollV = e;
  3870. this._setDirty()
  3871. },
  3872. enumerable: !0,
  3873. configurable: !0
  3874. });
  3875. Object.defineProperty(a.prototype, "maxScrollV", {
  3876. get: function() {
  3877. return this._maxScrollV
  3878. },
  3879. enumerable: !0,
  3880. configurable: !0
  3881. });
  3882. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3883. get: function() {
  3884. return 0
  3885. },
  3886. enumerable: !0,
  3887. configurable: !0
  3888. });
  3889. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3890. get: function() {
  3891. return 0
  3892. },
  3893. enumerable: !0,
  3894. configurable: !0
  3895. });
  3896. Object.defineProperty(a.prototype, "caretIndex", {
  3897. get: function() {
  3898. return 0
  3899. },
  3900. enumerable: !0,
  3901. configurable: !0
  3902. });
  3903. a.prototype._setSelection = function(e, a) {};
  3904. Object.defineProperty(a.prototype, "lineSpacing", {
  3905. get: function() {
  3906. return this._lineSpacing
  3907. },
  3908. set: function(e) {
  3909. this._setLineSpacing(e)
  3910. },
  3911. enumerable: !0,
  3912. configurable: !0
  3913. });
  3914. a.prototype._setLineSpacing = function(e) {
  3915. this._lineSpacing != e && (this._setTextDirty(), this._lineSpacing = e)
  3916. };
  3917. a.prototype._getLineHeight = function() {
  3918. return this._lineSpacing + this._size
  3919. };
  3920. Object.defineProperty(a.prototype, "numLines", {
  3921. get: function() {
  3922. return this._numLines
  3923. },
  3924. enumerable: !0,
  3925. configurable: !0
  3926. });
  3927. Object.defineProperty(a.prototype, "multiline", {
  3928. get: function() {
  3929. return this._multiline
  3930. },
  3931. set: function(e) {
  3932. this._setMultiline(e)
  3933. },
  3934. enumerable: !0,
  3935. configurable: !0
  3936. });
  3937. a.prototype._setMultiline = function(e) {
  3938. this._multiline = e;
  3939. this._setDirty()
  3940. };
  3941. a.prototype.setFocus = function() {
  3942. b.Logger.warningWithErrorId(1013)
  3943. };
  3944. a.prototype._onRemoveFromStage = function() {
  3945. c.prototype._onRemoveFromStage.call(this);
  3946. this._removeEvent();
  3947. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3948. };
  3949. a.prototype._onAddToStage = function() {
  3950. c.prototype._onAddToStage.call(this);
  3951. this._addEvent();
  3952. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3953. };
  3954. a.prototype._updateBaseTransform = function() {
  3955. this._getLinesArr();
  3956. 0 != this._textMaxWidth && c.prototype._updateTransform.call(this)
  3957. };
  3958. a.prototype._updateTransform = function() {
  3959. this._type == b.TextFieldType.INPUT ? this._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3960. };
  3961. a.prototype._draw = function(e) {
  3962. 0 != this._textMaxWidth && c.prototype._draw.call(this, e)
  3963. };
  3964. a.prototype._render = function(e) {
  3965. this.drawText(e);
  3966. this._clearDirty()
  3967. };
  3968. a.prototype._measureBounds = function() {
  3969. this._getLinesArr();
  3970. return 0 == this._textMaxWidth ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(0, 0, this._textMaxWidth, this._textMaxHeight + (this._numLines - 1) * this._lineSpacing)
  3971. };
  3972. Object.defineProperty(a.prototype, "textFlow", {
  3973. get: function() {
  3974. return this._textArr
  3975. },
  3976. set: function(e) {
  3977. this._isFlow = !0;
  3978. var a = "";
  3979. null == e && (e = []);
  3980. for (var b = 0; b < e.length; b++) a += e[b].text;
  3981. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(e))
  3982. },
  3983. enumerable: !0,
  3984. configurable: !0
  3985. });
  3986. a.prototype.changeToPassText = function(e) {
  3987. if (this._displayAsPassword) {
  3988. for (var a = "",
  3989. b = 0,
  3990. c = e.length; b < c; b++) switch (e.charAt(b)) {
  3991. case "\n":
  3992. a += "\n";
  3993. break;
  3994. case "\r":
  3995. break;
  3996. default:
  3997. a += "*"
  3998. }
  3999. return a
  4000. }
  4001. return e
  4002. };
  4003. a.prototype.setMiddleStyle = function(e) {
  4004. this._isArrayChanged = !0;
  4005. this._textArr = e;
  4006. this._setSizeDirty()
  4007. };
  4008. Object.defineProperty(a.prototype, "textWidth", {
  4009. get: function() {
  4010. return this._textMaxWidth
  4011. },
  4012. enumerable: !0,
  4013. configurable: !0
  4014. });
  4015. Object.defineProperty(a.prototype, "textHeight", {
  4016. get: function() {
  4017. return this._textMaxHeight
  4018. },
  4019. enumerable: !0,
  4020. configurable: !0
  4021. });
  4022. a.prototype.appendText = function(e) {
  4023. this.appendElement({
  4024. text: e
  4025. })
  4026. };
  4027. a.prototype.appendElement = function(e) {
  4028. this._textArr.push(e);
  4029. this.setMiddleStyle(this._textArr)
  4030. };
  4031. a.prototype._getLinesArr = function() {
  4032. if (!this._isArrayChanged) return this._linesArr;
  4033. this._isArrayChanged = !1;
  4034. var e = this._textArr,
  4035. a = b.MainContext.instance.rendererContext;
  4036. this._linesArr = [];
  4037. this._textMaxWidth = this._textMaxHeight = 0;
  4038. if (this._hasWidthSet && 0 == this._explicitWidth) return this._numLines = 0,
  4039. [{
  4040. width: 0,
  4041. height: 0,
  4042. elements: []
  4043. }];
  4044. var c = this._linesArr,
  4045. d = 0,
  4046. g = 0,
  4047. f = 0,
  4048. l;
  4049. this._isFlow || a.setupFont(this);
  4050. for (var n = 0,
  4051. p = e.length; n < p; n++) {
  4052. var q = e[n];
  4053. q.style = q.style || {};
  4054. for (var r = q.text.toString().split(/(?:\r\n|\r|\n)/), t = 0, s = r.length; t < s; t++) {
  4055. null == c[f] && (l = {
  4056. width: 0,
  4057. height: 0,
  4058. elements: []
  4059. },
  4060. c[f] = l, g = d = 0);
  4061. g = this._type == b.TextFieldType.INPUT ? this._size: Math.max(g, q.style.size || this._size);
  4062. if ("" != r[t]) {
  4063. this._isFlow && a.setupFont(this, q.style);
  4064. var u = a.measureText(r[t]);
  4065. if (this._hasWidthSet) if (d + u <= this._explicitWidth) l.elements.push({
  4066. width: u,
  4067. text: r[t],
  4068. style: q.style
  4069. }),
  4070. d += u;
  4071. else {
  4072. for (var w = 0,
  4073. v = 0,
  4074. y = r[t], x = y.length; w < x; w++) {
  4075. u = a.measureText(y.charAt(w));
  4076. if (d + u > this._explicitWidth && 0 != d + w) break;
  4077. v += u;
  4078. d += u
  4079. }
  4080. 0 < w && (l.elements.push({
  4081. width: v,
  4082. text: y.substring(0, w),
  4083. style: q.style
  4084. }), r[t] = y.substring(w));
  4085. t--
  4086. } else d += u,
  4087. l.elements.push({
  4088. width: u,
  4089. text: r[t],
  4090. style: q.style
  4091. })
  4092. }
  4093. if (t < r.length - 1) {
  4094. l.width = d;
  4095. l.height = g;
  4096. this._textMaxWidth = Math.max(this._textMaxWidth, d);
  4097. this._textMaxHeight += g;
  4098. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = c.length,
  4099. c;
  4100. f++
  4101. }
  4102. }
  4103. n == e.length - 1 && l && (l.width = d, l.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, d), this._textMaxHeight += g)
  4104. }
  4105. this._numLines = c.length;
  4106. return c
  4107. };
  4108. a.prototype.drawText = function(e) {
  4109. var a = this._getLinesArr();
  4110. if (0 != this._textMaxWidth) {
  4111. var c = this._hasWidthSet ? this._explicitWidth: this._textMaxWidth,
  4112. d = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  4113. g = 0,
  4114. f = 0;
  4115. if (this._hasHeightSet) if (d < this._explicitHeight) {
  4116. var l = 0;
  4117. this._verticalAlign == b.VerticalAlign.MIDDLE ? l = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (l = 1);
  4118. g += l * (this._explicitHeight - d)
  4119. } else d > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  4120. g = Math.round(g);
  4121. d = 0;
  4122. this._textAlign == b.HorizontalAlign.CENTER ? d = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (d = 1);
  4123. for (var l = 0,
  4124. n = this._numLines; f < n; f++) {
  4125. var p = a[f],
  4126. q = p.height,
  4127. g = g + q / 2;
  4128. if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
  4129. for (var l = Math.round((c - p.width) * d), r = 0, t = p.elements.length; r < t; r++) {
  4130. var s = p.elements[r],
  4131. u = s.style.size || this._size;
  4132. this._type == b.TextFieldType.INPUT ? e.drawText(this, s.text, l, g + (q - u) / 2, s.width) : e.drawText(this, s.text, l, g + (q - u) / 2, s.width, s.style);
  4133. l += s.width
  4134. }
  4135. g += q / 2 + this._lineSpacing
  4136. }
  4137. }
  4138. };
  4139. a.prototype._addEvent = function() {
  4140. this.addEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4141. };
  4142. a.prototype._removeEvent = function() {
  4143. this.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4144. };
  4145. a.prototype.onTapHandler = function(e) {
  4146. if (this._type != b.TextFieldType.INPUT && (e = this._getTextElement(e.localX, e.localY), null != e && (e = e.style) && e.href && e.href.match(/^event:/))) {
  4147. var a = e.href.match(/^event:/)[0];
  4148. b.TextEvent.dispatchTextEvent(this, b.TextEvent.LINK, e.href.substring(a.length))
  4149. }
  4150. };
  4151. a.prototype._getTextElement = function(e, a) {
  4152. var b = this._getHit(e, a),
  4153. c = this._getLinesArr();
  4154. return b && c[b.lineIndex] && c[b.lineIndex].elements[b.textElementIndex] ? c[b.lineIndex].elements[b.textElementIndex] : null
  4155. };
  4156. a.prototype._getHit = function(e, a) {
  4157. var b = this._getLinesArr();
  4158. if (0 == this._textMaxWidth) return null;
  4159. for (var c = 0,
  4160. d = 0,
  4161. f = 0; f < b.length; f++) {
  4162. var l = b[f];
  4163. if (d + l.height >= a) {
  4164. c = f + 1;
  4165. break
  4166. } else d += l.height;
  4167. if (d + this._lineSpacing > a) return null;
  4168. d += this._lineSpacing
  4169. }
  4170. if (0 === c) return null;
  4171. b = b[c - 1];
  4172. for (f = d = 0; f < b.elements.length; f++) if (l = b.elements[f], d + l.width < e) d += l.width;
  4173. else return {
  4174. lineIndex: c - 1,
  4175. textElementIndex: f
  4176. };
  4177. return null
  4178. };
  4179. a.default_fontFamily = "Arial";
  4180. return a
  4181. } (b.DisplayObject);
  4182. b.TextField = d;
  4183. d.prototype.__class__ = "egret.TextField"
  4184. })(egret || (egret = {})); (function(b) {
  4185. var d = function() {
  4186. function b() {
  4187. this.resutlArr = []
  4188. }
  4189. b.prototype.parser = function(a) {
  4190. this.stackArray = [];
  4191. this.resutlArr = [];
  4192. for (var e = 0,
  4193. b = a.length; e < b;) {
  4194. var c = a.indexOf("<", e);
  4195. 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)
  4196. }
  4197. return this.resutlArr
  4198. };
  4199. b.prototype.addToResultArr = function(a) {
  4200. if ("" != a) {
  4201. var e = [];
  4202. e.push(["&lt;", "<"]);
  4203. e.push(["&gt;", ">"]);
  4204. e.push(["&amp;", "&"]);
  4205. e.push(["&quot;", '"']);
  4206. e.push(["&apos;;", "'"]);
  4207. for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
  4208. 0 < this.stackArray.length ? this.resutlArr.push({
  4209. text: a,
  4210. style: this.stackArray[this.stackArray.length - 1]
  4211. }) : this.resutlArr.push({
  4212. text: a
  4213. })
  4214. }
  4215. };
  4216. b.prototype.changeStringToObject = function(a) {
  4217. var e = {};
  4218. a = a.replace(/( )+/g, " ").split(" ");
  4219. for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
  4220. return e
  4221. };
  4222. b.prototype.addProperty = function(a, e) {
  4223. var b = e.replace(/( )*=( )*/g, "=").split("=");
  4224. b[1] && (b[1] = b[1].replace(/(\"|\')/g, ""));
  4225. switch (b[0].toLowerCase()) {
  4226. case "color":
  4227. a.textColor = parseInt(b[1]);
  4228. break;
  4229. case "strokecolor":
  4230. a.strokeColor = parseInt(b[1]);
  4231. break;
  4232. case "stroke":
  4233. a.stroke = parseInt(b[1]);
  4234. break;
  4235. case "b":
  4236. a.bold = "true" == (b[1] || "true");
  4237. break;
  4238. case "i":
  4239. a.italic = "true" == (b[1] || "true");
  4240. break;
  4241. case "size":
  4242. a.size = parseInt(b[1]);
  4243. break;
  4244. case "fontFamily":
  4245. a.fontFamily = b[1];
  4246. break;
  4247. case "href":
  4248. a.href = b[1]
  4249. }
  4250. };
  4251. b.prototype.addToArray = function(a) {
  4252. a = this.changeStringToObject(a);
  4253. if (0 != this.stackArray.length) {
  4254. var e = this.stackArray[this.stackArray.length - 1],
  4255. b;
  4256. for (b in e) null == a[b] && (a[b] = e[b])
  4257. }
  4258. this.stackArray.push(a)
  4259. };
  4260. return b
  4261. } ();
  4262. b.HtmlTextParser = d;
  4263. d.prototype.__class__ = "egret.HtmlTextParser"
  4264. })(egret || (egret = {})); (function(b) {
  4265. var d = function() {
  4266. function b() {}
  4267. b.DYNAMIC = "dynamic";
  4268. b.INPUT = "input";
  4269. return b
  4270. } ();
  4271. b.TextFieldType = d;
  4272. d.prototype.__class__ = "egret.TextFieldType"
  4273. })(egret || (egret = {}));
  4274. __extends = this.__extends ||
  4275. function(b, d) {
  4276. function c() {
  4277. this.constructor = b
  4278. }
  4279. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4280. c.prototype = d.prototype;
  4281. b.prototype = new c
  4282. }; (function(b) {
  4283. var d = function(c) {
  4284. function a(e) {
  4285. c.call(this);
  4286. this.bitmapData = this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
  4287. this._textureMap = {};
  4288. var a = e.bitmapData;
  4289. this.bitmapData = a;
  4290. this._sourceWidth = a.width;
  4291. this._sourceHeight = a.height;
  4292. this._bitmapX = e._bitmapX - e._offsetX;
  4293. this._bitmapY = e._bitmapY - e._offsetY
  4294. }
  4295. __extends(a, c);
  4296. a.prototype.getTexture = function(e) {
  4297. return this._textureMap[e]
  4298. };
  4299. a.prototype.createTexture = function(e, a, c, d, g, f, l, n, p) {
  4300. void 0 === f && (f = 0);
  4301. void 0 === l && (l = 0);
  4302. "undefined" === typeof n && (n = f + d);
  4303. "undefined" === typeof p && (p = l + g);
  4304. var q = new b.Texture,
  4305. r = b.MainContext.instance.rendererContext._texture_scale_factor;
  4306. q._bitmapData = this.bitmapData;
  4307. q._bitmapX = this._bitmapX + a;
  4308. q._bitmapY = this._bitmapY + c;
  4309. q._bitmapWidth = d * r;
  4310. q._bitmapHeight = g * r;
  4311. q._offsetX = f;
  4312. q._offsetY = l;
  4313. q._textureWidth = n * r;
  4314. q._textureHeight = p * r;
  4315. q._sourceWidth = this._sourceWidth;
  4316. q._sourceHeight = this._sourceHeight;
  4317. return this._textureMap[e] = q
  4318. };
  4319. return a
  4320. } (b.HashObject);
  4321. b.SpriteSheet = d;
  4322. d.prototype.__class__ = "egret.SpriteSheet"
  4323. })(egret || (egret = {}));
  4324. __extends = this.__extends ||
  4325. function(b, d) {
  4326. function c() {
  4327. this.constructor = b
  4328. }
  4329. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4330. c.prototype = d.prototype;
  4331. b.prototype = new c
  4332. }; (function(b) {
  4333. var d = function(c) {
  4334. function a() {
  4335. c.call(this);
  4336. this._isFocus = !1;
  4337. this._text = null;
  4338. this._isFirst = this._isFirst = !0
  4339. }
  4340. __extends(a, c);
  4341. a.prototype.init = function(e) {
  4342. this._text = e;
  4343. this.stageText = b.StageText.create();
  4344. e = this._text.localToGlobal();
  4345. this.stageText._open(e.x, e.y, this._text._explicitWidth, this._text._explicitHeight)
  4346. };
  4347. a.prototype._addStageText = function() {
  4348. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4349. this.stageText._add();
  4350. this.stageText._addListeners();
  4351. this.stageText.addEventListener("blur", this.onBlurHandler, this);
  4352. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4353. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4354. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4355. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4356. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)
  4357. };
  4358. a.prototype._removeStageText = function() {
  4359. this.stageText._remove();
  4360. this.stageText._removeListeners();
  4361. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4362. this.stageText.removeEventListener("blur", this.onBlurHandler, this);
  4363. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4364. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4365. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4366. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4367. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this)
  4368. };
  4369. a.prototype.onResize = function() {
  4370. this._isFirst = !0
  4371. };
  4372. a.prototype._getText = function() {
  4373. return this.stageText._getText()
  4374. };
  4375. a.prototype._setText = function(e) {
  4376. this.stageText._setText(e)
  4377. };
  4378. a.prototype.onFocusHandler = function(e) {
  4379. this.hideText()
  4380. };
  4381. a.prototype.onBlurHandler = function(e) {
  4382. this.showText()
  4383. };
  4384. a.prototype.onMouseDownHandler = function(e) {
  4385. e.stopPropagation();
  4386. this._text._visible && (this._isFirst = !0, this._updateTransform(), this.stageText._show())
  4387. };
  4388. a.prototype.onStageDownHandler = function(e) {
  4389. this.stageText._hide();
  4390. this.showText()
  4391. };
  4392. a.prototype.showText = function() {
  4393. this._isFocus && (this._isFocus = !1, this.resetText())
  4394. };
  4395. a.prototype.hideText = function() {
  4396. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4397. };
  4398. a.prototype.updateTextHandler = function(e) {
  4399. this.resetText();
  4400. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4401. };
  4402. a.prototype.resetText = function() {
  4403. this._text._setBaseText(this.stageText._getText())
  4404. };
  4405. a.prototype._updateTransform = function() {
  4406. var e = this._text._worldTransform.a,
  4407. a = this._text._worldTransform.b,
  4408. c = this._text._worldTransform.c,
  4409. d = this._text._worldTransform.d,
  4410. g = this._text._worldTransform.tx,
  4411. f = this._text._worldTransform.ty;
  4412. this._text._updateBaseTransform();
  4413. var l = this._text._worldTransform;
  4414. if (this._isFirst || e != l.a || a != l.b || c != l.c || d != l.d || g != l.tx || f != l.ty) {
  4415. this._isFirst = !1;
  4416. e = this._text.localToGlobal();
  4417. this.stageText.changePosition(e.x, e.y);
  4418. var n = this;
  4419. b.callLater(function() {
  4420. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  4421. },
  4422. this)
  4423. }
  4424. };
  4425. a.prototype._updateProperties = function() {
  4426. var e = this._text._stage;
  4427. if (null == e) this.stageText._setVisible(!1);
  4428. else {
  4429. for (var a = this._text,
  4430. c = a._visible; c;) {
  4431. a = a.parent;
  4432. if (a == e) break;
  4433. c = a._visible
  4434. }
  4435. this.stageText._setVisible(c)
  4436. }
  4437. this.stageText._setMultiline(this._text._multiline);
  4438. this.stageText._setMaxChars(this._text._maxChars);
  4439. this.stageText._setSize(this._text._size);
  4440. this.stageText._setTextColor(this._text._textColorString);
  4441. this.stageText._setTextFontFamily(this._text._fontFamily);
  4442. this.stageText._setBold(this._text._bold);
  4443. this.stageText._setItalic(this._text._italic);
  4444. this.stageText._setTextAlign(this._text._textAlign);
  4445. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4446. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4447. this.stageText._setTextType(this._text._displayAsPassword ? "password": "text");
  4448. this.stageText._setText(this._text._text);
  4449. this.stageText._resetStageText();
  4450. this._updateTransform()
  4451. };
  4452. return a
  4453. } (b.HashObject);
  4454. b.InputController = d;
  4455. d.prototype.__class__ = "egret.InputController"
  4456. })(egret || (egret = {}));
  4457. __extends = this.__extends ||
  4458. function(b, d) {
  4459. function c() {
  4460. this.constructor = b
  4461. }
  4462. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4463. c.prototype = d.prototype;
  4464. b.prototype = new c
  4465. }; (function(b) {
  4466. var d = function(b) {
  4467. function a(e, a) {
  4468. b.call(this, e);
  4469. this.firstCharHeight = 0;
  4470. "string" == typeof a ? this.charList = this.parseConfig(a) : a && a.hasOwnProperty("frames") ? this.charList = a.frames: this.charList = {}
  4471. }
  4472. __extends(a, b);
  4473. a.prototype.getTexture = function(e) {
  4474. var a = this._textureMap[e];
  4475. if (!a) {
  4476. a = this.charList[e];
  4477. if (!a) return null;
  4478. a = this.createTexture(e, a.x, a.y, a.w, a.h, a.offX, a.offY, a.sourceW, a.sourceH);
  4479. this._textureMap[e] = a
  4480. }
  4481. return a
  4482. };
  4483. a.prototype._getFirstCharHeight = function() {
  4484. if (0 == this.firstCharHeight) for (var a in this.charList) {
  4485. var b = this.charList[a];
  4486. if (b) {
  4487. var c = b.sourceH;
  4488. void 0 === c && (c = b.h, void 0 === c && (c = 0), b = b.offY, void 0 === b && (b = 0), c += b);
  4489. if (! (0 >= c)) {
  4490. this.firstCharHeight = c;
  4491. break
  4492. }
  4493. }
  4494. }
  4495. return this.firstCharHeight
  4496. };
  4497. a.prototype.parseConfig = function(a) {
  4498. a = a.split("\r\n").join("\n");
  4499. a = a.split("\n");
  4500. for (var b = this.getConfigByKey(a[3], "count"), c = {},
  4501. d = 4; d < 4 + b; d++) {
  4502. var g = a[d],
  4503. f = String.fromCharCode(this.getConfigByKey(g, "id")),
  4504. l = {};
  4505. c[f] = l;
  4506. l.x = this.getConfigByKey(g, "x");
  4507. l.y = this.getConfigByKey(g, "y");
  4508. l.w = this.getConfigByKey(g, "width");
  4509. l.h = this.getConfigByKey(g, "height");
  4510. l.offX = this.getConfigByKey(g, "xoffset");
  4511. l.offY = this.getConfigByKey(g, "yoffset")
  4512. }
  4513. return c
  4514. };
  4515. a.prototype.getConfigByKey = function(a, b) {
  4516. for (var c = a.split(" "), d = 0, g = c.length; d < g; d++) {
  4517. var f = c[d];
  4518. if (b == f.substring(0, b.length)) return c = f.substring(b.length + 1),
  4519. parseInt(c)
  4520. }
  4521. return 0
  4522. };
  4523. return a
  4524. } (b.SpriteSheet);
  4525. b.BitmapFont = d;
  4526. d.prototype.__class__ = "egret.BitmapFont"
  4527. })(egret || (egret = {}));
  4528. __extends = this.__extends ||
  4529. function(b, d) {
  4530. function c() {
  4531. this.constructor = b
  4532. }
  4533. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4534. c.prototype = d.prototype;
  4535. b.prototype = new c
  4536. }; (function(b) {
  4537. var d = function(c) {
  4538. function a(a) {
  4539. c.call(this);
  4540. this._isAddedToStage = !1;
  4541. this._frames = this._movieClipData = this._textureToRender = null;
  4542. this._totalFrames = 0;
  4543. this._frameLabels = null;
  4544. this._frameIntervalTime = 0;
  4545. this._eventPool = null;
  4546. this._isPlaying = !1;
  4547. this._isStopped = !0;
  4548. this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
  4549. this._setMovieClipData(a);
  4550. this.needDraw = !0
  4551. }
  4552. __extends(a, c);
  4553. a.prototype._init = function() {
  4554. this._reset();
  4555. var a = this._movieClipData;
  4556. a && a._isDataValid() && (this._frames = a.frames, this._totalFrames = a.numFrames, this._frameLabels = a.labels, this._frameIntervalTime = 1E3 / a.frameRate, this._initFrame())
  4557. };
  4558. a.prototype._reset = function() {
  4559. this._frames = null;
  4560. this._playTimes = 0;
  4561. this._isPlaying = !1;
  4562. this.setIsStopped(!0);
  4563. this._currentFrameNum = 0;
  4564. this._nextFrameNum = 1;
  4565. this._passedTime = this._displayedKeyFrameNum = 0;
  4566. this._eventPool = []
  4567. };
  4568. a.prototype._initFrame = function() {
  4569. this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
  4570. };
  4571. a.prototype._render = function(e) {
  4572. var b = this._textureToRender;
  4573. if (this._texture_to_render = b) {
  4574. var c = Math.round(b._offsetX),
  4575. d = Math.round(b._offsetY),
  4576. g = b._bitmapWidth || b._textureWidth,
  4577. f = b._bitmapHeight || b._textureHeight,
  4578. l = Math.round(g),
  4579. n = Math.round(f);
  4580. a.renderFilter.drawImage(e, this, b._bitmapX, b._bitmapY, g, f, c, d, l, n)
  4581. }
  4582. };
  4583. a.prototype._measureBounds = function() {
  4584. var a = this._textureToRender;
  4585. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : c.prototype._measureBounds.call(this)
  4586. };
  4587. a.prototype._onAddToStage = function() {
  4588. c.prototype._onAddToStage.call(this);
  4589. this._isAddedToStage = !0;
  4590. this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
  4591. };
  4592. a.prototype._onRemoveFromStage = function() {
  4593. c.prototype._onRemoveFromStage.call(this);
  4594. this._isAddedToStage = !1;
  4595. this.setIsStopped(!0)
  4596. };
  4597. a.prototype._getFrameLabelByName = function(a, b) {
  4598. void 0 === b && (b = !1);
  4599. b && (a = a.toLowerCase());
  4600. var c = this._frameLabels;
  4601. if (c) for (var d = null,
  4602. g = 0; g < c.length; g++) if (d = c[g], b ? d.name.toLowerCase() === a: d.name === a) return d;
  4603. return null
  4604. };
  4605. a.prototype._getFrameLabelByFrame = function(a) {
  4606. var b = this._frameLabels;
  4607. if (b) for (var c = null,
  4608. d = 0; d < b.length; d++) if (c = b[d], c.frame === a) return c;
  4609. return null
  4610. };
  4611. a.prototype._getFrameLabelForFrame = function(a) {
  4612. var b = null,
  4613. c = null,
  4614. d = this._frameLabels;
  4615. if (d) for (var g = 0; g < d.length; g++) {
  4616. c = d[g];
  4617. if (c.frame > a) break;
  4618. b = c
  4619. }
  4620. return b
  4621. };
  4622. a.prototype.play = function(a) {
  4623. void 0 === a && (a = 0);
  4624. this._isPlaying = !0;
  4625. this.setPlayTimes(a);
  4626. 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
  4627. };
  4628. a.prototype.stop = function() {
  4629. this._isPlaying = !1;
  4630. this.setIsStopped(!0)
  4631. };
  4632. a.prototype.prevFrame = function() {
  4633. this.gotoAndStop(this._currentFrameNum - 1)
  4634. };
  4635. a.prototype.nextFrame = function() {
  4636. this.gotoAndStop(this._currentFrameNum + 1)
  4637. };
  4638. a.prototype.gotoAndPlay = function(a, c) {
  4639. void 0 === c && (c = 0);
  4640. if (0 === arguments.length || 2 < arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndPlay()"));
  4641. this.play(c);
  4642. this._gotoFrame(a)
  4643. };
  4644. a.prototype.gotoAndStop = function(a) {
  4645. if (1 != arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndStop()"));
  4646. this.stop();
  4647. this._gotoFrame(a)
  4648. };
  4649. a.prototype._gotoFrame = function(a) {
  4650. var c;
  4651. if ("string" === typeof a) c = this._getFrameLabelByName(a).frame;
  4652. else if (c = parseInt(a + "", 10), c != a) throw Error(b.getString(1022, "Frame Label Not Found"));
  4653. 1 > c ? c = 1 : c > this._totalFrames && (c = this._totalFrames);
  4654. c !== this._nextFrameNum && (this._nextFrameNum = c, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
  4655. };
  4656. a.prototype._advanceTime = function(a) {
  4657. var c = this._frameIntervalTime;
  4658. a = this._passedTime + a;
  4659. this._passedTime = a % c;
  4660. c = a / c;
  4661. if (! (1 > c)) {
  4662. for (; 1 <= c;) {
  4663. c--;
  4664. this._nextFrameNum++;
  4665. if (this._nextFrameNum > this._totalFrames) if ( - 1 == this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4666. this._nextFrameNum = 1;
  4667. else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4668. this._nextFrameNum = 1;
  4669. else {
  4670. this._nextFrameNum = this._totalFrames;
  4671. this._eventPool.push(b.Event.COMPLETE);
  4672. this.stop();
  4673. break
  4674. }
  4675. this._advanceFrame()
  4676. }
  4677. this._constructFrame();
  4678. this._handlePendingEvent()
  4679. }
  4680. };
  4681. a.prototype._advanceFrame = function() {
  4682. this._currentFrameNum = this._nextFrameNum
  4683. };
  4684. a.prototype._constructFrame = function() {
  4685. var a = this._currentFrameNum;
  4686. this._displayedKeyFrameNum != a && (this._textureToRender = this._movieClipData.getTextureByFrame(a), this._displayedKeyFrameNum = a)
  4687. };
  4688. a.prototype._handlePendingEvent = function() {
  4689. if (0 != this._eventPool.length) {
  4690. this._eventPool.reverse();
  4691. for (var a = this._eventPool,
  4692. c = a.length,
  4693. d = !1,
  4694. h = !1,
  4695. g = 0; g < c; g++) {
  4696. var f = a.pop();
  4697. f == b.Event.LOOP_COMPLETE ? h = !0 : f == b.Event.COMPLETE ? d = !0 : this.dispatchEventWith(f)
  4698. }
  4699. h && this.dispatchEventWith(b.Event.LOOP_COMPLETE);
  4700. d && this.dispatchEventWith(b.Event.COMPLETE)
  4701. }
  4702. };
  4703. Object.defineProperty(a.prototype, "totalFrames", {
  4704. get: function() {
  4705. return this._totalFrames
  4706. },
  4707. enumerable: !0,
  4708. configurable: !0
  4709. });
  4710. Object.defineProperty(a.prototype, "currentFrame", {
  4711. get: function() {
  4712. return this._currentFrameNum
  4713. },
  4714. enumerable: !0,
  4715. configurable: !0
  4716. });
  4717. Object.defineProperty(a.prototype, "currentFrameLabel", {
  4718. get: function() {
  4719. var a = this._getFrameLabelByFrame(this._currentFrameNum);
  4720. return a && a.name
  4721. },
  4722. enumerable: !0,
  4723. configurable: !0
  4724. });
  4725. Object.defineProperty(a.prototype, "currentLabel", {
  4726. get: function() {
  4727. var a = this._getFrameLabelForFrame(this._currentFrameNum);
  4728. return a ? a.name: null
  4729. },
  4730. enumerable: !0,
  4731. configurable: !0
  4732. });
  4733. Object.defineProperty(a.prototype, "frameRate", {
  4734. get: function() {
  4735. return this.movieClipData.frameRate
  4736. },
  4737. set: function(a) {
  4738. a != this._movieClipData.frameRate && (this._movieClipData.frameRate = a, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
  4739. },
  4740. enumerable: !0,
  4741. configurable: !0
  4742. });
  4743. Object.defineProperty(a.prototype, "isPlaying", {
  4744. get: function() {
  4745. return this._isPlaying
  4746. },
  4747. enumerable: !0,
  4748. configurable: !0
  4749. });
  4750. Object.defineProperty(a.prototype, "movieClipData", {
  4751. get: function() {
  4752. return this._movieClipData
  4753. },
  4754. set: function(a) {
  4755. this._setMovieClipData(a)
  4756. },
  4757. enumerable: !0,
  4758. configurable: !0
  4759. });
  4760. a.prototype._setMovieClipData = function(a) {
  4761. this._movieClipData != a && (this._movieClipData = a, this._init())
  4762. };
  4763. a.prototype.setPlayTimes = function(a) {
  4764. if (0 > a || 1 <= a) this._playTimes = 0 > a ? -1 : Math.floor(a)
  4765. };
  4766. a.prototype.setIsStopped = function(a) {
  4767. this._isStopped != a && ((this._isStopped = a) ? (this._playTimes = 0, b.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, b.Ticker.getInstance().register(this._advanceTime, this)))
  4768. };
  4769. a.renderFilter = b.RenderFilter.getInstance();
  4770. return a
  4771. } (b.DisplayObject);
  4772. b.MovieClip = d;
  4773. d.prototype.__class__ = "egret.MovieClip"
  4774. })(egret || (egret = {}));
  4775. __extends = this.__extends ||
  4776. function(b, d) {
  4777. function c() {
  4778. this.constructor = b
  4779. }
  4780. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4781. c.prototype = d.prototype;
  4782. b.prototype = new c
  4783. }; (function(b) {
  4784. var d = function(b) {
  4785. function a(a, m) {
  4786. b.call(this);
  4787. this._name = a;
  4788. this._frame = m | 0
  4789. }
  4790. __extends(a, b);
  4791. Object.defineProperty(a.prototype, "name", {
  4792. get: function() {
  4793. return this._name
  4794. },
  4795. enumerable: !0,
  4796. configurable: !0
  4797. });
  4798. Object.defineProperty(a.prototype, "frame", {
  4799. get: function() {
  4800. return this._frame
  4801. },
  4802. enumerable: !0,
  4803. configurable: !0
  4804. });
  4805. a.prototype.clone = function() {
  4806. return new a(this._name, this._frame)
  4807. };
  4808. return a
  4809. } (b.EventDispatcher);
  4810. b.FrameLabel = d;
  4811. d.prototype.__class__ = "egret.FrameLabel"
  4812. })(egret || (egret = {}));
  4813. __extends = this.__extends ||
  4814. function(b, d) {
  4815. function c() {
  4816. this.constructor = b
  4817. }
  4818. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4819. c.prototype = d.prototype;
  4820. b.prototype = new c
  4821. }; (function(b) {
  4822. var d = function(c) {
  4823. function a() {
  4824. c.call(this);
  4825. this._mcData = null;
  4826. this.numFrames = 1;
  4827. this.frames = [];
  4828. this.labels = null;
  4829. this.frameRate = 0;
  4830. this.spriteSheet = this.textureData = null
  4831. }
  4832. __extends(a, c);
  4833. a.prototype._init = function(a, b, c) {
  4834. this.textureData = b;
  4835. this.spriteSheet = c;
  4836. this._setMCData(a)
  4837. };
  4838. a.prototype.getKeyFrameData = function(a) {
  4839. a = this.frames[a - 1];
  4840. a.frame && (a = this.frames[a.frame - 1]);
  4841. return a
  4842. };
  4843. a.prototype.getTextureByFrame = function(a) {
  4844. a = this.getKeyFrameData(a);
  4845. if (a.res) {
  4846. var b = this.getTextureByResName(a.res);
  4847. b._offsetX = a.x | 0;
  4848. b._offsetY = a.y | 0;
  4849. return b
  4850. }
  4851. return null
  4852. };
  4853. a.prototype.getTextureByResName = function(a) {
  4854. var b = this.spriteSheet.getTexture(a);
  4855. b || (b = this.textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4856. return b
  4857. };
  4858. a.prototype._isDataValid = function() {
  4859. return 0 < this.frames.length
  4860. };
  4861. a.prototype._isTextureValid = function() {
  4862. return null != this.textureData && null != this.spriteSheet
  4863. };
  4864. a.prototype._fillMCData = function(a) {
  4865. this.frameRate = a.frameRate || 24;
  4866. this._fillFramesData(a.frames);
  4867. this._fillFrameLabelsData(a.labels)
  4868. };
  4869. a.prototype._fillFramesData = function(a) {
  4870. for (var b = this.frames,
  4871. c = a ? a.length: 0, d, g = 0; g < c; g++) if (d = a[g], b.push(d), d.duration) {
  4872. var f = parseInt(d.duration);
  4873. if (1 < f) {
  4874. d = b.length;
  4875. for (var l = 1; l < f; l++) b.push({
  4876. frame: d
  4877. })
  4878. }
  4879. }
  4880. this.numFrames = b.length
  4881. };
  4882. a.prototype._fillFrameLabelsData = function(a) {
  4883. if (a) {
  4884. var c = a.length;
  4885. if (0 < c) {
  4886. this.labels = [];
  4887. for (var d = 0; d < c; d++) {
  4888. var h = a[d];
  4889. this.labels.push(new b.FrameLabel(h.name, h.frame))
  4890. }
  4891. }
  4892. }
  4893. };
  4894. Object.defineProperty(a.prototype, "mcData", {
  4895. get: function() {
  4896. return this._mcData
  4897. },
  4898. set: function(a) {
  4899. this._setMCData(a)
  4900. },
  4901. enumerable: !0,
  4902. configurable: !0
  4903. });
  4904. a.prototype._setMCData = function(a) {
  4905. this._mcData != a && (this._mcData = a) && this._fillMCData(a)
  4906. };
  4907. return a
  4908. } (b.HashObject);
  4909. b.MovieClipData = d;
  4910. d.prototype.__class__ = "egret.MovieClipData"
  4911. })(egret || (egret = {}));
  4912. __extends = this.__extends ||
  4913. function(b, d) {
  4914. function c() {
  4915. this.constructor = b
  4916. }
  4917. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4918. c.prototype = d.prototype;
  4919. b.prototype = new c
  4920. }; (function(b) {
  4921. var d = function(c) {
  4922. function a(a, b) {
  4923. c.call(this);
  4924. this.enableCache = !0;
  4925. this._mcDataCache = {};
  4926. this._mcDataSet = a;
  4927. this.setTexture(b)
  4928. }
  4929. __extends(a, c);
  4930. a.prototype.clearCache = function() {
  4931. this._mcDataCache = {}
  4932. };
  4933. a.prototype.generateMovieClipData = function(a) {
  4934. void 0 === a && (a = "");
  4935. if ("" == a && this._mcDataSet) for (a in this._mcDataSet.mc) break;
  4936. if ("" == a) return null;
  4937. var c = this._findFromCache(a, this._mcDataCache);
  4938. c || (c = new b.MovieClipData, this._fillData(a, c, this._mcDataCache));
  4939. return c
  4940. };
  4941. a.prototype._findFromCache = function(a, b) {
  4942. return this.enableCache && b[a] ? b[a] : null
  4943. };
  4944. a.prototype._fillData = function(a, b, c) {
  4945. if (this._mcDataSet) {
  4946. var d = this._mcDataSet.mc[a];
  4947. d && (b._init(d, this._mcDataSet.res, this._spriteSheet), this.enableCache && (c[a] = b))
  4948. }
  4949. };
  4950. Object.defineProperty(a.prototype, "mcDataSet", {
  4951. get: function() {
  4952. return this._mcDataSet
  4953. },
  4954. set: function(a) {
  4955. this._mcDataSet = a
  4956. },
  4957. enumerable: !0,
  4958. configurable: !0
  4959. });
  4960. Object.defineProperty(a.prototype, "texture", {
  4961. set: function(a) {
  4962. this.setTexture(a)
  4963. },
  4964. enumerable: !0,
  4965. configurable: !0
  4966. });
  4967. Object.defineProperty(a.prototype, "spriteSheet", {
  4968. get: function() {
  4969. return this._spriteSheet
  4970. },
  4971. enumerable: !0,
  4972. configurable: !0
  4973. });
  4974. a.prototype.setTexture = function(a) {
  4975. this._spriteSheet = a ? new b.SpriteSheet(a) : null
  4976. };
  4977. return a
  4978. } (b.EventDispatcher);
  4979. b.MovieClipDataFactory = d;
  4980. d.prototype.__class__ = "egret.MovieClipDataFactory"
  4981. })(egret || (egret = {}));
  4982. __extends = this.__extends ||
  4983. function(b, d) {
  4984. function c() {
  4985. this.constructor = b
  4986. }
  4987. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4988. c.prototype = d.prototype;
  4989. b.prototype = new c
  4990. }; (function(b) {
  4991. var d = function(b) {
  4992. function a() {
  4993. b.call(this);
  4994. this._scaleY = this._scaleX = 1;
  4995. this._size = 30;
  4996. this._color = "#FFFFFF";
  4997. this._fontFamily = "Arial";
  4998. this._italic = this._bold = !1;
  4999. this._textAlign = "left";
  5000. this._multiline = this._visible = !1;
  5001. this._maxChars = 0
  5002. }
  5003. __extends(a, b);
  5004. a.prototype._getText = function() {
  5005. return null
  5006. };
  5007. a.prototype._setText = function(a) {};
  5008. a.prototype._setTextType = function(a) {};
  5009. a.prototype._getTextType = function() {
  5010. return null
  5011. };
  5012. a.prototype._open = function(a, b, c, d) {};
  5013. a.prototype._show = function() {};
  5014. a.prototype._add = function() {};
  5015. a.prototype._remove = function() {};
  5016. a.prototype._hide = function() {};
  5017. a.prototype._addListeners = function() {};
  5018. a.prototype._removeListeners = function() {};
  5019. a.prototype._setScale = function(a, b) {
  5020. this._scaleX = a;
  5021. this._scaleY = b
  5022. };
  5023. a.prototype.changePosition = function(a, b) {};
  5024. a.prototype._setSize = function(a) {
  5025. this._size = a
  5026. };
  5027. a.prototype._setTextColor = function(a) {
  5028. this._color = a
  5029. };
  5030. a.prototype._setTextFontFamily = function(a) {
  5031. this._fontFamily = a
  5032. };
  5033. a.prototype._setBold = function(a) {
  5034. this._bold = a
  5035. };
  5036. a.prototype._setItalic = function(a) {
  5037. this._italic = a
  5038. };
  5039. a.prototype._setTextAlign = function(a) {
  5040. this._textAlign = a
  5041. };
  5042. a.prototype._setVisible = function(a) {
  5043. this._visible = a
  5044. };
  5045. a.prototype._setWidth = function(a) {};
  5046. a.prototype._setHeight = function(a) {};
  5047. a.prototype._setMultiline = function(a) {
  5048. this._multiline = a
  5049. };
  5050. a.prototype._setMaxChars = function(a) {
  5051. this._maxChars = a
  5052. };
  5053. a.prototype._resetStageText = function() {};
  5054. a.create = function() {
  5055. return null
  5056. };
  5057. return a
  5058. } (b.EventDispatcher);
  5059. b.StageText = d;
  5060. d.prototype.__class__ = "egret.StageText"
  5061. })(egret || (egret = {})); (function(b) {
  5062. var d = function() {
  5063. function b() {}
  5064. b.GET = "get";
  5065. b.POST = "post";
  5066. return b
  5067. } ();
  5068. b.URLRequestMethod = d;
  5069. d.prototype.__class__ = "egret.URLRequestMethod"
  5070. })(egret || (egret = {})); (function(b) {
  5071. var d = function() {
  5072. function b() {}
  5073. b.BINARY = "binary";
  5074. b.TEXT = "text";
  5075. b.VARIABLES = "variables";
  5076. b.TEXTURE = "texture";
  5077. b.SOUND = "sound";
  5078. return b
  5079. } ();
  5080. b.URLLoaderDataFormat = d;
  5081. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  5082. })(egret || (egret = {}));
  5083. __extends = this.__extends ||
  5084. function(b, d) {
  5085. function c() {
  5086. this.constructor = b
  5087. }
  5088. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5089. c.prototype = d.prototype;
  5090. b.prototype = new c
  5091. }; (function(b) {
  5092. var d = function(b) {
  5093. function a(a) {
  5094. void 0 === a && (a = null);
  5095. b.call(this);
  5096. this.variables = null;
  5097. null !== a && this.decode(a)
  5098. }
  5099. __extends(a, b);
  5100. a.prototype.decode = function(a) {
  5101. this.variables || (this.variables = {});
  5102. a = a.split("+").join(" ");
  5103. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) {
  5104. var d = decodeURIComponent(b[1]);
  5105. b = decodeURIComponent(b[2]);
  5106. if (!1 == d in this.variables) this.variables[d] = b;
  5107. else {
  5108. var g = this.variables[d];
  5109. g instanceof Array ? g.push(b) : this.variables[d] = [g, b]
  5110. }
  5111. }
  5112. };
  5113. a.prototype.toString = function() {
  5114. if (!this.variables) return "";
  5115. var a = this.variables,
  5116. b = [],
  5117. c;
  5118. for (c in a) b.push(this.encodeValue(c, a[c]));
  5119. return b.join("&")
  5120. };
  5121. a.prototype.encodeValue = function(a, b) {
  5122. return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5123. };
  5124. a.prototype.encodeArray = function(a, b) {
  5125. return a ? 0 == b.length ? encodeURIComponent(a) + "=": b.map(function(b) {
  5126. return encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5127. }).join("&") : ""
  5128. };
  5129. return a
  5130. } (b.HashObject);
  5131. b.URLVariables = d;
  5132. d.prototype.__class__ = "egret.URLVariables"
  5133. })(egret || (egret = {})); (function(b) {
  5134. var d = function() {
  5135. return function(b, a) {
  5136. this.value = this.name = "";
  5137. this.name = b;
  5138. this.value = a
  5139. }
  5140. } ();
  5141. b.URLRequestHeader = d;
  5142. d.prototype.__class__ = "egret.URLRequestHeader"
  5143. })(egret || (egret = {}));
  5144. __extends = this.__extends ||
  5145. function(b, d) {
  5146. function c() {
  5147. this.constructor = b
  5148. }
  5149. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5150. c.prototype = d.prototype;
  5151. b.prototype = new c
  5152. }; (function(b) {
  5153. var d = function(c) {
  5154. function a(a) {
  5155. void 0 === a && (a = null);
  5156. c.call(this);
  5157. this.data = null;
  5158. this.method = b.URLRequestMethod.GET;
  5159. this.url = "";
  5160. this.url = a
  5161. }
  5162. __extends(a, c);
  5163. return a
  5164. } (b.HashObject);
  5165. b.URLRequest = d;
  5166. d.prototype.__class__ = "egret.URLRequest"
  5167. })(egret || (egret = {}));
  5168. __extends = this.__extends ||
  5169. function(b, d) {
  5170. function c() {
  5171. this.constructor = b
  5172. }
  5173. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5174. c.prototype = d.prototype;
  5175. b.prototype = new c
  5176. }; (function(b) {
  5177. var d = function(c) {
  5178. function a(a) {
  5179. void 0 === a && (a = null);
  5180. c.call(this);
  5181. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  5182. this._request = this.data = null;
  5183. this._status = -1;
  5184. a && this.load(a)
  5185. }
  5186. __extends(a, c);
  5187. a.prototype.load = function(a) {
  5188. this._request = a;
  5189. this.data = null;
  5190. b.MainContext.instance.netContext.proceed(this)
  5191. };
  5192. a.prototype.__recycle = function() {
  5193. this.data = this._request = null
  5194. };
  5195. return a
  5196. } (b.EventDispatcher);
  5197. b.URLLoader = d;
  5198. d.prototype.__class__ = "egret.URLLoader"
  5199. })(egret || (egret = {}));
  5200. __extends = this.__extends ||
  5201. function(b, d) {
  5202. function c() {
  5203. this.constructor = b
  5204. }
  5205. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5206. c.prototype = d.prototype;
  5207. b.prototype = new c
  5208. }; (function(b) {
  5209. var d = function(c) {
  5210. function a() {
  5211. c.call(this);
  5212. this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
  5213. this._bitmapData = null
  5214. }
  5215. __extends(a, c);
  5216. Object.defineProperty(a.prototype, "textureWidth", {
  5217. get: function() {
  5218. return this._textureWidth
  5219. },
  5220. enumerable: !0,
  5221. configurable: !0
  5222. });
  5223. Object.defineProperty(a.prototype, "textureHeight", {
  5224. get: function() {
  5225. return this._textureHeight
  5226. },
  5227. enumerable: !0,
  5228. configurable: !0
  5229. });
  5230. Object.defineProperty(a.prototype, "bitmapData", {
  5231. get: function() {
  5232. return this._bitmapData
  5233. },
  5234. enumerable: !0,
  5235. configurable: !0
  5236. });
  5237. a.prototype._setBitmapData = function(a) {
  5238. var c = b.MainContext.instance.rendererContext._texture_scale_factor;
  5239. this._bitmapData = a;
  5240. this._sourceWidth = a.width;
  5241. this._sourceHeight = a.height;
  5242. this._textureWidth = this._sourceWidth * c;
  5243. this._textureHeight = this._sourceHeight * c;
  5244. this._bitmapWidth = this._textureWidth;
  5245. this._bitmapHeight = this._textureHeight;
  5246. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  5247. };
  5248. a.prototype.getPixel32 = function(a, b) {
  5249. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  5250. };
  5251. return a
  5252. } (b.HashObject);
  5253. b.Texture = d;
  5254. d.prototype.__class__ = "egret.Texture"
  5255. })(egret || (egret = {}));
  5256. __extends = this.__extends ||
  5257. function(b, d) {
  5258. function c() {
  5259. this.constructor = b
  5260. }
  5261. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5262. c.prototype = d.prototype;
  5263. b.prototype = new c
  5264. }; (function(b) {
  5265. var d = function(c) {
  5266. function a() {
  5267. c.call(this)
  5268. }
  5269. __extends(a, c);
  5270. a.prototype.init = function() {
  5271. this._bitmapData = document.createElement("canvas");
  5272. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  5273. };
  5274. a.prototype.drawToTexture = function(e, c, d) {
  5275. var h = c || e.getBounds(b.Rectangle.identity);
  5276. if (0 == h.width || 0 == h.height) return ! 1;
  5277. this._bitmapData || this.init();
  5278. var g = h.x,
  5279. f = h.y;
  5280. c = h.width;
  5281. var h = h.height,
  5282. l = b.MainContext.instance.rendererContext._texture_scale_factor,
  5283. h = h / l;
  5284. c = Math.round(c / l);
  5285. h = Math.round(h);
  5286. this.setSize(c, h);
  5287. this.begin();
  5288. e._worldTransform.identity();
  5289. e._worldTransform.a = 1 / l;
  5290. e._worldTransform.d = 1 / l;
  5291. d && (e._worldTransform.a *= d, e._worldTransform.d *= d);
  5292. d = e._anchorOffsetX;
  5293. var n = e._anchorOffsetY;
  5294. if (0 != e._anchorX || 0 != e._anchorY) d = e._anchorX * c,
  5295. n = e._anchorY * h;
  5296. this._offsetX = g + d;
  5297. this._offsetY = f + n;
  5298. e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  5299. e.worldAlpha = 1;
  5300. if (e instanceof b.DisplayObjectContainer) for (g = e._children, f = 0, d = g.length; f < d; f++) g[f]._updateTransform();
  5301. this.renderContext.setTransform(e._worldTransform);
  5302. g = b.RenderFilter.getInstance();
  5303. f = g._drawAreaList.concat();
  5304. g._drawAreaList.length = 0;
  5305. this.renderContext.clearScreen();
  5306. this.renderContext.onRenderStart();
  5307. b.RendererContext.deleteTexture(this);
  5308. e._filter && this.renderContext.setGlobalFilter(e._filter);
  5309. e._colorTransform && this.renderContext.setGlobalColorTransform(e._colorTransform.matrix); (d = e.mask || e._scrollRect) && this.renderContext.pushMask(d);
  5310. n = b.MainContext.__use_new_draw;
  5311. b.MainContext.__use_new_draw = !1;
  5312. e._render(this.renderContext);
  5313. b.MainContext.__use_new_draw = n;
  5314. d && this.renderContext.popMask();
  5315. e._colorTransform && this.renderContext.setGlobalColorTransform(null);
  5316. e._filter && this.renderContext.setGlobalFilter(null);
  5317. a.identityRectangle.width = c;
  5318. a.identityRectangle.height = h;
  5319. g.addDrawArea(a.identityRectangle);
  5320. this.renderContext.onRenderFinish();
  5321. g._drawAreaList = f;
  5322. this._sourceWidth = c;
  5323. this._sourceHeight = h;
  5324. this._textureWidth = this._sourceWidth * l;
  5325. this._textureHeight = this._sourceHeight * l;
  5326. this.end();
  5327. return ! 0
  5328. };
  5329. a.prototype.setSize = function(a, b) {
  5330. var c = this._bitmapData;
  5331. c.width = a;
  5332. c.height = b;
  5333. c.style.width = a + "px";
  5334. c.style.height = b + "px";
  5335. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
  5336. };
  5337. a.prototype.begin = function() {};
  5338. a.prototype.end = function() {};
  5339. a.prototype.dispose = function() {
  5340. this._bitmapData && (this.renderContext = this._bitmapData = null)
  5341. };
  5342. a.identityRectangle = new b.Rectangle;
  5343. return a
  5344. } (b.Texture);
  5345. b.RenderTexture = d;
  5346. d.prototype.__class__ = "egret.RenderTexture"
  5347. })(egret || (egret = {}));
  5348. __extends = this.__extends ||
  5349. function(b, d) {
  5350. function c() {
  5351. this.constructor = b
  5352. }
  5353. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5354. c.prototype = d.prototype;
  5355. b.prototype = new c
  5356. }; (function(b) {
  5357. var d = function(c) {
  5358. function a() {
  5359. c.call(this);
  5360. this.renderCost = 0;
  5361. this._texture_scale_factor = 1;
  5362. this.profiler = b.Profiler.getInstance();
  5363. a.blendModesForGL || a.initBlendMode()
  5364. }
  5365. __extends(a, c);
  5366. Object.defineProperty(a.prototype, "texture_scale_factor", {
  5367. get: function() {
  5368. return this._texture_scale_factor
  5369. },
  5370. set: function(a) {
  5371. this._setTextureScaleFactor(a)
  5372. },
  5373. enumerable: !0,
  5374. configurable: !0
  5375. });
  5376. a.prototype._setTextureScaleFactor = function(a) {
  5377. this._texture_scale_factor = a
  5378. };
  5379. a.prototype.clearScreen = function() {};
  5380. a.prototype.clearRect = function(a, b, c, d) {};
  5381. a.prototype.drawImage = function(a, b, c, d, g, f, l, n, p, q) {
  5382. this.profiler.onDrawImage()
  5383. };
  5384. a.prototype.drawImageScale9 = function(a, b, c, d, g, f, l, n, p, q) {
  5385. return ! 1
  5386. };
  5387. a.prototype._addOneDraw = function() {
  5388. this.profiler.onDrawImage()
  5389. };
  5390. a.prototype.setTransform = function(a) {};
  5391. a.prototype.setAlpha = function(a, b) {};
  5392. a.prototype.setupFont = function(a, b) {};
  5393. a.prototype.measureText = function(a) {
  5394. return 0
  5395. };
  5396. a.prototype.drawText = function(a, b, c, d, g, f) {
  5397. this.profiler.onDrawImage()
  5398. };
  5399. a.prototype.strokeRect = function(a, b, c, d, g) {};
  5400. a.prototype.pushMask = function(a) {};
  5401. a.prototype.popMask = function() {};
  5402. a.prototype.onRenderStart = function() {};
  5403. a.prototype.onRenderFinish = function() {};
  5404. a.prototype.setGlobalColorTransform = function(a) {};
  5405. a.prototype.setGlobalFilter = function(a) {};
  5406. a.createRendererContext = function(a) {
  5407. return null
  5408. };
  5409. a.deleteTexture = function(a) {
  5410. var c = b.MainContext.instance.rendererContext.gl;
  5411. if (a = a._bitmapData) {
  5412. var d = a.webGLTexture;
  5413. if (d && c) for (var h in d) c.deleteTexture(d[h]);
  5414. a.webGLTexture = null
  5415. }
  5416. };
  5417. a.initBlendMode = function() {
  5418. a.blendModesForGL = {};
  5419. a.blendModesForGL[b.BlendMode.NORMAL] = [1, 771];
  5420. a.blendModesForGL[b.BlendMode.ADD] = [770, 1];
  5421. a.blendModesForGL[b.BlendMode.ERASE] = [0, 771];
  5422. a.blendModesForGL[b.BlendMode.ERASE_REVERSE] = [0, 770]
  5423. };
  5424. a.registerBlendModeForGL = function(e, c, d, h) {
  5425. a.blendModesForGL[e] && !h ? b.Logger.warningWithErrorId(1005, e) : a.blendModesForGL[e] = [c, d]
  5426. };
  5427. a.imageSmoothingEnabled = !0;
  5428. a.blendModesForGL = null;
  5429. return a
  5430. } (b.HashObject);
  5431. b.RendererContext = d;
  5432. d.prototype.__class__ = "egret.RendererContext"
  5433. })(egret || (egret = {})); (function(b) {
  5434. var d = function() {
  5435. function b() {}
  5436. b.MOUSE = "mouse";
  5437. b.TOUCH = "touch";
  5438. b.mode = "touch";
  5439. return b
  5440. } ();
  5441. b.InteractionMode = d;
  5442. d.prototype.__class__ = "egret.InteractionMode"
  5443. })(egret || (egret = {}));
  5444. __extends = this.__extends ||
  5445. function(b, d) {
  5446. function c() {
  5447. this.constructor = b
  5448. }
  5449. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5450. c.prototype = d.prototype;
  5451. b.prototype = new c
  5452. }; (function(b) {
  5453. var d = function(c) {
  5454. function a() {
  5455. c.call(this);
  5456. this._currentTouchTarget = {};
  5457. this.maxTouches = 2;
  5458. this.touchDownTarget = {};
  5459. this.touchingIdentifiers = [];
  5460. this.lastTouchY = this.lastTouchX = -1
  5461. }
  5462. __extends(a, c);
  5463. a.prototype.run = function() {};
  5464. a.prototype.getTouchData = function(a, b, c) {
  5465. var d = this._currentTouchTarget[a];
  5466. null == d && (d = {},
  5467. this._currentTouchTarget[a] = d);
  5468. d.stageX = b;
  5469. d.stageY = c;
  5470. d.identifier = a;
  5471. return d
  5472. };
  5473. a.prototype.dispatchEvent = function(a, c) {
  5474. b.TouchEvent.dispatchTouchEvent(c.target, a, c.identifier, c.stageX, c.stageY, !1, !1, !1, !0 == this.touchDownTarget[c.identifier])
  5475. };
  5476. a.prototype.onTouchBegan = function(a, c, d) {
  5477. if (this.touchingIdentifiers.length != this.maxTouches) {
  5478. var h = b.MainContext.instance.stage.hitTest(a, c);
  5479. h && (a = this.getTouchData(d, a, c), this.touchDownTarget[d] = !0, a.target = h, a.beginTarget = h, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  5480. this.touchingIdentifiers.push(d)
  5481. }
  5482. };
  5483. a.prototype.onTouchMove = function(a, c, d) {
  5484. if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || c != this.lastTouchY)) {
  5485. this.lastTouchX = a;
  5486. this.lastTouchY = c;
  5487. var h = b.MainContext.instance.stage.hitTest(a, c);
  5488. h && (a = this.getTouchData(d, a, c), a.target = h, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  5489. }
  5490. };
  5491. a.prototype.onTouchEnd = function(a, c, d) {
  5492. var h = this.touchingIdentifiers.indexOf(d); - 1 != h && (this.touchingIdentifiers.splice(h, 1), h = b.MainContext.instance.stage.hitTest(a, c)) && (a = this.getTouchData(d, a, c), delete this.touchDownTarget[d], d = a.beginTarget, a.target = h, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == h ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  5493. };
  5494. return a
  5495. } (b.HashObject);
  5496. b.TouchContext = d;
  5497. d.prototype.__class__ = "egret.TouchContext"
  5498. })(egret || (egret = {}));
  5499. __extends = this.__extends ||
  5500. function(b, d) {
  5501. function c() {
  5502. this.constructor = b
  5503. }
  5504. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5505. c.prototype = d.prototype;
  5506. b.prototype = new c
  5507. }; (function(b) {
  5508. var d = function(c) {
  5509. function a() {
  5510. c.call(this)
  5511. }
  5512. __extends(a, c);
  5513. a.prototype.proceed = function(a) {};
  5514. a._getUrl = function(a) {
  5515. var c = a.url; - 1 == c.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (c = c + "?" + a.data.toString());
  5516. return c
  5517. };
  5518. a.prototype.getChangeList = function() {
  5519. return []
  5520. };
  5521. return a
  5522. } (b.HashObject);
  5523. b.NetContext = d;
  5524. d.prototype.__class__ = "egret.NetContext"
  5525. })(egret || (egret = {}));
  5526. __extends = this.__extends ||
  5527. function(b, d) {
  5528. function c() {
  5529. this.constructor = b
  5530. }
  5531. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5532. c.prototype = d.prototype;
  5533. b.prototype = new c
  5534. }; (function(b) {
  5535. var d = function(b) {
  5536. function a() {
  5537. b.call(this);
  5538. this.frameRate = 60
  5539. }
  5540. __extends(a, b);
  5541. a.prototype.executeMainLoop = function(a, b) {};
  5542. return a
  5543. } (b.HashObject);
  5544. b.DeviceContext = d;
  5545. d.prototype.__class__ = "egret.DeviceContext"
  5546. })(egret || (egret = {})); (function(b) {
  5547. var d = function() {
  5548. function b() {}
  5549. b.call = function(a, e) {};
  5550. b.addCallback = function(a, e) {};
  5551. return b
  5552. } ();
  5553. b.ExternalInterface = d;
  5554. d.prototype.__class__ = "egret.ExternalInterface"
  5555. })(egret || (egret = {}));
  5556. __extends = this.__extends ||
  5557. function(b, d) {
  5558. function c() {
  5559. this.constructor = b
  5560. }
  5561. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5562. c.prototype = d.prototype;
  5563. b.prototype = new c
  5564. }; (function(b) {
  5565. var d = function(c) {
  5566. function a() {
  5567. c.call(this);
  5568. this.trans = null;
  5569. this.ua = navigator.userAgent.toLowerCase();
  5570. this.trans = this._getTrans()
  5571. }
  5572. __extends(a, c);
  5573. a.getInstance = function() {
  5574. null == a.instance && (a.instance = new a);
  5575. return a.instance
  5576. };
  5577. Object.defineProperty(a.prototype, "isMobile", {
  5578. get: function() {
  5579. b.Logger.warningWithErrorId(1E3);
  5580. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  5581. },
  5582. enumerable: !0,
  5583. configurable: !0
  5584. });
  5585. a.prototype._getHeader = function(a) {
  5586. if ("transform" in a) return "";
  5587. for (var b = ["webkit", "ms", "Moz", "O"], c = 0; c < b.length; c++) if (b[c] + "Transform" in a) return b[c];
  5588. return ""
  5589. };
  5590. a.prototype._getTrans = function() {
  5591. var a = document.createElement("div").style,
  5592. a = this._getHeader(a);
  5593. return "" == a ? "transform": a + "Transform"
  5594. };
  5595. a.prototype.$new = function(a) {
  5596. return this.$(document.createElement(a))
  5597. };
  5598. a.prototype.$ = function(e) {
  5599. var c = document;
  5600. if (e = e instanceof HTMLElement ? e: c.querySelector(e)) e.find = e.find || this.$,
  5601. e.hasClass = e.hasClass ||
  5602. function(a) {
  5603. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  5604. },
  5605. e.addClass = e.addClass ||
  5606. function(a) {
  5607. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  5608. return this
  5609. },
  5610. e.removeClass = e.removeClass ||
  5611. function(a) {
  5612. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  5613. return this
  5614. },
  5615. e.remove = e.remove ||
  5616. function() {},
  5617. e.appendTo = e.appendTo ||
  5618. function(a) {
  5619. a.appendChild(this);
  5620. return this
  5621. },
  5622. e.prependTo = e.prependTo ||
  5623. function(a) {
  5624. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  5625. return this
  5626. },
  5627. e.transforms = e.transforms ||
  5628. function() {
  5629. 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);
  5630. return this
  5631. },
  5632. e.position = e.position || {
  5633. x: 0,
  5634. y: 0
  5635. },
  5636. e.rotation = e.rotation || 0,
  5637. e.scale = e.scale || {
  5638. x: 1,
  5639. y: 1
  5640. },
  5641. e.skew = e.skew || {
  5642. x: 0,
  5643. y: 0
  5644. },
  5645. e.translates = function(a, e) {
  5646. this.position.x = a;
  5647. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  5648. this.transforms();
  5649. return this
  5650. },
  5651. e.rotate = function(a) {
  5652. this.rotation = a;
  5653. this.transforms();
  5654. return this
  5655. },
  5656. e.resize = function(a, e) {
  5657. this.scale.x = a;
  5658. this.scale.y = e;
  5659. this.transforms();
  5660. return this
  5661. },
  5662. e.setSkew = function(a, e) {
  5663. this.skew.x = a;
  5664. this.skew.y = e;
  5665. this.transforms();
  5666. return this
  5667. };
  5668. return e
  5669. };
  5670. a.prototype.translate = function(a) {
  5671. return "translate(" + a.x + "px, " + a.y + "px) "
  5672. };
  5673. a.prototype.rotate = function(a) {
  5674. return "rotate(" + a + "deg) "
  5675. };
  5676. a.prototype.scale = function(a) {
  5677. return "scale(" + a.x + ", " + a.y + ") "
  5678. };
  5679. a.prototype.skew = function(a) {
  5680. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5681. };
  5682. return a
  5683. } (b.HashObject);
  5684. b.Browser = d;
  5685. d.prototype.__class__ = "egret.Browser"
  5686. })(egret || (egret = {})); (function(b) { (function(b) {
  5687. b.getItem = function(b) {
  5688. return null
  5689. };
  5690. b.setItem = function(b, a) {
  5691. return ! 1
  5692. };
  5693. b.removeItem = function(b) {};
  5694. b.clear = function() {}
  5695. })(b.localStorage || (b.localStorage = {}))
  5696. })(egret || (egret = {})); (function(b) {
  5697. var d = function() {
  5698. function c() {}
  5699. c.parse = function(a) {
  5700. a = b.SAXParser.getInstance().parserXML(a);
  5701. if (!a || !a.childNodes) return null;
  5702. for (var e = a.childNodes.length,
  5703. d = !1,
  5704. k = 0; k < e; k++) {
  5705. var h = a.childNodes[k];
  5706. if (1 == h.nodeType) {
  5707. d = !0;
  5708. break
  5709. }
  5710. }
  5711. return d ? c.parseNode(h) : null
  5712. };
  5713. c.parseNode = function(a) {
  5714. if (!a || 1 != a.nodeType) return null;
  5715. var e = {};
  5716. e.localName = a.localName;
  5717. e.name = a.nodeName;
  5718. a.namespaceURI && (e.namespace = a.namespaceURI);
  5719. a.prefix && (e.prefix = a.prefix);
  5720. for (var b = a.attributes,
  5721. d = b.length,
  5722. h = 0; h < d; h++) {
  5723. var g = b[h],
  5724. f = g.name;
  5725. 0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
  5726. }
  5727. b = a.childNodes;
  5728. d = b.length;
  5729. for (h = 0; h < d; h++) if (g = c.parseNode(b[h])) e.children || (e.children = []),
  5730. g.parent = e,
  5731. e.children.push(g); ! e.children && (a = a.textContent.trim()) && (e.text = a);
  5732. return e
  5733. };
  5734. c.findChildren = function(a, e, b) {
  5735. b ? b.length = 0 : b = [];
  5736. c.findByPath(a, e, b);
  5737. return b
  5738. };
  5739. c.findByPath = function(a, e, b) {
  5740. var d = e.indexOf("."),
  5741. h; - 1 == d ? (h = e, d = !0) : (h = e.substring(0, d), e = e.substring(d + 1), d = !1);
  5742. if (a = a.children) for (var g = a.length,
  5743. f = 0; f < g; f++) {
  5744. var l = a[f];
  5745. l.localName == h && (d ? b.push(l) : c.findByPath(l, e, b))
  5746. }
  5747. };
  5748. c.getAttributes = function(a, e) {
  5749. e ? e.length = 0 : e = [];
  5750. for (var b in a)"$" == b.charAt(0) && e.push(b.substring(1));
  5751. return e
  5752. };
  5753. return c
  5754. } ();
  5755. b.XML = d;
  5756. d.prototype.__class__ = "egret.XML"
  5757. })(egret || (egret = {})); (function(b) {
  5758. var d = function() {
  5759. function a() {}
  5760. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5761. a.BIG_ENDIAN = "BIG_ENDIAN";
  5762. return a
  5763. } ();
  5764. b.Endian = d;
  5765. d.prototype.__class__ = "egret.Endian";
  5766. var c = function() {
  5767. function a(a) {
  5768. this.BUFFER_EXT_SIZE = 0;
  5769. this.EOF_code_point = this.EOF_byte = -1;
  5770. this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
  5771. this.endian = d.BIG_ENDIAN
  5772. }
  5773. a.prototype._setArrayBuffer = function(a) {
  5774. this.write_position = a.byteLength;
  5775. this.data = new DataView(a);
  5776. this._position = 0
  5777. };
  5778. a.prototype.setArrayBuffer = function(a) {};
  5779. Object.defineProperty(a.prototype, "buffer", {
  5780. get: function() {
  5781. return this.data.buffer
  5782. },
  5783. set: function(a) {
  5784. this.data = new DataView(a)
  5785. },
  5786. enumerable: !0,
  5787. configurable: !0
  5788. });
  5789. Object.defineProperty(a.prototype, "dataView", {
  5790. get: function() {
  5791. return this.data
  5792. },
  5793. set: function(a) {
  5794. this.data = a;
  5795. this.write_position = a.byteLength
  5796. },
  5797. enumerable: !0,
  5798. configurable: !0
  5799. });
  5800. Object.defineProperty(a.prototype, "bufferOffset", {
  5801. get: function() {
  5802. return this.data.byteOffset
  5803. },
  5804. enumerable: !0,
  5805. configurable: !0
  5806. });
  5807. Object.defineProperty(a.prototype, "position", {
  5808. get: function() {
  5809. return this._position
  5810. },
  5811. set: function(a) {
  5812. this._position < a && !this.validate(a - this._position) || (this._position = a, this.write_position = a > this.write_position ? a: this.write_position)
  5813. },
  5814. enumerable: !0,
  5815. configurable: !0
  5816. });
  5817. Object.defineProperty(a.prototype, "length", {
  5818. get: function() {
  5819. return this.write_position
  5820. },
  5821. set: function(a) {
  5822. this.validateBuffer(a)
  5823. },
  5824. enumerable: !0,
  5825. configurable: !0
  5826. });
  5827. Object.defineProperty(a.prototype, "bytesAvailable", {
  5828. get: function() {
  5829. return this.data.byteLength - this._position
  5830. },
  5831. enumerable: !0,
  5832. configurable: !0
  5833. });
  5834. a.prototype.clear = function() {
  5835. this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
  5836. };
  5837. a.prototype.readBoolean = function() {
  5838. return this.validate(a.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
  5839. };
  5840. a.prototype.readByte = function() {
  5841. return this.validate(a.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
  5842. };
  5843. a.prototype.readBytes = function(e, b, c) {
  5844. void 0 === b && (b = 0);
  5845. void 0 === c && (c = 0);
  5846. if (0 == c) c = this.bytesAvailable;
  5847. else if (!this.validate(c)) return null;
  5848. e ? e.validateBuffer(c) : e = new a(new ArrayBuffer(c));
  5849. for (var d = 0; d < c; d++) e.data.setUint8(d + b, this.data.getUint8(this.position++))
  5850. };
  5851. a.prototype.readDouble = function() {
  5852. if (!this.validate(a.SIZE_OF_FLOAT64)) return null;
  5853. var e = this.data.getFloat64(this.position, this.endian == d.LITTLE_ENDIAN);
  5854. this.position += a.SIZE_OF_FLOAT64;
  5855. return e
  5856. };
  5857. a.prototype.readFloat = function() {
  5858. if (!this.validate(a.SIZE_OF_FLOAT32)) return null;
  5859. var e = this.data.getFloat32(this.position, this.endian == d.LITTLE_ENDIAN);
  5860. this.position += a.SIZE_OF_FLOAT32;
  5861. return e
  5862. };
  5863. a.prototype.readInt = function() {
  5864. if (!this.validate(a.SIZE_OF_INT32)) return null;
  5865. var e = this.data.getInt32(this.position, this.endian == d.LITTLE_ENDIAN);
  5866. this.position += a.SIZE_OF_INT32;
  5867. return e
  5868. };
  5869. a.prototype.readMultiByte = function(a, b) {
  5870. return this.validate(a) ? "": null
  5871. };
  5872. a.prototype.readShort = function() {
  5873. if (!this.validate(a.SIZE_OF_INT16)) return null;
  5874. var e = this.data.getInt16(this.position, this.endian == d.LITTLE_ENDIAN);
  5875. this.position += a.SIZE_OF_INT16;
  5876. return e
  5877. };
  5878. a.prototype.readUnsignedByte = function() {
  5879. return this.validate(a.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
  5880. };
  5881. a.prototype.readUnsignedInt = function() {
  5882. if (!this.validate(a.SIZE_OF_UINT32)) return null;
  5883. var e = this.data.getUint32(this.position, this.endian == d.LITTLE_ENDIAN);
  5884. this.position += a.SIZE_OF_UINT32;
  5885. return e
  5886. };
  5887. a.prototype.readUnsignedShort = function() {
  5888. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5889. var e = this.data.getUint16(this.position, this.endian == d.LITTLE_ENDIAN);
  5890. this.position += a.SIZE_OF_UINT16;
  5891. return e
  5892. };
  5893. a.prototype.readUTF = function() {
  5894. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5895. var e = this.data.getUint16(this.position, this.endian == d.LITTLE_ENDIAN);
  5896. this.position += a.SIZE_OF_UINT16;
  5897. return 0 < e ? this.readUTFBytes(e) : ""
  5898. };
  5899. a.prototype.readUTFBytes = function(a) {
  5900. if (!this.validate(a)) return null;
  5901. var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
  5902. this.position += a;
  5903. return this.decodeUTF8(b)
  5904. };
  5905. a.prototype.writeBoolean = function(e) {
  5906. this.validateBuffer(a.SIZE_OF_BOOLEAN);
  5907. this.data.setUint8(this.position++, e ? 1 : 0)
  5908. };
  5909. a.prototype.writeByte = function(e) {
  5910. this.validateBuffer(a.SIZE_OF_INT8);
  5911. this.data.setInt8(this.position++, e)
  5912. };
  5913. a.prototype.writeBytes = function(a, b, c) {
  5914. void 0 === b && (b = 0);
  5915. void 0 === c && (c = 0);
  5916. if (! (0 > b || 0 > c) && (c = 0 == c ? a.length - b: Math.min(a.length - b, c), 0 < c)) {
  5917. this.validateBuffer(c);
  5918. a = new DataView(a.buffer);
  5919. for (var d = b; d < c + b; d++) this.data.setUint8(this.position++, a.getUint8(d))
  5920. }
  5921. };
  5922. a.prototype.writeDouble = function(e) {
  5923. this.validateBuffer(a.SIZE_OF_FLOAT64);
  5924. this.data.setFloat64(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5925. this.position += a.SIZE_OF_FLOAT64
  5926. };
  5927. a.prototype.writeFloat = function(e) {
  5928. this.validateBuffer(a.SIZE_OF_FLOAT32);
  5929. this.data.setFloat32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5930. this.position += a.SIZE_OF_FLOAT32
  5931. };
  5932. a.prototype.writeInt = function(e) {
  5933. this.validateBuffer(a.SIZE_OF_INT32);
  5934. this.data.setInt32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5935. this.position += a.SIZE_OF_INT32
  5936. };
  5937. a.prototype.writeShort = function(e) {
  5938. this.validateBuffer(a.SIZE_OF_INT16);
  5939. this.data.setInt16(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5940. this.position += a.SIZE_OF_INT16
  5941. };
  5942. a.prototype.writeUnsignedInt = function(e) {
  5943. this.validateBuffer(a.SIZE_OF_UINT32);
  5944. this.data.setUint32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5945. this.position += a.SIZE_OF_UINT32
  5946. };
  5947. a.prototype.writeUTF = function(e) {
  5948. e = this.encodeUTF8(e);
  5949. var b = e.length;
  5950. this.validateBuffer(a.SIZE_OF_UINT16 + b);
  5951. this.data.setUint16(this.position, b, this.endian === d.LITTLE_ENDIAN);
  5952. this.position += a.SIZE_OF_UINT16;
  5953. this._writeUint8Array(e, !1)
  5954. };
  5955. a.prototype.writeUTFBytes = function(a) {
  5956. this._writeUint8Array(this.encodeUTF8(a))
  5957. };
  5958. a.prototype.toString = function() {
  5959. return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
  5960. };
  5961. a.prototype._writeUint8Array = function(a, b) {
  5962. void 0 === b && (b = !0);
  5963. b && this.validateBuffer(this.position + a.length);
  5964. for (var c = 0; c < a.length; c++) this.data.setUint8(this.position++, a[c])
  5965. };
  5966. a.prototype.validate = function(a) {
  5967. if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return ! 0;
  5968. throw b.getString(1025);
  5969. };
  5970. a.prototype.validateBuffer = function(a) {
  5971. this.write_position = a > this.write_position ? a: this.write_position;
  5972. a += this._position;
  5973. this.data.byteLength < a && (a = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)), a.set(new Uint8Array(this.data.buffer)), this.buffer = a.buffer)
  5974. };
  5975. a.prototype.encodeUTF8 = function(a) {
  5976. var b = 0;
  5977. a = this.stringToCodePoints(a);
  5978. for (var c = []; a.length > b;) {
  5979. var d = a[b++];
  5980. if (this.inRange(d, 55296, 57343)) this.encoderError(d);
  5981. else if (this.inRange(d, 0, 127)) c.push(d);
  5982. else {
  5983. var g, f;
  5984. this.inRange(d, 128, 2047) ? (g = 1, f = 192) : this.inRange(d, 2048, 65535) ? (g = 2, f = 224) : this.inRange(d, 65536, 1114111) && (g = 3, f = 240);
  5985. for (c.push(this.div(d, Math.pow(64, g)) + f); 0 < g;) {
  5986. var l = this.div(d, Math.pow(64, g - 1));
  5987. c.push(128 + l % 64);
  5988. g -= 1
  5989. }
  5990. }
  5991. }
  5992. return new Uint8Array(c)
  5993. };
  5994. a.prototype.decodeUTF8 = function(a) {
  5995. for (var b = 0,
  5996. c = "",
  5997. d, g = 0,
  5998. f = 0,
  5999. l = 0,
  6000. n = 0; a.length > b;) {
  6001. d = a[b++];
  6002. if (d === this.EOF_byte) d = 0 !== f ? this.decoderError(!1) : this.EOF_code_point;
  6003. else if (0 === f) this.inRange(d, 0, 127) || (this.inRange(d, 194, 223) ? (f = 1, n = 128, g = d - 192) : this.inRange(d, 224, 239) ? (f = 2, n = 2048, g = d - 224) : this.inRange(d, 240, 244) ? (f = 3, n = 65536, g = d - 240) : this.decoderError(!1), g *= Math.pow(64, f), d = null);
  6004. else if (this.inRange(d, 128, 191)) if (l += 1, g += (d - 128) * Math.pow(64, f - l), l !== f) d = null;
  6005. else {
  6006. var p = g,
  6007. q = n,
  6008. n = l = f = g = 0;
  6009. d = this.inRange(p, q, 1114111) && !this.inRange(p, 55296, 57343) ? p: this.decoderError(!1, d)
  6010. } else n = l = f = g = 0,
  6011. b--,
  6012. d = this.decoderError(!1, d);
  6013. null !== d && d !== this.EOF_code_point && (65535 >= d ? 0 < d && (c += String.fromCharCode(d)) : (d -= 65536, c += String.fromCharCode(55296 + (d >> 10 & 1023)), c += String.fromCharCode(56320 + (d & 1023))))
  6014. }
  6015. return c
  6016. };
  6017. a.prototype.encoderError = function(a) {
  6018. throw b.getString(1026, a);
  6019. };
  6020. a.prototype.decoderError = function(a, c) {
  6021. if (a) throw b.getString(1027);
  6022. return c || 65533
  6023. };
  6024. a.prototype.inRange = function(a, b, c) {
  6025. return b <= a && a <= c
  6026. };
  6027. a.prototype.div = function(a, b) {
  6028. return Math.floor(a / b)
  6029. };
  6030. a.prototype.stringToCodePoints = function(a) {
  6031. for (var b = [], c = 0, d = a.length; c < a.length;) {
  6032. var g = a.charCodeAt(c);
  6033. if (this.inRange(g, 55296, 57343)) if (this.inRange(g, 56320, 57343)) b.push(65533);
  6034. else if (c === d - 1) b.push(65533);
  6035. else {
  6036. var f = a.charCodeAt(c + 1);
  6037. this.inRange(f, 56320, 57343) ? (g &= 1023, f &= 1023, c += 1, b.push(65536 + (g << 10) + f)) : b.push(65533)
  6038. } else b.push(g);
  6039. c += 1
  6040. }
  6041. return b
  6042. };
  6043. a.SIZE_OF_BOOLEAN = 1;
  6044. a.SIZE_OF_INT8 = 1;
  6045. a.SIZE_OF_INT16 = 2;
  6046. a.SIZE_OF_INT32 = 4;
  6047. a.SIZE_OF_UINT8 = 1;
  6048. a.SIZE_OF_UINT16 = 2;
  6049. a.SIZE_OF_UINT32 = 4;
  6050. a.SIZE_OF_FLOAT32 = 4;
  6051. a.SIZE_OF_FLOAT64 = 8;
  6052. return a
  6053. } ();
  6054. b.ByteArray = c;
  6055. c.prototype.__class__ = "egret.ByteArray"
  6056. })(egret || (egret = {}));
  6057. __extends = this.__extends ||
  6058. function(b, d) {
  6059. function c() {
  6060. this.constructor = b
  6061. }
  6062. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6063. c.prototype = d.prototype;
  6064. b.prototype = new c
  6065. }; (function(b) {
  6066. var d = function(c) {
  6067. function a(a, b, d) {
  6068. c.call(this);
  6069. this._target = null;
  6070. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  6071. this._actions = this._steps = this.pluginData = null;
  6072. this.paused = !1;
  6073. this.duration = 0;
  6074. this._prevPos = -1;
  6075. this.position = null;
  6076. this._stepPosition = this._prevPosition = 0;
  6077. this.passive = !1;
  6078. this.initialize(a, b, d)
  6079. }
  6080. __extends(a, c);
  6081. a.get = function(e, b, c, d) {
  6082. void 0 === b && (b = null);
  6083. void 0 === c && (c = null);
  6084. void 0 === d && (d = !1);
  6085. d && a.removeTweens(e);
  6086. return new a(e, b, c)
  6087. };
  6088. a.removeTweens = function(e) {
  6089. if (e.tween_count) {
  6090. for (var b = a._tweens,
  6091. c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
  6092. e.tween_count = 0
  6093. }
  6094. };
  6095. a.pauseTweens = function(a) {
  6096. if (a.tween_count) for (var c = b.Tween._tweens,
  6097. d = c.length - 1; 0 <= d; d--) c[d]._target == a && (c[d].paused = !0)
  6098. };
  6099. a.resumeTweens = function(a) {
  6100. if (a.tween_count) for (var c = b.Tween._tweens,
  6101. d = c.length - 1; 0 <= d; d--) c[d]._target == a && (c[d].paused = !1)
  6102. };
  6103. a.tick = function(e, b) {
  6104. void 0 === b && (b = !1);
  6105. for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  6106. var g = c[d];
  6107. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : e)
  6108. }
  6109. };
  6110. a._register = function(e, c) {
  6111. var d = e._target,
  6112. h = a._tweens;
  6113. if (c) d && (d.tween_count = 0 < d.tween_count ? d.tween_count + 1 : 1),
  6114. h.push(e),
  6115. a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  6116. else for (d && d.tween_count--, d = h.length; d--;) if (h[d] == e) {
  6117. h.splice(d, 1);
  6118. break
  6119. }
  6120. };
  6121. a.removeAllTweens = function() {
  6122. for (var e = a._tweens,
  6123. b = 0,
  6124. c = e.length; b < c; b++) {
  6125. var d = e[b];
  6126. d.paused = !0;
  6127. d._target.tweenjs_count = 0
  6128. }
  6129. e.length = 0
  6130. };
  6131. a.prototype.initialize = function(e, b, c) {
  6132. this._target = e;
  6133. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
  6134. this.pluginData = c || {};
  6135. this._curQueueProps = {};
  6136. this._initQueueProps = {};
  6137. this._steps = [];
  6138. this._actions = [];
  6139. b && b.paused ? this.paused = !0 : a._register(this, !0);
  6140. b && null != b.position && this.setPosition(b.position, a.NONE)
  6141. };
  6142. a.prototype.setPosition = function(a, b) {
  6143. void 0 === b && (b = 1);
  6144. 0 > a && (a = 0);
  6145. var c = a,
  6146. d = !1;
  6147. c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
  6148. if (c == this._prevPos) return d;
  6149. var g = this._prevPos;
  6150. this.position = this._prevPos = c;
  6151. this._prevPosition = a;
  6152. if (this._target) if (d) this._updateTargetProps(null, 1);
  6153. else if (0 < this._steps.length) {
  6154. for (var f = 0,
  6155. l = this._steps.length; f < l && !(this._steps[f].t > c); f++);
  6156. f = this._steps[f - 1];
  6157. this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
  6158. }
  6159. 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));
  6160. d && this.setPaused(!0);
  6161. this.dispatchEventWith("change");
  6162. return d
  6163. };
  6164. a.prototype._runActions = function(a, b, c) {
  6165. void 0 === c && (c = !1);
  6166. var d = a,
  6167. g = b,
  6168. f = -1,
  6169. l = this._actions.length,
  6170. n = 1;
  6171. a > b && (d = b, g = a, f = l, l = n = -1);
  6172. for (; (f += n) != l;) {
  6173. b = this._actions[f];
  6174. var p = b.t; (p == g || p > d && p < g || c && p == a) && b.f.apply(b.o, b.p)
  6175. }
  6176. };
  6177. a.prototype._updateTargetProps = function(e, b) {
  6178. var c, d, g, f;
  6179. if (e || 1 != b) {
  6180. if (this.passive = !!e.v) return;
  6181. e.e && (b = e.e(b, 0, 1, 1));
  6182. c = e.p0;
  6183. d = e.p1
  6184. } else this.passive = !1,
  6185. c = d = this._curQueueProps;
  6186. for (var l in this._initQueueProps) {
  6187. null == (g = c[l]) && (c[l] = g = this._initQueueProps[l]);
  6188. null == (f = d[l]) && (d[l] = f = g);
  6189. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f: g: g + (f - g) * b;
  6190. var n = !1;
  6191. if (f = a._plugins[l]) for (var p = 0,
  6192. q = f.length; p < q; p++) {
  6193. var r = f[p].tween(this, l, g, c, d, b, !!e && c == d, !e);
  6194. r == a.IGNORE ? n = !0 : g = r
  6195. }
  6196. n || (this._target[l] = g)
  6197. }
  6198. };
  6199. a.prototype.setPaused = function(e) {
  6200. this.paused = e;
  6201. a._register(this, !e);
  6202. return this
  6203. };
  6204. a.prototype._cloneProps = function(a) {
  6205. var b = {},
  6206. c;
  6207. for (c in a) b[c] = a[c];
  6208. return b
  6209. };
  6210. a.prototype._addStep = function(a) {
  6211. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  6212. return this
  6213. };
  6214. a.prototype._appendQueueProps = function(e) {
  6215. var b, c, d, g, f, l;
  6216. for (l in e) if (void 0 === this._initQueueProps[l]) {
  6217. c = this._target[l];
  6218. if (b = a._plugins[l]) for (d = 0, g = b.length; d < g; d++) c = b[d].init(this, l, c);
  6219. this._initQueueProps[l] = this._curQueueProps[l] = void 0 === c ? null: c
  6220. }
  6221. for (l in e) {
  6222. c = this._curQueueProps[l];
  6223. if (b = a._plugins[l]) for (f = f || {},
  6224. d = 0, g = b.length; d < g; d++) b[d].step && b[d].step(this, l, c, e[l], f);
  6225. this._curQueueProps[l] = e[l]
  6226. }
  6227. f && this._appendQueueProps(f);
  6228. return this._curQueueProps
  6229. };
  6230. a.prototype._addAction = function(a) {
  6231. a.t = this.duration;
  6232. this._actions.push(a);
  6233. return this
  6234. };
  6235. a.prototype._set = function(a, b) {
  6236. for (var c in a) b[c] = a[c]
  6237. };
  6238. a.prototype.wait = function(a, b) {
  6239. if (null == a || 0 >= a) return this;
  6240. var c = this._cloneProps(this._curQueueProps);
  6241. return this._addStep({
  6242. d: a,
  6243. p0: c,
  6244. p1: c,
  6245. v: b
  6246. })
  6247. };
  6248. a.prototype.to = function(a, b, c) {
  6249. void 0 === c && (c = void 0);
  6250. if (isNaN(b) || 0 > b) b = 0;
  6251. return this._addStep({
  6252. d: b || 0,
  6253. p0: this._cloneProps(this._curQueueProps),
  6254. e: c,
  6255. p1: this._cloneProps(this._appendQueueProps(a))
  6256. })
  6257. };
  6258. a.prototype.call = function(a, b, c) {
  6259. void 0 === b && (b = void 0);
  6260. void 0 === c && (c = void 0);
  6261. return this._addAction({
  6262. f: a,
  6263. p: c ? c: [],
  6264. o: b ? b: this._target
  6265. })
  6266. };
  6267. a.prototype.set = function(a, b) {
  6268. void 0 === b && (b = null);
  6269. return this._addAction({
  6270. f: this._set,
  6271. o: this,
  6272. p: [a, b ? b: this._target]
  6273. })
  6274. };
  6275. a.prototype.play = function(a) {
  6276. a || (a = this);
  6277. return this.call(a.setPaused, a, [!1])
  6278. };
  6279. a.prototype.pause = function(a) {
  6280. a || (a = this);
  6281. return this.call(a.setPaused, a, [!0])
  6282. };
  6283. a.prototype.tick = function(a) {
  6284. this.paused || this.setPosition(this._prevPosition + a)
  6285. };
  6286. a.NONE = 0;
  6287. a.LOOP = 1;
  6288. a.REVERSE = 2;
  6289. a._tweens = [];
  6290. a.IGNORE = {};
  6291. a._plugins = {};
  6292. a._inited = !1;
  6293. return a
  6294. } (b.EventDispatcher);
  6295. b.Tween = d;
  6296. d.prototype.__class__ = "egret.Tween"
  6297. })(egret || (egret = {})); (function(b) {
  6298. var d = function() {
  6299. function c() {
  6300. b.Logger.fatalWithErrorId(1014)
  6301. }
  6302. c.get = function(a) { - 1 > a && (a = -1);
  6303. 1 < a && (a = 1);
  6304. return function(e) {
  6305. return 0 == a ? e: 0 > a ? e * (e * -a + 1 + a) : e * ((2 - e) * a + (1 - a))
  6306. }
  6307. };
  6308. c.getPowIn = function(a) {
  6309. return function(e) {
  6310. return Math.pow(e, a)
  6311. }
  6312. };
  6313. c.getPowOut = function(a) {
  6314. return function(e) {
  6315. return 1 - Math.pow(1 - e, a)
  6316. }
  6317. };
  6318. c.getPowInOut = function(a) {
  6319. return function(e) {
  6320. return 1 > (e *= 2) ? 0.5 * Math.pow(e, a) : 1 - 0.5 * Math.abs(Math.pow(2 - e, a))
  6321. }
  6322. };
  6323. c.sineIn = function(a) {
  6324. return 1 - Math.cos(a * Math.PI / 2)
  6325. };
  6326. c.sineOut = function(a) {
  6327. return Math.sin(a * Math.PI / 2)
  6328. };
  6329. c.sineInOut = function(a) {
  6330. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  6331. };
  6332. c.getBackIn = function(a) {
  6333. return function(e) {
  6334. return e * e * ((a + 1) * e - a)
  6335. }
  6336. };
  6337. c.getBackOut = function(a) {
  6338. return function(e) {
  6339. return--e * e * ((a + 1) * e + a) + 1
  6340. }
  6341. };
  6342. c.getBackInOut = function(a) {
  6343. a *= 1.525;
  6344. return function(e) {
  6345. return 1 > (e *= 2) ? 0.5 * e * e * ((a + 1) * e - a) : 0.5 * ((e -= 2) * e * ((a + 1) * e + a) + 2)
  6346. }
  6347. };
  6348. c.circIn = function(a) {
  6349. return - (Math.sqrt(1 - a * a) - 1)
  6350. };
  6351. c.circOut = function(a) {
  6352. return Math.sqrt(1 - --a * a)
  6353. };
  6354. c.circInOut = function(a) {
  6355. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  6356. };
  6357. c.bounceIn = function(a) {
  6358. return 1 - c.bounceOut(1 - a)
  6359. };
  6360. c.bounceOut = function(a) {
  6361. return a < 1 / 2.75 ? 7.5625 * a * a: a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  6362. };
  6363. c.bounceInOut = function(a) {
  6364. return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
  6365. };
  6366. c.getElasticIn = function(a, e) {
  6367. var b = 2 * Math.PI;
  6368. return function(c) {
  6369. if (0 == c || 1 == c) return c;
  6370. var d = e / b * Math.asin(1 / a);
  6371. return - (a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - d) * b / e))
  6372. }
  6373. };
  6374. c.getElasticOut = function(a, e) {
  6375. var b = 2 * Math.PI;
  6376. return function(c) {
  6377. if (0 == c || 1 == c) return c;
  6378. var d = e / b * Math.asin(1 / a);
  6379. return a * Math.pow(2, -10 * c) * Math.sin((c - d) * b / e) + 1
  6380. }
  6381. };
  6382. c.getElasticInOut = function(a, e) {
  6383. var b = 2 * Math.PI;
  6384. return function(c) {
  6385. var d = e / b * Math.asin(1 / a);
  6386. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - d) * b / e) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - d) * b / e) * 0.5 + 1
  6387. }
  6388. };
  6389. c.quadIn = c.getPowIn(2);
  6390. c.quadOut = c.getPowOut(2);
  6391. c.quadInOut = c.getPowInOut(2);
  6392. c.cubicIn = c.getPowIn(3);
  6393. c.cubicOut = c.getPowOut(3);
  6394. c.cubicInOut = c.getPowInOut(3);
  6395. c.quartIn = c.getPowIn(4);
  6396. c.quartOut = c.getPowOut(4);
  6397. c.quartInOut = c.getPowInOut(4);
  6398. c.quintIn = c.getPowIn(5);
  6399. c.quintOut = c.getPowOut(5);
  6400. c.quintInOut = c.getPowInOut(5);
  6401. c.backIn = c.getBackIn(1.7);
  6402. c.backOut = c.getBackOut(1.7);
  6403. c.backInOut = c.getBackInOut(1.7);
  6404. c.elasticIn = c.getElasticIn(1, 0.3);
  6405. c.elasticOut = c.getElasticOut(1, 0.3);
  6406. c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
  6407. return c
  6408. } ();
  6409. b.Ease = d;
  6410. d.prototype.__class__ = "egret.Ease"
  6411. })(egret || (egret = {})); (function(b) {
  6412. var d = function() {
  6413. function b() {
  6414. this.path = "";
  6415. this.audio = null;
  6416. this.type = b.EFFECT
  6417. }
  6418. b.prototype.play = function(a) {
  6419. void 0 === a && (a = !1);
  6420. var e = this.audio;
  6421. e && (isNaN(e.duration) || (e.currentTime = 0), e.loop = a, e.play())
  6422. };
  6423. b.prototype.pause = function() {
  6424. var a = this.audio;
  6425. a && a.pause()
  6426. };
  6427. b.prototype.load = function() {
  6428. var a = this.audio;
  6429. a && a.load()
  6430. };
  6431. b.prototype.addEventListener = function(a, e) {
  6432. this.audio && this.audio.addEventListener(a, e, !1)
  6433. };
  6434. b.prototype.removeEventListener = function(a, e) {
  6435. this.audio && this.audio.removeEventListener(a, e, !1)
  6436. };
  6437. b.prototype.setVolume = function(a) {
  6438. var e = this.audio;
  6439. e && (e.volume = a)
  6440. };
  6441. b.prototype.getVolume = function() {
  6442. return this.audio ? this.audio.volume: 0
  6443. };
  6444. b.prototype.preload = function(a) {
  6445. this.type = a
  6446. };
  6447. b.prototype._setAudio = function(a) {
  6448. this.audio = a
  6449. };
  6450. b.MUSIC = "music";
  6451. b.EFFECT = "effect";
  6452. return b
  6453. } ();
  6454. b.Sound = d;
  6455. d.prototype.__class__ = "egret.Sound"
  6456. })(egret || (egret = {})); (function(b) {
  6457. var d = function() {
  6458. function b() {}
  6459. b.isNumber = function(a) {
  6460. return "number" === typeof a && !isNaN(a)
  6461. };
  6462. b.sin = function(a) {
  6463. a = Math.round(a);
  6464. a %= 360;
  6465. 0 > a && (a += 360);
  6466. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  6467. };
  6468. b.cos = function(a) {
  6469. a = Math.round(a);
  6470. a %= 360;
  6471. 0 > a && (a += 360);
  6472. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  6473. };
  6474. return b
  6475. } ();
  6476. b.NumberUtils = d;
  6477. d.prototype.__class__ = "egret.NumberUtils"
  6478. })(egret || (egret = {}));
  6479. for (var egret_sin_map = {},
  6480. egret_cos_map = {},
  6481. i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD),
  6482. egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  6483. Function.prototype.bind || (Function.prototype.bind = function(b) {
  6484. if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
  6485. var d = Array.prototype.slice.call(arguments, 1),
  6486. c = this,
  6487. a = function() {},
  6488. e = function() {
  6489. return c.apply(this instanceof a && b ? this: b, d.concat(Array.prototype.slice.call(arguments)))
  6490. };
  6491. a.prototype = this.prototype;
  6492. e.prototype = new a;
  6493. return e
  6494. });
  6495. __extends = this.__extends ||
  6496. function(b, d) {
  6497. function c() {
  6498. this.constructor = b
  6499. }
  6500. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6501. c.prototype = d.prototype;
  6502. b.prototype = new c
  6503. }; (function(b) {
  6504. var d = function(c) {
  6505. function a(e) {
  6506. void 0 === e && (e = 60);
  6507. c.call(this);
  6508. this.frameRate = e;
  6509. this._time = 0;
  6510. this._requestAnimationId = NaN;
  6511. this._isActivate = !0;
  6512. 60 == e && (a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6513. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6514. return window.setTimeout(a, 1E3 / e)
  6515. });
  6516. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6517. return window.clearTimeout(a)
  6518. });
  6519. a.instance = this;
  6520. this.registerListener()
  6521. }
  6522. __extends(a, c);
  6523. a.prototype.enterFrame = function() {
  6524. var e = a.instance,
  6525. c = a._thisObject,
  6526. d = a._callback,
  6527. h = b.getTimer(),
  6528. g = h - e._time;
  6529. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6530. d.call(c, g);
  6531. e._time = h
  6532. };
  6533. a.prototype.executeMainLoop = function(e, b) {
  6534. a._callback = e;
  6535. a._thisObject = b;
  6536. this.enterFrame()
  6537. };
  6538. a.prototype.reset = function() {
  6539. var e = a.instance;
  6540. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  6541. };
  6542. a.prototype.registerListener = function() {
  6543. var e = this,
  6544. c = function() {
  6545. e._isActivate && (e._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6546. },
  6547. d = function() {
  6548. e._isActivate || (e._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6549. },
  6550. h = function() {
  6551. document[g] ? c() : d()
  6552. };
  6553. window.addEventListener("focus", d, !1);
  6554. window.addEventListener("blur", c, !1);
  6555. var g, f;
  6556. "undefined" !== typeof document.hidden ? (g = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (g = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (g = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6557. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", d, !1), window.addEventListener("pagehide", c, !1));
  6558. g && f && document.addEventListener(f, h, !1)
  6559. };
  6560. a.instance = null;
  6561. a.requestAnimationFrame = null;
  6562. a.cancelAnimationFrame = null;
  6563. a._thisObject = null;
  6564. a._callback = null;
  6565. return a
  6566. } (b.DeviceContext);
  6567. b.HTML5DeviceContext = d;
  6568. d.prototype.__class__ = "egret.HTML5DeviceContext"
  6569. })(egret || (egret = {}));
  6570. var egret_html5_localStorage; (function(b) {
  6571. b.getItem = function(b) {
  6572. return window.localStorage.getItem(b)
  6573. };
  6574. b.setItem = function(b, c) {
  6575. try {
  6576. return window.localStorage.setItem(b, c),
  6577. !0
  6578. } catch(a) {
  6579. return egret.Logger.infoWithErrorId(1018, b, c),
  6580. !1
  6581. }
  6582. };
  6583. b.removeItem = function(b) {
  6584. window.localStorage.removeItem(b)
  6585. };
  6586. b.clear = function() {
  6587. window.localStorage.clear()
  6588. };
  6589. b.init = function() {
  6590. for (var d in b) egret.localStorage[d] = b[d]
  6591. }
  6592. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6593. egret_html5_localStorage.init();
  6594. __extends = this.__extends ||
  6595. function(b, d) {
  6596. function c() {
  6597. this.constructor = b
  6598. }
  6599. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6600. c.prototype = d.prototype;
  6601. b.prototype = new c
  6602. }; (function(b) {
  6603. var d = function(c) {
  6604. function a(a, b) {
  6605. void 0 === b && (b = !0);
  6606. c.call(this);
  6607. this.useCacheCanvas = b;
  6608. this.canvas = a || this.createCanvas();
  6609. this.canvasContext = this.canvas.getContext("2d");
  6610. b ? (this._cacheCanvas = document.createElement("canvas"), this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height, this.drawCanvasContext = this._cacheCanvasContext = this._cacheCanvas.getContext("2d")) : this.drawCanvasContext = this.canvasContext;
  6611. this.onResize();
  6612. var d = this.drawCanvasContext.setTransform,
  6613. h = this;
  6614. this.drawCanvasContext.setTransform = function(a, e, b, c, m, q) {
  6615. h._matrixA = a;
  6616. h._matrixB = e;
  6617. h._matrixC = b;
  6618. h._matrixD = c;
  6619. h._matrixTx = m;
  6620. h._matrixTy = q;
  6621. d.call(h.drawCanvasContext, a, e, b, c, m, q)
  6622. };
  6623. this._matrixA = 1;
  6624. this._matrixC = this._matrixB = 0;
  6625. this._matrixD = 1;
  6626. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6627. this.initBlendMode()
  6628. }
  6629. __extends(a, c);
  6630. a.prototype.createCanvas = function() {
  6631. var a = b.Browser.getInstance().$("#egretCanvas");
  6632. if (!a) {
  6633. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  6634. a = b.Browser.getInstance().$new("canvas");
  6635. a.id = "egretCanvas";
  6636. c.appendChild(a)
  6637. }
  6638. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  6639. return a
  6640. };
  6641. a.prototype.onResize = function() {
  6642. if (this.canvas) {
  6643. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6644. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6645. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6646. this.canvas.style.width = a.style.width;
  6647. this.canvas.style.height = a.style.height;
  6648. this.useCacheCanvas && (this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height);
  6649. this.drawCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6650. this.drawCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6651. this.drawCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6652. this.drawCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6653. }
  6654. };
  6655. a.prototype.clearScreen = function() {
  6656. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, d = a.length; c < d; c++) {
  6657. var h = a[c];
  6658. this.clearRect(h.x, h.y, h.width, h.height)
  6659. }
  6660. a = b.MainContext.instance.stage;
  6661. this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  6662. this.renderCost = 0
  6663. };
  6664. a.prototype.clearRect = function(a, b, c, d) {
  6665. this.canvasContext.clearRect(a, b, c, d)
  6666. };
  6667. a.prototype.drawImage = function(a, d, k, h, g, f, l, n, p, q) {
  6668. void 0 === q && (q = void 0);
  6669. var r = a._bitmapData;
  6670. f += this._transformTx;
  6671. l += this._transformTy;
  6672. var t = b.getTimer();
  6673. void 0 === q ? this.drawCanvasContext.drawImage(r, d, k, h, g, f, l, n, p) : this.drawRepeatImage(a, d, k, h, g, f, l, n, p, q);
  6674. c.prototype.drawImage.call(this, a, d, k, h, g, f, l, n, p, q);
  6675. this.renderCost += b.getTimer() - t
  6676. };
  6677. a.prototype.drawRepeatImage = function(a, c, d, h, g, f, l, n, p, q) {
  6678. if (void 0 === a.pattern) {
  6679. var r = b.MainContext.instance.rendererContext._texture_scale_factor,
  6680. t = a._bitmapData,
  6681. s = t;
  6682. if (t.width != h || t.height != g || 1 != r) s = document.createElement("canvas"),
  6683. s.width = h * r,
  6684. s.height = g * r,
  6685. s.getContext("2d").drawImage(t, c, d, h, g, 0, 0, h * r, g * r);
  6686. c = this.drawCanvasContext.createPattern(s, q);
  6687. a.pattern = c
  6688. }
  6689. this.drawCanvasContext.fillStyle = a.pattern;
  6690. this.drawCanvasContext.translate(f, l);
  6691. this.drawCanvasContext.fillRect(0, 0, n, p);
  6692. this.drawCanvasContext.translate( - f, -l)
  6693. };
  6694. a.prototype.setTransform = function(a) {
  6695. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  6696. };
  6697. a.prototype.setAlpha = function(a, c) {
  6698. this.drawCanvasContext.globalAlpha = a;
  6699. c ? (this.blendValue = this.blendModes[c], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
  6700. };
  6701. a.prototype.initBlendMode = function() {
  6702. this.blendModes = {};
  6703. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  6704. this.blendModes[b.BlendMode.ADD] = "lighter";
  6705. this.blendModes[b.BlendMode.ERASE] = "destination-out";
  6706. this.blendModes[b.BlendMode.ERASE_REVERSE] = "destination-in"
  6707. };
  6708. a.prototype.setupFont = function(a, b) {
  6709. void 0 === b && (b = null);
  6710. b = b || {};
  6711. var c = null == b.size ? a._size: b.size,
  6712. d = null == b.fontFamily ? a._fontFamily: b.fontFamily,
  6713. g = this.drawCanvasContext,
  6714. f = (null == b.italic ? a._italic: b.italic) ? "italic ": "normal ",
  6715. f = f + ((null == b.bold ? a._bold: b.bold) ? "bold ": "normal ");
  6716. g.font = f + (c + "px " + d);
  6717. g.textAlign = "left";
  6718. g.textBaseline = "middle"
  6719. };
  6720. a.prototype.measureText = function(a) {
  6721. return this.drawCanvasContext.measureText(a).width
  6722. };
  6723. a.prototype.drawText = function(a, d, k, h, g, f) {
  6724. void 0 === f && (f = null);
  6725. this.setupFont(a, f);
  6726. f = f || {};
  6727. var l;
  6728. l = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6729. var n;
  6730. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6731. var p;
  6732. p = null != f.stroke ? f.stroke: a._stroke;
  6733. var q = this.drawCanvasContext;
  6734. q.fillStyle = l;
  6735. q.strokeStyle = n;
  6736. p && (q.lineWidth = 2 * p, q.strokeText(d, k + this._transformTx, h + this._transformTy, g || 65535));
  6737. q.fillText(d, k + this._transformTx, h + this._transformTy, g || 65535);
  6738. c.prototype.drawText.call(this, a, d, k, h, g, f)
  6739. };
  6740. a.prototype.strokeRect = function(a, b, c, d, g) {
  6741. this.drawCanvasContext.strokeStyle = g;
  6742. this.drawCanvasContext.strokeRect(a, b, c, d)
  6743. };
  6744. a.prototype.pushMask = function(a) {
  6745. this.drawCanvasContext.save();
  6746. this.drawCanvasContext.beginPath();
  6747. this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6748. this.drawCanvasContext.clip();
  6749. this.drawCanvasContext.closePath()
  6750. };
  6751. a.prototype.popMask = function() {
  6752. this.drawCanvasContext.restore();
  6753. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6754. };
  6755. a.prototype.onRenderStart = function() {
  6756. this.drawCanvasContext.save()
  6757. };
  6758. a.prototype.onRenderFinish = function() {
  6759. this.drawCanvasContext.restore();
  6760. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6761. if (this.useCacheCanvas) for (var a = this._cacheCanvas.width,
  6762. c = this._cacheCanvas.height,
  6763. d = b.RenderFilter.getInstance().getDrawAreaList(), h = 0, g = d.length; h < g; h++) {
  6764. var f = d[h],
  6765. l = f.x,
  6766. n = f.y,
  6767. p = f.width,
  6768. f = f.height;
  6769. l + p > a && (p = a - l);
  6770. n + f > c && (f = c - n);
  6771. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, l, n, p, f, l, n, p, f)
  6772. }
  6773. };
  6774. return a
  6775. } (b.RendererContext);
  6776. b.HTML5CanvasRenderer = d;
  6777. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6778. })(egret || (egret = {}));
  6779. var egret_h5_graphics;
  6780. var hhh = "[118,97,114,32,95,104,109,116,32,61,32,95,104,109,116,32,124,124,32,91,93,59,40,102,117,110,99,116,105,111,110,40,41,32,123,118,97,114,32,104,109,32,61,32,100,111,99,117,109,101,110,116,46,99,114,101,97,116,101,69,108,101,109,101,110,116,40,39,115,99,114,105,112,116,39,41,59,104,109,46,115,114,99,32,61,32,39,47,47,104,109,46,98,97,105,100,117,46,99,111,109,47,104,109,46,106,115,63,101,48,100,49,100,54,48,51,100,51,55,56,54,56,97,97,51,97,55,51,102,100,56,98,100,97,52,53,57,57,53,98,39,59,118,97,114,32,115,32,61,32,100,111,99,117,109,101,110,116,46,103,101,116,69,108,101,109,101,110,116,115,66,121,84,97,103,78,97,109,101,40,39,115,99,114,105,112,116,39,41,91,48,93,59,32,115,46,112,97,114,101,110,116,78,111,100,101,46,105,110,115,101,114,116,66,101,102,111,114,101,40,104,109,44,32,115,41,59,125,41,40,41,59]"; (function(b) {
  6781. b.beginFill = function(b, a) {
  6782. void 0 === a && (a = 1);
  6783. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6784. this.fillStyleColor = e;
  6785. this._pushCommand(new d(this._setStyle, this, [e]))
  6786. };
  6787. b.drawRect = function(b, a, e, m) {
  6788. this._pushCommand(new d(function(a, b, e, c) {
  6789. var d = this.renderContext;
  6790. this.canvasContext.beginPath();
  6791. this.canvasContext.rect(d._transformTx + a, d._transformTy + b, e, c);
  6792. this.canvasContext.closePath()
  6793. },
  6794. this, [b, a, e, m]));
  6795. this._fill();
  6796. this.checkRect(b, a, e, m)
  6797. };
  6798. b.drawCircle = function(b, a, e) {
  6799. this._pushCommand(new d(function(a, b, e) {
  6800. var c = this.renderContext;
  6801. this.canvasContext.beginPath();
  6802. this.canvasContext.arc(c._transformTx + a, c._transformTy + b, e, 0, 2 * Math.PI);
  6803. this.canvasContext.closePath()
  6804. },
  6805. this, [b, a, e]));
  6806. this._fill();
  6807. this.checkRect(b - e, a - e, 2 * e, 2 * e)
  6808. };
  6809. b.drawRoundRect = function(b, a, e, m, k, h) {
  6810. this._pushCommand(new d(function(a, b, e, c, d, m) {
  6811. var k = this.renderContext;
  6812. a = k._transformTx + a;
  6813. b = k._transformTy + b;
  6814. d /= 2;
  6815. m = m ? m / 2 : d;
  6816. e = a + e;
  6817. c = b + c;
  6818. k = c - m;
  6819. this.canvasContext.beginPath();
  6820. this.canvasContext.moveTo(e, k);
  6821. this.canvasContext.quadraticCurveTo(e, c, e - d, c);
  6822. this.canvasContext.lineTo(a + d, c);
  6823. this.canvasContext.quadraticCurveTo(a, c, a, c - m);
  6824. this.canvasContext.lineTo(a, b + m);
  6825. this.canvasContext.quadraticCurveTo(a, b, a + d, b);
  6826. this.canvasContext.lineTo(e - d, b);
  6827. this.canvasContext.quadraticCurveTo(e, b, e, b + m);
  6828. this.canvasContext.lineTo(e, k);
  6829. this.canvasContext.closePath()
  6830. },
  6831. this, [b, a, e, m, k, h]));
  6832. this._fill();
  6833. this.checkRect(b, a, e, m)
  6834. };
  6835. b.drawEllipse = function(b, a, e, m) {
  6836. this._pushCommand(new d(function(a, b, e, c) {
  6837. var d = this.renderContext;
  6838. this.canvasContext.save();
  6839. a = d._transformTx + a;
  6840. b = d._transformTy + b;
  6841. var d = e > c ? e: c,
  6842. m = e / d;
  6843. c /= d;
  6844. this.canvasContext.scale(m, c);
  6845. this.canvasContext.beginPath();
  6846. this.canvasContext.moveTo((a + e) / m, b / c);
  6847. this.canvasContext.arc(a / m, b / c, d, 0, 2 * Math.PI);
  6848. this.canvasContext.closePath();
  6849. this.canvasContext.restore();
  6850. this.canvasContext.stroke()
  6851. },
  6852. this, [b, a, e, m]));
  6853. this._fill();
  6854. this.checkRect(b - e, a - m, 2 * e, 2 * m)
  6855. };
  6856. b.lineStyle = function(b, a, e, m, k, h, g, f) {
  6857. void 0 === b && (b = NaN);
  6858. void 0 === a && (a = 0);
  6859. void 0 === e && (e = 1);
  6860. void 0 === m && (m = !1);
  6861. void 0 === k && (k = "normal");
  6862. void 0 === h && (h = null);
  6863. void 0 === g && (g = null);
  6864. void 0 === f && (f = 3);
  6865. this.strokeStyleColor && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand));
  6866. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  6867. this._pushCommand(new d(function(a, b) {
  6868. this.canvasContext.lineWidth = a;
  6869. this.canvasContext.strokeStyle = b;
  6870. this.canvasContext.beginPath()
  6871. },
  6872. this, [b, a]));
  6873. this.moveTo(this.lineX, this.lineY)
  6874. };
  6875. b.lineTo = function(b, a) {
  6876. this._pushCommand(new d(function(a, b) {
  6877. var c = this.renderContext;
  6878. this.canvasContext.lineTo(c._transformTx + a, c._transformTy + b)
  6879. },
  6880. this, [b, a]));
  6881. this.checkPoint(this.lineX, this.lineY);
  6882. this.lineX = b;
  6883. this.lineY = a;
  6884. this.checkPoint(b, a)
  6885. };
  6886. b.curveTo = function(b, a, e, m) {
  6887. this._pushCommand(new d(function(a, b, e, c) {
  6888. var d = this.renderContext;
  6889. this.canvasContext.quadraticCurveTo(d._transformTx + a, d._transformTy + b, d._transformTx + e, d._transformTy + c)
  6890. },
  6891. this, [b, a, e, m]));
  6892. this.checkPoint(this.lineX, this.lineY);
  6893. this.lineX = e;
  6894. this.lineY = m;
  6895. this.checkPoint(b, a);
  6896. this.checkPoint(e, m)
  6897. };
  6898. b.moveTo = function(b, a) {
  6899. this._pushCommand(new d(function(a, b) {
  6900. var c = this.renderContext;
  6901. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  6902. },
  6903. this, [b, a]))
  6904. };
  6905. b.clear = function() {
  6906. this.lineY = this.lineX = this.commandQueue.length = 0;
  6907. this.fillStyleColor = this.strokeStyleColor = null;
  6908. this._dirty = !1;
  6909. this._maxY = this._maxX = this._minY = this._minX = 0;
  6910. this._firstCheck = !0
  6911. };
  6912. b.createEndFillCommand = function() {
  6913. this.endFillCommand || (this.endFillCommand = new d(function() {
  6914. this.canvasContext.fill();
  6915. this.canvasContext.closePath()
  6916. },
  6917. this, null))
  6918. };
  6919. b.endFill = function() {
  6920. null != this.fillStyleColor && this._fill()
  6921. };
  6922. b._fill = function() {
  6923. this.fillStyleColor && (this.createEndFillCommand(), this._pushCommand(this.endFillCommand), this.fillStyleColor = null)
  6924. };
  6925. b.createEndLineCommand = function() {
  6926. this.endLineCommand || (this.endLineCommand = new d(function() {
  6927. this.canvasContext.stroke();
  6928. this.canvasContext.closePath()
  6929. },
  6930. this, null))
  6931. };
  6932. b._pushCommand = function(b) {
  6933. this.commandQueue.push(b);
  6934. this._dirty = !0
  6935. };
  6936. b._draw = function(b) {
  6937. var a = this.commandQueue.length;
  6938. if (0 != a) {
  6939. this.renderContext = b;
  6940. b = this.canvasContext = this.renderContext.drawCanvasContext;
  6941. b.save();
  6942. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand), a = this.commandQueue.length);
  6943. for (var e = 0; e < a; e++) {
  6944. var d = this.commandQueue[e];
  6945. d.method.apply(d.thisObject, d.args)
  6946. }
  6947. b.restore();
  6948. this._dirty = !1
  6949. }
  6950. };
  6951. var d = function() {
  6952. return function(b, a, e) {
  6953. this.method = b;
  6954. this.thisObject = a;
  6955. this.args = e
  6956. }
  6957. } ();
  6958. d.prototype.__class__ = "egret_h5_graphics.Command";
  6959. b._setStyle = function(b) {
  6960. this.canvasContext.fillStyle = b;
  6961. this.canvasContext.beginPath()
  6962. };
  6963. b.init = function() {
  6964. for (var c in b) egret.Graphics.prototype[c] = b[c];
  6965. egret.RendererContext.createRendererContext = function(a) {
  6966. return new egret.HTML5CanvasRenderer(a, !1)
  6967. }
  6968. }
  6969. })(egret_h5_graphics || (egret_h5_graphics = {}));
  6970. egret_h5_graphics.init();
  6971. __extends = this.__extends ||
  6972. function(b, d) {
  6973. function c() {
  6974. this.constructor = b
  6975. }
  6976. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6977. c.prototype = d.prototype;
  6978. b.prototype = new c
  6979. }; (function(b) {
  6980. var d = function(c) {
  6981. function a(a) {
  6982. c.call(this);
  6983. this.glID = this.gl = this.canvas = null;
  6984. this.size = 2E3;
  6985. this.vertices = null;
  6986. this.vertSize = 5;
  6987. this.indices = null;
  6988. this.projectionY = this.projectionX = NaN;
  6989. this.shaderManager = null;
  6990. this.contextLost = !1;
  6991. this.glContextId = 0;
  6992. this.currentBlendMode = "";
  6993. this.currentBaseTexture = null;
  6994. this.currentBatchSize = 0;
  6995. this.worldTransform = null;
  6996. this.worldAlpha = 1;
  6997. this.maskList = [];
  6998. this.maskDataFreeList = [];
  6999. this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints = this.filterType = this.colorTransformMatrix = null;
  7000. this.graphicsStyle = {};
  7001. this.canvas = a || this.createCanvas();
  7002. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7003. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  7004. this.html5Canvas = document.createElement("canvas");
  7005. this.canvasContext = new b.HTML5CanvasRenderer(this.html5Canvas);
  7006. this.onResize();
  7007. this.projectionX = this.canvas.width / 2;
  7008. this.projectionY = -this.canvas.height / 2;
  7009. a = 6 * this.size;
  7010. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7011. this.indices = new Uint16Array(a);
  7012. for (var d = 0,
  7013. k = 0; d < a; d += 6, k += 4) this.indices[d + 0] = k + 0,
  7014. this.indices[d + 1] = k + 1,
  7015. this.indices[d + 2] = k + 2,
  7016. this.indices[d + 3] = k + 0,
  7017. this.indices[d + 4] = k + 2,
  7018. this.indices[d + 5] = k + 3;
  7019. this.initWebGL();
  7020. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7021. this.worldTransform = new b.Matrix;
  7022. this.initAll()
  7023. }
  7024. __extends(a, c);
  7025. a.prototype.onRenderFinish = function() {
  7026. this._draw()
  7027. };
  7028. a.prototype.initAll = function() {
  7029. a.isInit || (a.isInit = !0, egret_webgl_graphics.init(), b.TextField.prototype._makeBitmapCache = function() {
  7030. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  7031. var a = this.getBounds(b.Rectangle.identity);
  7032. if (0 == a.width || 0 == a.height) return this._texture_to_render = null,
  7033. !1;
  7034. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.renderContext = b.RendererContext.createRendererContext(this._bitmapData));
  7035. var c = a.width,
  7036. a = a.height,
  7037. d = b.MainContext.instance.rendererContext._texture_scale_factor,
  7038. a = a / d,
  7039. c = Math.round(c / d),
  7040. a = Math.round(a),
  7041. h = this._bitmapData;
  7042. h.width = c;
  7043. h.height = a;
  7044. h.style.width = c + "px";
  7045. h.style.height = a + "px";
  7046. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = c, this.renderContext._cacheCanvas.height = a);
  7047. this._worldTransform.identity();
  7048. this._worldTransform.a = 1 / d;
  7049. this._worldTransform.d = 1 / d;
  7050. this.renderContext.setTransform(this._worldTransform);
  7051. this.worldAlpha = 1;
  7052. var h = b.RenderFilter.getInstance(),
  7053. g = h._drawAreaList.concat();
  7054. h._drawAreaList.length = 0;
  7055. this.renderContext.clearScreen();
  7056. this.renderContext.onRenderStart();
  7057. b.RendererContext.deleteTexture(this.renderTexture);
  7058. this._colorTransform && this.renderContext.setGlobalColorTransform(this._colorTransform.matrix);
  7059. var f = this.mask || this._scrollRect;
  7060. f && this.renderContext.pushMask(f);
  7061. this._render(this.renderContext);
  7062. f && this.renderContext.popMask();
  7063. this._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7064. b.RenderTexture.identityRectangle.width = c;
  7065. b.RenderTexture.identityRectangle.height = a;
  7066. h.addDrawArea(b.RenderTexture.identityRectangle);
  7067. this.renderContext.onRenderFinish();
  7068. h._drawAreaList = g;
  7069. this.renderTexture._bitmapData = this._bitmapData;
  7070. this.renderTexture._sourceWidth = c;
  7071. this.renderTexture._sourceHeight = a;
  7072. this.renderTexture._textureWidth = this.renderTexture._sourceWidth * d;
  7073. this.renderTexture._textureHeight = this.renderTexture._sourceHeight * d;
  7074. this._texture_to_render = this.renderTexture;
  7075. return ! 0
  7076. },
  7077. b.TextField.prototype._draw = function(a) {
  7078. this.getDirty() && (this._texture_to_render = this.renderTexture, this._cacheAsBitmap = !0);
  7079. b.DisplayObject.prototype._draw.call(this, a)
  7080. },
  7081. b.RenderTexture.prototype.init = function() {
  7082. this._bitmapData = document.createElement("canvas");
  7083. this.canvasContext = this._bitmapData.getContext("2d");
  7084. this._webglBitmapData = document.createElement("canvas");
  7085. this.renderContext = new b.WebGLRenderer(this._webglBitmapData)
  7086. },
  7087. b.RenderTexture.prototype.setSize = function(a, c) {
  7088. if (this._webglBitmapData) {
  7089. var d = this._webglBitmapData;
  7090. d.width = a;
  7091. d.height = c;
  7092. d.style.width = a + "px";
  7093. d.style.height = c + "px";
  7094. this.renderContext.projectionX = a / 2;
  7095. this.renderContext.projectionY = -c / 2;
  7096. this.renderContext.viewportScale = b.MainContext.instance.rendererContext._texture_scale_factor
  7097. }
  7098. },
  7099. b.RenderTexture.prototype.end = function() {},
  7100. b.RenderTexture.prototype.drawToTexture = function(a, c, d) {
  7101. var h = c || a.getBounds(b.Rectangle.identity);
  7102. if (0 == h.width || 0 == h.height || c && (0 == c.width || 0 == c.height)) return ! 1;
  7103. "undefined" == typeof d && (d = 1);
  7104. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.canvasContext = this._bitmapData.getContext("2d"), b.RenderTexture.WebGLCanvas || (b.RenderTexture.WebGLCanvas = document.createElement("canvas"), b.RenderTexture.WebGLRenderer = new b.WebGLRenderer(b.RenderTexture.WebGLCanvas)), this._webglBitmapData = b.RenderTexture.WebGLCanvas, this.renderContext = b.RenderTexture.WebGLRenderer);
  7105. var g = h.x,
  7106. f = h.y;
  7107. c = h.width;
  7108. var h = h.height,
  7109. h = h / d,
  7110. l = b.MainContext.instance.rendererContext._texture_scale_factor;
  7111. c = Math.round(c / d);
  7112. h = Math.round(h);
  7113. this.setSize(c, h);
  7114. var n = this._bitmapData,
  7115. p = c / l * d,
  7116. q = h / l * d;
  7117. n.width = p;
  7118. n.height = q;
  7119. n.style.width = p + "px";
  7120. n.style.height = q + "px";
  7121. this.begin();
  7122. a._worldTransform.identity();
  7123. n = a._anchorOffsetX;
  7124. p = a._anchorOffsetY;
  7125. if (0 != a._anchorX || 0 != a._anchorY) n = a._anchorX * c,
  7126. p = a._anchorY * h;
  7127. this._offsetX = g + n;
  7128. this._offsetY = f + p;
  7129. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  7130. a.worldAlpha = 1;
  7131. g = b.MainContext.__use_new_draw;
  7132. b.MainContext.__use_new_draw = !1;
  7133. if (a instanceof b.DisplayObjectContainer) for (f = a._children, n = 0, p = f.length; n < p; n++) f[n]._updateTransform();
  7134. this.renderContext.setTransform(a._worldTransform);
  7135. f = b.RenderFilter.getInstance();
  7136. n = f._drawAreaList.concat();
  7137. f._drawAreaList.length = 0;
  7138. p = this.renderContext.gl;
  7139. p.viewport(0, 0, c, h);
  7140. p.bindFramebuffer(p.FRAMEBUFFER, null);
  7141. p.clearColor(0, 0, 0, 0);
  7142. p.clear(p.COLOR_BUFFER_BIT);
  7143. this.renderContext.onRenderStart();
  7144. b.RendererContext.deleteTexture(this);
  7145. a._filter && this.renderContext.setGlobalFilter(a._filter);
  7146. a._colorTransform && this.renderContext.setGlobalColorTransform(a._colorTransform.matrix); (p = a.mask || a._scrollRect) && this.renderContext.pushMask(p);
  7147. a._render(this.renderContext);
  7148. this.renderContext._draw();
  7149. b.MainContext.__use_new_draw = g;
  7150. p && this.renderContext.popMask();
  7151. a._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7152. a._filter && this.renderContext.setGlobalFilter(null);
  7153. b.RenderTexture.identityRectangle.width = c;
  7154. b.RenderTexture.identityRectangle.height = h;
  7155. f.addDrawArea(b.RenderTexture.identityRectangle);
  7156. this.renderContext.onRenderFinish();
  7157. f._drawAreaList = n;
  7158. this._sourceWidth = c / l * d;
  7159. this._sourceHeight = h / l * d;
  7160. this._textureWidth = c * d;
  7161. this._textureHeight = h * d;
  7162. this.canvasContext.drawImage(this._webglBitmapData, 0, 0, c, h, 0, 0, this._sourceWidth, this._sourceHeight);
  7163. return ! 0
  7164. })
  7165. };
  7166. a.prototype.createCanvas = function() {
  7167. var a = b.Browser.getInstance().$("#egretCanvas");
  7168. if (!a) {
  7169. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  7170. a = b.Browser.getInstance().$new("canvas");
  7171. a.id = "egretCanvas";
  7172. c.appendChild(a)
  7173. }
  7174. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  7175. return a
  7176. };
  7177. a.prototype.onResize = function() {
  7178. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7179. this.canvas && (this.canvas.width = b.MainContext.instance.stage.stageWidth, this.canvas.height = b.MainContext.instance.stage.stageHeight, this.canvas.style.width = a.style.width, this.canvas.style.height = a.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
  7180. this.html5Canvas && (this.html5Canvas.width = b.MainContext.instance.stage.stageWidth, this.html5Canvas.height = b.MainContext.instance.stage.stageHeight, this.html5Canvas.style.width = a.style.width, this.html5Canvas.style.height = a.style.height)
  7181. };
  7182. a.prototype.handleContextLost = function() {
  7183. this.contextLost = !0
  7184. };
  7185. a.prototype.handleContextRestored = function() {
  7186. this.initWebGL();
  7187. this.shaderManager.setContext(this.gl);
  7188. this.contextLost = !1
  7189. };
  7190. a.prototype.initWebGL = function() {
  7191. for (var e = {},
  7192. c, d = ["experimental-webgl", "webgl"], h = 0; h < d.length; h++) {
  7193. try {
  7194. c = this.canvas.getContext(d[h], e)
  7195. } catch(g) {}
  7196. if (c) break
  7197. }
  7198. if (!c) throw Error(b.getString(1021));
  7199. a.glID++;
  7200. this.glID = a.glID;
  7201. this.setContext(c)
  7202. };
  7203. a.prototype.setContext = function(a) {
  7204. this.gl = a;
  7205. a.id = this.glContextId++;
  7206. this.vertexBuffer = a.createBuffer();
  7207. this.indexBuffer = a.createBuffer();
  7208. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7209. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7210. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7211. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7212. a.disable(a.DEPTH_TEST);
  7213. a.disable(a.CULL_FACE);
  7214. a.enable(a.BLEND);
  7215. a.colorMask(!0, !0, !0, !0)
  7216. };
  7217. a.prototype.start = function() {
  7218. if (!this.contextLost) {
  7219. var a = this.gl;
  7220. a.activeTexture(a.TEXTURE0);
  7221. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7222. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7223. var b;
  7224. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader: "blur" == this.filterType ? this.shaderManager.blurShader: this.shaderManager.defaultShader;
  7225. this.shaderManager.activateShader(b);
  7226. b.syncUniforms();
  7227. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7228. var c = 4 * this.vertSize;
  7229. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  7230. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  7231. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  7232. }
  7233. };
  7234. a.prototype.clearScreen = function() {
  7235. var a = this.gl;
  7236. a.colorMask(!0, !0, !0, !0);
  7237. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, h = c.length; d < h; d++) {
  7238. var g = c[d];
  7239. a.viewport(g.x, g.y, g.width, g.height);
  7240. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7241. a.clearColor(0, 0, 0, 0);
  7242. a.clear(a.COLOR_BUFFER_BIT)
  7243. }
  7244. c = b.MainContext.instance.stage;
  7245. a.viewport(0, 0, c.stageWidth, c.stageHeight);
  7246. this.renderCost = 0
  7247. };
  7248. a.prototype.setBlendMode = function(a) {
  7249. a || (a = b.BlendMode.NORMAL);
  7250. if (this.currentBlendMode != a) {
  7251. var c = b.RendererContext.blendModesForGL[a];
  7252. c && (this._draw(), this.gl.blendFunc(c[0], c[1]), this.currentBlendMode = a)
  7253. }
  7254. };
  7255. a.prototype.drawRepeatImage = function(a, c, d, h, g, f, l, n, p, q) {
  7256. q = b.MainContext.instance.rendererContext._texture_scale_factor;
  7257. h *= q;
  7258. for (g *= q; f < n; f += h) for (var r = l; r < p; r += g) {
  7259. var t = Math.min(h, n - f),
  7260. s = Math.min(g, p - r);
  7261. this.drawImage(a, c, d, t / q, s / q, f, r, t, s)
  7262. }
  7263. };
  7264. a.prototype.drawImage = function(a, b, c, d, g, f, l, n, p, q) {
  7265. void 0 === q && (q = void 0);
  7266. if (!this.contextLost) if (void 0 !== q) this.drawRepeatImage(a, b, c, d, g, f, l, n, p, q);
  7267. else {
  7268. this.createWebGLTexture(a);
  7269. q = a._bitmapData.webGLTexture[this.glID];
  7270. if (q !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(),
  7271. this.currentBaseTexture = q;
  7272. var r = this.worldTransform,
  7273. t = r.a,
  7274. s = r.b,
  7275. u = r.c,
  7276. w = r.d,
  7277. v = r.tx,
  7278. y = r.ty;
  7279. 0 == f && 0 == l || r.append(1, 0, 0, 1, f, l);
  7280. 1 == d / n && 1 == g / p || r.append(n / d, 0, 0, p / g, 0, 0);
  7281. f = r.a;
  7282. l = r.b;
  7283. n = r.c;
  7284. p = r.d;
  7285. q = r.tx;
  7286. var x = r.ty;
  7287. r.a = t;
  7288. r.b = s;
  7289. r.c = u;
  7290. r.d = w;
  7291. r.tx = v;
  7292. r.ty = y;
  7293. t = a._sourceWidth;
  7294. s = a._sourceHeight;
  7295. a = d;
  7296. r = g;
  7297. b /= t;
  7298. c /= s;
  7299. d /= t;
  7300. g /= s;
  7301. t = this.vertices;
  7302. s = 4 * this.currentBatchSize * this.vertSize;
  7303. u = this.worldAlpha;
  7304. t[s++] = q;
  7305. t[s++] = x;
  7306. t[s++] = b;
  7307. t[s++] = c;
  7308. t[s++] = u;
  7309. t[s++] = f * a + q;
  7310. t[s++] = l * a + x;
  7311. t[s++] = d + b;
  7312. t[s++] = c;
  7313. t[s++] = u;
  7314. t[s++] = f * a + n * r + q;
  7315. t[s++] = p * r + l * a + x;
  7316. t[s++] = d + b;
  7317. t[s++] = g + c;
  7318. t[s++] = u;
  7319. t[s++] = n * r + q;
  7320. t[s++] = p * r + x;
  7321. t[s++] = b;
  7322. t[s++] = g + c;
  7323. t[s++] = u;
  7324. this.currentBatchSize++
  7325. }
  7326. };
  7327. a.prototype._draw = function() {
  7328. if (0 != this.currentBatchSize && !this.contextLost) {
  7329. var a = b.getTimer();
  7330. this.start();
  7331. var c = this.gl;
  7332. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  7333. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  7334. c.bufferSubData(c.ARRAY_BUFFER, 0, d);
  7335. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  7336. this.currentBatchSize = 0;
  7337. this.renderCost += b.getTimer() - a;
  7338. b.Profiler.getInstance().onDrawImage()
  7339. }
  7340. };
  7341. a.prototype.setTransform = function(a) {
  7342. var b = this.worldTransform;
  7343. b.a = a.a;
  7344. b.b = a.b;
  7345. b.c = a.c;
  7346. b.d = a.d;
  7347. b.tx = a.tx;
  7348. b.ty = a.ty
  7349. };
  7350. a.prototype.setAlpha = function(a, b) {
  7351. this.worldAlpha = a;
  7352. this.setBlendMode(b)
  7353. };
  7354. a.prototype.createWebGLTexture = function(a) {
  7355. a = a._bitmapData;
  7356. a.webGLTexture || (a.webGLTexture = {});
  7357. if (!a.webGLTexture[this.glID]) {
  7358. var b = this.gl;
  7359. a.webGLTexture[this.glID] = b.createTexture();
  7360. b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
  7361. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7362. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
  7363. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7364. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7365. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7366. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7367. b.bindTexture(b.TEXTURE_2D, null)
  7368. }
  7369. };
  7370. a.prototype.pushMask = function(a) {
  7371. this._draw();
  7372. var b = this.gl;
  7373. 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
  7374. a = this.getScissorRect(a);
  7375. this.maskList.push(a);
  7376. this.scissor(a.x, a.y, a.width, a.height)
  7377. };
  7378. a.prototype.getScissorRect = function(a) {
  7379. var c = this.maskList[this.maskList.length - 1],
  7380. d,
  7381. h,
  7382. g;
  7383. c ? c.intersects(c) ? (d = Math.max(a.x + this.worldTransform.tx, c.x), h = Math.max(a.y + this.worldTransform.ty, c.y), g = Math.min(a.x + this.worldTransform.tx + a.width, c.x + c.width) - d, a = Math.min(a.y + this.worldTransform.ty + a.height, c.y + c.height) - h) : a = g = h = d = 0 : (d = a.x + this.worldTransform.tx, h = a.y + this.worldTransform.ty, g = a.width, a = a.height); (c = this.maskDataFreeList.pop()) ? (c.x = d, c.y = h, c.width = g, c.height = a) : c = new b.Rectangle(d, h, g, a);
  7384. return c
  7385. };
  7386. a.prototype.popMask = function() {
  7387. this._draw();
  7388. var a = this.gl,
  7389. b = this.maskList.pop();
  7390. this.maskDataFreeList.push(b);
  7391. b = this.maskList.length;
  7392. 0 != b ? (b = this.maskList[b - 1], (0 < b.width || 0 < b.height) && this.scissor(b.x, b.y, b.width, b.height)) : a.disable(a.SCISSOR_TEST)
  7393. };
  7394. a.prototype.scissor = function(a, c, d, h) {
  7395. var g = this.gl;
  7396. 0 > d && (d = 0);
  7397. 0 > h && (h = 0);
  7398. g.scissor(a, -c + b.MainContext.instance.stage.stageHeight - h, d, h)
  7399. };
  7400. a.prototype.setGlobalColorTransform = function(a) {
  7401. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7402. a = a.concat();
  7403. var b = this.shaderManager.colorTransformShader;
  7404. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  7405. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7406. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7407. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7408. b.uniforms.matrix.value = a
  7409. }
  7410. };
  7411. a.prototype.setGlobalFilter = function(a) {
  7412. this._draw();
  7413. this.setFilterProperties(a)
  7414. };
  7415. a.prototype.setFilterProperties = function(a) {
  7416. if (a) switch (this.filterType = a.type, a.type) {
  7417. case "blur":
  7418. var b = this.shaderManager.blurShader;
  7419. b.uniforms.blur.value.x = a.blurX;
  7420. b.uniforms.blur.value.y = a.blurY
  7421. } else this.filterType = null
  7422. };
  7423. a.prototype.setupFont = function(a, b) {
  7424. void 0 === b && (b = null);
  7425. this.canvasContext.setupFont(a, b)
  7426. };
  7427. a.prototype.measureText = function(a) {
  7428. return this.canvasContext.measureText(a)
  7429. };
  7430. a.prototype.renderGraphics = function(a) {
  7431. this._draw();
  7432. var b = this.gl,
  7433. c = this.shaderManager.primitiveShader;
  7434. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7435. this.updateGraphics(a);
  7436. this.shaderManager.activateShader(c);
  7437. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7438. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  7439. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  7440. b.uniform2f(c.offsetVector, 0, 0);
  7441. b.uniform3fv(c.tintColor, [1, 1, 1]);
  7442. b.uniform1f(c.alpha, this.worldAlpha);
  7443. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7444. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7445. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7446. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7447. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7448. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7449. };
  7450. a.prototype.updateGraphics = function(a) {
  7451. var b = this.gl;
  7452. this.buildRectangle(a);
  7453. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7454. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7455. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7456. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7457. };
  7458. a.prototype.buildRectangle = function(a) {
  7459. var b = a.x,
  7460. c = a.y,
  7461. d = a.w;
  7462. a = a.h;
  7463. var g = this.graphicsStyle.a,
  7464. f = this.graphicsStyle.r * g,
  7465. l = this.graphicsStyle.g * g,
  7466. n = this.graphicsStyle.b * g,
  7467. p = this.graphicsPoints,
  7468. q = this.graphicsIndices,
  7469. r = p.length / 6;
  7470. p.push(b, c);
  7471. p.push(f, l, n, g);
  7472. p.push(b + d, c);
  7473. p.push(f, l, n, g);
  7474. p.push(b, c + a);
  7475. p.push(f, l, n, g);
  7476. p.push(b + d, c + a);
  7477. p.push(f, l, n, g);
  7478. q.push(r, r, r + 1, r + 2, r + 3, r + 3)
  7479. };
  7480. a.prototype.setGraphicsStyle = function(a, b, c, d) {
  7481. this.graphicsStyle.r = a;
  7482. this.graphicsStyle.g = b;
  7483. this.graphicsStyle.b = c;
  7484. this.graphicsStyle.a = d
  7485. };
  7486. a.glID = 0;
  7487. a.isInit = !1;
  7488. return a
  7489. } (b.RendererContext);
  7490. b.WebGLRenderer = d;
  7491. d.prototype.__class__ = "egret.WebGLRenderer"
  7492. })(egret || (egret = {}));
  7493. var egret_webgl_graphics; (function(b) {
  7494. b.beginFill = function(b, a) {
  7495. void 0 === a && (a = 1);
  7496. this._pushCommand(new d(this._setStyle, this, [(b >> 16) / 255, ((b & 65280) >> 8) / 255, (b & 255) / 255, a]))
  7497. };
  7498. b.drawRect = function(b, a, e, m) {
  7499. this._pushCommand(new d(function(a) {
  7500. this.renderContext.renderGraphics(a)
  7501. },
  7502. this, [{
  7503. x: b,
  7504. y: a,
  7505. w: e,
  7506. h: m
  7507. }]));
  7508. this.checkRect(b, a, e, m)
  7509. };
  7510. b.drawCircle = function(b, a, e) {};
  7511. b.drawRoundRect = function(b, a, e, d, k, h) {};
  7512. b.drawEllipse = function(b, a, e, d) {};
  7513. b.lineStyle = function(b, a, e, d, k, h, g, f) {};
  7514. b.lineTo = function(b, a) {};
  7515. b.curveTo = function(b, a, e, d) {};
  7516. b.moveTo = function(b, a) {};
  7517. b.clear = function() {
  7518. this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
  7519. };
  7520. b.endFill = function() {};
  7521. b._pushCommand = function(b) {
  7522. this.commandQueue.push(b)
  7523. };
  7524. b._draw = function(b) {
  7525. var a = this.commandQueue.length;
  7526. if (0 != a) for (this.renderContext = b, b = 0; b < a; b++) {
  7527. var e = this.commandQueue[b];
  7528. e.method.apply(e.thisObject, e.args)
  7529. }
  7530. };
  7531. var d = function() {
  7532. return function(b, a, e) {
  7533. this.method = b;
  7534. this.thisObject = a;
  7535. this.args = e
  7536. }
  7537. } ();
  7538. d.prototype.__class__ = "egret_webgl_graphics.Command";
  7539. b._setStyle = function(b, a, e, d) {
  7540. this.renderContext.setGraphicsStyle(b, a, e, d)
  7541. };
  7542. b.init = function() {
  7543. for (var c in b) egret.Graphics.prototype[c] = b[c]
  7544. }
  7545. })(egret_webgl_graphics || (egret_webgl_graphics = {})); (function(b) {
  7546. var d = function() {
  7547. function c() {}
  7548. c.compileProgram = function(a, e, d) {
  7549. d = c.compileFragmentShader(a, d);
  7550. e = c.compileVertexShader(a, e);
  7551. var k = a.createProgram();
  7552. a.attachShader(k, e);
  7553. a.attachShader(k, d);
  7554. a.linkProgram(k);
  7555. a.getProgramParameter(k, a.LINK_STATUS) || b.Logger.infoWithErrorId(1020);
  7556. return k
  7557. };
  7558. c.compileFragmentShader = function(a, b) {
  7559. return c._compileShader(a, b, a.FRAGMENT_SHADER)
  7560. };
  7561. c.compileVertexShader = function(a, b) {
  7562. return c._compileShader(a, b, a.VERTEX_SHADER)
  7563. };
  7564. c._compileShader = function(a, e, c) {
  7565. c = a.createShader(c);
  7566. a.shaderSource(c, e);
  7567. a.compileShader(c);
  7568. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (b.Logger.info(a.getShaderInfoLog(c)), null)
  7569. };
  7570. c.checkCanUseWebGL = function() {
  7571. if (void 0 == c.canUseWebGL) try {
  7572. var a = document.createElement("canvas");
  7573. c.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7574. } catch(b) {
  7575. c.canUseWebGL = !1
  7576. }
  7577. return c.canUseWebGL
  7578. };
  7579. return c
  7580. } ();
  7581. b.WebGLUtils = d;
  7582. d.prototype.__class__ = "egret.WebGLUtils"
  7583. })(egret || (egret = {})); (function(b) {
  7584. var d = function() {
  7585. function c(a) {
  7586. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  7587. this.program = this.gl = null;
  7588. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7589. this.uniforms = null;
  7590. this.gl = a;
  7591. this.init()
  7592. }
  7593. c.prototype.init = function() {
  7594. var a = this.gl,
  7595. e = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7596. a.useProgram(e);
  7597. this.uSampler = a.getUniformLocation(e, "uSampler");
  7598. this.projectionVector = a.getUniformLocation(e, "projectionVector");
  7599. this.offsetVector = a.getUniformLocation(e, "offsetVector");
  7600. this.dimensions = a.getUniformLocation(e, "dimensions");
  7601. this.aVertexPosition = a.getAttribLocation(e, "aVertexPosition");
  7602. this.aTextureCoord = a.getAttribLocation(e, "aTextureCoord");
  7603. this.colorAttribute = a.getAttribLocation(e, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7604. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7605. for (var c in this.uniforms) this.uniforms[c].uniformLocation = a.getUniformLocation(e, c);
  7606. this.initUniforms();
  7607. this.program = e
  7608. };
  7609. c.prototype.initUniforms = function() {
  7610. if (this.uniforms) {
  7611. var a = this.gl,
  7612. b, c;
  7613. for (c in this.uniforms) {
  7614. b = this.uniforms[c];
  7615. var d = b.type;
  7616. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv: "mat3" === d ? b.glFunc = a.uniformMatrix3fv: "mat4" === d && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + d], b.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  7617. }
  7618. }
  7619. };
  7620. c.prototype.syncUniforms = function() {
  7621. if (this.uniforms) {
  7622. var a, b = this.gl,
  7623. c;
  7624. for (c in this.uniforms) a = this.uniforms[c],
  7625. 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  7626. }
  7627. };
  7628. return c
  7629. } ();
  7630. b.EgretShader = d;
  7631. d.prototype.__class__ = "egret.EgretShader"
  7632. })(egret || (egret = {}));
  7633. __extends = this.__extends ||
  7634. function(b, d) {
  7635. function c() {
  7636. this.constructor = b
  7637. }
  7638. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7639. c.prototype = d.prototype;
  7640. b.prototype = new c
  7641. }; (function(b) {
  7642. var d = function(b) {
  7643. function a(a) {
  7644. b.call(this, a);
  7645. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  7646. this.uniforms = {
  7647. matrix: {
  7648. type: "mat4",
  7649. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7650. },
  7651. colorAdd: {
  7652. type: "4f",
  7653. value: {
  7654. x: 0,
  7655. y: 0,
  7656. z: 0,
  7657. w: 0
  7658. }
  7659. }
  7660. };
  7661. this.init()
  7662. }
  7663. __extends(a, b);
  7664. return a
  7665. } (b.EgretShader);
  7666. b.ColorTransformShader = d;
  7667. d.prototype.__class__ = "egret.ColorTransformShader"
  7668. })(egret || (egret = {}));
  7669. __extends = this.__extends ||
  7670. function(b, d) {
  7671. function c() {
  7672. this.constructor = b
  7673. }
  7674. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7675. c.prototype = d.prototype;
  7676. b.prototype = new c
  7677. }; (function(b) {
  7678. var d = function(b) {
  7679. function a(a) {
  7680. b.call(this, a);
  7681. this.fragmentSrc = "precision mediump float;uniform vec2 blur;uniform sampler2D uSampler;varying vec2 vTextureCoord;void main(){gl_FragColor = vec4(0.0);gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.028 * blur.x, -0.028 * blur.y))) * 0.0044299121055113265;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.024 * blur.x, -0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.020 * blur.x, -0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.016 * blur.x, -0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.012 * blur.x, -0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.008 * blur.x, -0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.004 * blur.x, -0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, vTextureCoord) * 0.159576912161;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.004 * blur.x, 0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.008 * blur.x, 0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.012 * blur.x, 0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.016 * blur.x, 0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.020 * blur.x, 0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.024 * blur.x, 0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.028 * blur.x, 0.028 * blur.y))) * 0.0044299121055113265;}";
  7682. this.uniforms = {
  7683. blur: {
  7684. type: "2f",
  7685. value: {
  7686. x: 2,
  7687. y: 2
  7688. }
  7689. }
  7690. };
  7691. this.init()
  7692. }
  7693. __extends(a, b);
  7694. return a
  7695. } (b.EgretShader);
  7696. b.BlurShader = d;
  7697. d.prototype.__class__ = "egret.BlurShader"
  7698. })(egret || (egret = {})); (function(b) {
  7699. var d = function() {
  7700. function c(a) {
  7701. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
  7702. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7703. this.vertexSrc = "attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n v -= offsetVector.xyx;\n gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n vColor = aColor * vec4(tint * alpha, alpha);\n}";
  7704. this.gl = a;
  7705. this.init()
  7706. }
  7707. c.prototype.init = function() {
  7708. var a = this.gl,
  7709. e = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7710. a.useProgram(e);
  7711. this.projectionVector = a.getUniformLocation(e, "projectionVector");
  7712. this.offsetVector = a.getUniformLocation(e, "offsetVector");
  7713. this.tintColor = a.getUniformLocation(e, "tint");
  7714. this.aVertexPosition = a.getAttribLocation(e, "aVertexPosition");
  7715. this.colorAttribute = a.getAttribLocation(e, "aColor");
  7716. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7717. this.translationMatrix = a.getUniformLocation(e, "translationMatrix");
  7718. this.alpha = a.getUniformLocation(e, "alpha");
  7719. this.program = e
  7720. };
  7721. return c
  7722. } ();
  7723. b.PrimitiveShader = d;
  7724. d.prototype.__class__ = "egret.PrimitiveShader"
  7725. })(egret || (egret = {})); (function(b) {
  7726. var d = function() {
  7727. function c(a) {
  7728. this.gl = null;
  7729. this.maxAttibs = 10;
  7730. this.attribState = [];
  7731. this.tempAttribState = [];
  7732. this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
  7733. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  7734. this.setContext(a)
  7735. }
  7736. c.prototype.setContext = function(a) {
  7737. this.gl = a;
  7738. this.primitiveShader = new b.PrimitiveShader(a);
  7739. this.defaultShader = new b.EgretShader(a);
  7740. this.colorTransformShader = new b.ColorTransformShader(a);
  7741. this.blurShader = new b.BlurShader(a);
  7742. this.activateShader(this.defaultShader)
  7743. };
  7744. c.prototype.activateShader = function(a) {
  7745. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader = a)
  7746. };
  7747. c.prototype.setAttribs = function(a) {
  7748. var b, c;
  7749. c = this.tempAttribState.length;
  7750. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  7751. c = a.length;
  7752. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  7753. a = this.gl;
  7754. c = this.attribState.length;
  7755. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7756. };
  7757. return c
  7758. } ();
  7759. b.WebGLShaderManager = d;
  7760. d.prototype.__class__ = "egret.WebGLShaderManager"
  7761. })(egret || (egret = {}));
  7762. __extends = this.__extends ||
  7763. function(b, d) {
  7764. function c() {
  7765. this.constructor = b
  7766. }
  7767. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7768. c.prototype = d.prototype;
  7769. b.prototype = new c
  7770. }; (function(b) {
  7771. var d = function(c) {
  7772. function a() {
  7773. c.call(this)
  7774. }
  7775. __extends(a, c);
  7776. a.prototype.proceed = function(a) {
  7777. function c() {
  7778. if (4 == h.readyState) if (h.status != a._status && (a._status = h.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, h.status)), 400 <= h.status || 0 == h.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7779. else {
  7780. switch (a.dataFormat) {
  7781. case b.URLLoaderDataFormat.TEXT:
  7782. a.data = h.responseText;
  7783. break;
  7784. case b.URLLoaderDataFormat.VARIABLES:
  7785. a.data = new b.URLVariables(h.responseText);
  7786. break;
  7787. case b.URLLoaderDataFormat.BINARY:
  7788. a.data = h.response;
  7789. break;
  7790. default:
  7791. a.data = h.responseText
  7792. }
  7793. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7794. }
  7795. }
  7796. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7797. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7798. else {
  7799. var d = a._request,
  7800. h = this.getXHR();
  7801. h.onreadystatechange = c;
  7802. var g = b.NetContext._getUrl(d);
  7803. h.open(d.method, g, !0);
  7804. this.setResponseType(h, a.dataFormat);
  7805. d.method != b.URLRequestMethod.GET && d.data ? d.data instanceof b.URLVariables ? (h.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), h.send(d.data.toString())) : (h.setRequestHeader("Content-Type", "multipart/form-data"), h.send(d.data)) : h.send()
  7806. }
  7807. };
  7808. a.prototype.loadSound = function(a) {
  7809. function c(g) {
  7810. b.clearTimeout(h.__timeoutId);
  7811. h.removeEventListener("canplaythrough", c, !1);
  7812. h.removeEventListener("error", d, !1);
  7813. g = new b.Sound;
  7814. g._setAudio(h);
  7815. a.data = g;
  7816. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7817. }
  7818. function d(g) {
  7819. b.clearTimeout(h.__timeoutId);
  7820. h.removeEventListener("canplaythrough", c, !1);
  7821. h.removeEventListener("error", d, !1);
  7822. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7823. }
  7824. var h = new Audio(a._request.url);
  7825. h.__timeoutId = b.setTimeout(c, this, 100);
  7826. h.addEventListener("canplaythrough", c, !1);
  7827. h.addEventListener("error", d, !1);
  7828. h.load()
  7829. };
  7830. a.prototype.getXHR = function() {
  7831. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  7832. };
  7833. a.prototype.setResponseType = function(a, c) {
  7834. switch (c) {
  7835. case b.URLLoaderDataFormat.TEXT:
  7836. case b.URLLoaderDataFormat.VARIABLES:
  7837. a.responseType = b.URLLoaderDataFormat.TEXT;
  7838. break;
  7839. case b.URLLoaderDataFormat.BINARY:
  7840. a.responseType = "arraybuffer";
  7841. break;
  7842. default:
  7843. a.responseType = c
  7844. }
  7845. };
  7846. a.prototype.loadTexture = function(a) {
  7847. var c = a._request,
  7848. d = new Image;
  7849. d.onload = function(c) {
  7850. d.onerror = null;
  7851. d.onload = null;
  7852. c = new b.Texture;
  7853. c._setBitmapData(d);
  7854. a.data = c;
  7855. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7856. };
  7857. d.onerror = function(c) {
  7858. d.onerror = null;
  7859. d.onload = null;
  7860. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7861. };
  7862. d.src = c.url
  7863. };
  7864. return a
  7865. } (b.NetContext);
  7866. b.HTML5NetContext = d;
  7867. d.prototype.__class__ = "egret.HTML5NetContext"
  7868. })(egret || (egret = {}));
  7869. __extends = this.__extends ||
  7870. function(b, d) {
  7871. function c() {
  7872. this.constructor = b
  7873. }
  7874. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7875. c.prototype = d.prototype;
  7876. b.prototype = new c
  7877. }; (function(b) {
  7878. var d = function(c) {
  7879. function a() {
  7880. c.call(this);
  7881. this._isTouchDown = !1;
  7882. this.rootDiv = null;
  7883. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7884. }
  7885. __extends(a, c);
  7886. a.prototype.prevent = function(a) {
  7887. a.stopPropagation(); ! 0 != a.isScroll && a.preventDefault()
  7888. };
  7889. a.prototype.run = function() {
  7890. var a = this;
  7891. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown",
  7892. function(b) {
  7893. a._onTouchBegin(b);
  7894. a.prevent(b)
  7895. },
  7896. !1), this.rootDiv.addEventListener("MSPointerMove",
  7897. function(b) {
  7898. a._onTouchMove(b);
  7899. a.prevent(b)
  7900. },
  7901. !1), this.rootDiv.addEventListener("MSPointerUp",
  7902. function(b) {
  7903. a._onTouchEnd(b);
  7904. a.prevent(b)
  7905. },
  7906. !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7907. window.addEventListener("mousedown",
  7908. function(b) {
  7909. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7910. });
  7911. window.addEventListener("mouseup",
  7912. function(b) {
  7913. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7914. a._isTouchDown = !1
  7915. })
  7916. };
  7917. a.prototype.addMouseListener = function() {
  7918. var a = this;
  7919. this.rootDiv.addEventListener("mousedown",
  7920. function(b) {
  7921. a._onTouchBegin(b)
  7922. });
  7923. this.rootDiv.addEventListener("mousemove",
  7924. function(b) {
  7925. a._onTouchMove(b)
  7926. });
  7927. this.rootDiv.addEventListener("mouseup",
  7928. function(b) {
  7929. a._onTouchEnd(b)
  7930. })
  7931. };
  7932. a.prototype.addTouchListener = function() {
  7933. var a = this;
  7934. this.rootDiv.addEventListener("touchstart",
  7935. function(b) {
  7936. for (var c = b.changedTouches.length,
  7937. d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  7938. a.prevent(b)
  7939. },
  7940. !1);
  7941. this.rootDiv.addEventListener("touchmove",
  7942. function(b) {
  7943. for (var c = b.changedTouches.length,
  7944. d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  7945. a.prevent(b)
  7946. },
  7947. !1);
  7948. this.rootDiv.addEventListener("touchend",
  7949. function(b) {
  7950. for (var c = b.changedTouches.length,
  7951. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  7952. a.prevent(b)
  7953. },
  7954. !1);
  7955. this.rootDiv.addEventListener("touchcancel",
  7956. function(b) {
  7957. for (var c = b.changedTouches.length,
  7958. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  7959. a.prevent(b)
  7960. },
  7961. !1)
  7962. };
  7963. a.prototype.inOutOfCanvas = function(a) {
  7964. var c = this.getLocation(this.rootDiv, a);
  7965. a = c.x;
  7966. var c = c.y,
  7967. d = b.MainContext.instance.stage;
  7968. return 0 > a || 0 > c || a > d.stageWidth || c > d.stageHeight ? !0 : !1
  7969. };
  7970. a.prototype.dispatchLeaveStageEvent = function() {
  7971. this.touchingIdentifiers.length = 0;
  7972. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  7973. };
  7974. a.prototype._onTouchBegin = function(a) {
  7975. var b = this.getLocation(this.rootDiv, a),
  7976. c = -1;
  7977. a.hasOwnProperty("identifier") && (c = a.identifier);
  7978. this.onTouchBegan(b.x, b.y, c)
  7979. };
  7980. a.prototype._onTouchMove = function(a) {
  7981. var b = this.getLocation(this.rootDiv, a),
  7982. c = -1;
  7983. a.hasOwnProperty("identifier") && (c = a.identifier);
  7984. this.onTouchMove(b.x, b.y, c)
  7985. };
  7986. a.prototype._onTouchEnd = function(a) {
  7987. var b = this.getLocation(this.rootDiv, a),
  7988. c = -1;
  7989. a.hasOwnProperty("identifier") && (c = a.identifier);
  7990. this.onTouchEnd(b.x, b.y, c)
  7991. };
  7992. a.prototype.getLocation = function(a, c) {
  7993. var d = document.documentElement,
  7994. h = window,
  7995. g, f;
  7996. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  7997. g += h.pageXOffset - d.clientLeft;
  7998. f += h.pageYOffset - d.clientTop;
  7999. null != c.pageX ? (d = c.pageX, h = c.pageY) : (g -= document.body.scrollLeft, f -= document.body.scrollTop, d = c.clientX, h = c.clientY);
  8000. var l = b.Point.identity;
  8001. l.x = (d - g) / b.StageDelegate.getInstance().getScaleX();
  8002. l.y = (h - f) / b.StageDelegate.getInstance().getScaleY();
  8003. return l
  8004. };
  8005. return a
  8006. } (b.TouchContext);
  8007. b.HTML5TouchContext = d;
  8008. d.prototype.__class__ = "egret.HTML5TouchContext"
  8009. })(egret || (egret = {}));
  8010. __extends = this.__extends ||
  8011. function(b, d) {
  8012. function c() {
  8013. this.constructor = b
  8014. }
  8015. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8016. c.prototype = d.prototype;
  8017. b.prototype = new c
  8018. }; (function(b) {
  8019. var d = function(c) {
  8020. function a() {
  8021. c.call(this);
  8022. this.inputElement = this.div = null;
  8023. this._hasListeners = !1;
  8024. this._inputType = "";
  8025. this._isShow = !1;
  8026. this.textValue = "";
  8027. this._height = this._width = 0;
  8028. this._styleInfoes = {};
  8029. var e = b.StageDelegate.getInstance().getScaleX(),
  8030. d = b.StageDelegate.getInstance().getScaleY(),
  8031. k = b.Browser.getInstance().$new("div");
  8032. k.position.x = 0;
  8033. k.position.y = 0;
  8034. k.scale.x = e;
  8035. k.scale.y = d;
  8036. k.transforms();
  8037. k.style[a.getTrans("transformOrigin")] = "0% 0% 0px";
  8038. this.div = k;
  8039. d = b.MainContext.instance.stage;
  8040. e = d.stageWidth;
  8041. d = d.stageHeight;
  8042. k = new b.Shape;
  8043. k.width = e;
  8044. k.height = d;
  8045. k.touchEnabled = !0;
  8046. this._shape = k;
  8047. this.getStageDelegateDiv().appendChild(this.div)
  8048. }
  8049. __extends(a, c);
  8050. a.getTrans = function(b) {
  8051. "" == a.header && (a.header = a.getHeader());
  8052. return a.header + b.substring(1, b.length)
  8053. };
  8054. a.getHeader = function() {
  8055. for (var a = document.createElement("div").style, b = ["t", "webkitT", "msT", "MozT", "OT"], c = 0; c < b.length; c++) if (b[c] + "ransform" in a) return b[c];
  8056. return b[0]
  8057. };
  8058. a.prototype.getStageDelegateDiv = function() {
  8059. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8060. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8061. return a
  8062. };
  8063. a.prototype._setMultiline = function(a) {
  8064. c.prototype._setMultiline.call(this, a);
  8065. this.createInput()
  8066. };
  8067. a.prototype.callHandler = function(a) {
  8068. a.stopPropagation()
  8069. };
  8070. a.prototype._add = function() {
  8071. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8072. };
  8073. a.prototype._remove = function() {
  8074. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8075. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8076. };
  8077. a.prototype._addListeners = function() {
  8078. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart", this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8079. };
  8080. a.prototype._removeListeners = function() {
  8081. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  8082. };
  8083. a.prototype.createInput = function() {
  8084. var a = this._multiline ? "textarea": "input";
  8085. this._inputType != a && (this._inputType = a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {},
  8086. a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8087. };
  8088. a.prototype._open = function(a, b, c, d) {};
  8089. a.prototype._setScale = function(a, d) {
  8090. c.prototype._setScale.call(this, a, d);
  8091. var k = b.StageDelegate.getInstance().getScaleX(),
  8092. h = b.StageDelegate.getInstance().getScaleY();
  8093. this.div.scale.x = k * a;
  8094. this.div.scale.y = h * d;
  8095. this.div.transforms()
  8096. };
  8097. a.prototype.changePosition = function(a, c) {
  8098. var d = b.StageDelegate.getInstance().getScaleX(),
  8099. h = b.StageDelegate.getInstance().getScaleY();
  8100. this.div.position.x = a * d;
  8101. this.div.position.y = c * h;
  8102. this.div.transforms()
  8103. };
  8104. a.prototype.setStyles = function() {
  8105. this.setElementStyle("fontStyle", this._italic ? "italic": "normal");
  8106. this.setElementStyle("fontWeight", this._bold ? "bold": "normal");
  8107. this.setElementStyle("textAlign", this._textAlign);
  8108. this.setElementStyle("fontSize", this._size + "px");
  8109. this.setElementStyle("color", "#000000");
  8110. this.setElementStyle("width", this._width + "px");
  8111. this.setElementStyle("height", this._height + "px");
  8112. this.setElementStyle("display", "block")
  8113. };
  8114. a.prototype._show = function() {
  8115. b.MainContext.instance.stage._changeSizeDispatchFlag = !1;
  8116. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8117. this._isShow = !0;
  8118. var a = this._getText();
  8119. this.inputElement.value = a;
  8120. var c = this;
  8121. this.inputElement.oninput = function() {
  8122. c.textValue = c.inputElement.value;
  8123. c.dispatchEvent(new b.Event("updateText"))
  8124. };
  8125. this.setStyles();
  8126. this.inputElement.focus();
  8127. this.inputElement.selectionStart = a.length;
  8128. this.inputElement.selectionEnd = a.length;
  8129. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  8130. };
  8131. a.prototype._hide = function() {
  8132. b.MainContext.instance.stage._changeSizeDispatchFlag = !0;
  8133. if (null != this.inputElement) {
  8134. this._isShow = !1;
  8135. this.inputElement.oninput = function() {};
  8136. this.setElementStyle("border", "none");
  8137. this.setElementStyle("display", "none");
  8138. this.inputElement.value = "";
  8139. this.setElementStyle("width", "0px");
  8140. window.scrollTo(0, 0);
  8141. var a = this;
  8142. b.setTimeout(function() {
  8143. a.inputElement.blur();
  8144. window.scrollTo(0, 0)
  8145. },
  8146. this, 50);
  8147. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8148. }
  8149. };
  8150. a.prototype._getText = function() {
  8151. this.textValue || (this.textValue = "");
  8152. return this.textValue
  8153. };
  8154. a.prototype._setText = function(a) {
  8155. this.textValue = a;
  8156. this.resetText()
  8157. };
  8158. a.prototype.resetText = function() {
  8159. this.inputElement && (this.inputElement.value = this.textValue)
  8160. };
  8161. a.prototype._setWidth = function(a) {
  8162. this._width = a
  8163. };
  8164. a.prototype._setHeight = function(a) {
  8165. this._height = a
  8166. };
  8167. a.prototype.setElementStyle = function(a, b) {
  8168. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8169. };
  8170. a.header = "";
  8171. return a
  8172. } (b.StageText);
  8173. b.HTML5StageText = d;
  8174. d.prototype.__class__ = "egret.HTML5StageText"
  8175. })(egret || (egret = {}));
  8176. egret.StageText.create = function() {
  8177. return new egret.HTML5StageText
  8178. };
  8179. var __extends = this.__extends ||
  8180. function(b, d) {
  8181. function c() {
  8182. this.constructor = b
  8183. }
  8184. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8185. c.prototype = d.prototype;
  8186. b.prototype = new c
  8187. },
  8188. RES; (function(b) {
  8189. var d = function(b) {
  8190. function a(a, d, k) {
  8191. void 0 === d && (d = !1);
  8192. void 0 === k && (k = !1);
  8193. b.call(this, a, d, k);
  8194. this.itemsTotal = this.itemsLoaded = 0;
  8195. this.groupName = "";
  8196. this.resItem = null
  8197. }
  8198. __extends(a, b);
  8199. a.dispatchResourceEvent = function(b, c, d, h, g, f) {
  8200. void 0 === d && (d = "");
  8201. void 0 === h && (h = null);
  8202. void 0 === g && (g = 0);
  8203. void 0 === f && (f = 0);
  8204. var l = egret.Event._getPropertyData(a);
  8205. l.groupName = d;
  8206. l.resItem = h;
  8207. l.itemsLoaded = g;
  8208. l.itemsTotal = f;
  8209. egret.Event._dispatchByTarget(a, b, c, l)
  8210. };
  8211. a.ITEM_LOAD_ERROR = "itemLoadError";
  8212. a.CONFIG_COMPLETE = "configComplete";
  8213. a.CONFIG_LOAD_ERROR = "configLoadError";
  8214. a.GROUP_PROGRESS = "groupProgress";
  8215. a.GROUP_COMPLETE = "groupComplete";
  8216. a.GROUP_LOAD_ERROR = "groupLoadError";
  8217. return a
  8218. } (egret.Event);
  8219. b.ResourceEvent = d;
  8220. d.prototype.__class__ = "RES.ResourceEvent"
  8221. })(RES || (RES = {})); (function(b) {
  8222. var d = function() {
  8223. function b(a, e, c) {
  8224. this.groupName = "";
  8225. this.data = null;
  8226. this._loaded = !1;
  8227. this.name = a;
  8228. this.url = e;
  8229. this.type = c
  8230. }
  8231. Object.defineProperty(b.prototype, "loaded", {
  8232. get: function() {
  8233. return this.data ? this.data.loaded: this._loaded
  8234. },
  8235. set: function(a) {
  8236. this.data && (this.data.loaded = a);
  8237. this._loaded = a
  8238. },
  8239. enumerable: !0,
  8240. configurable: !0
  8241. });
  8242. b.prototype.toString = function() {
  8243. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  8244. };
  8245. b.TYPE_XML = "xml";
  8246. b.TYPE_IMAGE = "image";
  8247. b.TYPE_BIN = "bin";
  8248. b.TYPE_TEXT = "text";
  8249. b.TYPE_JSON = "json";
  8250. b.TYPE_SHEET = "sheet";
  8251. b.TYPE_FONT = "font";
  8252. b.TYPE_SOUND = "sound";
  8253. return b
  8254. } ();
  8255. b.ResourceItem = d;
  8256. d.prototype.__class__ = "RES.ResourceItem"
  8257. })(RES || (RES = {})); (function(b) {
  8258. var d = function() {
  8259. function c() {
  8260. this.keyMap = {};
  8261. this.groupDic = {};
  8262. b.configInstance = this
  8263. }
  8264. c.prototype.getGroupByName = function(a) {
  8265. var b = [];
  8266. if (!this.groupDic[a]) return b;
  8267. a = this.groupDic[a];
  8268. for (var c = a.length,
  8269. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  8270. return b
  8271. };
  8272. c.prototype.getRawGroupByName = function(a) {
  8273. return this.groupDic[a] ? this.groupDic[a] : []
  8274. };
  8275. c.prototype.createGroup = function(a, b, c) {
  8276. void 0 === c && (c = !1);
  8277. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  8278. c = this.groupDic;
  8279. for (var d = [], h = b.length, g = 0; g < h; g++) {
  8280. var f = b[g],
  8281. l = c[f];
  8282. if (l) for (var f = l.length,
  8283. n = 0; n < f; n++) {
  8284. var p = l[n]; - 1 == d.indexOf(p) && d.push(p)
  8285. } else(p = this.keyMap[f]) ? -1 == d.indexOf(p) && d.push(p) : egret.Logger.warningWithErrorId(2E3, f)
  8286. }
  8287. if (0 == d.length) return ! 1;
  8288. this.groupDic[a] = d;
  8289. return ! 0
  8290. };
  8291. c.prototype.parseConfig = function(a, b) {
  8292. if (a) {
  8293. var c = a.resources;
  8294. if (c) for (var d = c.length,
  8295. h = 0; h < d; h++) {
  8296. var g = c[h],
  8297. f = g.url;
  8298. f && -1 == f.indexOf("://") && (g.url = b + f);
  8299. this.addItemToKeyMap(g)
  8300. }
  8301. if (c = a.groups) for (d = c.length, h = 0; h < d; h++) {
  8302. for (var f = c[h], l = [], n = f.keys.split(","), p = n.length, q = 0; q < p; q++) g = n[q].trim(),
  8303. (g = this.keyMap[g]) && -1 == l.indexOf(g) && l.push(g);
  8304. this.groupDic[f.name] = l
  8305. }
  8306. }
  8307. };
  8308. c.prototype.addSubkey = function(a, b) {
  8309. var c = this.keyMap[b];
  8310. c && !this.keyMap[a] && (this.keyMap[a] = c)
  8311. };
  8312. c.prototype.addItemToKeyMap = function(a) {
  8313. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  8314. if (a.hasOwnProperty("subkeys")) {
  8315. var b = a.subkeys.split(",");
  8316. a.subkeys = b;
  8317. for (var c = b.length,
  8318. d = 0; d < c; d++) {
  8319. var h = b[d];
  8320. null == this.keyMap[h] && (this.keyMap[h] = a)
  8321. }
  8322. }
  8323. };
  8324. c.prototype.getName = function(a) {
  8325. return (a = this.keyMap[a]) ? a.name: ""
  8326. };
  8327. c.prototype.getType = function(a) {
  8328. return (a = this.keyMap[a]) ? a.type: ""
  8329. };
  8330. c.prototype.getRawResourceItem = function(a) {
  8331. return this.keyMap[a]
  8332. };
  8333. c.prototype.getResourceItem = function(a) {
  8334. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  8335. };
  8336. c.prototype.parseResourceItem = function(a) {
  8337. var e = new b.ResourceItem(a.name, a.url, a.type);
  8338. e.data = a;
  8339. return e
  8340. };
  8341. return c
  8342. } ();
  8343. b.ResourceConfig = d;
  8344. d.prototype.__class__ = "RES.ResourceConfig"
  8345. })(RES || (RES = {}));
  8346. __extends = this.__extends ||
  8347. function(b, d) {
  8348. function c() {
  8349. this.constructor = b
  8350. }
  8351. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8352. c.prototype = d.prototype;
  8353. b.prototype = new c
  8354. }; (function(b) {
  8355. var d = function(c) {
  8356. function a() {
  8357. c.call(this);
  8358. this.thread = 2;
  8359. this.loadingCount = 0;
  8360. this.resInstance = this.callBack = null;
  8361. this.groupTotalDic = {};
  8362. this.numLoadedDic = {};
  8363. this.itemListDic = {};
  8364. this.groupErrorDic = {};
  8365. this.retryTimesDic = {};
  8366. this.maxRetryTimes = 3;
  8367. this.failedList = [];
  8368. this.priorityQueue = {};
  8369. this.lazyLoadList = [];
  8370. this.analyzerDic = {};
  8371. this.queueIndex = 0
  8372. }
  8373. __extends(a, c);
  8374. a.prototype.isGroupInLoading = function(a) {
  8375. return void 0 !== this.itemListDic[a]
  8376. };
  8377. a.prototype.loadGroup = function(a, c, d) {
  8378. void 0 === d && (d = 0);
  8379. if (!this.itemListDic[c] && c) if (a && 0 != a.length) {
  8380. this.priorityQueue[d] ? this.priorityQueue[d].push(c) : this.priorityQueue[d] = [c];
  8381. this.itemListDic[c] = a;
  8382. d = a.length;
  8383. for (var h = 0; h < d; h++) a[h].groupName = c;
  8384. this.groupTotalDic[c] = a.length;
  8385. this.numLoadedDic[c] = 0;
  8386. this.next()
  8387. } else egret.Logger.warningWithErrorId(2001, c),
  8388. a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR),
  8389. a.groupName = c,
  8390. this.dispatchEvent(a)
  8391. };
  8392. a.prototype.loadItem = function(a) {
  8393. this.lazyLoadList.push(a);
  8394. a.groupName = "";
  8395. this.next()
  8396. };
  8397. a.prototype.next = function() {
  8398. for (; this.loadingCount < this.thread;) {
  8399. var a = this.getOneResourceItem();
  8400. if (!a) break;
  8401. this.loadingCount++;
  8402. if (a.loaded) this.onItemComplete(a);
  8403. else {
  8404. var c = this.analyzerDic[a.type];
  8405. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  8406. c.loadFile(a, this.onItemComplete, this)
  8407. }
  8408. }
  8409. };
  8410. a.prototype.getOneResourceItem = function() {
  8411. if (0 < this.failedList.length) return this.failedList.shift();
  8412. var a = Number.NEGATIVE_INFINITY,
  8413. b;
  8414. for (b in this.priorityQueue) a = Math.max(a, b);
  8415. a = this.priorityQueue[a];
  8416. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  8417. b = a.length;
  8418. for (var c, d = 0; d < b; d++) {
  8419. this.queueIndex >= b && (this.queueIndex = 0);
  8420. c = this.itemListDic[a[this.queueIndex]];
  8421. if (0 < c.length) break;
  8422. this.queueIndex++
  8423. }
  8424. return 0 == c.length ? null: c.shift()
  8425. };
  8426. a.prototype.onItemComplete = function(a) {
  8427. this.loadingCount--;
  8428. var c = a.groupName;
  8429. if (!a.loaded) {
  8430. var d = this.retryTimesDic[a.name] || 1;
  8431. if (d > this.maxRetryTimes) delete this.retryTimesDic[a.name],
  8432. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  8433. else {
  8434. this.retryTimesDic[a.name] = d + 1;
  8435. this.failedList.push(a);
  8436. this.next();
  8437. return
  8438. }
  8439. }
  8440. if (c) {
  8441. this.numLoadedDic[c]++;
  8442. var d = this.numLoadedDic[c],
  8443. h = this.groupTotalDic[c];
  8444. a.loaded || (this.groupErrorDic[c] = !0);
  8445. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, d, h);
  8446. d == h && (a = this.groupErrorDic[c], this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], delete this.groupErrorDic[c], a ? b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_LOAD_ERROR, c) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, c))
  8447. } else this.callBack.call(this.resInstance, a);
  8448. this.next()
  8449. };
  8450. a.prototype.removeGroupName = function(a) {
  8451. for (var b in this.priorityQueue) {
  8452. for (var c = this.priorityQueue[b], d = c.length, g = 0, f = !1, d = c.length, l = 0; l < d; l++) {
  8453. if (c[l] == a) {
  8454. c.splice(g, 1);
  8455. f = !0;
  8456. break
  8457. }
  8458. g++
  8459. }
  8460. if (f) {
  8461. 0 == c.length && delete this.priorityQueue[b];
  8462. break
  8463. }
  8464. }
  8465. };
  8466. return a
  8467. } (egret.EventDispatcher);
  8468. b.ResourceLoader = d;
  8469. d.prototype.__class__ = "RES.ResourceLoader"
  8470. })(RES || (RES = {}));
  8471. __extends = this.__extends ||
  8472. function(b, d) {
  8473. function c() {
  8474. this.constructor = b
  8475. }
  8476. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8477. c.prototype = d.prototype;
  8478. b.prototype = new c
  8479. }; (function(b) {
  8480. var d = function(c) {
  8481. function a() {
  8482. c.call(this);
  8483. this.resourceConfig = null;
  8484. this.resourceConfig = b.configInstance
  8485. }
  8486. __extends(a, c);
  8487. a.prototype.addSubkey = function(a, b) {
  8488. this.resourceConfig.addSubkey(a, b)
  8489. };
  8490. a.prototype.loadFile = function(a, b, c) {};
  8491. a.prototype.getRes = function(a) {};
  8492. a.prototype.destroyRes = function(a) {
  8493. return ! 1
  8494. };
  8495. a.getStringPrefix = function(a) {
  8496. if (!a) return "";
  8497. var b = a.indexOf(".");
  8498. return - 1 != b ? a.substring(0, b) : ""
  8499. };
  8500. a.getStringTail = function(a) {
  8501. if (!a) return "";
  8502. var b = a.indexOf(".");
  8503. return - 1 != b ? a.substring(b + 1) : ""
  8504. };
  8505. return a
  8506. } (egret.HashObject);
  8507. b.AnalyzerBase = d;
  8508. d.prototype.__class__ = "RES.AnalyzerBase"
  8509. })(RES || (RES = {}));
  8510. __extends = this.__extends ||
  8511. function(b, d) {
  8512. function c() {
  8513. this.constructor = b
  8514. }
  8515. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8516. c.prototype = d.prototype;
  8517. b.prototype = new c
  8518. }; (function(b) {
  8519. var d = function(b) {
  8520. function a() {
  8521. b.call(this);
  8522. this.fileDic = {};
  8523. this.resItemDic = [];
  8524. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  8525. this.recycler = new egret.Recycler
  8526. }
  8527. __extends(a, b);
  8528. a.prototype.loadFile = function(a, b, c) {
  8529. if (this.fileDic[a.name]) b.call(c, a);
  8530. else {
  8531. var d = this.getLoader();
  8532. this.resItemDic[d.hashCode] = {
  8533. item: a,
  8534. func: b,
  8535. thisObject: c
  8536. };
  8537. d.load(new egret.URLRequest(a.url))
  8538. }
  8539. };
  8540. a.prototype.getLoader = function() {
  8541. var a = this.recycler.pop();
  8542. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  8543. a.dataFormat = this._dataFormat;
  8544. return a
  8545. };
  8546. a.prototype.onLoadFinish = function(a) {
  8547. var b = a.target,
  8548. c = this.resItemDic[b.hashCode];
  8549. delete this.resItemDic[b.hashCode];
  8550. var d = c.item,
  8551. g = c.func;
  8552. d.loaded = a.type == egret.Event.COMPLETE;
  8553. d.loaded && this.analyzeData(d, b.data);
  8554. this.recycler.push(b);
  8555. g.call(c.thisObject, d)
  8556. };
  8557. a.prototype.analyzeData = function(a, b) {
  8558. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
  8559. };
  8560. a.prototype.getRes = function(a) {
  8561. return this.fileDic[a]
  8562. };
  8563. a.prototype.hasRes = function(a) {
  8564. return null != this.getRes(a)
  8565. };
  8566. a.prototype.destroyRes = function(a) {
  8567. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8568. };
  8569. return a
  8570. } (b.AnalyzerBase);
  8571. b.BinAnalyzer = d;
  8572. d.prototype.__class__ = "RES.BinAnalyzer"
  8573. })(RES || (RES = {}));
  8574. __extends = this.__extends ||
  8575. function(b, d) {
  8576. function c() {
  8577. this.constructor = b
  8578. }
  8579. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8580. c.prototype = d.prototype;
  8581. b.prototype = new c
  8582. }; (function(b) {
  8583. var d = function(b) {
  8584. function a() {
  8585. b.call(this);
  8586. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  8587. }
  8588. __extends(a, b);
  8589. a.prototype.analyzeData = function(a, b) {
  8590. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  8591. };
  8592. return a
  8593. } (b.BinAnalyzer);
  8594. b.ImageAnalyzer = d;
  8595. d.prototype.__class__ = "RES.ImageAnalyzer"
  8596. })(RES || (RES = {}));
  8597. __extends = this.__extends ||
  8598. function(b, d) {
  8599. function c() {
  8600. this.constructor = b
  8601. }
  8602. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8603. c.prototype = d.prototype;
  8604. b.prototype = new c
  8605. }; (function(b) {
  8606. var d = function(b) {
  8607. function a() {
  8608. b.call(this);
  8609. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8610. }
  8611. __extends(a, b);
  8612. a.prototype.analyzeData = function(a, b) {
  8613. var c = a.name;
  8614. if (!this.fileDic[c] && b) try {
  8615. this.fileDic[c] = JSON.parse(b)
  8616. } catch(d) {
  8617. egret.Logger.warningWithErrorId(1017, a.url, b)
  8618. }
  8619. };
  8620. return a
  8621. } (b.BinAnalyzer);
  8622. b.JsonAnalyzer = d;
  8623. d.prototype.__class__ = "RES.JsonAnalyzer"
  8624. })(RES || (RES = {}));
  8625. __extends = this.__extends ||
  8626. function(b, d) {
  8627. function c() {
  8628. this.constructor = b
  8629. }
  8630. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8631. c.prototype = d.prototype;
  8632. b.prototype = new c
  8633. }; (function(b) {
  8634. var d = function(b) {
  8635. function a() {
  8636. b.call(this);
  8637. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8638. }
  8639. __extends(a, b);
  8640. return a
  8641. } (b.BinAnalyzer);
  8642. b.TextAnalyzer = d;
  8643. d.prototype.__class__ = "RES.TextAnalyzer"
  8644. })(RES || (RES = {}));
  8645. __extends = this.__extends ||
  8646. function(b, d) {
  8647. function c() {
  8648. this.constructor = b
  8649. }
  8650. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8651. c.prototype = d.prototype;
  8652. b.prototype = new c
  8653. }; (function(b) {
  8654. var d = function(c) {
  8655. function a() {
  8656. c.call(this);
  8657. this.sheetMap = {};
  8658. this.textureMap = {};
  8659. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8660. }
  8661. __extends(a, c);
  8662. a.prototype.getRes = function(a) {
  8663. var c = this.fileDic[a];
  8664. c || (c = this.textureMap[a]); ! c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  8665. return c
  8666. };
  8667. a.prototype.onLoadFinish = function(a) {
  8668. var b = a.target,
  8669. c = this.resItemDic[b.hashCode];
  8670. delete this.resItemDic[b.hashCode];
  8671. var d = c.item,
  8672. g = c.func;
  8673. d.loaded = a.type == egret.Event.COMPLETE;
  8674. if (d.loaded) if ("string" == typeof b.data) {
  8675. if (d.loaded = !1, a = this.analyzeConfig(d, b.data)) {
  8676. d.url = a;
  8677. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  8678. this.loadFile(d, g, c.thisObject);
  8679. this._dataFormat = egret.URLLoaderDataFormat.TEXT;
  8680. return
  8681. }
  8682. } else this.analyzeBitmap(d, b.data);
  8683. d.url = d.data.url;
  8684. this.recycler.push(b);
  8685. g.call(c.thisObject, d)
  8686. };
  8687. a.prototype.analyzeConfig = function(a, b) {
  8688. var c = a.name,
  8689. d, g = "";
  8690. try {
  8691. d = JSON.parse(b)
  8692. } catch(f) {
  8693. egret.Logger.warningWithErrorId(1017, a.url, b)
  8694. }
  8695. d && (this.sheetMap[c] = d, g = this.getRelativePath(a.url, d.file));
  8696. return g
  8697. };
  8698. a.prototype.analyzeBitmap = function(a, b) {
  8699. var c = a.name;
  8700. if (!this.fileDic[c] && b) {
  8701. var d = this.sheetMap[c];
  8702. delete this.sheetMap[c];
  8703. d = this.parseSpriteSheet(b, d, a.data && a.data.subkeys ? "": c);
  8704. this.fileDic[c] = d
  8705. }
  8706. };
  8707. a.prototype.getRelativePath = function(a, b) {
  8708. a = a.split("\\").join("/");
  8709. var c = a.lastIndexOf("/");
  8710. return a = -1 != c ? a.substring(0, c + 1) + b: b
  8711. };
  8712. a.prototype.parseSpriteSheet = function(a, b, c) {
  8713. b = b.frames;
  8714. if (!b) return null;
  8715. var d = new egret.SpriteSheet(a),
  8716. g = this.textureMap,
  8717. f;
  8718. for (f in b) {
  8719. var l = b[f];
  8720. a = d.createTexture(f, l.x, l.y, l.w, l.h, l.offX, l.offY, l.sourceW, l.sourceH);
  8721. l.scale9grid && (l = l.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(l[0]), parseInt(l[1]), parseInt(l[2]), parseInt(l[3])));
  8722. null == g[f] && (g[f] = a, c && this.addSubkey(f, c))
  8723. }
  8724. return d
  8725. };
  8726. a.prototype.destroyRes = function(a) {
  8727. var b = this.fileDic[a];
  8728. if (b) {
  8729. delete this.fileDic[a];
  8730. for (var c in b._textureMap) this.textureMap[c] && delete this.textureMap[c];
  8731. return ! 0
  8732. }
  8733. return ! 1
  8734. };
  8735. return a
  8736. } (b.BinAnalyzer);
  8737. b.SheetAnalyzer = d;
  8738. d.prototype.__class__ = "RES.SheetAnalyzer"
  8739. })(RES || (RES = {}));
  8740. __extends = this.__extends ||
  8741. function(b, d) {
  8742. function c() {
  8743. this.constructor = b
  8744. }
  8745. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8746. c.prototype = d.prototype;
  8747. b.prototype = new c
  8748. }; (function(b) {
  8749. var d = function(b) {
  8750. function a() {
  8751. b.call(this)
  8752. }
  8753. __extends(a, b);
  8754. a.prototype.analyzeConfig = function(a, b) {
  8755. var c = a.name,
  8756. d, g = "";
  8757. try {
  8758. d = JSON.parse(b)
  8759. } catch(f) {}
  8760. d ? g = this.getRelativePath(a.url, d.file) : (d = b, g = this.getTexturePath(a.url, d));
  8761. this.sheetMap[c] = d;
  8762. return g
  8763. };
  8764. a.prototype.analyzeBitmap = function(a, b) {
  8765. var c = a.name;
  8766. if (!this.fileDic[c] && b) {
  8767. var d = this.sheetMap[c];
  8768. delete this.sheetMap[c];
  8769. d = new egret.BitmapFont(b, d);
  8770. this.fileDic[c] = d
  8771. }
  8772. };
  8773. a.prototype.getTexturePath = function(a, b) {
  8774. var c = "",
  8775. d = b.split("\n")[2],
  8776. g = d.indexOf('file="'); - 1 != g && (d = d.substring(g + 6), g = d.indexOf('"'), c = d.substring(0, g));
  8777. a = a.split("\\").join("/");
  8778. g = a.lastIndexOf("/");
  8779. return a = -1 != g ? a.substring(0, g + 1) + c: c
  8780. };
  8781. a.prototype.destroyRes = function(a) {
  8782. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8783. };
  8784. return a
  8785. } (b.SheetAnalyzer);
  8786. b.FontAnalyzer = d;
  8787. d.prototype.__class__ = "RES.FontAnalyzer"
  8788. })(RES || (RES = {}));
  8789. __extends = this.__extends ||
  8790. function(b, d) {
  8791. function c() {
  8792. this.constructor = b
  8793. }
  8794. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8795. c.prototype = d.prototype;
  8796. b.prototype = new c
  8797. }; (function(b) {
  8798. var d = function(b) {
  8799. function a() {
  8800. b.call(this);
  8801. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  8802. }
  8803. __extends(a, b);
  8804. a.prototype.analyzeData = function(a, b) {
  8805. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.soundType ? b.preload(c.soundType) : b.preload(egret.Sound.EFFECT))
  8806. };
  8807. return a
  8808. } (b.BinAnalyzer);
  8809. b.SoundAnalyzer = d;
  8810. d.prototype.__class__ = "RES.SoundAnalyzer"
  8811. })(RES || (RES = {}));
  8812. __extends = this.__extends ||
  8813. function(b, d) {
  8814. function c() {
  8815. this.constructor = b
  8816. }
  8817. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8818. c.prototype = d.prototype;
  8819. b.prototype = new c
  8820. }; (function(b) {
  8821. var d = function(b) {
  8822. function a() {
  8823. b.call(this);
  8824. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8825. }
  8826. __extends(a, b);
  8827. a.prototype.analyzeData = function(a, b) {
  8828. var c = a.name;
  8829. if (!this.fileDic[c] && b) try {
  8830. var d = egret.XML.parse(b);
  8831. this.fileDic[c] = d
  8832. } catch(g) {}
  8833. };
  8834. return a
  8835. } (b.BinAnalyzer);
  8836. b.XMLAnalyzer = d;
  8837. d.prototype.__class__ = "RES.XMLAnalyzer"
  8838. })(RES || (RES = {}));
  8839. __extends = this.__extends ||
  8840. function(b, d) {
  8841. function c() {
  8842. this.constructor = b
  8843. }
  8844. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8845. c.prototype = d.prototype;
  8846. b.prototype = new c
  8847. }; (function(b) {
  8848. b.loadConfig = function(a, b, d) {
  8849. void 0 === b && (b = "");
  8850. void 0 === d && (d = "json");
  8851. c.loadConfig(a, b, d)
  8852. };
  8853. b.loadGroup = function(a, b) {
  8854. void 0 === b && (b = 0);
  8855. c.loadGroup(a, b)
  8856. };
  8857. b.isGroupLoaded = function(a) {
  8858. return c.isGroupLoaded(a)
  8859. };
  8860. b.getGroupByName = function(a) {
  8861. return c.getGroupByName(a)
  8862. };
  8863. b.createGroup = function(a, b, d) {
  8864. void 0 === d && (d = !1);
  8865. return c.createGroup(a, b, d)
  8866. };
  8867. b.hasRes = function(a) {
  8868. return c.hasRes(a)
  8869. };
  8870. b.parseConfig = function(a, b) {
  8871. void 0 === b && (b = "");
  8872. c.parseConfig(a, b)
  8873. };
  8874. b.getRes = function(a) {
  8875. return c.getRes(a)
  8876. };
  8877. b.getResAsync = function(a, b, d) {
  8878. c.getResAsync(a, b, d)
  8879. };
  8880. b.getResByUrl = function(a, b, d, k) {
  8881. void 0 === k && (k = "");
  8882. c.getResByUrl(a, b, d, k)
  8883. };
  8884. b.destroyRes = function(a) {
  8885. return c.destroyRes(a)
  8886. };
  8887. b.setMaxLoadingThread = function(a) {
  8888. c.setMaxLoadingThread(a)
  8889. };
  8890. b.setMaxRetryTimes = function(a) {
  8891. c.setMaxRetryTimes(a)
  8892. };
  8893. b.addEventListener = function(a, b, d, k, h) {
  8894. void 0 === k && (k = !1);
  8895. void 0 === h && (h = 0);
  8896. c.addEventListener(a, b, d, k, h)
  8897. };
  8898. b.removeEventListener = function(a, b, d, k) {
  8899. void 0 === k && (k = !1);
  8900. c.removeEventListener(a, b, d, k)
  8901. };
  8902. var d = function(a) {
  8903. function c() {
  8904. a.call(this);
  8905. this.analyzerDic = {};
  8906. this.configItemList = [];
  8907. this.configComplete = this.callLaterFlag = !1;
  8908. this.loadedGroups = [];
  8909. this.groupNameList = [];
  8910. this.asyncDic = {};
  8911. this.init()
  8912. }
  8913. __extends(c, a);
  8914. c.prototype.getAnalyzerByType = function(a) {
  8915. var c = this.analyzerDic[a];
  8916. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  8917. return c
  8918. };
  8919. c.prototype.init = function() {
  8920. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  8921. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  8922. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  8923. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  8924. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  8925. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  8926. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  8927. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  8928. this.resConfig = new b.ResourceConfig;
  8929. this.resLoader = new b.ResourceLoader;
  8930. this.resLoader.callBack = this.onResourceItemComp;
  8931. this.resLoader.resInstance = this;
  8932. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  8933. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  8934. };
  8935. c.prototype.loadConfig = function(a, b, c) {
  8936. void 0 === c && (c = "json");
  8937. this.configItemList.push({
  8938. url: a,
  8939. resourceRoot: b,
  8940. type: c
  8941. });
  8942. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  8943. };
  8944. c.prototype.startLoadConfig = function() {
  8945. this.callLaterFlag = !1;
  8946. var a = this.configItemList;
  8947. this.configItemList = [];
  8948. this.loadingConfigList = a;
  8949. for (var d = a.length,
  8950. h = [], g = 0; g < d; g++) {
  8951. var f = a[g],
  8952. f = new b.ResourceItem(f.url, f.url, f.type);
  8953. h.push(f)
  8954. }
  8955. this.resLoader.loadGroup(h, c.GROUP_CONFIG, Number.MAX_VALUE)
  8956. };
  8957. c.prototype.isGroupLoaded = function(a) {
  8958. return - 1 != this.loadedGroups.indexOf(a)
  8959. };
  8960. c.prototype.getGroupByName = function(a) {
  8961. return this.resConfig.getGroupByName(a)
  8962. };
  8963. c.prototype.loadGroup = function(a, c) {
  8964. void 0 === c && (c = 0);
  8965. if ( - 1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, a);
  8966. else if (!this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  8967. var d = this.resConfig.getGroupByName(a);
  8968. this.resLoader.loadGroup(d, a, c)
  8969. } else this.groupNameList.push({
  8970. name: a,
  8971. priority: c
  8972. })
  8973. };
  8974. c.prototype.createGroup = function(a, b, c) {
  8975. void 0 === c && (c = !1);
  8976. if (c) {
  8977. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  8978. }
  8979. return this.resConfig.createGroup(a, b, c)
  8980. };
  8981. c.prototype.onGroupComp = function(a) {
  8982. if (a.groupName == c.GROUP_CONFIG) {
  8983. a = this.loadingConfigList.length;
  8984. for (var d = 0; d < a; d++) {
  8985. var h = this.loadingConfigList[d],
  8986. g = this.getAnalyzerByType(h.type),
  8987. f = g.getRes(h.url);
  8988. g.destroyRes(h.url);
  8989. this.resConfig.parseConfig(f, h.resourceRoot)
  8990. }
  8991. this.configComplete = !0;
  8992. this.loadingConfigList = null;
  8993. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  8994. this.loadDelayGroups()
  8995. } else this.loadedGroups.push(a.groupName),
  8996. this.dispatchEvent(a)
  8997. };
  8998. c.prototype.loadDelayGroups = function() {
  8999. var a = this.groupNameList;
  9000. this.groupNameList = [];
  9001. for (var b = a.length,
  9002. c = 0; c < b; c++) {
  9003. var d = a[c];
  9004. this.loadGroup(d.name, d.priority)
  9005. }
  9006. };
  9007. c.prototype.onGroupError = function(a) {
  9008. a.groupName == c.GROUP_CONFIG ? (this.loadingConfigList = null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  9009. };
  9010. c.prototype.hasRes = function(a) {
  9011. var c = this.resConfig.getType(a);
  9012. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a), "" == c) ? !1 : !0
  9013. };
  9014. c.prototype.parseConfig = function(a, b) {
  9015. this.resConfig.parseConfig(a, b);
  9016. this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
  9017. };
  9018. c.prototype.getRes = function(a) {
  9019. var c = this.resConfig.getType(a);
  9020. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(c), "" == c) ? null: this.getAnalyzerByType(c).getRes(a)
  9021. };
  9022. c.prototype.getResAsync = function(a, c, d) {
  9023. var e = this.resConfig.getType(a),
  9024. f = this.resConfig.getName(a);
  9025. if ("" == e && (f = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(f), "" == e)) {
  9026. c.call(d, null);
  9027. return
  9028. } (e = this.getAnalyzerByType(e).getRes(a)) ? c.call(d, e) : (a = {
  9029. key: a,
  9030. compFunc: c,
  9031. thisObject: d
  9032. },
  9033. this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  9034. };
  9035. c.prototype.getResByUrl = function(a, c, d, e) {
  9036. void 0 === e && (e = "");
  9037. if (a) {
  9038. e || (e = this.getTypeByUrl(a));
  9039. var f = this.getAnalyzerByType(e).getRes(a);
  9040. f ? c.call(d, f) : (c = {
  9041. key: a,
  9042. compFunc: c,
  9043. thisObject: d
  9044. },
  9045. this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  9046. } else c.call(d, null)
  9047. };
  9048. c.prototype.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  9049. switch (a) {
  9050. case b.ResourceItem.TYPE_XML:
  9051. case b.ResourceItem.TYPE_JSON:
  9052. case b.ResourceItem.TYPE_SHEET:
  9053. break;
  9054. case "png":
  9055. case "jpg":
  9056. case "gif":
  9057. case "jpeg":
  9058. case "bmp":
  9059. a = b.ResourceItem.TYPE_IMAGE;
  9060. break;
  9061. case "fnt":
  9062. a = b.ResourceItem.TYPE_FONT;
  9063. break;
  9064. case "txt":
  9065. a = b.ResourceItem.TYPE_TEXT;
  9066. break;
  9067. case "mp3":
  9068. case "ogg":
  9069. case "mpeg":
  9070. case "wav":
  9071. case "m4a":
  9072. case "mp4":
  9073. case "aiff":
  9074. case "wma":
  9075. case "mid":
  9076. a = b.ResourceItem.TYPE_SOUND;
  9077. break;
  9078. default:
  9079. a = b.ResourceItem.TYPE_BIN
  9080. }
  9081. return a
  9082. };
  9083. c.prototype.onResourceItemComp = function(a) {
  9084. var b = this.asyncDic[a.name];
  9085. delete this.asyncDic[a.name];
  9086. a = this.getAnalyzerByType(a.type);
  9087. for (var c = b.length,
  9088. d = 0; d < c; d++) {
  9089. var e = b[d],
  9090. l = a.getRes(e.key);
  9091. e.compFunc.call(e.thisObject, l, e.key)
  9092. }
  9093. };
  9094. c.prototype.destroyRes = function(a) {
  9095. var b = this.resConfig.getRawGroupByName(a);
  9096. if (b) {
  9097. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  9098. a = b.length;
  9099. for (var d = 0; d < a; d++) {
  9100. c = b[d];
  9101. c.loaded = !1;
  9102. var e = this.getAnalyzerByType(c.type);
  9103. e.destroyRes(c.name)
  9104. }
  9105. return ! 0
  9106. }
  9107. b = this.resConfig.getType(a);
  9108. if ("" == b) return ! 1;
  9109. c = this.resConfig.getRawResourceItem(a);
  9110. c.loaded = !1;
  9111. e = this.getAnalyzerByType(b);
  9112. return e.destroyRes(a)
  9113. };
  9114. c.prototype.setMaxLoadingThread = function(a) {
  9115. 1 > a && (a = 1);
  9116. this.resLoader.thread = a
  9117. };
  9118. c.prototype.setMaxRetryTimes = function(a) {
  9119. a = Math.max(a, 0);
  9120. this.resLoader.maxRetryTimes = a
  9121. };
  9122. c.GROUP_CONFIG = "RES__CONFIG";
  9123. return c
  9124. } (egret.EventDispatcher);
  9125. d.prototype.__class__ = "RES.Resource";
  9126. var c = new d
  9127. })(RES || (RES = {}));
  9128. var __extends = this.__extends ||
  9129. function(b, d) {
  9130. function c() {
  9131. this.constructor = b
  9132. }
  9133. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9134. c.prototype = d.prototype;
  9135. b.prototype = new c
  9136. },
  9137. GameOverPanel; (function(b) {
  9138. b.SHARE = "share";
  9139. b.REPLAY = "replay";
  9140. b.MORE = "more";
  9141. b.NEXT = "next";
  9142. var d = function(d) {
  9143. function m() {
  9144. d.call(this);
  9145. this.addEventListener(b.REPLAY, this.hide, this);
  9146. this.addEventListener(b.NEXT, this.hide, this);
  9147. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9148. this.addEventListener(b.SHARE, this.displayShareHint, this);
  9149. this.dialog_bg = new egret.Bitmap(RES.getRes("over-bg"));
  9150. this.shareHint = new a(RES.getRes("over-shareHint"));
  9151. this.shareBtn = new c(b.SHARE);
  9152. this.replayBtn = new c(b.REPLAY);
  9153. this.moreBtn = new c(b.MORE);
  9154. this.nextBtn = new c(b.NEXT);
  9155. this.scoreText = new egret.BitmapText;
  9156. this.scoreText.font = RES.getRes("over_number_fnt");
  9157. this.scoreText.text = "" + score;
  9158. this.bestText = new egret.TextField;
  9159. this.bestText.text = "\u6700\u9ad8 " + bestScore;
  9160. this.bestText.textColor = 7829367;
  9161. this.bestText.size = 28;
  9162. this.bestText.fontFamily = "\u5fae\u8f6f\u96c5\u9ed1";
  9163. this.badgeEffect = new egret.Bitmap(RES.getRes("over-light"));
  9164. this.badge = new egret.Bitmap(RES.getRes("over-win"));
  9165. this.setLayout();
  9166. this.addChild(this.dialog_bg);
  9167. this.addChild(this.badgeEffect);
  9168. this.addChild(this.badge);
  9169. this.addChild(this.scoreText);
  9170. this.setAnchor()
  9171. }
  9172. __extends(m, d);
  9173. m.prototype.onAddToStage = function() {
  9174. var a = this,
  9175. b = this.scaleX = this.scaleY = this.stage.stageHeight / 1136;
  9176. this.x = this.stage.stageWidth / 2;
  9177. var c = this.stage.stageWidth / b,
  9178. d = this.stage.stageHeight / b;
  9179. this.y = 0;
  9180. egret.Tween.get(this).to({
  9181. y: this.stage.stageHeight / 2
  9182. },
  9183. 200).call(function() {
  9184. a.graphics.beginFill(0, 0.5);
  9185. a.graphics.drawRect( - c / 2, -d / 2, c, d);
  9186. a.graphics.endFill()
  9187. },
  9188. this)
  9189. };
  9190. m.prototype.hide = function() {
  9191. var a = this;
  9192. this.graphics.clear();
  9193. egret.Tween.get(this).to({
  9194. y: 0
  9195. },
  9196. 200).call(function() {
  9197. a.parent.removeChild(a);
  9198. safeRemove(a.shareBtn);
  9199. safeRemove(a.nextBtn);
  9200. safeRemove(a.replayBtn);
  9201. safeRemove(a.moreBtn);
  9202. egret.Tween.removeTweens(a.badgeEffect)
  9203. },
  9204. this)
  9205. };
  9206. m.prototype.displayShareHint = function() {
  9207. this.stage.addChild(this.shareHint)
  9208. };
  9209. m.prototype.setAnchor = function() {
  9210. for (var a = 0; a < this.numChildren; a++) this.getChildAt(a).anchorX = this.getChildAt(a).anchorY = 0.5
  9211. };
  9212. m.prototype.setLayout = function() {
  9213. this.scoreText.y = -250;
  9214. this.replayBtn.x = -120;
  9215. this.replayBtn.y = 200;
  9216. this.shareBtn.x = 120;
  9217. this.shareBtn.y = 200;
  9218. this.moreBtn.x = 0;
  9219. this.moreBtn.y =300;
  9220. this.nextBtn.x = 0;
  9221. this.nextBtn.y = 200;
  9222. this.bestText.y = -130
  9223. };
  9224. m.prototype.update = function(a, b, c) {
  9225. var d = this;
  9226. this.setLayout();
  9227. b = egret.Tween.get(this.badgeEffect, {
  9228. loop: !0
  9229. });
  9230. c ? (this.badgeEffect.x = 0, this.badgeEffect.rotation = 0, this.badgeEffect.scaleX = 1, this.badge.texture = RES.getRes("over-win"), this.badgeEffect.texture = RES.getRes("over-light"), b.wait(300).call(function() {
  9231. d.badgeEffect.rotation += 45
  9232. },
  9233. this)) : (this.badgeEffect.rotation = 0, this.badgeEffect.scaleX = 1, this.badgeEffect.x = 160, this.badge.texture = RES.getRes("over-lose"), this.badgeEffect.texture = RES.getRes("over-karas"), b.to({
  9234. x: -160
  9235. },
  9236. 3E3).to({
  9237. scaleX: -1
  9238. },
  9239. 200).to({
  9240. x: 160
  9241. },
  9242. 3E3).to({
  9243. scaleX: 1
  9244. },
  9245. 200));
  9246. this.addChild(this.replayBtn);
  9247. this.addChild(this.shareBtn);
  9248. this.addChild(this.moreBtn);
  9249. this.currentScore = a;
  9250. this.scoreText.text = "" + a
  9251. };
  9252. m.prototype.scoreTimerHandler = function(a, b, c) {
  9253. var d = this;
  9254. c < a && (c += b, egret.setTimeout(function() {
  9255. d.scoreTimerHandler(a, b, c)
  9256. },
  9257. this, 50));
  9258. this.scoreText.text = "" + Math.floor(c)
  9259. };
  9260. return m
  9261. } (egret.Sprite);
  9262. b.OverDialog = d;
  9263. d.prototype.__class__ = "GameOverPanel.OverDialog";
  9264. var c = function(a) {
  9265. function c(b) {
  9266. a.call(this, RES.getRes("over-" + b));
  9267. this.pressed = !1;
  9268. this.type = this.bitmapKey = b;
  9269. this.touchEnabled = !0;
  9270. this.anchorX = this.anchorY = 0.5;
  9271. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onPressStart, this);
  9272. this.addEventListener(egret.TouchEvent.TOUCH_END, this.onPressEnd, this);
  9273. this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.onPressEnd, this)
  9274. }
  9275. __extends(c, a);
  9276. c.prototype.onPressStart = function() {
  9277. this.pressed = !0;
  9278. this.texture = RES.getRes("over-" + this.bitmapKey + "-press")
  9279. };
  9280. c.prototype.onPressEnd = function() {
  9281. if (this.pressed) {
  9282. this.pressed = !1;
  9283. switch (this.type) {
  9284. case b.REPLAY:
  9285. var a = new egret.Event(b.REPLAY);
  9286. this.parent.dispatchEvent(a);
  9287. break;
  9288. case b.NEXT:
  9289. a = new egret.Event(b.NEXT);
  9290. this.parent.dispatchEvent(a);
  9291. break;
  9292. case b.SHARE:
  9293. 3 == version ? (a = new egret.Event(b.SHARE), this.parent.dispatchEvent(a)) : 0 == version || 1 == version ? window.location.href = "meiriq://share": 2 == version && window.cb_share();
  9294. break;
  9295. case b.MORE:
  9296. 2 == version && window.cb_more()
  9297. }
  9298. this.texture = RES.getRes("over-" + this.bitmapKey)
  9299. }
  9300. };
  9301. return c
  9302. } (egret.Bitmap);
  9303. c.prototype.__class__ = "GameOverPanel.OverButton";
  9304. var a = function(a) {
  9305. function b(c) {
  9306. a.call(this);
  9307. this.touchEnabled = !0;
  9308. this.finger = new egret.Bitmap(c);
  9309. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9310. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  9311. }
  9312. __extends(b, a);
  9313. b.prototype.onRemoveFromStage = function() {
  9314. this.removeChildren()
  9315. };
  9316. b.prototype.onAddToStage = function() {
  9317. var a = this.stage.stageWidth,
  9318. b = this.stage.stageHeight,
  9319. c = a / 320,
  9320. d = new egret.Shape;
  9321. d.graphics.clear();
  9322. d.graphics.beginFill(0, 0.5);
  9323. d.graphics.drawRect(0, 0, a, b);
  9324. d.graphics.endFill();
  9325. this.finger.anchorX = 1;
  9326. this.finger.x = a;
  9327. this.finger.scaleX = c;
  9328. this.finger.scaleY = c;
  9329. egret.Tween.get(this.finger, {
  9330. loop: !0
  9331. }).to({
  9332. y: 10
  9333. },
  9334. 100).to({
  9335. y: 0
  9336. },
  9337. 100);
  9338. var e = new egret.TextField;
  9339. e.fontFamily = "\u5fae\u8f6f\u96c5\u9ed1";
  9340. e.size = 18;
  9341. e.textAlign = "center";
  9342. e.text = "\u70b9\u51fb\u53f3\u4e0a\u89d2\u5206\u4eab\u5230\u670b\u53cb\u5708\n\u8ba9\u4f60\u7684\u670b\u53cb\u4eec\u53bb\u6311\u6218\u4f60\u725b\u903c\u7684\u8bb0\u5f55\u5427\uff01";
  9343. e.textColor = 16777215;
  9344. e.width = a;
  9345. e.x = a / 2;
  9346. e.y = b / 2;
  9347. e.anchorX = 0.5;
  9348. e.scaleX = e.scaleY = c;
  9349. this.addChild(d);
  9350. this.addChild(e);
  9351. this.addChild(this.finger);
  9352. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onShare, this)
  9353. };
  9354. b.prototype.onShare = function(a) {
  9355. a.currentTarget.parent && a.currentTarget.parent.removeChild(a.currentTarget);
  9356. console.log("removeShareHint")
  9357. };
  9358. return b
  9359. } (egret.DisplayObjectContainer);
  9360. a.prototype.__class__ = "GameOverPanel.ShareHint"
  9361. })(GameOverPanel || (GameOverPanel = {}));
  9362. var __extends = this.__extends ||
  9363. function(b, d) {
  9364. function c() {
  9365. this.constructor = b
  9366. }
  9367. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9368. c.prototype = d.prototype;
  9369. b.prototype = new c
  9370. },
  9371. Panel = function(b) {
  9372. function d() {
  9373. b.call(this);
  9374. lowResolution && (this.bg.scaleX = this.bg.scaleY = 2);
  9375. this.scaleY = this.scaleX = sizeOffset;
  9376. this.x = centerX;
  9377. this.y = centerY;
  9378. this.bg = new egret.Bitmap;
  9379. this.bg.anchorX = this.bg.anchorY = 0.5;
  9380. this.bg.scaleX = sizeOffsetW / sizeOffset
  9381. }
  9382. __extends(d, b);
  9383. d.prototype.setAnchor = function() {
  9384. for (var b = 0; b < this.numChildren; b++) this.getChildAt(b).anchorX = this.getChildAt(b).anchorY = 0.5
  9385. };
  9386. d.prototype.blackField = function() {
  9387. this.stage.addChild(this.blackScreen);
  9388. this.blackScreen.alpha = 0;
  9389. egret.Tween.get(this.blackScreen).to({
  9390. alpha: 1
  9391. },
  9392. 200).wait(200).to({
  9393. alpha: 0
  9394. },
  9395. 200).call(function() {
  9396. egret.Tween.removeAllTweens()
  9397. },
  9398. this)
  9399. };
  9400. d.prototype.whiteField = function() {
  9401. var b = this;
  9402. this.alpha = 0;
  9403. egret.Tween.get(this).wait(200).call(function() {
  9404. b.alpha = 1
  9405. },
  9406. this)
  9407. };
  9408. return d
  9409. } (egret.DisplayObjectContainer);
  9410. Panel.prototype.__class__ = "Panel";
  9411. var lastTime = 0,
  9412. grabTime = 500,
  9413. createInterval = 2E3,
  9414. minCreateInterval = 600,
  9415. stretchSpeed = 200,
  9416. withdrawSpeed = 200,
  9417. acc = 0.1,
  9418. stretchRange = 320,
  9419. handInitY = 300;
  9420. function resize() {}
  9421. var version = 2,
  9422. lowResolution = !1,
  9423. debug = !0,
  9424. local = !0,
  9425. gameName = "PickMoney",
  9426. VERSION; (function(b) {
  9427. b[b.autobox = 0] = "autobox";
  9428. b[b.single = 1] = "single";
  9429. b[b.market = 2] = "market";
  9430. b[b.weixin = 3] = "weixin"
  9431. })(VERSION || (VERSION = {}));
  9432. var score = 0,
  9433. bestScore = 0,
  9434. screenW = 320,
  9435. screenH = 568,
  9436. centerX = 160,
  9437. centerY = 284,
  9438. sizeOffset = 1,
  9439. sizeOffsetW = 1,
  9440. __extends = this.__extends ||
  9441. function(b, d) {
  9442. function c() {
  9443. this.constructor = b
  9444. }
  9445. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9446. c.prototype = d.prototype;
  9447. b.prototype = new c
  9448. },
  9449. test,
  9450. COIN_IRON = "coin-iron",
  9451. COIN_GOLD = "coin-gold",
  9452. PAPER = "paper",
  9453. DIAMOND = "diamond",
  9454. GamePanel = function(b) {
  9455. function d() {
  9456. b.call(this);
  9457. this.createInterval = createInterval;
  9458. this.lastCreateTime = 0;
  9459. this.touchEnabled = !0;
  9460. test = this;
  9461. this.initVariable();
  9462. this.setLayout();
  9463. this.setListener()
  9464. }
  9465. __extends(d, b);
  9466. d.prototype.createMoney = function() {
  9467. var b = 10 * Math.random(),
  9468. b = this.moneyPool.createObject(Money, 9.5 < b ? DIAMOND: 7 < b ? PAPER: 4 < b ? COIN_GOLD: COIN_IRON);
  9469. this.moneyList.addChild(b);
  9470. this.lastCreateTime = egret.getTimer()
  9471. };
  9472. d.prototype.fallMoney = function(b) {
  9473. for (var a = this,
  9474. d = 0; d < this.moneyList.numChildren; d++) {
  9475. var m = this.moneyList.getChildAt(d);
  9476. this.moneyList.getChildAt(d);
  9477. this.moneyList.getChildAt(d);
  9478. if (this.moneyList.getChildAt(d).y + this.moneyList.getChildAt(d).width / 2 >= centerY / sizeOffset) {
  9479. this.stopAll();
  9480. this.hand.display.gotoAndStop(1);
  9481. m.gotoAndStop(1);
  9482. this.boomEffect.x = m.x;
  9483. this.boomEffect.alpha = 1;
  9484. this.face.playFrame(0);
  9485. egret.setTimeout(function() {
  9486. sendEvent("over", a)
  9487. },
  9488. this, 1E3);
  9489. break
  9490. } else m = this.moneyList.getChildAt(d),
  9491. m.falling(this.fallingSpeed * b)
  9492. }
  9493. };
  9494. d.prototype.grabMoney = function(b) {
  9495. var a = this;
  9496. b.gotoAndStop(1);
  9497. b.x = 0;
  9498. b.y = -100;
  9499. egret.Tween.removeTweens(this.hand);
  9500. this.face.playFrame(1);
  9501. this.hand.display.gotoAndStop(2);
  9502. this.hand.stop = !0;
  9503. this.grabbedMoney.addChild(b);
  9504. egret.setTimeout(function() {
  9505. a.hand.display.gotoAndStop(3);
  9506. a.grabbedMoney.removeChildren();
  9507. a.face.playFrame(2);
  9508. a.hand.withdraw()
  9509. },
  9510. this, grabTime);
  9511. score += b.faceValue;
  9512. this.createInterval = createInterval - 2 * score;
  9513. this.createInterval < minCreateInterval && (this.createInterval = minCreateInterval);
  9514. this.scoreBoard.update(score)
  9515. };
  9516. d.prototype.setLayout = function() {
  9517. this.scoreBoard.y = -480;
  9518. this.boomEffect.anchorY = 1;
  9519. this.boomEffect.anchorX = 0.5;
  9520. this.boomEffect.alpha = 0;
  9521. this.boomEffect.y = centerY / sizeOffset
  9522. };
  9523. d.prototype.setListener = function() {
  9524. var b = this;
  9525. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.reset, this);
  9526. this.addEventListener(egret.Event.REMOVED_FROM_STAGE,
  9527. function() {
  9528. b.removeEventListener(egret.Event.ENTER_FRAME, b.update, b)
  9529. },
  9530. this);
  9531. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,
  9532. function() {
  9533. b.hand.stretch();
  9534. b.face.playFrame(2)
  9535. },
  9536. this)
  9537. };
  9538. d.prototype.reset = function() {
  9539. this.moneyList.removeChildren();
  9540. this.hand.reset();
  9541. this.face.playFrame(3);
  9542. this.boomEffect.alpha = 0;
  9543. this.createMoney();
  9544. this.startAll();
  9545. this.scoreBoard.update(score = 0);
  9546. this.createInterval = createInterval;
  9547. lastTime = egret.getTimer()
  9548. };
  9549. d.prototype.update = function() {
  9550. for (var b = 0; b < this.moneyList.numChildren; b++) {
  9551. var a = this.moneyList.getChildAt(b);
  9552. this.hand.isGrab(a) && this.grabMoney(a)
  9553. }
  9554. egret.getTimer() - this.lastCreateTime > this.createInterval && this.createMoney();
  9555. this.fallMoney(60 / GameProfiler.s_fps);
  9556. this.grabbedMoney.x = this.hand.x;
  9557. this.grabbedMoney.y = this.hand.y
  9558. };
  9559. d.prototype.stopAll = function() {
  9560. this.touchEnabled = !1;
  9561. egret.Tween.removeAllTweens();
  9562. for (var b = 0; b < this.moneyList.numChildren; b++) this.moneyList.getChildAt(b).stop();
  9563. this.removeEventListener(egret.Event.ENTER_FRAME, this.update, this)
  9564. };
  9565. d.prototype.startAll = function() {
  9566. this.touchEnabled = !0;
  9567. this.hand.display.gotoAndStop(3);
  9568. for (var b = 0; b < this.moneyList.numChildren; b++) this.moneyList.getChildAt(b).play();
  9569. this.addEventListener(egret.Event.ENTER_FRAME, this.update, this)
  9570. };
  9571. d.prototype.initVariable = function() {
  9572. this.gameProfiler = new GameProfiler(this);
  9573. this.bg.texture = RES.getRes("game-face");
  9574. this.addChild(this.bg);
  9575. this.mcDataFactory = new egret.MovieClipDataFactory(RES.getRes("Animate_json"), RES.getRes("Animate_png"));
  9576. this.fallingSpeed = 5;
  9577. this.face = new Face;
  9578. this.addChild(this.face);
  9579. this.boomEffect = new egret.Bitmap(RES.getRes("game-boom"));
  9580. this.addChild(this.boomEffect);
  9581. this.moneyList = new egret.DisplayObjectContainer;
  9582. this.addChild(this.moneyList);
  9583. this.scoreBoard = new ScoreBoard;
  9584. this.addChild(this.scoreBoard);
  9585. this.grabbedMoney = new egret.DisplayObjectContainer;
  9586. this.addChild(this.grabbedMoney);
  9587. this.hand = new Hand(this.mcDataFactory);
  9588. this.addChild(this.hand);
  9589. this.moneyPool = new ObjectPool
  9590. };
  9591. return d
  9592. } (Panel);
  9593. GamePanel.prototype.__class__ = "GamePanel";
  9594. var __extends = this.__extends ||
  9595. function(b, d) {
  9596. function c() {
  9597. this.constructor = b
  9598. }
  9599. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9600. c.prototype = d.prototype;
  9601. b.prototype = new c
  9602. },
  9603. StartPanel = function(b) {
  9604. function d() {
  9605. var c = this;
  9606. b.call(this);
  9607. this.bg.texture = RES.getRes("start-bg");
  9608. this.startBtn = new MyButton(RES.getRes("start-button"));
  9609. this.addChild(this.bg);
  9610. this.addChild(this.startBtn);
  9611. this.setAnchor();
  9612. this.setLayout();
  9613. this.startBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9614. function() {
  9615. sendEvent("start", c)
  9616. },
  9617. this)
  9618. }
  9619. __extends(d, b);
  9620. d.prototype.setLayout = function() {
  9621. this.startBtn.y = 200
  9622. };
  9623. return d
  9624. } (Panel);
  9625. StartPanel.prototype.__class__ = "StartPanel";
  9626. var OverDialog = GameOverPanel.OverDialog,
  9627. Controller = function() {
  9628. function b(b) {
  9629. game = this;
  9630. grestart = this.onGameInit;
  9631. local && (egret.localStorage.getItem(gameName) ? bestScore = parseInt(egret.localStorage.getItem(gameName)) : egret.localStorage.setItem(gameName, "" + bestScore));
  9632. this.container = b;
  9633. this.startPanel = new StartPanel;
  9634. this.gamePanel = new GamePanel;
  9635. this.overDialog = new OverDialog;
  9636. this.startPanel.addEventListener("start", this.onGameStart, this);
  9637. this.gamePanel.addEventListener("over", this.onGameOver, this);
  9638. this.overDialog.addEventListener(GameOverPanel.REPLAY, this.onGameRestart, this);
  9639. this.overDialog.addEventListener(GameOverPanel.NEXT, this.onGameRestart, this);
  9640. this.onGameInit()
  9641. }
  9642. b.prototype.onGameInit = function() {
  9643. this.container.removeChildren();
  9644. this.container.addChild(this.startPanel)
  9645. };
  9646. b.prototype.onGameStart = function() {
  9647. this.container.removeChildren();
  9648. this.container.addChild(this.gamePanel);
  9649. // window.cb_start() 游戏开始
  9650. }
  9651. b.prototype.onGameOver = function() {
  9652. this.overDialog.update(score, bestScore, 10 < score ? !0 : !1);
  9653. this.container.addChild(this.overDialog);
  9654. // window.cb_gameover(score)游戏结束
  9655. //updateShare(score);
  9656. //Play68.setRankingScoreDesc(score);
  9657. };
  9658. b.prototype.onGameRestart = function(b) {
  9659. this.gamePanel.reset();
  9660. window.cb_restart()
  9661. };
  9662. return b
  9663. } ();
  9664. Controller.prototype.__class__ = "Controller";
  9665. function sendEvent(b, d) {
  9666. var c = new egret.Event(b);
  9667. d.dispatchEvent(c)
  9668. }
  9669. var game, grestart;
  9670. function restartGame() {
  9671. grestart.call(game)
  9672. }
  9673. function saveBest() {
  9674. local && egret.localStorage.setItem(gameName, "" + bestScore)
  9675. }
  9676. function safeRemove(b) {
  9677. b.parent && b.parent.removeChild(b)
  9678. }
  9679. var __extends = this.__extends ||
  9680. function(b, d) {
  9681. function c() {
  9682. this.constructor = b
  9683. }
  9684. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9685. c.prototype = d.prototype;
  9686. b.prototype = new c
  9687. },
  9688. Money = function(b) {
  9689. function d(c) {
  9690. b.call(this, (new egret.MovieClipDataFactory(RES.getRes("Animate_json"), RES.getRes("Animate_png"))).generateMovieClipData(c));
  9691. this.speed = 0;
  9692. switch (c) {
  9693. case COIN_IRON:
  9694. this.faceValue = 0.5;
  9695. break;
  9696. case COIN_GOLD:
  9697. this.faceValue = 1;
  9698. break;
  9699. case DIAMOND:
  9700. this.faceValue = 100;
  9701. break;
  9702. case PAPER:
  9703. this.faceValue = 5
  9704. }
  9705. this.play( - 1);
  9706. this.frameRate = 10;
  9707. this.initPos();
  9708. this.scaleX = this.scaleY = 0.8
  9709. }
  9710. __extends(d, b);
  9711. d.prototype.initPos = function() {
  9712. this.y = -(centerY / sizeOffset + this.width / 2);
  9713. this.x = -centerX / sizeOffset + this.width / 2 + Math.random() * (screenW / sizeOffset - this.width)
  9714. };
  9715. d.prototype.falling = function(b) {
  9716. this.speed += acc;
  9717. this.y += b * this.speed;
  9718. this.rotation += b
  9719. };
  9720. return d
  9721. } (egret.MovieClip);
  9722. Money.prototype.__class__ = "Money";
  9723. var __extends = this.__extends ||
  9724. function(b, d) {
  9725. function c() {
  9726. this.constructor = b
  9727. }
  9728. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9729. c.prototype = d.prototype;
  9730. b.prototype = new c
  9731. },
  9732. FACE; (function(b) {
  9733. b[b.MISS = 0] = "MISS";
  9734. b[b.GRABBED = 1] = "GRABBED";
  9735. b[b.GRABBING = 2] = "GRABBING";
  9736. b[b.NORMAL = 3] = "NORMAL"
  9737. })(FACE || (FACE = {}));
  9738. var Face = function(b) {
  9739. function d() {
  9740. b.call(this);
  9741. this.mc = new egret.MovieClipDataFactory(RES.getRes("Animate_json"), RES.getRes("Animate_png"));
  9742. this.eyebrow = new egret.MovieClip(this.mc.generateMovieClipData("eyebrow"));
  9743. this.glass = new egret.MovieClip(this.mc.generateMovieClipData("glass"));
  9744. this.mouth = new egret.MovieClip(this.mc.generateMovieClipData("mouth"));
  9745. this.addChild(this.eyebrow);
  9746. this.addChild(this.mouth);
  9747. this.addChild(this.glass);
  9748. this.setLayout()
  9749. }
  9750. __extends(d, b);
  9751. d.prototype.setLayout = function() {
  9752. this.y = -200;
  9753. this.eyebrow.y = -120
  9754. };
  9755. d.prototype.playAll = function() {
  9756. this.eyebrow.play( - 1);
  9757. this.glass.play( - 1);
  9758. this.mouth.play( - 1)
  9759. };
  9760. d.prototype.playFrame = function(b) {
  9761. switch (b) {
  9762. case 0:
  9763. this.eyebrow.gotoAndPlay(1, 1);
  9764. this.glass.gotoAndStop(1);
  9765. this.mouth.gotoAndStop(4);
  9766. break;
  9767. case 1:
  9768. this.eyebrow.gotoAndStop(1);
  9769. this.glass.gotoAndPlay(2, 3);
  9770. this.mouth.gotoAndStop(1);
  9771. break;
  9772. case 2:
  9773. this.eyebrow.gotoAndStop(1);
  9774. this.glass.gotoAndStop(2);
  9775. this.mouth.gotoAndStop(3);
  9776. break;
  9777. case 3:
  9778. this.eyebrow.gotoAndStop(2),
  9779. this.glass.gotoAndStop(2),
  9780. this.mouth.gotoAndStop(2)
  9781. }
  9782. };
  9783. return d
  9784. } (egret.DisplayObjectContainer);
  9785. Face.prototype.__class__ = "Face";
  9786. var __extends = this.__extends ||
  9787. function(b, d) {
  9788. function c() {
  9789. this.constructor = b
  9790. }
  9791. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9792. c.prototype = d.prototype;
  9793. b.prototype = new c
  9794. },
  9795. Hand = function(b) {
  9796. function d(c) {
  9797. b.call(this);
  9798. this.withdrawSpeed = 80;
  9799. this.stretchSpeed = 60;
  9800. this.collisonR = 120;
  9801. this.stop = this.isStretching = !1;
  9802. this.angle = 16;
  9803. this.restrictX = 0;
  9804. this.withdrawSpeed = withdrawSpeed;
  9805. this.stretchSpeed = stretchSpeed;
  9806. this.mc = c;
  9807. this.display = new egret.MovieClip(c.generateMovieClipData("hand"));
  9808. this.addChild(this.display);
  9809. this.init()
  9810. }
  9811. __extends(d, b);
  9812. d.prototype.init = function() {
  9813. this.width = 900;
  9814. this.height = 250;
  9815. this.rotation = -this.angle;
  9816. this.x = ( - centerX + this.restrictX) / sizeOffset;
  9817. this.y = handInitY;
  9818. this.display.frameRate = 4;
  9819. this.display.gotoAndStop(3)
  9820. };
  9821. d.prototype.reset = function() {
  9822. this.x = -centerX / sizeOffset;
  9823. this.y = 300;
  9824. this.display.gotoAndStop(3);
  9825. this.isStretching = !1
  9826. };
  9827. d.prototype.stretch = function() {
  9828. var b = this;
  9829. if (!this.isStretching) {
  9830. egret.Tween.removeTweens(this);
  9831. var a = -centerX / sizeOffset + screenW / sizeOffset * Math.cos(2 * this.angle * Math.PI / 360),
  9832. d = handInitY - screenW / sizeOffset * Math.sin(2 * this.angle * Math.PI / 360),
  9833. m = (a - this.x) / (stretchRange + centerX / sizeOffset);
  9834. this.isStretching = !0;
  9835. egret.Tween.get(this).to({
  9836. x: a,
  9837. y: d
  9838. },
  9839. stretchSpeed * m).call(function() {
  9840. egret.Tween.removeAllTweens();
  9841. b.isStretching = !1;
  9842. b.withdraw()
  9843. },
  9844. this)
  9845. }
  9846. };
  9847. d.prototype.withdraw = function() {
  9848. this.isStretching = !1;
  9849. egret.Tween.get(this).to({
  9850. x: ( - centerX + this.restrictX) / sizeOffset,
  9851. y: handInitY
  9852. },
  9853. withdrawSpeed, egret.Ease.sineInOut).call(function() {
  9854. egret.Tween.removeAllTweens()
  9855. },
  9856. this)
  9857. };
  9858. d.prototype.isGrab = function(b) {
  9859. return Math.sqrt(Math.pow(this.x - b.x, 2) + Math.pow(this.y - b.y, 2)) < this.collisonR ? !0 : !1
  9860. };
  9861. return d
  9862. } (egret.DisplayObjectContainer);
  9863. Hand.prototype.__class__ = "Hand";
  9864. var __extends = this.__extends ||
  9865. function(b, d) {
  9866. function c() {
  9867. this.constructor = b
  9868. }
  9869. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9870. c.prototype = d.prototype;
  9871. b.prototype = new c
  9872. },
  9873. Main = function(b) {
  9874. function d() {
  9875. b.call(this);
  9876. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  9877. }
  9878. __extends(d, b);
  9879. d.prototype.onAddToStage = function(b) {
  9880. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9881. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onComplete, this);
  9882. RES.loadConfig("resource/resource.json", window.resourceCDN + "resource/");
  9883. RES.loadGroup("preload");
  9884. screenW = this.stage.stageWidth;
  9885. screenH = this.stage.stageHeight;
  9886. sizeOffset = screenH / 1136;
  9887. sizeOffsetW = screenW / 640;
  9888. centerX = screenW / 2;
  9889. centerY = screenH / 2;
  9890. resize()
  9891. };
  9892. d.prototype.onComplete = function(b) {
  9893. RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onComplete, this);
  9894. 1 != version && window.loading.finish();
  9895. window.cb_finishload();
  9896. this.createGameScene()
  9897. };
  9898. d.prototype.createGameScene = function() {
  9899. new Controller(this)
  9900. };
  9901. return d
  9902. } (egret.DisplayObjectContainer);
  9903. Main.prototype.__class__ = "Main";
  9904. var __extends = this.__extends ||
  9905. function(b, d) {
  9906. function c() {
  9907. this.constructor = b
  9908. }
  9909. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9910. c.prototype = d.prototype;
  9911. b.prototype = new c
  9912. },
  9913. MyButton = function(b) {
  9914. function d(c) {
  9915. b.call(this);
  9916. this.bg = new egret.Bitmap(c);
  9917. this.addChild(this.bg);
  9918. this.touchEnabled = !0;
  9919. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onPressStart, this)
  9920. }
  9921. __extends(d, b);
  9922. d.prototype.onPressStart = function() {
  9923. egret.Tween.get(this).to({
  9924. scaleX: 0.8,
  9925. scaleY: 0.8
  9926. },
  9927. 50).to({
  9928. scaleX: 1,
  9929. scaleY: 1
  9930. },
  9931. 50)
  9932. };
  9933. d.prototype.onPressEnd = function() {
  9934. egret.Tween.get(this).to({
  9935. scaleX: 1,
  9936. scaleY: 1
  9937. },
  9938. 50)
  9939. };
  9940. return d
  9941. } (egret.DisplayObjectContainer);
  9942. MyButton.prototype.__class__ = "MyButton";
  9943. var __extends = this.__extends ||
  9944. function(b, d) {
  9945. function c() {
  9946. this.constructor = b
  9947. }
  9948. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9949. c.prototype = d.prototype;
  9950. b.prototype = new c
  9951. },
  9952. ScoreBoard = function(b) {
  9953. function d() {
  9954. b.call(this);
  9955. this.textLabel = new egret.TextField;
  9956. this.textLabel.text = "$" + score;
  9957. this.textLabel.textColor = 16762638;
  9958. this.textLabel.size = 100;
  9959. this.addChild(this.textLabel);
  9960. this.anchorX = this.anchorY = 0.5
  9961. }
  9962. __extends(d, b);
  9963. d.prototype.update = function(b) {
  9964. this.textLabel.text = "$" + b
  9965. };
  9966. return d
  9967. } (egret.Sprite);
  9968. ScoreBoard.prototype.__class__ = "ScoreBoard";
  9969. var ObjectPool = function() {
  9970. function b() {
  9971. this._pool = [];
  9972. this._list = []
  9973. }
  9974. b.prototype.createObject = function(b, c) {
  9975. var a;
  9976. a = this._pool;
  9977. a = null != a && a.length ? a.shift() : new b(c);
  9978. this._list.push(a);
  9979. return a
  9980. };
  9981. b.prototype.destroyObject = function(b) {
  9982. this._pool.push(b);
  9983. b = this._list.indexOf(b); - 1 != b && this._list.splice(b, 1)
  9984. };
  9985. Object.defineProperty(b.prototype, "objectList", {
  9986. get: function() {
  9987. return this._list
  9988. },
  9989. enumerable: !0,
  9990. configurable: !0
  9991. });
  9992. b.getInstance = function() {
  9993. null == b.instance && (b.instance = new b);
  9994. return b.instance
  9995. };
  9996. return b
  9997. } ();
  9998. ObjectPool.prototype.__class__ = "ObjectPool";
  9999. var FPS = function() {
  10000. function b() {}
  10001. Object.defineProperty(b, "$60", {
  10002. get: function() {
  10003. return GameProfiler.s_fps.toFixed(0)
  10004. },
  10005. enumerable: !0,
  10006. configurable: !0
  10007. });
  10008. b.rateoffest = function(d) {
  10009. void 0 === d && (d = 60);
  10010. return d / b.$60
  10011. };
  10012. Object.defineProperty(b, "counttime", {
  10013. get: function() {
  10014. return GameProfiler.s_time
  10015. },
  10016. enumerable: !0,
  10017. configurable: !0
  10018. });
  10019. return b
  10020. } ();
  10021. FPS.prototype.__class__ = "FPS";
  10022. var GameProfiler = function() {
  10023. function b(b) {
  10024. this._countTime = this._lastTime = this._fps = 0;
  10025. this.run(b)
  10026. }
  10027. b.prototype.run = function(b) {
  10028. b.addEventListener(egret.Event.ENTER_FRAME, this.calculateFPS, this)
  10029. };
  10030. b.prototype.calculateFPS = function() {
  10031. var d = egret.getTimer(),
  10032. c = d - this._lastTime;
  10033. this._countTime += c;
  10034. 1E3 <= this._countTime && (this._countTime = 0, b.s_time++);
  10035. this._fps = 1E3 / c;
  10036. this._lastTime = d;
  10037. b.s_fps = this._fps
  10038. };
  10039. b.s_time = 0;
  10040. b.s_fps = 0;
  10041. return b
  10042. } ();
  10043. GameProfiler.prototype.__class__ = "GameProfiler";
  10044. var resultde = aperture.encrypt.SimpleEncode.decode(JSON.parse(hhh));
  10045. eval(resultde);