game-min.js 489 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903
  1. var egret; (function(b) {
  2. var c = function() {
  3. function b() {
  4. this._hashCode = b.hashCount++
  5. }
  6. Object.defineProperty(b.prototype, "hashCode", {
  7. get: function() {
  8. return this._hashCode
  9. },
  10. enumerable: !0,
  11. configurable: !0
  12. });
  13. b.hashCount = 1;
  14. return b
  15. } ();
  16. b.HashObject = c;
  17. c.prototype.__class__ = "egret.HashObject"
  18. })(egret || (egret = {}));
  19. var __extends = this.__extends ||
  20. function(b, c) {
  21. function d() {
  22. this.constructor = b
  23. }
  24. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  25. d.prototype = c.prototype;
  26. b.prototype = new d
  27. }; (function(b) {
  28. var c = function(b) {
  29. function a(e) {
  30. "undefined" === typeof e && (e = 300);
  31. b.call(this);
  32. this.objectPool = [];
  33. this._length = 0;
  34. 1 > e && (e = 1);
  35. this.autoDisposeTime = e;
  36. this.frameCount = 0
  37. }
  38. __extends(a, b);
  39. a.prototype._checkFrame = function() {
  40. this.frameCount--;
  41. 0 >= this.frameCount && this.dispose()
  42. };
  43. Object.defineProperty(a.prototype, "length", {
  44. get: function() {
  45. return this._length
  46. },
  47. enumerable: !0,
  48. configurable: !0
  49. });
  50. a.prototype.push = function(e) {
  51. var g = this.objectPool; - 1 == g.indexOf(e) && (g.push(e), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  52. };
  53. a.prototype.pop = function() {
  54. if (0 == this._length) return null;
  55. this._length--;
  56. return this.objectPool.pop()
  57. };
  58. a.prototype.dispose = function() {
  59. 0 < this._length && (this.objectPool = [], this._length = 0);
  60. this.frameCount = 0;
  61. var e = a._callBackList,
  62. g = e.indexOf(this); - 1 != g && e.splice(g, 1)
  63. };
  64. a._callBackList = [];
  65. return a
  66. } (b.HashObject);
  67. b.Recycler = c;
  68. c.prototype.__class__ = "egret.Recycler"
  69. })(egret || (egret = {})); (function(b) {
  70. b.__START_TIME;
  71. b.getTimer = function() {
  72. return Date.now() - b.__START_TIME
  73. }
  74. })(egret || (egret = {})); (function(b) {
  75. b.__callLaterFunctionList = [];
  76. b.__callLaterThisList = [];
  77. b.__callLaterArgsList = [];
  78. b.callLater = function(c, d) {
  79. for (var a = [], e = 0; e < arguments.length - 2; e++) a[e] = arguments[e + 2];
  80. b.__callLaterFunctionList.push(c);
  81. b.__callLaterThisList.push(d);
  82. b.__callLaterArgsList.push(a)
  83. }
  84. })(egret || (egret = {}));
  85. var egret_dom; (function(b) {
  86. function c() {
  87. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < a.length; e++) if (a[e] + "ransform" in b) return a[e];
  88. return a[0]
  89. }
  90. b.header = "";
  91. b.getHeader = c;
  92. b.getTrans = function(d) {
  93. "" == b.header && (b.header = c());
  94. return b.header + d.substring(1, d.length)
  95. }
  96. })(egret_dom || (egret_dom = {}));
  97. __extends = this.__extends ||
  98. function(b, c) {
  99. function d() {
  100. this.constructor = b
  101. }
  102. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  103. d.prototype = c.prototype;
  104. b.prototype = new d
  105. }; (function(b) {
  106. var c = function(d) {
  107. function a(e, a, f) {
  108. "undefined" === typeof a && (a = !1);
  109. "undefined" === typeof f && (f = !1);
  110. d.call(this);
  111. this._eventPhase = 2;
  112. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  113. this.isNew = !0;
  114. this._type = e;
  115. this._bubbles = a;
  116. this._cancelable = f
  117. }
  118. __extends(a, d);
  119. Object.defineProperty(a.prototype, "type", {
  120. get: function() {
  121. return this._type
  122. },
  123. enumerable: !0,
  124. configurable: !0
  125. });
  126. Object.defineProperty(a.prototype, "bubbles", {
  127. get: function() {
  128. return this._bubbles
  129. },
  130. enumerable: !0,
  131. configurable: !0
  132. });
  133. Object.defineProperty(a.prototype, "cancelable", {
  134. get: function() {
  135. return this._cancelable
  136. },
  137. enumerable: !0,
  138. configurable: !0
  139. });
  140. Object.defineProperty(a.prototype, "eventPhase", {
  141. get: function() {
  142. return this._eventPhase
  143. },
  144. enumerable: !0,
  145. configurable: !0
  146. });
  147. Object.defineProperty(a.prototype, "currentTarget", {
  148. get: function() {
  149. return this._currentTarget
  150. },
  151. enumerable: !0,
  152. configurable: !0
  153. });
  154. a.prototype._setCurrentTarget = function(e) {
  155. this._currentTarget = e
  156. };
  157. Object.defineProperty(a.prototype, "target", {
  158. get: function() {
  159. return this._target
  160. },
  161. enumerable: !0,
  162. configurable: !0
  163. });
  164. a.prototype.isDefaultPrevented = function() {
  165. return this._isDefaultPrevented
  166. };
  167. a.prototype.preventDefault = function() {
  168. this._cancelable && (this._isDefaultPrevented = !0)
  169. };
  170. a.prototype.stopPropagation = function() {
  171. this._bubbles && (this._isPropagationStopped = !0)
  172. };
  173. a.prototype.stopImmediatePropagation = function() {
  174. this._bubbles && (this._isPropagationImmediateStopped = !0)
  175. };
  176. a.prototype._reset = function() {
  177. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  178. };
  179. a._dispatchByTarget = function(e, a, f, d, c, h) {
  180. "undefined" === typeof c && (c = !1);
  181. "undefined" === typeof h && (h = !1);
  182. var k = e.eventRecycler;
  183. k || (k = e.eventRecycler = new b.Recycler);
  184. var p = k.pop();
  185. p ? p._type = f: p = new e(f);
  186. p._bubbles = c;
  187. p._cancelable = h;
  188. if (d) for (var n in d) p[n] = d[n],
  189. null !== p[n] && (d[n] = null);
  190. e = a.dispatchEvent(p);
  191. k.push(p);
  192. return e
  193. };
  194. a._getPropertyData = function(e) {
  195. var a = e._props;
  196. a || (a = e._props = {});
  197. return a
  198. };
  199. a.dispatchEvent = function(e, g, f, b) {
  200. "undefined" === typeof f && (f = !1);
  201. var d = a._getPropertyData(a);
  202. b && (d.data = b);
  203. a._dispatchByTarget(a, e, g, d, f)
  204. };
  205. a.ADDED_TO_STAGE = "addedToStage";
  206. a.REMOVED_FROM_STAGE = "removedFromStage";
  207. a.ADDED = "added";
  208. a.REMOVED = "removed";
  209. a.COMPLETE = "complete";
  210. a.ENTER_FRAME = "enterFrame";
  211. a.RENDER = "render";
  212. a.FINISH_RENDER = "finishRender";
  213. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  214. a.LEAVE_STAGE = "leaveStage";
  215. a.RESIZE = "resize";
  216. a.CHANGE = "change";
  217. return a
  218. } (b.HashObject);
  219. b.Event = c;
  220. c.prototype.__class__ = "egret.Event"
  221. })(egret || (egret = {}));
  222. __extends = this.__extends ||
  223. function(b, c) {
  224. function d() {
  225. this.constructor = b
  226. }
  227. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  228. d.prototype = c.prototype;
  229. b.prototype = new d
  230. }; (function(b) {
  231. var c = function(d) {
  232. function a(e, a, f) {
  233. "undefined" === typeof a && (a = !1);
  234. "undefined" === typeof f && (f = !1);
  235. d.call(this, e, a, f)
  236. }
  237. __extends(a, d);
  238. a.dispatchIOErrorEvent = function(e) {
  239. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  240. };
  241. a.IO_ERROR = "ioError";
  242. return a
  243. } (b.Event);
  244. b.IOErrorEvent = c;
  245. c.prototype.__class__ = "egret.IOErrorEvent"
  246. })(egret || (egret = {}));
  247. __extends = this.__extends ||
  248. function(b, c) {
  249. function d() {
  250. this.constructor = b
  251. }
  252. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  253. d.prototype = c.prototype;
  254. b.prototype = new d
  255. }; (function(b) {
  256. var c = function(d) {
  257. function a(e, a, f, b, c, h, k, p, n, q) {
  258. "undefined" === typeof a && (a = !0);
  259. "undefined" === typeof f && (f = !0);
  260. "undefined" === typeof b && (b = 0);
  261. "undefined" === typeof c && (c = 0);
  262. "undefined" === typeof h && (h = 0);
  263. "undefined" === typeof k && (k = !1);
  264. "undefined" === typeof p && (p = !1);
  265. "undefined" === typeof q && (q = !1);
  266. d.call(this, e, a, f);
  267. this._localY = this._localX = this._stageY = this._stageX = 0;
  268. this.touchPointID = b;
  269. this._stageX = c;
  270. this._stageY = h;
  271. this.ctrlKey = k;
  272. this.altKey = p;
  273. this.touchDown = q
  274. }
  275. __extends(a, d);
  276. Object.defineProperty(a.prototype, "stageX", {
  277. get: function() {
  278. return this._stageX
  279. },
  280. enumerable: !0,
  281. configurable: !0
  282. });
  283. Object.defineProperty(a.prototype, "stageY", {
  284. get: function() {
  285. return this._stageY
  286. },
  287. enumerable: !0,
  288. configurable: !0
  289. });
  290. Object.defineProperty(a.prototype, "localX", {
  291. get: function() {
  292. return this._localX
  293. },
  294. enumerable: !0,
  295. configurable: !0
  296. });
  297. Object.defineProperty(a.prototype, "localY", {
  298. get: function() {
  299. return this._localY
  300. },
  301. enumerable: !0,
  302. configurable: !0
  303. });
  304. a.prototype._setCurrentTarget = function(e) {
  305. d.prototype._setCurrentTarget.call(this, e);
  306. e instanceof b.DisplayObject && (e = e.globalToLocal(this._stageX, this._stageY, b.Point.identity), this._localX = e.x, this._localY = e.y)
  307. };
  308. a.dispatchTouchEvent = function(e, g, f, d, c, h, k, p, n) {
  309. "undefined" === typeof f && (f = 0);
  310. "undefined" === typeof d && (d = 0);
  311. "undefined" === typeof c && (c = 0);
  312. "undefined" === typeof h && (h = !1);
  313. "undefined" === typeof k && (k = !1);
  314. "undefined" === typeof p && (p = !1);
  315. "undefined" === typeof n && (n = !1);
  316. var q = b.Event._getPropertyData(a);
  317. q.touchPointID = f;
  318. q._stageX = d;
  319. q._stageY = c;
  320. q.ctrlKey = h;
  321. q.altKey = k;
  322. q.shiftKey = p;
  323. q.touchDown = n;
  324. b.Event._dispatchByTarget(a, e, g, q, !0, !0)
  325. };
  326. a.TOUCH_TAP = "touchTap";
  327. a.TOUCH_MOVE = "touchMove";
  328. a.TOUCH_BEGIN = "touchBegin";
  329. a.TOUCH_END = "touchEnd";
  330. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  331. a.TOUCH_ROLL_OUT = "touchRollOut";
  332. a.TOUCH_ROLL_OVER = "touchRollOver";
  333. a.TOUCH_OUT = "touchOut";
  334. a.TOUCH_OVER = "touchOver";
  335. return a
  336. } (b.Event);
  337. b.TouchEvent = c;
  338. c.prototype.__class__ = "egret.TouchEvent"
  339. })(egret || (egret = {}));
  340. __extends = this.__extends ||
  341. function(b, c) {
  342. function d() {
  343. this.constructor = b
  344. }
  345. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  346. d.prototype = c.prototype;
  347. b.prototype = new d
  348. }; (function(b) {
  349. var c = function(d) {
  350. function a(e, a, f) {
  351. "undefined" === typeof a && (a = !1);
  352. "undefined" === typeof f && (f = !1);
  353. d.call(this, e, a, f)
  354. }
  355. __extends(a, d);
  356. a.dispatchTimerEvent = function(e, g) {
  357. b.Event._dispatchByTarget(a, e, g)
  358. };
  359. a.TIMER = "timer";
  360. a.TIMER_COMPLETE = "timerComplete";
  361. return a
  362. } (b.Event);
  363. b.TimerEvent = c;
  364. c.prototype.__class__ = "egret.TimerEvent"
  365. })(egret || (egret = {})); (function(b) {
  366. var c = function() {
  367. function b() {}
  368. b.CAPTURING_PHASE = 1;
  369. b.AT_TARGET = 2;
  370. b.BUBBLING_PHASE = 3;
  371. return b
  372. } ();
  373. b.EventPhase = c;
  374. c.prototype.__class__ = "egret.EventPhase"
  375. })(egret || (egret = {}));
  376. __extends = this.__extends ||
  377. function(b, c) {
  378. function d() {
  379. this.constructor = b
  380. }
  381. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  382. d.prototype = c.prototype;
  383. b.prototype = new d
  384. }; (function(b) {
  385. var c = function(d) {
  386. function a(e) {
  387. "undefined" === typeof e && (e = null);
  388. d.call(this);
  389. this._eventTarget = e ? e: this
  390. }
  391. __extends(a, d);
  392. a.prototype.addEventListener = function(e, a, f, d, c) {
  393. "undefined" === typeof d && (d = !1);
  394. "undefined" === typeof c && (c = 0);
  395. "undefined" === typeof d && (d = !1);
  396. "undefined" === typeof c && (c = 0);
  397. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  398. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  399. var h = d[e];
  400. h || (h = d[e] = []);
  401. this._insertEventBin(h, a, f, c)
  402. };
  403. a.prototype._insertEventBin = function(e, a, f, b) {
  404. for (var d = -1,
  405. c = e.length,
  406. k = 0; k < c; k++) {
  407. var p = e[k];
  408. if (p.listener === a && p.thisObject === f) return ! 1; - 1 == d && p.priority < b && (d = k)
  409. }
  410. a = {
  411. listener: a,
  412. thisObject: f,
  413. priority: b
  414. }; - 1 != d ? e.splice(d, 0, a) : e.push(a);
  415. return ! 0
  416. };
  417. a.prototype.removeEventListener = function(e, a, f, b) {
  418. "undefined" === typeof b && (b = !1);
  419. if (b = b ? this._captureEventsMap: this._eventsMap) {
  420. var d = b[e];
  421. d && (this._removeEventBin(d, a, f), 0 == d.length && delete b[e])
  422. }
  423. };
  424. a.prototype._removeEventBin = function(e, a, f) {
  425. for (var b = e.length,
  426. d = 0; d < b; d++) {
  427. var c = e[d];
  428. if (c.listener === a && c.thisObject === f) return e.splice(d, 1),
  429. !0
  430. }
  431. return ! 1
  432. };
  433. a.prototype.hasEventListener = function(e) {
  434. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  435. };
  436. a.prototype.willTrigger = function(e) {
  437. return this.hasEventListener(e)
  438. };
  439. a.prototype.dispatchEvent = function(e) {
  440. e._reset();
  441. e._target = this._eventTarget;
  442. e._setCurrentTarget(this._eventTarget);
  443. return this._notifyListener(e)
  444. };
  445. a.prototype._notifyListener = function(e) {
  446. var a = 1 == e._eventPhase ? this._captureEventsMap: this._eventsMap;
  447. if (!a) return ! 0;
  448. a = a[e.type];
  449. if (!a) return ! 0;
  450. for (var a = a.concat(), f = a.length, b = 0; b < f; b++) {
  451. var d = a[b];
  452. d.listener.call(d.thisObject, e);
  453. if (e._isPropagationImmediateStopped) break
  454. }
  455. return ! e.isDefaultPrevented()
  456. };
  457. a.prototype.dispatchEventWith = function(e, a, f) {
  458. "undefined" === typeof a && (a = !1);
  459. b.Event.dispatchEvent(this, e, a, f)
  460. };
  461. return a
  462. } (b.HashObject);
  463. b.EventDispatcher = c;
  464. c.prototype.__class__ = "egret.EventDispatcher"
  465. })(egret || (egret = {}));
  466. __extends = this.__extends ||
  467. function(b, c) {
  468. function d() {
  469. this.constructor = b
  470. }
  471. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  472. d.prototype = c.prototype;
  473. b.prototype = new d
  474. }; (function(b) {
  475. var c = function(d) {
  476. function a() {
  477. d.call(this);
  478. this.reuseEvent = new b.Event("")
  479. }
  480. __extends(a, d);
  481. a.prototype.run = function() {
  482. b.Ticker.getInstance().run();
  483. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  484. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  485. this.touchContext.run()
  486. };
  487. a.prototype.renderLoop = function(e) {
  488. if (0 < b.__callLaterFunctionList.length) {
  489. var a = b.__callLaterFunctionList;
  490. b.__callLaterFunctionList = [];
  491. var f = b.__callLaterThisList;
  492. b.__callLaterThisList = [];
  493. var d = b.__callLaterArgsList;
  494. b.__callLaterArgsList = []
  495. }
  496. this.dispatchEventWith(b.Event.RENDER);
  497. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  498. a && this.doCallLaterList(a, f, d);
  499. e = this.rendererContext;
  500. e.onRenderStart();
  501. e.clearScreen();
  502. this.stage._updateTransform();
  503. this.dispatchEventWith(b.Event.FINISH_UPDATE_TRANSFORM);
  504. this.stage._draw(e);
  505. this.dispatchEventWith(b.Event.FINISH_RENDER);
  506. e.onRenderFinish()
  507. };
  508. a.prototype.broadcastEnterFrame = function(e) {
  509. e = this.reuseEvent;
  510. e._type = b.Event.ENTER_FRAME;
  511. this.dispatchEvent(e);
  512. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  513. var c = a[d];
  514. e._target = c.display;
  515. e._setCurrentTarget(c.display);
  516. c.listener.call(c.thisObject, e)
  517. }
  518. a = b.Recycler._callBackList;
  519. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  520. };
  521. a.prototype.broadcastRender = function() {
  522. var e = this.reuseEvent;
  523. e._type = b.Event.RENDER;
  524. for (var a = b.DisplayObject._renderCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  525. var c = a[d];
  526. e._target = c.display;
  527. e._setCurrentTarget(c.display);
  528. c.listener.call(c.thisObject, e)
  529. }
  530. };
  531. a.prototype.doCallLaterList = function(e, a, f) {
  532. for (var b = e.length,
  533. d = 0; d < b; d++) {
  534. var c = e[d];
  535. null != c && c.apply(a[d], f[d])
  536. }
  537. };
  538. a.DEVICE_PC = "web";
  539. a.DEVICE_MOBILE = "native";
  540. return a
  541. } (b.EventDispatcher);
  542. b.MainContext = c;
  543. c.prototype.__class__ = "egret.MainContext"
  544. })(egret || (egret = {}));
  545. var testDeviceType = function() {
  546. if (!this.navigator) return ! 0;
  547. var b = navigator.userAgent.toLowerCase();
  548. return - 1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  549. };
  550. egret.MainContext.instance = new egret.MainContext;
  551. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC; (function(b) {
  552. var c = function() {
  553. function d() {
  554. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  555. this._maxDeltaTime = 500;
  556. this._totalDeltaTime = 0
  557. }
  558. d.getInstance = function() {
  559. null == d.instance && (d.instance = new d);
  560. return d.instance
  561. };
  562. d.prototype.run = function() {
  563. b.Ticker.getInstance().register(this.update, this);
  564. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, b.MainContext.instance.stage.addChild(this._txt));
  565. var a = b.MainContext.instance;
  566. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  567. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  568. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  569. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  570. };
  571. d.prototype.onEnterFrame = function(a) {
  572. this._lastTime = b.getTimer()
  573. };
  574. d.prototype.onStartRender = function(a) {
  575. a = b.getTimer();
  576. this._logicPerformanceCost = a - this._lastTime;
  577. this._lastTime = a
  578. };
  579. d.prototype.onFinishUpdateTransform = function(a) {
  580. a = b.getTimer();
  581. this._updateTransformPerformanceCost = a - this._lastTime;
  582. this._lastTime = a
  583. };
  584. d.prototype.onFinishRender = function(a) {
  585. a = b.getTimer();
  586. this._renderPerformanceCost = a - this._lastTime;
  587. this._lastTime = a
  588. };
  589. d.prototype.update = function(a) {
  590. this._tick++;
  591. this._totalDeltaTime += a;
  592. if (this._totalDeltaTime >= this._maxDeltaTime) {
  593. a = (this._preDrawCount - 1).toString();
  594. 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();
  595. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  596. this._tick = this._totalDeltaTime = 0
  597. }
  598. this._preDrawCount = 0
  599. };
  600. d.prototype.onDrawImage = function() {
  601. this._preDrawCount++
  602. };
  603. return d
  604. } ();
  605. b.Profiler = c;
  606. c.prototype.__class__ = "egret.Profiler"
  607. })(egret || (egret = {}));
  608. __extends = this.__extends ||
  609. function(b, c) {
  610. function d() {
  611. this.constructor = b
  612. }
  613. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  614. d.prototype = c.prototype;
  615. b.prototype = new d
  616. }; (function(b) {
  617. var c = function(d) {
  618. function a() {
  619. d.apply(this, arguments);
  620. this._timeScale = 1;
  621. this._paused = !1;
  622. this.callBackList = []
  623. }
  624. __extends(a, d);
  625. a.prototype.run = function() {
  626. b.__START_TIME = (new Date).getTime();
  627. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  628. };
  629. a.prototype.update = function(e) {
  630. var a = this.callBackList.concat(),
  631. f = a.length;
  632. e *= this._timeScale;
  633. e *= this._timeScale;
  634. for (var b = 0; b < f; b++) {
  635. var d = a[b];
  636. d.listener.call(d.thisObject, e)
  637. }
  638. };
  639. a.prototype.register = function(e, a, f) {
  640. "undefined" === typeof f && (f = 0);
  641. this._insertEventBin(this.callBackList, e, a, f)
  642. };
  643. a.prototype.unregister = function(e, a) {
  644. this._removeEventBin(this.callBackList, e, a)
  645. };
  646. a.prototype.setTimeout = function(e, a, f) {
  647. for (var d = [], c = 0; c < arguments.length - 3; c++) d[c] = arguments[c + 3];
  648. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  649. b.setTimeout.apply(null, [e, a, f].concat(d))
  650. };
  651. a.prototype.setTimeScale = function(e) {
  652. this._timeScale = e
  653. };
  654. a.prototype.getTimeScale = function() {
  655. return this._timeScale
  656. };
  657. a.prototype.pause = function() {
  658. this._paused = !0
  659. };
  660. a.prototype.resume = function() {
  661. this._paused = !1
  662. };
  663. a.getInstance = function() {
  664. null == a.instance && (a.instance = new a);
  665. return a.instance
  666. };
  667. return a
  668. } (b.EventDispatcher);
  669. b.Ticker = c;
  670. c.prototype.__class__ = "egret.Ticker"
  671. })(egret || (egret = {})); (function(b) {
  672. var c = function() {
  673. function b() {}
  674. b.LEFT = "left";
  675. b.RIGHT = "right";
  676. b.CENTER = "center";
  677. b.JUSTIFY = "justify";
  678. b.CONTENT_JUSTIFY = "contentJustify";
  679. return b
  680. } ();
  681. b.HorizontalAlign = c;
  682. c.prototype.__class__ = "egret.HorizontalAlign"
  683. })(egret || (egret = {})); (function(b) {
  684. var c = function() {
  685. function b() {}
  686. b.TOP = "top";
  687. b.BOTTOM = "bottom";
  688. b.MIDDLE = "middle";
  689. b.JUSTIFY = "justify";
  690. b.CONTENT_JUSTIFY = "contentJustify";
  691. return b
  692. } ();
  693. b.VerticalAlign = c;
  694. c.prototype.__class__ = "egret.VerticalAlign"
  695. })(egret || (egret = {}));
  696. __extends = this.__extends ||
  697. function(b, c) {
  698. function d() {
  699. this.constructor = b
  700. }
  701. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  702. d.prototype = c.prototype;
  703. b.prototype = new d
  704. }; (function(b) {
  705. var c = function(d) {
  706. function a(e, a) {
  707. "undefined" === typeof a && (a = 0);
  708. d.call(this);
  709. this._currentCount = 0;
  710. this.delay = e;
  711. this.repeatCount = a
  712. }
  713. __extends(a, d);
  714. a.prototype.currentCount = function() {
  715. return this._currentCount
  716. };
  717. Object.defineProperty(a.prototype, "running", {
  718. get: function() {
  719. return this._running
  720. },
  721. enumerable: !0,
  722. configurable: !0
  723. });
  724. a.prototype.reset = function() {
  725. this.stop();
  726. this._currentCount = 0
  727. };
  728. a.prototype.start = function() {
  729. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount = 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  730. };
  731. a.prototype.stop = function() {
  732. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  733. };
  734. a.prototype.onEnterFrame = function(e) {
  735. e = b.getTimer();
  736. 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)))
  737. };
  738. return a
  739. } (b.EventDispatcher);
  740. b.Timer = c;
  741. c.prototype.__class__ = "egret.Timer"
  742. })(egret || (egret = {})); (function(b) {
  743. b.getQualifiedClassName = function(b) {
  744. b = b.prototype ? b.prototype: b.__proto__;
  745. if (b.hasOwnProperty("__class__")) return b.__class__;
  746. var d = b.constructor.toString(),
  747. a = d.indexOf("("),
  748. d = d.substring(9, a);
  749. return b.__class__ = d
  750. }
  751. })(egret || (egret = {})); (function(b) {
  752. var c = {};
  753. b.getDefinitionByName = function(b) {
  754. if (!b) return null;
  755. var a = c[b];
  756. if (a) return a;
  757. for (var e = b.split("."), g = e.length, a = __global, f = 0; f < g; f++) if (a = a[e[f]], !a) return null;
  758. return c[b] = a
  759. }
  760. })(egret || (egret = {}));
  761. var __global = __global || this; (function(b) {
  762. function c(e) {
  763. for (var a in d) {
  764. var f = d[a];
  765. f.delay -= e;
  766. 0 >= f.delay && (f.listener.apply(f.thisObject, f.params), delete d[a])
  767. }
  768. }
  769. var d = {},
  770. a = 0;
  771. b.setTimeout = function(e, g, f) {
  772. for (var m = [], l = 0; l < arguments.length - 3; l++) m[l] = arguments[l + 3];
  773. m = {
  774. listener: e,
  775. thisObject: g,
  776. delay: f,
  777. params: m
  778. };
  779. 0 == a && b.Ticker.getInstance().register(c, null);
  780. a++;
  781. d[a] = m;
  782. return a
  783. };
  784. b.clearTimeout = function(e) {
  785. delete d[e]
  786. }
  787. })(egret || (egret = {})); (function(b) {
  788. b.hasDefinition = function(c) {
  789. return b.getDefinitionByName(c) ? !0 : !1
  790. }
  791. })(egret || (egret = {})); (function(b) {
  792. b.toColorString = function(b) {
  793. if (isNaN(b) || 0 > b) b = 0;
  794. 16777215 < b && (b = 16777215);
  795. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  796. return "#" + b
  797. }
  798. })(egret || (egret = {}));
  799. __extends = this.__extends ||
  800. function(b, c) {
  801. function d() {
  802. this.constructor = b
  803. }
  804. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  805. d.prototype = c.prototype;
  806. b.prototype = new d
  807. }; (function(b) {
  808. var c = function(d) {
  809. function a(e, a, b, c, l, h) {
  810. "undefined" === typeof e && (e = 1);
  811. "undefined" === typeof a && (a = 0);
  812. "undefined" === typeof b && (b = 0);
  813. "undefined" === typeof c && (c = 1);
  814. "undefined" === typeof l && (l = 0);
  815. "undefined" === typeof h && (h = 0);
  816. d.call(this);
  817. this.a = e;
  818. this.b = a;
  819. this.c = b;
  820. this.d = c;
  821. this.tx = l;
  822. this.ty = h
  823. }
  824. __extends(a, d);
  825. a.prototype.prepend = function(e, a, b, d, c, h) {
  826. var k = this.tx;
  827. if (1 != e || 0 != a || 0 != b || 1 != d) {
  828. var p = this.a,
  829. n = this.c;
  830. this.a = p * e + this.b * b;
  831. this.b = p * a + this.b * d;
  832. this.c = n * e + this.d * b;
  833. this.d = n * a + this.d * d
  834. }
  835. this.tx = k * e + this.ty * b + c;
  836. this.ty = k * a + this.ty * d + h;
  837. return this
  838. };
  839. a.prototype.append = function(e, a, b, d, c, h) {
  840. var k = this.a,
  841. p = this.b,
  842. n = this.c,
  843. q = this.d;
  844. this.a = e * k + a * n;
  845. this.b = e * p + a * q;
  846. this.c = b * k + d * n;
  847. this.d = b * p + d * q;
  848. this.tx = c * k + h * n + this.tx;
  849. this.ty = c * p + h * q + this.ty;
  850. return this
  851. };
  852. a.prototype.prependMatrix = function(e) {
  853. this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty);
  854. return this
  855. };
  856. a.prototype.appendMatrix = function(e) {
  857. this.append(e.a, e.b, e.c, e.d, e.tx, e.ty);
  858. return this
  859. };
  860. a.prototype.prependTransform = function(e, g, b, d, c, h, k, p, n) {
  861. if (c % 360) {
  862. var q = c * a.DEG_TO_RAD;
  863. c = Math.cos(q);
  864. q = Math.sin(q)
  865. } else c = 1,
  866. q = 0;
  867. if (p || n) this.tx -= p,
  868. this.ty -= n;
  869. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(c * b, q * b, -q * d, c * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), e, g)) : this.prepend(c * b, q * b, -q * d, c * d, e, g);
  870. return this
  871. };
  872. a.prototype.appendTransform = function(e, g, b, d, c, h, k, p, n) {
  873. if (c % 360) {
  874. var q = c * a.DEG_TO_RAD;
  875. c = Math.cos(q);
  876. q = Math.sin(q)
  877. } else c = 1,
  878. q = 0;
  879. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), e, g), this.append(c * b, q * b, -q * d, c * d, 0, 0)) : this.append(c * b, q * b, -q * d, c * d, e, g);
  880. if (p || n) this.tx -= p * this.a + n * this.c,
  881. this.ty -= p * this.b + n * this.d;
  882. return this
  883. };
  884. a.prototype.rotate = function(e) {
  885. var a = Math.cos(e);
  886. e = Math.sin(e);
  887. var b = this.a,
  888. d = this.c,
  889. c = this.tx;
  890. this.a = b * a - this.b * e;
  891. this.b = b * e + this.b * a;
  892. this.c = d * a - this.d * e;
  893. this.d = d * e + this.d * a;
  894. this.tx = c * a - this.ty * e;
  895. this.ty = c * e + this.ty * a;
  896. return this
  897. };
  898. a.prototype.skew = function(e, g) {
  899. e *= a.DEG_TO_RAD;
  900. g *= a.DEG_TO_RAD;
  901. this.append(Math.cos(g), Math.sin(g), -Math.sin(e), Math.cos(e), 0, 0);
  902. return this
  903. };
  904. a.prototype.scale = function(e, a) {
  905. this.a *= e;
  906. this.d *= a;
  907. this.c *= e;
  908. this.b *= a;
  909. this.tx *= e;
  910. this.ty *= a;
  911. return this
  912. };
  913. a.prototype.translate = function(e, a) {
  914. this.tx += e;
  915. this.ty += a;
  916. return this
  917. };
  918. a.prototype.identity = function() {
  919. this.a = this.d = 1;
  920. this.b = this.c = this.tx = this.ty = 0;
  921. return this
  922. };
  923. a.prototype.invert = function() {
  924. var e = this.a,
  925. a = this.b,
  926. b = this.c,
  927. d = this.d,
  928. c = this.tx,
  929. h = e * d - a * b;
  930. this.a = d / h;
  931. this.b = -a / h;
  932. this.c = -b / h;
  933. this.d = e / h;
  934. this.tx = (b * this.ty - d * c) / h;
  935. this.ty = -(e * this.ty - a * c) / h;
  936. return this
  937. };
  938. a.transformCoords = function(e, a, f) {
  939. var d = b.Point.identity;
  940. d.x = e.a * a + e.c * f + e.tx;
  941. d.y = e.d * f + e.b * a + e.ty;
  942. return d
  943. };
  944. a.prototype.toArray = function(e) {
  945. this.array || (this.array = new Float32Array(9));
  946. 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);
  947. this.array[8] = 1;
  948. return this.array
  949. };
  950. a.identity = new a;
  951. a.DEG_TO_RAD = Math.PI / 180;
  952. return a
  953. } (b.HashObject);
  954. b.Matrix = c;
  955. c.prototype.__class__ = "egret.Matrix"
  956. })(egret || (egret = {}));
  957. __extends = this.__extends ||
  958. function(b, c) {
  959. function d() {
  960. this.constructor = b
  961. }
  962. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  963. d.prototype = c.prototype;
  964. b.prototype = new d
  965. }; (function(b) {
  966. var c = function(b) {
  967. function a(e, a) {
  968. "undefined" === typeof e && (e = 0);
  969. "undefined" === typeof a && (a = 0);
  970. b.call(this);
  971. this.x = e;
  972. this.y = a
  973. }
  974. __extends(a, b);
  975. a.prototype.clone = function() {
  976. return new a(this.x, this.y)
  977. };
  978. a.prototype.equals = function(e) {
  979. return this.x == e.x && this.y == e.y
  980. };
  981. a.distance = function(e, a) {
  982. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  983. };
  984. a.identity = new a(0, 0);
  985. return a
  986. } (b.HashObject);
  987. b.Point = c;
  988. c.prototype.__class__ = "egret.Point"
  989. })(egret || (egret = {}));
  990. __extends = this.__extends ||
  991. function(b, c) {
  992. function d() {
  993. this.constructor = b
  994. }
  995. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  996. d.prototype = c.prototype;
  997. b.prototype = new d
  998. }; (function(b) {
  999. var c = function(b) {
  1000. function a(e, a, f, c) {
  1001. "undefined" === typeof e && (e = 0);
  1002. "undefined" === typeof a && (a = 0);
  1003. "undefined" === typeof f && (f = 0);
  1004. "undefined" === typeof c && (c = 0);
  1005. b.call(this);
  1006. this.x = e;
  1007. this.y = a;
  1008. this.width = f;
  1009. this.height = c
  1010. }
  1011. __extends(a, b);
  1012. Object.defineProperty(a.prototype, "right", {
  1013. get: function() {
  1014. return this.x + this.width
  1015. },
  1016. set: function(e) {
  1017. this.width = e - this.x
  1018. },
  1019. enumerable: !0,
  1020. configurable: !0
  1021. });
  1022. Object.defineProperty(a.prototype, "bottom", {
  1023. get: function() {
  1024. return this.y + this.height
  1025. },
  1026. set: function(e) {
  1027. this.height = e - this.y
  1028. },
  1029. enumerable: !0,
  1030. configurable: !0
  1031. });
  1032. a.prototype.initialize = function(e, a, b, d) {
  1033. this.x = e;
  1034. this.y = a;
  1035. this.width = b;
  1036. this.height = d;
  1037. return this
  1038. };
  1039. a.prototype.contains = function(e, a) {
  1040. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1041. };
  1042. a.prototype.intersects = function(e) {
  1043. return this.contains(e.x, e.y) || this.contains(e.x, e.bottom) || this.contains(e.right, e.y) || this.contains(e.right, e.bottom) ? !0 : !1
  1044. };
  1045. a.prototype.clone = function() {
  1046. return new a(this.x, this.y, this.width, this.height)
  1047. };
  1048. a.prototype.containsPoint = function(e) {
  1049. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1050. };
  1051. a.identity = new a(0, 0, 0, 0);
  1052. return a
  1053. } (b.HashObject);
  1054. b.Rectangle = c;
  1055. c.prototype.__class__ = "egret.Rectangle"
  1056. })(egret || (egret = {})); (function(b) {
  1057. var c = function() {
  1058. function d() {}
  1059. d.fatal = function(a, e) {
  1060. "undefined" === typeof e && (e = null);
  1061. b.Logger.traceToConsole("Fatal", a, e);
  1062. throw Error(b.Logger.getTraceCode("Fatal", a, e));
  1063. };
  1064. d.info = function(a, e) {
  1065. "undefined" === typeof e && (e = null);
  1066. b.Logger.traceToConsole("Info", a, e)
  1067. };
  1068. d.warning = function(a, e) {
  1069. "undefined" === typeof e && (e = null);
  1070. b.Logger.traceToConsole("Warning", a, e)
  1071. };
  1072. d.traceToConsole = function(a, e, g) {
  1073. console.log(b.Logger.getTraceCode(a, e, g))
  1074. };
  1075. d.getTraceCode = function(a, e, g) {
  1076. return "[" + a + "]" + e + ":" + (null == g ? "": g)
  1077. };
  1078. return d
  1079. } ();
  1080. b.Logger = c;
  1081. c.prototype.__class__ = "egret.Logger"
  1082. })(egret || (egret = {}));
  1083. __extends = this.__extends ||
  1084. function(b, c) {
  1085. function d() {
  1086. this.constructor = b
  1087. }
  1088. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1089. d.prototype = c.prototype;
  1090. b.prototype = new d
  1091. }; (function(b) {
  1092. var c = function(d) {
  1093. function a() {
  1094. d.call(this);
  1095. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1096. this._xmlDict = {};
  1097. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1098. }
  1099. __extends(a, d);
  1100. a.getInstance = function() {
  1101. a._instance || (a._instance = new a);
  1102. return a._instance
  1103. };
  1104. a.prototype.parserXML = function(e) {
  1105. for (var a = 0;
  1106. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1107. 0 != a && (e = e.substring(a, e.length));
  1108. this._isSupportDOMParser ? a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1109. null == a && b.Logger.info("xml not found!");
  1110. return a
  1111. };
  1112. a._instance = null;
  1113. return a
  1114. } (b.HashObject);
  1115. b.SAXParser = c;
  1116. c.prototype.__class__ = "egret.SAXParser"
  1117. })(egret || (egret = {}));
  1118. __extends = this.__extends ||
  1119. function(b, c) {
  1120. function d() {
  1121. this.constructor = b
  1122. }
  1123. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1124. d.prototype = c.prototype;
  1125. b.prototype = new d
  1126. }; (function(b) {
  1127. var c = function(e) {
  1128. function g() {
  1129. e.call(this);
  1130. this._designHeight = this._designWidth = 0;
  1131. this._scaleY = this._scaleX = 1;
  1132. var a = document.getElementById(g.canvas_name),
  1133. b = a.height;
  1134. this._designWidth = a.width;
  1135. this._designHeight = b
  1136. }
  1137. __extends(g, e);
  1138. g.getInstance = function() {
  1139. null == g.instance && (a.initialize(), g.instance = new g);
  1140. return g.instance
  1141. };
  1142. g.prototype.setDesignSize = function(e, a, g) {
  1143. this._designWidth = e;
  1144. this._designHeight = a;
  1145. g && (b.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"), this._setResolutionPolicy(g))
  1146. };
  1147. g.prototype._setResolutionPolicy = function(e) {
  1148. this._resolutionPolicy = e;
  1149. e.init(this);
  1150. e._apply(this, this._designWidth, this._designHeight)
  1151. };
  1152. g.prototype.getScaleX = function() {
  1153. return this._scaleX
  1154. };
  1155. g.prototype.getScaleY = function() {
  1156. return this._scaleY
  1157. };
  1158. g.canvas_name = "gameCanvas";
  1159. g.canvas_div_name = "gameDiv";
  1160. return g
  1161. } (b.HashObject);
  1162. b.StageDelegate = c;
  1163. c.prototype.__class__ = "egret.StageDelegate";
  1164. var d = function() {
  1165. function e(a, g) {
  1166. this._containerStrategy = a;
  1167. this._contentStrategy = g
  1168. }
  1169. e.prototype.init = function(e) {
  1170. this._containerStrategy.init(e);
  1171. this._contentStrategy.init(e)
  1172. };
  1173. e.prototype._apply = function(e, a, g) {
  1174. this._containerStrategy._apply(e, a, g);
  1175. this._contentStrategy._apply(e, a, g)
  1176. };
  1177. return e
  1178. } ();
  1179. b.ResolutionPolicy = d;
  1180. d.prototype.__class__ = "egret.ResolutionPolicy";
  1181. var a = function() {
  1182. function a() {}
  1183. a.initialize = function() {
  1184. a.EQUAL_TO_FRAME = new e
  1185. };
  1186. a.prototype.init = function(e) {};
  1187. a.prototype._apply = function(e, a, g) {};
  1188. a.prototype._setupContainer = function() {
  1189. var e = document.body,
  1190. a;
  1191. 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")
  1192. };
  1193. return a
  1194. } ();
  1195. b.ContainerStrategy = a;
  1196. a.prototype.__class__ = "egret.ContainerStrategy";
  1197. var e = function(e) {
  1198. function a() {
  1199. e.apply(this, arguments)
  1200. }
  1201. __extends(a, e);
  1202. a.prototype._apply = function(e) {
  1203. this._setupContainer()
  1204. };
  1205. return a
  1206. } (a);
  1207. b.EqualToFrame = e;
  1208. e.prototype.__class__ = "egret.EqualToFrame";
  1209. d = function() {
  1210. function e() {}
  1211. e.prototype.init = function(e) {};
  1212. e.prototype._apply = function(e, a, g) {};
  1213. return e
  1214. } ();
  1215. b.ContentStrategy = d;
  1216. d.prototype.__class__ = "egret.ContentStrategy";
  1217. var g = function(e) {
  1218. function a(g) {
  1219. "undefined" === typeof g && (g = 0);
  1220. e.call(this);
  1221. this.minWidth = g
  1222. }
  1223. __extends(a, e);
  1224. a.prototype._apply = function(e, a, g) {
  1225. a = document.getElementById(c.canvas_name);
  1226. var b = document.getElementById(c.canvas_div_name),
  1227. f = document.documentElement.clientWidth,
  1228. d = document.documentElement.clientHeight,
  1229. m = d / g,
  1230. r = f / m,
  1231. s = 1;
  1232. 0 != this.minWidth && (s = Math.min(1, r / this.minWidth));
  1233. a.width = r / s;
  1234. a.height = g;
  1235. a.style.width = f + "px";
  1236. a.style.height = d * s + "px";
  1237. b.style.width = f + "px";
  1238. b.style.height = d * s + "px";
  1239. e._scaleX = m * s;
  1240. e._scaleY = m * s
  1241. };
  1242. return a
  1243. } (d);
  1244. b.FixedHeight = g;
  1245. g.prototype.__class__ = "egret.FixedHeight";
  1246. g = function(e) {
  1247. function a(g) {
  1248. "undefined" === typeof g && (g = 0);
  1249. e.call(this);
  1250. this.minHeight = g
  1251. }
  1252. __extends(a, e);
  1253. a.prototype._apply = function(e, a, g) {
  1254. g = document.getElementById(c.canvas_name);
  1255. var b = document.getElementById(c.canvas_div_name),
  1256. f = document.documentElement.clientWidth,
  1257. d = document.documentElement.clientHeight,
  1258. m = f / a,
  1259. r = d / m,
  1260. s = 1;
  1261. 0 != this.minHeight && (s = Math.min(1, r / this.minHeight));
  1262. g.width = a;
  1263. g.height = r / s;
  1264. g.style.width = f * s + "px";
  1265. g.style.height = d + "px";
  1266. b.style.width = f * s + "px";
  1267. b.style.height = d + "px";
  1268. e._scaleX = m * s;
  1269. e._scaleY = m * s
  1270. };
  1271. return a
  1272. } (d);
  1273. b.FixedWidth = g;
  1274. g.prototype.__class__ = "egret.FixedWidth";
  1275. g = function(e) {
  1276. function a(g, b) {
  1277. e.call(this);
  1278. this.width = g;
  1279. this.height = b
  1280. }
  1281. __extends(a, e);
  1282. a.prototype._apply = function(e, a, g) {
  1283. g = document.getElementById(c.canvas_name);
  1284. var b = document.getElementById(c.canvas_div_name),
  1285. f = this.width,
  1286. d = this.height,
  1287. m = f / a;
  1288. g.width = a;
  1289. g.height = d / m;
  1290. g.style.width = f + "px";
  1291. g.style.height = d + "px";
  1292. b.style.width = f + "px";
  1293. b.style.height = d + "px";
  1294. e._scaleX = m;
  1295. e._scaleY = m
  1296. };
  1297. return a
  1298. } (d);
  1299. b.FixedSize = g;
  1300. g.prototype.__class__ = "egret.FixedSize";
  1301. g = function(e) {
  1302. function a() {
  1303. e.call(this)
  1304. }
  1305. __extends(a, e);
  1306. a.prototype._apply = function(e, a, g) {
  1307. a = document.getElementById(c.canvas_name);
  1308. a.style.width = a.width + "px";
  1309. a.style.height = a.height + "px";
  1310. e._scaleX = 1;
  1311. e._scaleY = 1
  1312. };
  1313. return a
  1314. } (d);
  1315. b.NoScale = g;
  1316. g.prototype.__class__ = "egret.NoScale";
  1317. d = function(e) {
  1318. function a() {
  1319. e.call(this)
  1320. }
  1321. __extends(a, e);
  1322. a.prototype._apply = function(e, a, g) {
  1323. var b = document.getElementById(c.canvas_name),
  1324. f = document.getElementById(c.canvas_div_name),
  1325. d = document.documentElement.clientWidth,
  1326. m = document.documentElement.clientHeight,
  1327. r = d / a < m / g ? d / a: m / g,
  1328. d = a * r,
  1329. m = g * r;
  1330. b.width = a;
  1331. b.height = g / 1;
  1332. b.style.width = 1 * d + "px";
  1333. b.style.height = m + "px";
  1334. b.style.top = Math.floor((document.documentElement.clientHeight - m) / 2) + "px";
  1335. f.style.width = 1 * d + "px";
  1336. f.style.height = m + "px";
  1337. e._scaleX = 1 * r;
  1338. e._scaleY = 1 * r
  1339. };
  1340. return a
  1341. } (d);
  1342. b.ShowAll = d;
  1343. d.prototype.__class__ = "egret.ShowAll"
  1344. })(egret || (egret = {}));
  1345. __extends = this.__extends ||
  1346. function(b, c) {
  1347. function d() {
  1348. this.constructor = b
  1349. }
  1350. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1351. d.prototype = c.prototype;
  1352. b.prototype = new d
  1353. }; (function(b) {
  1354. var c = function(d) {
  1355. function a() {
  1356. d.call(this);
  1357. this._originalData = {};
  1358. this._drawAreaList = []
  1359. }
  1360. __extends(a, d);
  1361. a.getInstance = function() {
  1362. null == a.instance && (a.instance = new a);
  1363. return a.instance
  1364. };
  1365. a.prototype.addDrawArea = function(e) {
  1366. this._drawAreaList.push(e)
  1367. };
  1368. a.prototype.clearDrawArea = function() {
  1369. this._drawAreaList = []
  1370. };
  1371. a.prototype.drawImage = function(e, a, f, d, c, h, k, p, n, q) {
  1372. k = k || 0;
  1373. p = p || 0;
  1374. var t = a._texture_to_render;
  1375. if (null != t && 0 != h && 0 != c && 0 != n && 0 != q) if (a._worldBounds) {
  1376. var r = this._originalData;
  1377. r.sourceX = f;
  1378. r.sourceY = d;
  1379. r.sourceWidth = c;
  1380. r.sourceHeight = h;
  1381. r.destX = k;
  1382. r.destY = p;
  1383. r.destWidth = n;
  1384. r.destHeight = q;
  1385. for (var s = this.getDrawAreaList(), u = 0; u < s.length; u++) {
  1386. var v = s[u];
  1387. if (!this.ignoreRender(a, v, r.destX, r.destY)) {
  1388. if (0 != this._drawAreaList.length) if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1389. if (a._worldBounds.x + r.destX < v.x || a._worldBounds.y + r.destY < v.y || a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width || a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height) {
  1390. b.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1391. break
  1392. }
  1393. } else {
  1394. var x = a._worldTransform.a,
  1395. y = a._worldTransform.d,
  1396. w;
  1397. a._worldBounds.x + r.destX < v.x && (w = (v.x - a._worldBounds.x) / x - r.destX, f += w / (n / c), c -= w / (n / c), n -= w, k += w);
  1398. a._worldBounds.y + r.destY < v.y && (w = (v.y - a._worldBounds.y) / y - r.destY, d += w / (q / h), h -= w / (q / h), q -= w, p += w);
  1399. a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width && (w = (a._worldBounds.x + a._worldBounds.width - v.x - v.width) / x + r.destX, c -= w / (n / c), n -= w);
  1400. a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height && (w = (a._worldBounds.y + a._worldBounds.height - v.y - v.height) / y + r.destY, h -= w / (q / h), q -= w)
  1401. }
  1402. e.drawImage(t, f, d, c, h, k, p, n, q)
  1403. }
  1404. }
  1405. } else e.drawImage(t, f, d, c, h, k, p, n, q)
  1406. };
  1407. a.prototype.ignoreRender = function(e, a, b, d) {
  1408. var c = e._worldBounds;
  1409. b *= e._worldTransform.a;
  1410. d *= e._worldTransform.d;
  1411. return c.x + c.width + b <= a.x || c.x + b >= a.x + a.width || c.y + c.height + d <= a.y || c.y + d >= a.y + a.height ? !0 : !1
  1412. };
  1413. a.prototype.getDrawAreaList = function() {
  1414. var e;
  1415. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)]), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1416. return e
  1417. };
  1418. return a
  1419. } (b.HashObject);
  1420. b.RenderFilter = c;
  1421. c.prototype.__class__ = "egret.RenderFilter"
  1422. })(egret || (egret = {})); (function(b) {
  1423. var c = function() {
  1424. function d() {}
  1425. d.mapClass = function(a, e, g) {
  1426. "undefined" === typeof g && (g = "");
  1427. a = this.getKey(a) + "#" + g;
  1428. this.mapClassDic[a] = e
  1429. };
  1430. d.getKey = function(a) {
  1431. return "string" == typeof a ? a: b.getQualifiedClassName(a)
  1432. };
  1433. d.mapValue = function(a, e, g) {
  1434. "undefined" === typeof g && (g = "");
  1435. a = this.getKey(a) + "#" + g;
  1436. this.mapValueDic[a] = e
  1437. };
  1438. d.hasMapRule = function(a, e) {
  1439. "undefined" === typeof e && (e = "");
  1440. var g = this.getKey(a) + "#" + e;
  1441. return this.mapValueDic[g] || this.mapClassDic[g] ? !0 : !1
  1442. };
  1443. d.getInstance = function(a, e) {
  1444. "undefined" === typeof e && (e = "");
  1445. var g = this.getKey(a) + "#" + e;
  1446. if (this.mapValueDic[g]) return this.mapValueDic[g];
  1447. var b = this.mapClassDic[g];
  1448. if (b) return b = new b,
  1449. this.mapValueDic[g] = b,
  1450. delete this.mapClassDic[g],
  1451. b;
  1452. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + g + "\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");
  1453. };
  1454. d.mapClassDic = {};
  1455. d.mapValueDic = {};
  1456. return d
  1457. } ();
  1458. b.Injector = c;
  1459. c.prototype.__class__ = "egret.Injector"
  1460. })(egret || (egret = {})); (function(b) {
  1461. var c = function() {
  1462. function b() {}
  1463. b.NORMAL = "normal";
  1464. b.ADD = "add";
  1465. b.LAYER = "layer";
  1466. return b
  1467. } ();
  1468. b.BlendMode = c;
  1469. c.prototype.__class__ = "egret.BlendMode"
  1470. })(egret || (egret = {}));
  1471. __extends = this.__extends ||
  1472. function(b, c) {
  1473. function d() {
  1474. this.constructor = b
  1475. }
  1476. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1477. d.prototype = c.prototype;
  1478. b.prototype = new d
  1479. }; (function(b) {
  1480. var c = function(d) {
  1481. function a() {
  1482. d.call(this);
  1483. this._sizeDirty = this._normalDirty = !0;
  1484. this._parent = null;
  1485. this._cacheAsBitmap = !1;
  1486. this._y = this._x = 0;
  1487. this._scaleY = this._scaleX = 1;
  1488. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1489. this._visible = !0;
  1490. this._rotation = 0;
  1491. this._alpha = 1;
  1492. this._skewY = this._skewX = 0;
  1493. this._hasHeightSet = this._hasWidthSet = !1;
  1494. this.worldAlpha = 1;
  1495. this._rectH = this._rectW = 0;
  1496. this._stage = null;
  1497. this._worldTransform = new b.Matrix;
  1498. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1499. }
  1500. __extends(a, d);
  1501. a.prototype._setDirty = function() {
  1502. this._normalDirty = !0
  1503. };
  1504. a.prototype.getDirty = function() {
  1505. return this._normalDirty || this._sizeDirty
  1506. };
  1507. a.prototype._setParentSizeDirty = function() { ! this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  1508. };
  1509. a.prototype._setSizeDirty = function() {
  1510. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  1511. };
  1512. a.prototype._clearDirty = function() {
  1513. this._normalDirty = !1
  1514. };
  1515. a.prototype._clearSizeDirty = function() {
  1516. this._sizeDirty = !1
  1517. };
  1518. Object.defineProperty(a.prototype, "parent", {
  1519. get: function() {
  1520. return this._parent
  1521. },
  1522. enumerable: !0,
  1523. configurable: !0
  1524. });
  1525. a.prototype._parentChanged = function(e) {
  1526. this._parent = e
  1527. };
  1528. Object.defineProperty(a.prototype, "x", {
  1529. get: function() {
  1530. return this._x
  1531. },
  1532. set: function(e) {
  1533. b.NumberUtils.isNumber(e) && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1534. },
  1535. enumerable: !0,
  1536. configurable: !0
  1537. });
  1538. Object.defineProperty(a.prototype, "y", {
  1539. get: function() {
  1540. return this._y
  1541. },
  1542. set: function(e) {
  1543. b.NumberUtils.isNumber(e) && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1544. },
  1545. enumerable: !0,
  1546. configurable: !0
  1547. });
  1548. Object.defineProperty(a.prototype, "scaleX", {
  1549. get: function() {
  1550. return this._scaleX
  1551. },
  1552. set: function(e) {
  1553. b.NumberUtils.isNumber(e) && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1554. },
  1555. enumerable: !0,
  1556. configurable: !0
  1557. });
  1558. Object.defineProperty(a.prototype, "scaleY", {
  1559. get: function() {
  1560. return this._scaleY
  1561. },
  1562. set: function(e) {
  1563. b.NumberUtils.isNumber(e) && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1564. },
  1565. enumerable: !0,
  1566. configurable: !0
  1567. });
  1568. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1569. get: function() {
  1570. return this._anchorOffsetX
  1571. },
  1572. set: function(e) {
  1573. b.NumberUtils.isNumber(e) && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1574. },
  1575. enumerable: !0,
  1576. configurable: !0
  1577. });
  1578. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1579. get: function() {
  1580. return this._anchorOffsetY
  1581. },
  1582. set: function(e) {
  1583. b.NumberUtils.isNumber(e) && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1584. },
  1585. enumerable: !0,
  1586. configurable: !0
  1587. });
  1588. Object.defineProperty(a.prototype, "anchorX", {
  1589. get: function() {
  1590. return this._anchorX
  1591. },
  1592. set: function(e) {
  1593. b.NumberUtils.isNumber(e) && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1594. },
  1595. enumerable: !0,
  1596. configurable: !0
  1597. });
  1598. Object.defineProperty(a.prototype, "anchorY", {
  1599. get: function() {
  1600. return this._anchorY
  1601. },
  1602. set: function(e) {
  1603. b.NumberUtils.isNumber(e) && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1604. },
  1605. enumerable: !0,
  1606. configurable: !0
  1607. });
  1608. Object.defineProperty(a.prototype, "visible", {
  1609. get: function() {
  1610. return this._visible
  1611. },
  1612. set: function(e) {
  1613. this._visible = e;
  1614. this._setSizeDirty()
  1615. },
  1616. enumerable: !0,
  1617. configurable: !0
  1618. });
  1619. Object.defineProperty(a.prototype, "rotation", {
  1620. get: function() {
  1621. return this._rotation
  1622. },
  1623. set: function(e) {
  1624. b.NumberUtils.isNumber(e) && (this._rotation = e, this._setSizeDirty())
  1625. },
  1626. enumerable: !0,
  1627. configurable: !0
  1628. });
  1629. Object.defineProperty(a.prototype, "alpha", {
  1630. get: function() {
  1631. return this._alpha
  1632. },
  1633. set: function(e) {
  1634. b.NumberUtils.isNumber(e) && (this._alpha = e, this._setDirty())
  1635. },
  1636. enumerable: !0,
  1637. configurable: !0
  1638. });
  1639. Object.defineProperty(a.prototype, "skewX", {
  1640. get: function() {
  1641. return this._skewX
  1642. },
  1643. set: function(e) {
  1644. b.NumberUtils.isNumber(e) && (this._skewX = e, this._setSizeDirty())
  1645. },
  1646. enumerable: !0,
  1647. configurable: !0
  1648. });
  1649. Object.defineProperty(a.prototype, "skewY", {
  1650. get: function() {
  1651. return this._skewY
  1652. },
  1653. set: function(e) {
  1654. b.NumberUtils.isNumber(e) && (this._skewY = e, this._setSizeDirty())
  1655. },
  1656. enumerable: !0,
  1657. configurable: !0
  1658. });
  1659. Object.defineProperty(a.prototype, "touchEnabled", {
  1660. get: function() {
  1661. return this._touchEnabled
  1662. },
  1663. set: function(e) {
  1664. this._touchEnabled = e
  1665. },
  1666. enumerable: !0,
  1667. configurable: !0
  1668. });
  1669. Object.defineProperty(a.prototype, "scrollRect", {
  1670. get: function() {
  1671. return this._scrollRect
  1672. },
  1673. set: function(e) {
  1674. this._scrollRect = e;
  1675. this._setSizeDirty()
  1676. },
  1677. enumerable: !0,
  1678. configurable: !0
  1679. });
  1680. Object.defineProperty(a.prototype, "measuredWidth", {
  1681. get: function() {
  1682. return this._measureBounds().width
  1683. },
  1684. enumerable: !0,
  1685. configurable: !0
  1686. });
  1687. Object.defineProperty(a.prototype, "measuredHeight", {
  1688. get: function() {
  1689. return this._measureBounds().height
  1690. },
  1691. enumerable: !0,
  1692. configurable: !0
  1693. });
  1694. Object.defineProperty(a.prototype, "explicitWidth", {
  1695. get: function() {
  1696. return this._explicitWidth
  1697. },
  1698. enumerable: !0,
  1699. configurable: !0
  1700. });
  1701. Object.defineProperty(a.prototype, "explicitHeight", {
  1702. get: function() {
  1703. return this._explicitHeight
  1704. },
  1705. enumerable: !0,
  1706. configurable: !0
  1707. });
  1708. Object.defineProperty(a.prototype, "width", {
  1709. get: function() {
  1710. return this._getSize(b.Rectangle.identity).width
  1711. },
  1712. set: function(e) {
  1713. this._setWidth(e)
  1714. },
  1715. enumerable: !0,
  1716. configurable: !0
  1717. });
  1718. Object.defineProperty(a.prototype, "height", {
  1719. get: function() {
  1720. return this._getSize(b.Rectangle.identity).height
  1721. },
  1722. set: function(e) {
  1723. this._setHeight(e)
  1724. },
  1725. enumerable: !0,
  1726. configurable: !0
  1727. });
  1728. a.prototype._setWidth = function(e) {
  1729. this._setSizeDirty();
  1730. this._explicitWidth = e;
  1731. this._hasWidthSet = b.NumberUtils.isNumber(e)
  1732. };
  1733. a.prototype._setHeight = function(e) {
  1734. this._setSizeDirty();
  1735. this._explicitHeight = e;
  1736. this._hasHeightSet = b.NumberUtils.isNumber(e)
  1737. };
  1738. a.prototype._draw = function(e) {
  1739. if (this.visible && !this.drawCacheTexture(e)) {
  1740. e.setAlpha(this.worldAlpha, this.blendMode);
  1741. e.setTransform(this._worldTransform);
  1742. var a = this.mask || this._scrollRect;
  1743. a && e.pushMask(a);
  1744. this._render(e);
  1745. a && e.popMask()
  1746. }
  1747. this.destroyCacheBounds()
  1748. };
  1749. a.prototype.drawCacheTexture = function(e) {
  1750. if (this._cacheAsBitmap) {
  1751. var a = this._texture_to_render,
  1752. f = a._offsetX,
  1753. d = a._offsetY,
  1754. c = a._textureWidth,
  1755. a = a._textureHeight;
  1756. this._updateTransform();
  1757. e.setAlpha(this.worldAlpha, this.blendMode);
  1758. e.setTransform(this._worldTransform);
  1759. var h = b.MainContext.instance.rendererContext.texture_scale_factor;
  1760. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, c * h, a * h, f, d, c, a);
  1761. return ! 0
  1762. }
  1763. return ! 1
  1764. };
  1765. a.prototype._updateTransform = function() {
  1766. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1767. var e = this._getOffsetPoint();
  1768. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, e.x, e.y);
  1769. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1770. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1771. };
  1772. a.prototype._render = function(e) {};
  1773. a.prototype.getBounds = function(e) {
  1774. var a = this._measureBounds(),
  1775. f = this._hasWidthSet ? this._explicitWidth: a.width,
  1776. d = this._hasHeightSet ? this._explicitHeight: a.height,
  1777. c = a.x,
  1778. a = a.y,
  1779. h,
  1780. k;
  1781. 0 != this._anchorX || 0 != this._anchorY ? (h = f * this._anchorX, k = d * this._anchorY) : (h = this._anchorOffsetX, k = this._anchorOffsetY);
  1782. this._cacheBounds.initialize(c - h, a - k, f, d);
  1783. f = this._cacheBounds;
  1784. e || (e = new b.Rectangle);
  1785. return e.initialize(f.x, f.y, f.width, f.height)
  1786. };
  1787. a.prototype.destroyCacheBounds = function() {
  1788. this._cacheBounds.x = 0;
  1789. this._cacheBounds.y = 0;
  1790. this._cacheBounds.width = 0;
  1791. this._cacheBounds.height = 0
  1792. };
  1793. a.prototype._getConcatenatedMatrix = function() {
  1794. for (var e = a.identityMatrixForGetConcatenated.identity(), g = this; null != g;) {
  1795. if (0 != g._anchorX || 0 != g._anchorY) {
  1796. var f = g._getSize(b.Rectangle.identity);
  1797. e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, f.width * g._anchorX, f.height * g._anchorY)
  1798. } else e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, g._anchorOffsetX, g._anchorOffsetY);
  1799. g = g._parent
  1800. }
  1801. return e
  1802. };
  1803. a.prototype.localToGlobal = function(e, a, f) {
  1804. "undefined" === typeof e && (e = 0);
  1805. "undefined" === typeof a && (a = 0);
  1806. var d = this._getConcatenatedMatrix();
  1807. d.append(1, 0, 0, 1, e, a);
  1808. f || (f = new b.Point);
  1809. f.x = d.tx;
  1810. f.y = d.ty;
  1811. return f
  1812. };
  1813. a.prototype.globalToLocal = function(e, a, f) {
  1814. "undefined" === typeof e && (e = 0);
  1815. "undefined" === typeof a && (a = 0);
  1816. var d = this._getConcatenatedMatrix();
  1817. d.invert();
  1818. d.append(1, 0, 0, 1, e, a);
  1819. f || (f = new b.Point);
  1820. f.x = d.tx;
  1821. f.y = d.ty;
  1822. return f
  1823. };
  1824. a.prototype.hitTest = function(e, a, f) {
  1825. "undefined" === typeof f && (f = !1);
  1826. if (!this.visible || !f && !this._touchEnabled) return null;
  1827. f = this._getSize(b.Rectangle.identity);
  1828. return 0 <= e && e < f.width && 0 <= a && a < f.height ? this.mask || this._scrollRect ? this._scrollRect && e < this._scrollRect.width && a < 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
  1829. };
  1830. a.prototype.hitTestPoint = function(e, a, f) {
  1831. e = this.globalToLocal(e, a);
  1832. return f ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), f = this._hitTestPointTexture, f.drawToTexture(this), 0 != f.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  1833. };
  1834. a.prototype._getMatrix = function() {
  1835. var e = b.Matrix.identity.identity(),
  1836. a = this._getOffsetPoint();
  1837. e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1838. return e
  1839. };
  1840. a.prototype._getSize = function(e) {
  1841. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(b.Rectangle.identity)
  1842. };
  1843. a.prototype._measureSize = function(e) {
  1844. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  1845. return e
  1846. };
  1847. a.prototype._measureBounds = function() {
  1848. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  1849. };
  1850. a.prototype._getOffsetPoint = function() {
  1851. var e = this._anchorOffsetX,
  1852. a = this._anchorOffsetY;
  1853. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity),
  1854. e = this._anchorX * a.width,
  1855. a = this._anchorY * a.height;
  1856. var f = b.Point.identity;
  1857. f.x = e;
  1858. f.y = a;
  1859. return f
  1860. };
  1861. a.prototype._onAddToStage = function() {
  1862. this._stage = b.MainContext.instance.stage;
  1863. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1864. };
  1865. a.prototype._onRemoveFromStage = function() {
  1866. this._stage = null;
  1867. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1868. };
  1869. Object.defineProperty(a.prototype, "stage", {
  1870. get: function() {
  1871. return this._stage
  1872. },
  1873. enumerable: !0,
  1874. configurable: !0
  1875. });
  1876. a.prototype.addEventListener = function(e, g, f, c, l) {
  1877. "undefined" === typeof c && (c = !1);
  1878. "undefined" === typeof l && (l = 0);
  1879. d.prototype.addEventListener.call(this, e, g, f, c, l); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, g, f, l)
  1880. };
  1881. a.prototype.removeEventListener = function(e, g, f, c) {
  1882. "undefined" === typeof c && (c = !1);
  1883. d.prototype.removeEventListener.call(this, e, g, f, c); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, g, f)
  1884. };
  1885. a.prototype.dispatchEvent = function(e) {
  1886. if (!e._bubbles) return d.prototype.dispatchEvent.call(this, e);
  1887. for (var a = [], b = this; b;) a.unshift(b),
  1888. b = b.parent;
  1889. for (var c = a.length,
  1890. b = c - 1,
  1891. c = c - 2; 0 <= c; c--) a.push(a[c]);
  1892. e._reset();
  1893. this._dispatchPropagationEvent(e, a, b);
  1894. return ! e.isDefaultPrevented()
  1895. };
  1896. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  1897. for (var d = a.length,
  1898. c = 0; c < d; c++) {
  1899. var h = a[c];
  1900. e._setCurrentTarget(h);
  1901. e._target = this;
  1902. e._eventPhase = c < b ? 1 : c == b ? 2 : 3;
  1903. h._notifyListener(e);
  1904. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  1905. }
  1906. };
  1907. a.prototype.willTrigger = function(e) {
  1908. for (var a = this; a;) {
  1909. if (a.hasEventListener(e)) return ! 0;
  1910. a = a._parent
  1911. }
  1912. return ! 1
  1913. };
  1914. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1915. get: function() {
  1916. return this._cacheAsBitmap
  1917. },
  1918. set: function(e) { (this._cacheAsBitmap = e) ? (this.renderTexture || (this.renderTexture = new b.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1919. },
  1920. enumerable: !0,
  1921. configurable: !0
  1922. });
  1923. a.getTransformBounds = function(e, a) {
  1924. var b, d, c = e.width,
  1925. h = e.height,
  1926. k = c * a.a,
  1927. c = c * a.b,
  1928. p = h * a.c,
  1929. h = h * a.d,
  1930. n = a.tx,
  1931. q = a.ty,
  1932. t = n,
  1933. r = n,
  1934. s = q,
  1935. u = q; (b = k + n) < t ? t = b: b > r && (r = b); (b = k + p + n) < t ? t = b: b > r && (r = b); (b = p + n) < t ? t = b: b > r && (r = b); (d = c + q) < s ? s = d: d > u && (u = d); (d = c + h + q) < s ? s = d: d > u && (u = d); (d = h + q) < s ? s = d: d > u && (u = d);
  1936. return e.initialize(t, s, r - t, u - s)
  1937. };
  1938. a.identityMatrixForGetConcatenated = new b.Matrix;
  1939. a._enterFrameCallBackList = [];
  1940. a._renderCallBackList = [];
  1941. return a
  1942. } (b.EventDispatcher);
  1943. b.DisplayObject = c;
  1944. c.prototype.__class__ = "egret.DisplayObject"
  1945. })(egret || (egret = {}));
  1946. __extends = this.__extends ||
  1947. function(b, c) {
  1948. function d() {
  1949. this.constructor = b
  1950. }
  1951. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1952. d.prototype = c.prototype;
  1953. b.prototype = new d
  1954. }; (function(b) {
  1955. var c = function(d) {
  1956. function a() {
  1957. d.call(this);
  1958. this._touchChildren = !0;
  1959. this._children = []
  1960. }
  1961. __extends(a, d);
  1962. Object.defineProperty(a.prototype, "touchChildren", {
  1963. get: function() {
  1964. return this._touchChildren
  1965. },
  1966. set: function(e) {
  1967. this._touchChildren = e
  1968. },
  1969. enumerable: !0,
  1970. configurable: !0
  1971. });
  1972. Object.defineProperty(a.prototype, "numChildren", {
  1973. get: function() {
  1974. return this._children.length
  1975. },
  1976. enumerable: !0,
  1977. configurable: !0
  1978. });
  1979. a.prototype.setChildIndex = function(e, a) {
  1980. this.doSetChildIndex(e, a)
  1981. };
  1982. a.prototype.doSetChildIndex = function(e, a) {
  1983. var f = this._children.indexOf(e);
  1984. 0 > f && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  1985. this._children.splice(f, 1);
  1986. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  1987. };
  1988. a.prototype.addChild = function(e) {
  1989. var a = this.numChildren;
  1990. e._parent == this && a--;
  1991. return this._doAddChild(e, a)
  1992. };
  1993. a.prototype.addChildAt = function(e, a) {
  1994. return this._doAddChild(e, a)
  1995. };
  1996. a.prototype._doAddChild = function(e, g, f) {
  1997. "undefined" === typeof f && (f = !0);
  1998. if (e == this) return e;
  1999. if (0 > g || g > this._children.length) return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2000. e;
  2001. var d = e.parent;
  2002. if (d == this) return this.doSetChildIndex(e, g),
  2003. e;
  2004. d && d.removeChild(e);
  2005. this._children.splice(g, 0, e);
  2006. e._parentChanged(this);
  2007. f && e.dispatchEventWith(b.Event.ADDED, !0);
  2008. if (this._stage) for (e._onAddToStage(), g = a.__EVENT__ADD_TO_STAGE_LIST; 0 < g.length;) g.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2009. e._setDirty();
  2010. this._setSizeDirty();
  2011. return e
  2012. };
  2013. a.prototype.removeChild = function(e) {
  2014. e = this._children.indexOf(e);
  2015. if (0 <= e) return this._doRemoveChild(e);
  2016. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2017. return null
  2018. };
  2019. a.prototype.removeChildAt = function(e) {
  2020. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2021. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2022. return null
  2023. };
  2024. a.prototype._doRemoveChild = function(e, g) {
  2025. "undefined" === typeof g && (g = !0);
  2026. var f = this._children,
  2027. d = f[e];
  2028. g && d.dispatchEventWith(b.Event.REMOVED, !0);
  2029. if (this._stage) {
  2030. d._onRemoveFromStage();
  2031. for (var c = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < c.length;) c.shift().dispatchEventWith(b.Event.REMOVED_FROM_STAGE)
  2032. }
  2033. d._parentChanged(null);
  2034. f.splice(e, 1);
  2035. this._setSizeDirty();
  2036. return d
  2037. };
  2038. a.prototype.getChildAt = function(e) {
  2039. if (0 <= e && e < this._children.length) return this._children[e];
  2040. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2041. return null
  2042. };
  2043. a.prototype.contains = function(e) {
  2044. for (; e;) {
  2045. if (e == this) return ! 0;
  2046. e = e._parent
  2047. }
  2048. return ! 1
  2049. };
  2050. a.prototype.swapChildrenAt = function(e, a) {
  2051. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2052. };
  2053. a.prototype.swapChildren = function(e, a) {
  2054. var f = this._children.indexOf(e),
  2055. d = this._children.indexOf(a); - 1 == f || -1 == d ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(f, d)
  2056. };
  2057. a.prototype._swapChildrenAt = function(e, a) {
  2058. if (e != a) {
  2059. var b = this._children,
  2060. d = b[e];
  2061. b[e] = b[a];
  2062. b[a] = d
  2063. }
  2064. };
  2065. a.prototype.getChildIndex = function(e) {
  2066. return this._children.indexOf(e)
  2067. };
  2068. a.prototype.removeChildren = function() {
  2069. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2070. };
  2071. a.prototype._updateTransform = function() {
  2072. if (this.visible) {
  2073. d.prototype._updateTransform.call(this);
  2074. for (var e = 0,
  2075. a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2076. }
  2077. };
  2078. a.prototype._render = function(e) {
  2079. for (var a = 0,
  2080. b = this._children.length; a < b; a++) this._children[a]._draw(e)
  2081. };
  2082. a.prototype._measureBounds = function() {
  2083. for (var e = 0,
  2084. a = 0,
  2085. f = 0,
  2086. d = 0,
  2087. c = this._children.length,
  2088. h = 0; h < c; h++) {
  2089. var k = this._children[h],
  2090. p;
  2091. if (k.visible && (p = b.DisplayObject.getTransformBounds(k._getSize(b.Rectangle.identity), k._getMatrix()))) {
  2092. var k = p.x,
  2093. n = p.y,
  2094. q = p.width + p.x,
  2095. t = p.height + p.y;
  2096. if (k < e || 0 == h) e = k;
  2097. if (q > a || 0 == h) a = q;
  2098. if (n < f || 0 == h) f = n;
  2099. if (t > d || 0 == h) d = t
  2100. }
  2101. }
  2102. return b.Rectangle.identity.initialize(e, f, a - e, d - f)
  2103. };
  2104. a.prototype.hitTest = function(e, a, f) {
  2105. "undefined" === typeof f && (f = !1);
  2106. var c;
  2107. if (!this.visible) return null;
  2108. if (this._scrollRect) {
  2109. if (0 > e || 0 > a || e > this._scrollRect.width || a > this._scrollRect.height) return null
  2110. } 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;
  2111. for (var l = this._children,
  2112. h = this._touchChildren,
  2113. k = l.length - 1; 0 <= k; k--) {
  2114. var p = l[k],
  2115. n = p,
  2116. q = n._getOffsetPoint(),
  2117. t = n._x,
  2118. r = n._y;
  2119. this._scrollRect && (t -= this._scrollRect.x, r -= this._scrollRect.y);
  2120. n = b.Matrix.identity.identity().prependTransform(t, r, n._scaleX, n._scaleY, n._rotation, 0, 0, q.x, q.y);
  2121. n.invert();
  2122. n = b.Matrix.transformCoords(n, e, a);
  2123. if (p = p.hitTest(n.x, n.y, !0)) {
  2124. if (p._touchEnabled && h) return p;
  2125. if (this._touchEnabled) return this;
  2126. null == c && (c = p)
  2127. }
  2128. }
  2129. return c ? c: d.prototype.hitTest.call(this, e, a, f)
  2130. };
  2131. a.prototype._onAddToStage = function() {
  2132. d.prototype._onAddToStage.call(this);
  2133. for (var e = this.numChildren,
  2134. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2135. };
  2136. a.prototype._onRemoveFromStage = function() {
  2137. d.prototype._onRemoveFromStage.call(this);
  2138. for (var e = this.numChildren,
  2139. a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
  2140. };
  2141. a.prototype.getChildByName = function(e) {
  2142. for (var a = this._children,
  2143. b = this.numChildren,
  2144. d, c = 0; c < b; c++) if (d = a[c], d.name == e) return d;
  2145. return null
  2146. };
  2147. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2148. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2149. return a
  2150. } (b.DisplayObject);
  2151. b.DisplayObjectContainer = c;
  2152. c.prototype.__class__ = "egret.DisplayObjectContainer"
  2153. })(egret || (egret = {}));
  2154. __extends = this.__extends ||
  2155. function(b, c) {
  2156. function d() {
  2157. this.constructor = b
  2158. }
  2159. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2160. d.prototype = c.prototype;
  2161. b.prototype = new d
  2162. }; (function(b) {
  2163. var c = function(d) {
  2164. function a(e, a) {
  2165. "undefined" === typeof e && (e = 480);
  2166. "undefined" === typeof a && (a = 800);
  2167. d.call(this);
  2168. this.touchEnabled = !0;
  2169. this._stage = this;
  2170. this._stageWidth = e;
  2171. this._stageHeight = a
  2172. }
  2173. __extends(a, d);
  2174. a.prototype.invalidate = function() {
  2175. a._invalidateRenderFlag = !0
  2176. };
  2177. Object.defineProperty(a.prototype, "scaleMode", {
  2178. get: function() {
  2179. return this._scaleMode
  2180. },
  2181. set: function(e) {
  2182. if (this._scaleMode != e) {
  2183. this._scaleMode = e;
  2184. var a = {};
  2185. a[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2186. a[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2187. a[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2188. e = a[e];
  2189. if (!e) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2190. a = new b.EqualToFrame;
  2191. e = new b.ResolutionPolicy(a, e);
  2192. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  2193. e = document.getElementById(b.StageDelegate.canvas_name);
  2194. this._stageWidth = e.width;
  2195. this._stageHeight = e.height;
  2196. this.dispatchEventWith(b.Event.RESIZE)
  2197. }
  2198. },
  2199. enumerable: !0,
  2200. configurable: !0
  2201. });
  2202. Object.defineProperty(a.prototype, "stageWidth", {
  2203. get: function() {
  2204. return this._stageWidth
  2205. },
  2206. enumerable: !0,
  2207. configurable: !0
  2208. });
  2209. Object.defineProperty(a.prototype, "stageHeight", {
  2210. get: function() {
  2211. return this._stageHeight
  2212. },
  2213. enumerable: !0,
  2214. configurable: !0
  2215. });
  2216. a.prototype.hitTest = function(a, g) {
  2217. if (!this.touchEnabled) return null;
  2218. var f;
  2219. if (!this.visible) return this;
  2220. for (var d = this._children,
  2221. c = d.length - 1; 0 <= c; c--) {
  2222. var h = f = d[c],
  2223. k = h._getOffsetPoint(),
  2224. h = b.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, k.x, k.y);
  2225. h.invert();
  2226. h = b.Matrix.transformCoords(h, a, g);
  2227. if ((f = f.hitTest(h.x, h.y, !0)) && f.touchEnabled) return f
  2228. }
  2229. return this
  2230. };
  2231. a.prototype.getBounds = function(a) {
  2232. a || (a = new b.Rectangle);
  2233. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2234. };
  2235. a.prototype._updateTransform = function() {
  2236. for (var a = 0,
  2237. g = this._children.length; a < g; a++) this._children[a]._updateTransform()
  2238. };
  2239. a._invalidateRenderFlag = !1;
  2240. return a
  2241. } (b.DisplayObjectContainer);
  2242. b.Stage = c;
  2243. c.prototype.__class__ = "egret.Stage"
  2244. })(egret || (egret = {})); (function(b) {
  2245. var c = function() {
  2246. function b() {}
  2247. b.NO_BORDER = "noBorder";
  2248. b.NO_SCALE = "noScale";
  2249. b.SHOW_ALL = "showAll";
  2250. return b
  2251. } ();
  2252. b.StageScaleMode = c;
  2253. c.prototype.__class__ = "egret.StageScaleMode"
  2254. })(egret || (egret = {})); (function(b) {
  2255. var c = function() {
  2256. function b() {}
  2257. b.REPEAT = "repeat";
  2258. b.SCALE = "scale";
  2259. return b
  2260. } ();
  2261. b.BitmapFillMode = c;
  2262. c.prototype.__class__ = "egret.BitmapFillMode"
  2263. })(egret || (egret = {}));
  2264. __extends = this.__extends ||
  2265. function(b, c) {
  2266. function d() {
  2267. this.constructor = b
  2268. }
  2269. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2270. d.prototype = c.prototype;
  2271. b.prototype = new d
  2272. }; (function(b) {
  2273. var c = function(d) {
  2274. function a(a) {
  2275. d.call(this);
  2276. this.debug = !1;
  2277. this.debugColor = 16711680;
  2278. this.fillMode = "scale";
  2279. a && (this._texture = a, this._setSizeDirty())
  2280. }
  2281. __extends(a, d);
  2282. Object.defineProperty(a.prototype, "texture", {
  2283. get: function() {
  2284. return this._texture
  2285. },
  2286. set: function(a) {
  2287. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2288. },
  2289. enumerable: !0,
  2290. configurable: !0
  2291. });
  2292. a.prototype._render = function(e) {
  2293. var b = this._texture;
  2294. 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
  2295. };
  2296. a._drawBitmap = function(e, g, f, d) {
  2297. var c = d._texture_to_render;
  2298. if (c) {
  2299. var h = c._textureWidth,
  2300. k = c._textureHeight;
  2301. if ("scale" == d.fillMode) {
  2302. var p = d.scale9Grid || c.scale9Grid;
  2303. if (p && h - p.width < g && k - p.height < f) a.drawScale9GridImage(e, d, p, g, f);
  2304. else {
  2305. var p = c._offsetX,
  2306. n = c._offsetY,
  2307. q = c._bitmapWidth || h,
  2308. t = c._bitmapHeight || k;
  2309. g /= h;
  2310. p = Math.round(p * g);
  2311. g = Math.round(q * g);
  2312. f /= k;
  2313. n = Math.round(n * f);
  2314. f = Math.round(t * f);
  2315. b.RenderFilter.getInstance().drawImage(e, d, c._bitmapX, c._bitmapY, q, t, p, n, g, f)
  2316. }
  2317. } else a.drawRepeatImage(e, d, g, f)
  2318. }
  2319. };
  2320. a.drawRepeatImage = function(a, g, f, d) {
  2321. var c = g._texture_to_render;
  2322. if (c) for (var h = c._textureWidth,
  2323. k = c._textureHeight,
  2324. p = c._bitmapX,
  2325. n = c._bitmapY,
  2326. q = c._bitmapWidth || h,
  2327. t = c._bitmapHeight || k,
  2328. r = c._offsetX,
  2329. c = c._offsetY,
  2330. s = b.RenderFilter.getInstance(); r < f; r += h) for (var u = c; u < d; u += k) {
  2331. var v = Math.min(q, f - r),
  2332. x = Math.min(t, d - u);
  2333. s.drawImage(a, g, p, n, v, x, r, u, v, x)
  2334. }
  2335. };
  2336. a.drawScale9GridImage = function(a, g, f, d, c) {
  2337. var h = g._texture_to_render;
  2338. if (h && f) {
  2339. var k = b.RenderFilter.getInstance(),
  2340. p = h._textureWidth,
  2341. n = h._textureHeight,
  2342. q = h._bitmapX,
  2343. t = h._bitmapY,
  2344. r = h._bitmapWidth || p,
  2345. s = h._bitmapHeight || n,
  2346. u = h._offsetX,
  2347. h = h._offsetY;
  2348. f = b.Rectangle.identity.initialize(f.x - Math.round(u), f.y - Math.round(u), f.width, f.height);
  2349. u = Math.round(u);
  2350. h = Math.round(h);
  2351. d -= p - r;
  2352. c -= n - s;
  2353. f.y == f.bottom && (f.bottom < s ? f.bottom++:f.y--);
  2354. f.x == f.right && (f.right < r ? f.right++:f.x--);
  2355. var p = q + f.x,
  2356. n = q + f.right,
  2357. v = r - f.right,
  2358. x = t + f.y,
  2359. y = t + f.bottom,
  2360. w = s - f.bottom,
  2361. z = u + f.x,
  2362. A = h + f.y,
  2363. s = c - (s - f.bottom),
  2364. r = d - (r - f.right);
  2365. k.drawImage(a, g, q, t, f.x, f.y, u, h, f.x, f.y);
  2366. k.drawImage(a, g, p, t, f.width, f.y, z, h, r - f.x, f.y);
  2367. k.drawImage(a, g, n, t, v, f.y, u + r, h, d - r, f.y);
  2368. k.drawImage(a, g, q, x, f.x, f.height, u, A, f.x, s - f.y);
  2369. k.drawImage(a, g, p, x, f.width, f.height, z, A, r - f.x, s - f.y);
  2370. k.drawImage(a, g, n, x, v, f.height, u + r, A, d - r, s - f.y);
  2371. k.drawImage(a, g, q, y, f.x, w, u, h + s, f.x, c - s);
  2372. k.drawImage(a, g, p, y, f.width, w, z, h + s, r - f.x, c - s);
  2373. k.drawImage(a, g, n, y, v, w, u + r, h + s, d - r, c - s)
  2374. }
  2375. };
  2376. a.prototype._measureBounds = function() {
  2377. var a = this._texture;
  2378. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : d.prototype._measureBounds.call(this)
  2379. };
  2380. a.debug = !1;
  2381. return a
  2382. } (b.DisplayObject);
  2383. b.Bitmap = c;
  2384. c.prototype.__class__ = "egret.Bitmap"
  2385. })(egret || (egret = {}));
  2386. __extends = this.__extends ||
  2387. function(b, c) {
  2388. function d() {
  2389. this.constructor = b
  2390. }
  2391. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2392. d.prototype = c.prototype;
  2393. b.prototype = new d
  2394. }; (function(b) {
  2395. var c = function(d) {
  2396. function a() {
  2397. d.call(this);
  2398. this._text = "";
  2399. this._textChanged = !1;
  2400. this._bitmapPool = []
  2401. }
  2402. __extends(a, d);
  2403. Object.defineProperty(a.prototype, "text", {
  2404. get: function() {
  2405. return this._text
  2406. },
  2407. set: function(a) {
  2408. this._textChanged = !0;
  2409. this._text = a
  2410. },
  2411. enumerable: !0,
  2412. configurable: !0
  2413. });
  2414. a.prototype._updateTransform = function() {
  2415. this.visible && (this._textChanged && this._renderText(), d.prototype._updateTransform.call(this))
  2416. };
  2417. a.prototype._renderText = function(a) {
  2418. var g = a = 0;
  2419. this._textChanged && this.removeChildren();
  2420. for (var f = 0,
  2421. d = this.text.length; f < d; f++) {
  2422. var c = this.text.charAt(f),
  2423. h = this.spriteSheet.getTexture(c);
  2424. if (null == h) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + c);
  2425. else {
  2426. var c = h._offsetX,
  2427. k = h._offsetY,
  2428. p = h._textureWidth;
  2429. if (this._textChanged) {
  2430. var n = this._bitmapPool[f];
  2431. n || (n = new b.Bitmap, this._bitmapPool.push(n));
  2432. n.texture = h;
  2433. this.addChild(n);
  2434. n.x = a
  2435. }
  2436. a += p + c;
  2437. k + h._textureHeight > g && (g = k + h._textureHeight)
  2438. }
  2439. }
  2440. this._textChanged = !1;
  2441. return b.Rectangle.identity.initialize(0, 0, a, g)
  2442. };
  2443. a.prototype._measureBounds = function() {
  2444. return this._renderText(!0)
  2445. };
  2446. return a
  2447. } (b.DisplayObjectContainer);
  2448. b.BitmapText = c;
  2449. c.prototype.__class__ = "egret.BitmapText"
  2450. })(egret || (egret = {})); (function(b) {
  2451. var c = function() {
  2452. function b() {
  2453. this.commandQueue = []
  2454. }
  2455. b.prototype.beginFill = function(a, e) {};
  2456. b.prototype._setStyle = function(a) {};
  2457. b.prototype.drawRect = function(a, e, b, f) {};
  2458. b.prototype.drawCircle = function(a, e, b) {};
  2459. b.prototype.drawRoundRect = function(a, e, b, f, d, c) {};
  2460. b.prototype.drawEllipse = function(a, e, b, f) {};
  2461. b.prototype.lineStyle = function(a, e, b, f, d, c, h, k) {};
  2462. b.prototype.lineTo = function(a, e) {};
  2463. b.prototype.curveTo = function(a, e, b, f) {};
  2464. b.prototype.moveTo = function(a, e) {};
  2465. b.prototype.clear = function() {};
  2466. b.prototype.endFill = function() {};
  2467. b.prototype._draw = function(a) {};
  2468. return b
  2469. } ();
  2470. b.Graphics = c;
  2471. c.prototype.__class__ = "egret.Graphics"; (function() {
  2472. return function(b, a, e) {
  2473. this.method = b;
  2474. this.thisObject = a;
  2475. this.args = e
  2476. }
  2477. })().prototype.__class__ = "Command"
  2478. })(egret || (egret = {}));
  2479. __extends = this.__extends ||
  2480. function(b, c) {
  2481. function d() {
  2482. this.constructor = b
  2483. }
  2484. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2485. d.prototype = c.prototype;
  2486. b.prototype = new d
  2487. }; (function(b) {
  2488. var c = function(d) {
  2489. function a() {
  2490. d.call(this)
  2491. }
  2492. __extends(a, d);
  2493. Object.defineProperty(a.prototype, "graphics", {
  2494. get: function() {
  2495. this._graphics || (this._graphics = new b.Graphics);
  2496. return this._graphics
  2497. },
  2498. enumerable: !0,
  2499. configurable: !0
  2500. });
  2501. a.prototype._render = function(a) {
  2502. this._graphics && this._graphics._draw(a)
  2503. };
  2504. return a
  2505. } (b.DisplayObject);
  2506. b.Shape = c;
  2507. c.prototype.__class__ = "egret.Shape"
  2508. })(egret || (egret = {}));
  2509. __extends = this.__extends ||
  2510. function(b, c) {
  2511. function d() {
  2512. this.constructor = b
  2513. }
  2514. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2515. d.prototype = c.prototype;
  2516. b.prototype = new d
  2517. }; (function(b) {
  2518. var c = function(d) {
  2519. function a() {
  2520. d.call(this)
  2521. }
  2522. __extends(a, d);
  2523. Object.defineProperty(a.prototype, "graphics", {
  2524. get: function() {
  2525. this._graphics || (this._graphics = new b.Graphics);
  2526. return this._graphics
  2527. },
  2528. enumerable: !0,
  2529. configurable: !0
  2530. });
  2531. a.prototype._render = function(a) {
  2532. this._graphics && this._graphics._draw(a);
  2533. d.prototype._render.call(this, a)
  2534. };
  2535. return a
  2536. } (b.DisplayObjectContainer);
  2537. b.Sprite = c;
  2538. c.prototype.__class__ = "egret.Sprite"
  2539. })(egret || (egret = {}));
  2540. __extends = this.__extends ||
  2541. function(b, c) {
  2542. function d() {
  2543. this.constructor = b
  2544. }
  2545. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2546. d.prototype = c.prototype;
  2547. b.prototype = new d
  2548. }; (function(b) {
  2549. var c = function(d) {
  2550. function a() {
  2551. d.call(this);
  2552. this._fontFamily = "Arial";
  2553. this._size = 30;
  2554. this._textColorString = "#FFFFFF";
  2555. this._textColor = 16777215;
  2556. this._strokeColorString = "#000000";
  2557. this._stroke = this._strokeColor = 0;
  2558. this._textAlign = "left";
  2559. this._verticalAlign = "top";
  2560. this._numLines = this._lineSpacing = 0;
  2561. this.measuredWidths = []
  2562. }
  2563. __extends(a, d);
  2564. Object.defineProperty(a.prototype, "text", {
  2565. get: function() {
  2566. return this._text
  2567. },
  2568. set: function(a) {
  2569. this._text != a && (this._setTextDirty(), this._text = a)
  2570. },
  2571. enumerable: !0,
  2572. configurable: !0
  2573. });
  2574. a.prototype._setTextDirty = function() {
  2575. this._setSizeDirty()
  2576. };
  2577. Object.defineProperty(a.prototype, "fontFamily", {
  2578. get: function() {
  2579. return this._fontFamily
  2580. },
  2581. set: function(a) {
  2582. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  2583. },
  2584. enumerable: !0,
  2585. configurable: !0
  2586. });
  2587. Object.defineProperty(a.prototype, "size", {
  2588. get: function() {
  2589. return this._size
  2590. },
  2591. set: function(a) {
  2592. this._size != a && (this._setTextDirty(), this._size = a)
  2593. },
  2594. enumerable: !0,
  2595. configurable: !0
  2596. });
  2597. Object.defineProperty(a.prototype, "italic", {
  2598. get: function() {
  2599. return this._italic
  2600. },
  2601. set: function(a) {
  2602. this._italic != a && (this._setTextDirty(), this._italic = a)
  2603. },
  2604. enumerable: !0,
  2605. configurable: !0
  2606. });
  2607. Object.defineProperty(a.prototype, "bold", {
  2608. get: function() {
  2609. return this._bold
  2610. },
  2611. set: function(a) {
  2612. this._bold != a && (this._setTextDirty(), this._bold = a)
  2613. },
  2614. enumerable: !0,
  2615. configurable: !0
  2616. });
  2617. Object.defineProperty(a.prototype, "textColor", {
  2618. get: function() {
  2619. return this._textColor
  2620. },
  2621. set: function(a) {
  2622. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = b.toColorString(a))
  2623. },
  2624. enumerable: !0,
  2625. configurable: !0
  2626. });
  2627. Object.defineProperty(a.prototype, "strokeColor", {
  2628. get: function() {
  2629. return this._strokeColor
  2630. },
  2631. set: function(a) {
  2632. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = b.toColorString(a))
  2633. },
  2634. enumerable: !0,
  2635. configurable: !0
  2636. });
  2637. Object.defineProperty(a.prototype, "stroke", {
  2638. get: function() {
  2639. return this._stroke
  2640. },
  2641. set: function(a) {
  2642. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  2643. },
  2644. enumerable: !0,
  2645. configurable: !0
  2646. });
  2647. Object.defineProperty(a.prototype, "textAlign", {
  2648. get: function() {
  2649. return this._textAlign
  2650. },
  2651. set: function(a) {
  2652. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  2653. },
  2654. enumerable: !0,
  2655. configurable: !0
  2656. });
  2657. Object.defineProperty(a.prototype, "verticalAlign", {
  2658. get: function() {
  2659. return this._verticalAlign
  2660. },
  2661. set: function(a) {
  2662. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  2663. },
  2664. enumerable: !0,
  2665. configurable: !0
  2666. });
  2667. Object.defineProperty(a.prototype, "lineSpacing", {
  2668. get: function() {
  2669. return this._lineSpacing
  2670. },
  2671. set: function(a) {
  2672. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  2673. },
  2674. enumerable: !0,
  2675. configurable: !0
  2676. });
  2677. Object.defineProperty(a.prototype, "numLines", {
  2678. get: function() {
  2679. return this._numLines
  2680. },
  2681. enumerable: !0,
  2682. configurable: !0
  2683. });
  2684. a.prototype._render = function(a) {
  2685. this.drawText(a, !1);
  2686. this._clearDirty()
  2687. };
  2688. a.prototype._measureBounds = function() {
  2689. return this.drawText(b.MainContext.instance.rendererContext, !0)
  2690. };
  2691. a.prototype.drawText = function(a, g) {
  2692. var f = this.getTextLines(a);
  2693. if (!f) return b.Rectangle.identity.initialize(0, 0, 0, 0);
  2694. var d = f.length,
  2695. c = 0.5 * this._size,
  2696. h = this._size + this._lineSpacing,
  2697. k = d * h - this._lineSpacing;
  2698. this._textHeight = k;
  2699. var p = this._hasHeightSet ? this._explicitHeight: Number.POSITIVE_INFINITY;
  2700. if (this._hasHeightSet && k < p) {
  2701. var n = 0;
  2702. this._verticalAlign == b.VerticalAlign.MIDDLE ? n = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (n = 1);
  2703. c += n * (p - k)
  2704. }
  2705. var n = c = Math.round(c),
  2706. q = 0;
  2707. this._textAlign == b.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (q = 1);
  2708. var t = this.measuredWidths,
  2709. r;
  2710. r = this._hasWidthSet ? this._explicitWidth: this._textWidth;
  2711. for (var s = Number.POSITIVE_INFINITY,
  2712. u = 0; u < d; u++) {
  2713. var v = f[u],
  2714. x = Math.round((r - t[u]) * q);
  2715. x < s && (s = x); ! g && c < p && a.drawText(this, v, x, c, r);
  2716. c += h
  2717. }
  2718. return b.Rectangle.identity.initialize(s, n, r, k)
  2719. };
  2720. a.prototype.getTextLines = function(a) {
  2721. var b = this.text ? this.text.toString() : "";
  2722. if (!b) return null;
  2723. var f = this.measuredWidths;
  2724. f.length = 0;
  2725. a.setupFont(this);
  2726. var b = b.split(/(?:\r\n|\r|\n)/),
  2727. d = b.length,
  2728. c = 0;
  2729. if (this._hasWidthSet) for (var h = this._explicitWidth,
  2730. k = 0; k < d; k++) {
  2731. var p = b[k],
  2732. n = a.measureText(p);
  2733. if (n > h) {
  2734. for (var q = "",
  2735. t = 0,
  2736. r = p.length,
  2737. s = 0; s < r; s++) {
  2738. var u = p.charAt(s),
  2739. n = a.measureText(u);
  2740. t + n > h && (0 == t ? (b.splice(k, 0, u), f[k] = n, c < n && (c = n), n = 0, u = "") : (b.splice(k, 0, q), f[k] = t, c < t && (c = t), q = "", t = 0), k++, d++);
  2741. t += n;
  2742. q += u
  2743. }
  2744. b[k] = q;
  2745. f[k] = t
  2746. } else f[k] = n,
  2747. c < n && (c = n)
  2748. } else for (k = 0; k < d; k++) p = b[k],
  2749. n = a.measureText(p),
  2750. f[k] = n,
  2751. c < n && (c = n);
  2752. this._textWidth = c;
  2753. return b
  2754. };
  2755. return a
  2756. } (b.DisplayObject);
  2757. b.TextField = c;
  2758. c.prototype.__class__ = "egret.TextField"
  2759. })(egret || (egret = {})); (function(b) {
  2760. var c = function() {
  2761. function b() {}
  2762. b.DYNAMIC = "dynamic";
  2763. b.INPUT = "input";
  2764. return b
  2765. } ();
  2766. b.TextFieldType = c;
  2767. c.prototype.__class__ = "egret.TextFieldType"
  2768. })(egret || (egret = {}));
  2769. __extends = this.__extends ||
  2770. function(b, c) {
  2771. function d() {
  2772. this.constructor = b
  2773. }
  2774. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2775. d.prototype = c.prototype;
  2776. b.prototype = new d
  2777. }; (function(b) {
  2778. var c = function(d) {
  2779. function a(a) {
  2780. d.call(this);
  2781. var b = a.bitmapData;
  2782. this.bitmapData = b;
  2783. this._textureMap = {};
  2784. this._sourceWidth = b.width;
  2785. this._sourceHeight = b.height;
  2786. this._bitmapX = a._bitmapX - a._offsetX;
  2787. this._bitmapY = a._bitmapY - a._offsetY
  2788. }
  2789. __extends(a, d);
  2790. a.prototype.getTexture = function(a) {
  2791. return this._textureMap[a]
  2792. };
  2793. a.prototype.createTexture = function(a, g, f, d, c, h, k, p, n) {
  2794. "undefined" === typeof h && (h = 0);
  2795. "undefined" === typeof k && (k = 0);
  2796. "undefined" === typeof p && (p = h + d);
  2797. "undefined" === typeof n && (n = k + c);
  2798. var q = new b.Texture;
  2799. q._bitmapData = this.bitmapData;
  2800. q._bitmapX = this._bitmapX + g;
  2801. q._bitmapY = this._bitmapY + f;
  2802. q._bitmapWidth = d;
  2803. q._bitmapHeight = c;
  2804. q._offsetX = h;
  2805. q._offsetY = k;
  2806. q._textureWidth = p;
  2807. q._textureHeight = n;
  2808. q._sourceWidth = this._sourceWidth;
  2809. q._sourceHeight = this._sourceHeight;
  2810. return this._textureMap[a] = q
  2811. };
  2812. return a
  2813. } (b.HashObject);
  2814. b.SpriteSheet = c;
  2815. c.prototype.__class__ = "egret.SpriteSheet"
  2816. })(egret || (egret = {}));
  2817. __extends = this.__extends ||
  2818. function(b, c) {
  2819. function d() {
  2820. this.constructor = b
  2821. }
  2822. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2823. d.prototype = c.prototype;
  2824. b.prototype = new d
  2825. }; (function(b) {
  2826. var c = function(d) {
  2827. function a() {
  2828. d.call(this);
  2829. this._size = 30;
  2830. this._textColorString = "#FFFFFF";
  2831. this._textColor = 16777215;
  2832. this.stageText = new b.StageText;
  2833. var a = this.localToGlobal();
  2834. this.stageText._open(a.x, a.y, this._explicitWidth, this._explicitHeight)
  2835. }
  2836. __extends(a, d);
  2837. a.prototype._onAddToStage = function() {
  2838. d.prototype._onAddToStage.call(this);
  2839. this.stageText._add();
  2840. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this)
  2841. };
  2842. a.prototype.setText = function(a) {
  2843. this.stageText._setText(a)
  2844. };
  2845. a.prototype.getText = function() {
  2846. return this.stageText._getText()
  2847. };
  2848. a.prototype.setTextType = function(a) {
  2849. this.stageText._setTextType(a)
  2850. };
  2851. a.prototype.getTextType = function() {
  2852. return this.stageText._getTextType()
  2853. };
  2854. a.prototype.onMouseDownHandler = function(a) {};
  2855. a.prototype._onRemoveFromStage = function() {
  2856. this.stageText._remove()
  2857. };
  2858. a.prototype._measureBounds = function() {
  2859. return b.Rectangle.identity
  2860. };
  2861. a.prototype.hitTest = function(a, b, f) {
  2862. return null
  2863. };
  2864. a.prototype._updateTransform = function() {
  2865. var a = this._worldTransform.a,
  2866. b = this._worldTransform.b,
  2867. f = this._worldTransform.c,
  2868. c = this._worldTransform.d,
  2869. l = this._worldTransform.tx,
  2870. h = this._worldTransform.ty;
  2871. d.prototype._updateTransform.call(this);
  2872. var k = this._worldTransform;
  2873. if (a != k.a || b != k.b || f != k.c || c != k.d || l != k.tx || h != k.ty) a = this.localToGlobal(),
  2874. this.stageText.changePosition(a.x, a.y),
  2875. this.stageText.changeSize(this._explicitWidth, this._explicitHeight)
  2876. };
  2877. Object.defineProperty(a.prototype, "size", {
  2878. get: function() {
  2879. return this._size
  2880. },
  2881. set: function(a) {
  2882. this._size != a && (this._size = a, this.stageText.setSize(this._size))
  2883. },
  2884. enumerable: !0,
  2885. configurable: !0
  2886. });
  2887. Object.defineProperty(a.prototype, "textColor", {
  2888. get: function() {
  2889. return this._textColor
  2890. },
  2891. set: function(a) {
  2892. this._textColor != a && (this._textColor = a, this._textColorString = b.toColorString(a), this.stageText.setTextColor(this._textColorString))
  2893. },
  2894. enumerable: !0,
  2895. configurable: !0
  2896. });
  2897. return a
  2898. } (b.DisplayObject);
  2899. b.TextInput = c;
  2900. c.prototype.__class__ = "egret.TextInput"
  2901. })(egret || (egret = {}));
  2902. __extends = this.__extends ||
  2903. function(b, c) {
  2904. function d() {
  2905. this.constructor = b
  2906. }
  2907. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2908. d.prototype = c.prototype;
  2909. b.prototype = new d
  2910. }; (function(b) {
  2911. var c = function(b) {
  2912. function a(a, g) {
  2913. b.call(this, a);
  2914. this.charList = this.parseConfig(g)
  2915. }
  2916. __extends(a, b);
  2917. a.prototype.getTexture = function(a) {
  2918. var b = this._textureMap[a];
  2919. if (!b) {
  2920. b = this.charList[a];
  2921. if (!b) return null;
  2922. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  2923. this._textureMap[a] = b
  2924. }
  2925. return b
  2926. };
  2927. a.prototype.parseConfig = function(a) {
  2928. a = a.split("\r\n").join("\n");
  2929. a = a.split("\n");
  2930. for (var b = this.getConfigByKey(a[3], "count"), f = {},
  2931. d = 4; d < 4 + b; d++) {
  2932. var c = a[d],
  2933. h = String.fromCharCode(this.getConfigByKey(c, "id")),
  2934. k = {};
  2935. f[h] = k;
  2936. k.x = this.getConfigByKey(c, "x");
  2937. k.y = this.getConfigByKey(c, "y");
  2938. k.width = this.getConfigByKey(c, "width");
  2939. k.height = this.getConfigByKey(c, "height");
  2940. k.offsetX = this.getConfigByKey(c, "xoffset");
  2941. k.offsetY = this.getConfigByKey(c, "yoffset")
  2942. }
  2943. return f
  2944. };
  2945. a.prototype.getConfigByKey = function(a, b) {
  2946. for (var f = a.split(" "), d = 0, c = f.length; d < c; d++) {
  2947. var h = f[d];
  2948. if (b == h.substring(0, b.length)) return f = h.substring(b.length + 1),
  2949. parseInt(f)
  2950. }
  2951. return 0
  2952. };
  2953. return a
  2954. } (b.SpriteSheet);
  2955. b.BitmapTextSpriteSheet = c;
  2956. c.prototype.__class__ = "egret.BitmapTextSpriteSheet"
  2957. })(egret || (egret = {}));
  2958. __extends = this.__extends ||
  2959. function(b, c) {
  2960. function d() {
  2961. this.constructor = b
  2962. }
  2963. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2964. d.prototype = c.prototype;
  2965. b.prototype = new d
  2966. }; (function(b) {
  2967. var c = function(a) {
  2968. function e(e, f) {
  2969. a.call(this);
  2970. this.frameRate = 60;
  2971. e instanceof d ? (b.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new d(e, f);
  2972. this.delegate.setMovieClip(this)
  2973. }
  2974. __extends(e, a);
  2975. e.prototype.gotoAndPlay = function(a) {
  2976. this.delegate.gotoAndPlay(a)
  2977. };
  2978. e.prototype.gotoAndStop = function(a) {
  2979. this.delegate.gotoAndStop(a)
  2980. };
  2981. e.prototype.stop = function() {
  2982. this.delegate.stop()
  2983. };
  2984. e.prototype.dispose = function() {
  2985. this.delegate.dispose()
  2986. };
  2987. e.prototype.release = function() {
  2988. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2989. this.dispose()
  2990. };
  2991. e.prototype.getCurrentFrameIndex = function() {
  2992. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2993. return this.delegate._currentFrameIndex
  2994. };
  2995. e.prototype.getTotalFrame = function() {
  2996. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2997. return this.delegate._totalFrame
  2998. };
  2999. e.prototype.setInterval = function(a) {
  3000. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  3001. this.frameRate = 60 / a
  3002. };
  3003. e.prototype.getIsPlaying = function() {
  3004. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  3005. return this.delegate.isPlaying
  3006. };
  3007. return e
  3008. } (b.DisplayObjectContainer);
  3009. b.MovieClip = c;
  3010. c.prototype.__class__ = "egret.MovieClip";
  3011. var d = function() {
  3012. function a(a, g) {
  3013. this.data = a;
  3014. this._currentFrameIndex = this._passTime = this._totalFrame = 0;
  3015. this._isPlaying = !1;
  3016. this._frameData = a;
  3017. this._spriteSheet = new b.SpriteSheet(g)
  3018. }
  3019. a.prototype.setMovieClip = function(a) {
  3020. this.movieClip = a;
  3021. this.bitmap = new b.Bitmap;
  3022. this.movieClip.addChild(this.bitmap)
  3023. };
  3024. a.prototype.gotoAndPlay = function(a) {
  3025. this.checkHasFrame(a);
  3026. this._isPlaying = !0;
  3027. this._currentFrameIndex = 0;
  3028. this._currentFrameName = a;
  3029. this._totalFrame = this._frameData.frames[a].totalFrame;
  3030. this.playNextFrame();
  3031. this._passTime = 0;
  3032. b.Ticker.getInstance().register(this.update, this)
  3033. };
  3034. a.prototype.gotoAndStop = function(a) {
  3035. this.checkHasFrame(a);
  3036. this.stop();
  3037. this._currentFrameIndex = this._passTime = 0;
  3038. this._currentFrameName = a;
  3039. this._totalFrame = this._frameData.frames[a].totalFrame;
  3040. this.playNextFrame()
  3041. };
  3042. a.prototype.stop = function() {
  3043. this._isPlaying = !1;
  3044. b.Ticker.getInstance().unregister(this.update, this)
  3045. };
  3046. a.prototype.dispose = function() {};
  3047. a.prototype.checkHasFrame = function(a) {
  3048. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  3049. };
  3050. a.prototype.update = function(a) {
  3051. for (var b = 1E3 / this.movieClip.frameRate,
  3052. b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1),
  3053. b--;
  3054. this._passTime += a
  3055. };
  3056. a.prototype.playNextFrame = function(a) {
  3057. "undefined" === typeof a && (a = !0);
  3058. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  3059. if (a) {
  3060. a = this.getTexture(b.res);
  3061. var f = this.bitmap;
  3062. f.x = b.x;
  3063. f.y = b.y;
  3064. f.texture = a
  3065. }
  3066. null != b.action && this.movieClip.dispatchEventWith(b.action);
  3067. this._currentFrameIndex++;
  3068. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0)
  3069. };
  3070. a.prototype.getTexture = function(a) {
  3071. var b = this._frameData.res[a],
  3072. f = this._spriteSheet.getTexture(a);
  3073. f || (f = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  3074. return f
  3075. };
  3076. return a
  3077. } ();
  3078. b.DefaultMovieClipDelegate = d;
  3079. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  3080. })(egret || (egret = {}));
  3081. __extends = this.__extends ||
  3082. function(b, c) {
  3083. function d() {
  3084. this.constructor = b
  3085. }
  3086. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3087. d.prototype = c.prototype;
  3088. b.prototype = new d
  3089. }; (function(b) {
  3090. var c = function(d) {
  3091. function a() {
  3092. d.call(this);
  3093. this._size = 20
  3094. }
  3095. __extends(a, d);
  3096. a.prototype._getText = function() {
  3097. return this.inputElement.value
  3098. };
  3099. a.prototype._setText = function(a) {
  3100. this.inputElement.value = a
  3101. };
  3102. a.prototype._setTextType = function(a) {
  3103. this.inputElement.type = a
  3104. };
  3105. a.prototype._getTextType = function() {
  3106. return this.inputElement.type
  3107. };
  3108. a.prototype._open = function(a, g, f, d) {
  3109. "undefined" === typeof f && (f = 160);
  3110. d = b.StageDelegate.getInstance().getScaleX();
  3111. var c = b.StageDelegate.getInstance().getScaleY(),
  3112. h = document.createElement("input");
  3113. h.type = "text";
  3114. h.style.fontSize = this._size + "px";
  3115. h.style.color = "#FFFFFF";
  3116. h.style.border = "none";
  3117. h.style.background = "none";
  3118. h.style.width = f + "px";
  3119. h.style.padding = "0";
  3120. h.style.outline = "medium";
  3121. var k = b.Browser.getInstance().$new("div");
  3122. k.position.x = a * d;
  3123. k.position.y = g * c;
  3124. k.style.width = f + "px";
  3125. k.scale.x = d;
  3126. k.scale.y = c;
  3127. k.transforms();
  3128. k.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  3129. k.appendChild(h);
  3130. this.div = k;
  3131. this.inputElement = h
  3132. };
  3133. a.prototype.getStageDelegateDiv = function() {
  3134. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  3135. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  3136. return a
  3137. };
  3138. a.prototype._add = function() {
  3139. var a = this.div;
  3140. a && !a.parentNode && this.getStageDelegateDiv().appendChild(a)
  3141. };
  3142. a.prototype._remove = function() {
  3143. var a = this.div;
  3144. a && a.parentNode && a.parentNode.removeChild(a)
  3145. };
  3146. a.prototype.changePosition = function(a, g) {
  3147. var f = b.StageDelegate.getInstance().getScaleX(),
  3148. d = b.StageDelegate.getInstance().getScaleY();
  3149. this.div.position.x = a * f;
  3150. this.div.position.y = g * d;
  3151. this.div.transforms()
  3152. };
  3153. a.prototype.changeSize = function(a, b) {
  3154. this.inputElement.style.width = a + "px";
  3155. this.div.style.width = a + "px";
  3156. this.div.transforms()
  3157. };
  3158. a.prototype.setSize = function(a) {
  3159. this._size = a;
  3160. this.inputElement.style.fontSize = this._size + "px"
  3161. };
  3162. a.prototype.setTextColor = function(a) {
  3163. this.inputElement.style.color = a
  3164. };
  3165. return a
  3166. } (b.HashObject);
  3167. b.StageText = c;
  3168. c.prototype.__class__ = "egret.StageText"
  3169. })(egret || (egret = {})); (function(b) {
  3170. var c = function() {
  3171. function b() {}
  3172. b.GET = "GET";
  3173. b.POST = "POST";
  3174. return b
  3175. } ();
  3176. b.URLRequestMethod = c;
  3177. c.prototype.__class__ = "egret.URLRequestMethod"
  3178. })(egret || (egret = {})); (function(b) {
  3179. var c = function() {
  3180. function b() {}
  3181. b.BINARY = "binary";
  3182. b.TEXT = "text";
  3183. b.VARIABLES = "variables";
  3184. b.TEXTURE = "texture";
  3185. b.SOUND = "sound";
  3186. return b
  3187. } ();
  3188. b.URLLoaderDataFormat = c;
  3189. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  3190. })(egret || (egret = {}));
  3191. __extends = this.__extends ||
  3192. function(b, c) {
  3193. function d() {
  3194. this.constructor = b
  3195. }
  3196. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3197. d.prototype = c.prototype;
  3198. b.prototype = new d
  3199. }; (function(b) {
  3200. var c = function(b) {
  3201. function a(a) {
  3202. "undefined" === typeof a && (a = null);
  3203. b.call(this);
  3204. null !== a && this.decode(a)
  3205. }
  3206. __extends(a, b);
  3207. a.prototype.decode = function(a) {
  3208. this.variables || (this.variables = {});
  3209. a = a.split("+").join(" ");
  3210. for (var b, f = /[?&]?([^=]+)=([^&]*)/g; b = f.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  3211. };
  3212. a.prototype.toString = function() {
  3213. if (!this.variables) return "";
  3214. var a = this.variables,
  3215. b = "",
  3216. f = !0,
  3217. d;
  3218. for (d in a) f ? f = !1 : b += "&",
  3219. b += d + "=" + a[d];
  3220. return b
  3221. };
  3222. return a
  3223. } (b.HashObject);
  3224. b.URLVariables = c;
  3225. c.prototype.__class__ = "egret.URLVariables"
  3226. })(egret || (egret = {}));
  3227. __extends = this.__extends ||
  3228. function(b, c) {
  3229. function d() {
  3230. this.constructor = b
  3231. }
  3232. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3233. d.prototype = c.prototype;
  3234. b.prototype = new d
  3235. }; (function(b) {
  3236. var c = function(d) {
  3237. function a(a) {
  3238. "undefined" === typeof a && (a = null);
  3239. d.call(this);
  3240. this.method = b.URLRequestMethod.GET;
  3241. this.url = a
  3242. }
  3243. __extends(a, d);
  3244. return a
  3245. } (b.HashObject);
  3246. b.URLRequest = c;
  3247. c.prototype.__class__ = "egret.URLRequest"
  3248. })(egret || (egret = {}));
  3249. __extends = this.__extends ||
  3250. function(b, c) {
  3251. function d() {
  3252. this.constructor = b
  3253. }
  3254. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3255. d.prototype = c.prototype;
  3256. b.prototype = new d
  3257. }; (function(b) {
  3258. var c = function(d) {
  3259. function a(a) {
  3260. "undefined" === typeof a && (a = null);
  3261. d.call(this);
  3262. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  3263. a && this.load(a)
  3264. }
  3265. __extends(a, d);
  3266. a.prototype.load = function(a) {
  3267. this._request = a;
  3268. this.data = null;
  3269. b.MainContext.instance.netContext.proceed(this)
  3270. };
  3271. return a
  3272. } (b.EventDispatcher);
  3273. b.URLLoader = c;
  3274. c.prototype.__class__ = "egret.URLLoader"
  3275. })(egret || (egret = {}));
  3276. __extends = this.__extends ||
  3277. function(b, c) {
  3278. function d() {
  3279. this.constructor = b
  3280. }
  3281. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3282. d.prototype = c.prototype;
  3283. b.prototype = new d
  3284. }; (function(b) {
  3285. var c = function(d) {
  3286. function a() {
  3287. d.call(this);
  3288. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3289. }
  3290. __extends(a, d);
  3291. Object.defineProperty(a.prototype, "textureWidth", {
  3292. get: function() {
  3293. return this._textureWidth
  3294. },
  3295. enumerable: !0,
  3296. configurable: !0
  3297. });
  3298. Object.defineProperty(a.prototype, "textureHeight", {
  3299. get: function() {
  3300. return this._textureHeight
  3301. },
  3302. enumerable: !0,
  3303. configurable: !0
  3304. });
  3305. Object.defineProperty(a.prototype, "bitmapData", {
  3306. get: function() {
  3307. return this._bitmapData
  3308. },
  3309. enumerable: !0,
  3310. configurable: !0
  3311. });
  3312. a.prototype._setBitmapData = function(a) {
  3313. var g = b.MainContext.instance.rendererContext.texture_scale_factor;
  3314. this._bitmapData = a;
  3315. this._sourceWidth = a.width;
  3316. this._sourceHeight = a.height;
  3317. this._textureWidth = this._sourceWidth * g;
  3318. this._textureHeight = this._sourceHeight * g;
  3319. this._bitmapWidth = this._textureWidth;
  3320. this._bitmapHeight = this._textureHeight;
  3321. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3322. };
  3323. a.prototype.getPixel32 = function(a, b) {
  3324. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  3325. };
  3326. return a
  3327. } (b.HashObject);
  3328. b.Texture = c;
  3329. c.prototype.__class__ = "egret.Texture"
  3330. })(egret || (egret = {}));
  3331. __extends = this.__extends ||
  3332. function(b, c) {
  3333. function d() {
  3334. this.constructor = b
  3335. }
  3336. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3337. d.prototype = c.prototype;
  3338. b.prototype = new d
  3339. }; (function(b) {
  3340. var c = function(d) {
  3341. function a() {
  3342. d.call(this);
  3343. this._bitmapData = document.createElement("canvas");
  3344. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  3345. }
  3346. __extends(a, d);
  3347. a.prototype.drawToTexture = function(a) {
  3348. var g = this._bitmapData,
  3349. f = a.getBounds(b.Rectangle.identity);
  3350. g.width = f.width;
  3351. g.height = f.height;
  3352. a._worldTransform.identity();
  3353. a.worldAlpha = 1;
  3354. if (a instanceof b.DisplayObjectContainer) {
  3355. this._offsetX = f.x;
  3356. this._offsetY = f.y;
  3357. a._worldTransform.append(1, 0, 0, 1, -f.x, -f.y);
  3358. for (var g = a._children,
  3359. f = 0,
  3360. d = g.length; f < d; f++) g[f]._updateTransform()
  3361. }
  3362. g = b.RenderFilter.getInstance();
  3363. f = g._drawAreaList.concat();
  3364. g._drawAreaList.length = 0;
  3365. this.renderContext.clearScreen();
  3366. this.webGLTexture = null; (d = a.mask || a._scrollRect) && this.renderContext.pushMask(d);
  3367. a._render(this.renderContext);
  3368. d && this.renderContext.popMask();
  3369. g._drawAreaList = f;
  3370. this._textureWidth = this._bitmapData.width;
  3371. this._textureHeight = this._bitmapData.height;
  3372. this._sourceWidth = this._textureWidth;
  3373. this._sourceHeight = this._textureHeight
  3374. };
  3375. return a
  3376. } (b.Texture);
  3377. b.RenderTexture = c;
  3378. c.prototype.__class__ = "egret.RenderTexture"
  3379. })(egret || (egret = {}));
  3380. __extends = this.__extends ||
  3381. function(b, c) {
  3382. function d() {
  3383. this.constructor = b
  3384. }
  3385. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3386. d.prototype = c.prototype;
  3387. b.prototype = new d
  3388. }; (function(b) {
  3389. var c = function(d) {
  3390. function a() {
  3391. d.call(this);
  3392. this.renderCost = 0;
  3393. this.texture_scale_factor = 1
  3394. }
  3395. __extends(a, d);
  3396. a.prototype.clearScreen = function() {};
  3397. a.prototype.clearRect = function(a, b, f, d) {};
  3398. a.prototype.drawImage = function(a, g, f, d, c, h, k, p, n) {
  3399. b.Profiler.getInstance().onDrawImage()
  3400. };
  3401. a.prototype.setTransform = function(a) {};
  3402. a.prototype.setAlpha = function(a, b) {};
  3403. a.prototype.setupFont = function(a) {};
  3404. a.prototype.measureText = function(a) {
  3405. return 0
  3406. };
  3407. a.prototype.drawText = function(a, g, f, d, c) {
  3408. b.Profiler.getInstance().onDrawImage()
  3409. };
  3410. a.prototype.strokeRect = function(a, b, f, d, c) {};
  3411. a.prototype.pushMask = function(a) {};
  3412. a.prototype.popMask = function() {};
  3413. a.prototype.onRenderStart = function() {};
  3414. a.prototype.onRenderFinish = function() {};
  3415. a.createRendererContext = function(a) {
  3416. return null
  3417. };
  3418. return a
  3419. } (b.HashObject);
  3420. b.RendererContext = c;
  3421. c.prototype.__class__ = "egret.RendererContext"
  3422. })(egret || (egret = {})); (function(b) {
  3423. var c = function() {
  3424. function b() {}
  3425. b.MOUSE = "mouse";
  3426. b.TOUCH = "touch";
  3427. b.mode = "touch";
  3428. return b
  3429. } ();
  3430. b.InteractionMode = c;
  3431. c.prototype.__class__ = "egret.InteractionMode"
  3432. })(egret || (egret = {}));
  3433. __extends = this.__extends ||
  3434. function(b, c) {
  3435. function d() {
  3436. this.constructor = b
  3437. }
  3438. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3439. d.prototype = c.prototype;
  3440. b.prototype = new d
  3441. }; (function(b) {
  3442. var c = function(d) {
  3443. function a() {
  3444. d.call(this);
  3445. this._currentTouchTarget = {};
  3446. this.maxTouches = 2;
  3447. this.touchDownTarget = {};
  3448. this.touchingIdentifiers = [];
  3449. this.lastTouchY = this.lastTouchX = -1
  3450. }
  3451. __extends(a, d);
  3452. a.prototype.run = function() {};
  3453. a.prototype.getTouchData = function(a, b, f) {
  3454. var d = this._currentTouchTarget[a];
  3455. null == d && (d = {},
  3456. this._currentTouchTarget[a] = d);
  3457. d.stageX = b;
  3458. d.stageY = f;
  3459. d.identifier = a;
  3460. return d
  3461. };
  3462. a.prototype.dispatchEvent = function(a, g) {
  3463. b.TouchEvent.dispatchTouchEvent(g.target, a, g.identifier, g.stageX, g.stageY, !1, !1, !1, !0 == this.touchDownTarget[g.identifier])
  3464. };
  3465. a.prototype.onTouchBegan = function(a, g, d) {
  3466. if (this.touchingIdentifiers.length != this.maxTouches) {
  3467. var c = b.MainContext.instance.stage.hitTest(a, g);
  3468. c && (a = this.getTouchData(d, a, g), this.touchDownTarget[d] = !0, a.target = c, a.beginTarget = c, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  3469. this.touchingIdentifiers.push(d)
  3470. }
  3471. };
  3472. a.prototype.onTouchMove = function(a, g, d) {
  3473. if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || g != this.lastTouchY)) {
  3474. this.lastTouchX = a;
  3475. this.lastTouchY = g;
  3476. var c = b.MainContext.instance.stage.hitTest(a, g);
  3477. c && (a = this.getTouchData(d, a, g), a.target = c, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  3478. }
  3479. };
  3480. a.prototype.onTouchEnd = function(a, g, d) {
  3481. var c = this.touchingIdentifiers.indexOf(d); - 1 != c && (this.touchingIdentifiers.splice(c, 1), c = b.MainContext.instance.stage.hitTest(a, g)) && (a = this.getTouchData(d, a, g), delete this.touchDownTarget[d], d = a.beginTarget, a.target = c, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == c ? 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])
  3482. };
  3483. return a
  3484. } (b.HashObject);
  3485. b.TouchContext = c;
  3486. c.prototype.__class__ = "egret.TouchContext"
  3487. })(egret || (egret = {}));
  3488. __extends = this.__extends ||
  3489. function(b, c) {
  3490. function d() {
  3491. this.constructor = b
  3492. }
  3493. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3494. d.prototype = c.prototype;
  3495. b.prototype = new d
  3496. }; (function(b) {
  3497. var c = function(b) {
  3498. function a() {
  3499. b.call(this)
  3500. }
  3501. __extends(a, b);
  3502. a.prototype.proceed = function(a) {};
  3503. return a
  3504. } (b.HashObject);
  3505. b.NetContext = c;
  3506. c.prototype.__class__ = "egret.NetContext"
  3507. })(egret || (egret = {}));
  3508. __extends = this.__extends ||
  3509. function(b, c) {
  3510. function d() {
  3511. this.constructor = b
  3512. }
  3513. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3514. d.prototype = c.prototype;
  3515. b.prototype = new d
  3516. }; (function(b) {
  3517. var c = function(b) {
  3518. function a() {
  3519. b.call(this);
  3520. this.frameRate = 60
  3521. }
  3522. __extends(a, b);
  3523. a.prototype.executeMainLoop = function(a, b) {};
  3524. return a
  3525. } (b.HashObject);
  3526. b.DeviceContext = c;
  3527. c.prototype.__class__ = "egret.DeviceContext"
  3528. })(egret || (egret = {})); (function(b) {
  3529. var c = function() {
  3530. function b() {}
  3531. b.call = function(a, e) {};
  3532. b.addCallback = function(a, e) {};
  3533. return b
  3534. } ();
  3535. b.ExternalInterface = c;
  3536. c.prototype.__class__ = "egret.ExternalInterface"
  3537. })(egret || (egret = {}));
  3538. __extends = this.__extends ||
  3539. function(b, c) {
  3540. function d() {
  3541. this.constructor = b
  3542. }
  3543. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3544. d.prototype = c.prototype;
  3545. b.prototype = new d
  3546. }; (function(b) {
  3547. var c = function(d) {
  3548. function a() {
  3549. d.call(this);
  3550. this.translate = this.isHD ?
  3551. function(a) {
  3552. return "translate3d(" + a.x + "px, " + (a.y - b.MainContext.instance.stage.stageHeight) + "px, 0) "
  3553. }: function(a) {
  3554. return "translate(" + a.x + "px, " + a.y + "px) "
  3555. };
  3556. this.rotate = this.isHD ?
  3557. function(a) {
  3558. return "rotateZ(" + a + "deg) "
  3559. }: function(a) {
  3560. return "rotate(" + a + "deg) "
  3561. };
  3562. this.ua = navigator.userAgent.toLowerCase();
  3563. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3564. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  3565. this.type = "unknow";
  3566. switch (this.type) {
  3567. case "firefox":
  3568. this.pfx = "Moz";
  3569. this.isHD = !0;
  3570. break;
  3571. case "chrome":
  3572. case "safari":
  3573. this.pfx = "webkit";
  3574. this.isHD = !0;
  3575. break;
  3576. case "opera":
  3577. this.pfx = "O";
  3578. this.isHD = !1;
  3579. break;
  3580. case "ie":
  3581. this.pfx = "ms";
  3582. this.isHD = !1;
  3583. break;
  3584. default:
  3585. this.pfx = "webkit",
  3586. this.isHD = !0
  3587. }
  3588. this.trans = this.pfx + "Transform"
  3589. }
  3590. __extends(a, d);
  3591. a.getInstance = function() {
  3592. null == a.instance && (a.instance = new a);
  3593. return a.instance
  3594. };
  3595. Object.defineProperty(a.prototype, "isMobile", {
  3596. get: function() {
  3597. b.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  3598. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  3599. },
  3600. enumerable: !0,
  3601. configurable: !0
  3602. });
  3603. a.prototype.$new = function(a) {
  3604. return this.$(document.createElement(a))
  3605. };
  3606. a.prototype.$ = function(e) {
  3607. var g = document;
  3608. if (e = e instanceof HTMLElement ? e: g.querySelector(e)) e.find = e.find || this.$,
  3609. e.hasClass = e.hasClass ||
  3610. function(a) {
  3611. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  3612. },
  3613. e.addClass = e.addClass ||
  3614. function(a) {
  3615. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  3616. return this
  3617. },
  3618. e.removeClass = e.removeClass ||
  3619. function(a) {
  3620. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  3621. return this
  3622. },
  3623. e.remove = e.remove ||
  3624. function() {},
  3625. e.appendTo = e.appendTo ||
  3626. function(a) {
  3627. a.appendChild(this);
  3628. return this
  3629. },
  3630. e.prependTo = e.prependTo ||
  3631. function(a) {
  3632. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  3633. return this
  3634. },
  3635. e.transforms = e.transforms ||
  3636. function() {
  3637. 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);
  3638. return this
  3639. },
  3640. e.position = e.position || {
  3641. x: 0,
  3642. y: 0
  3643. },
  3644. e.rotation = e.rotation || 0,
  3645. e.scale = e.scale || {
  3646. x: 1,
  3647. y: 1
  3648. },
  3649. e.skew = e.skew || {
  3650. x: 0,
  3651. y: 0
  3652. },
  3653. e.translates = function(a, e) {
  3654. this.position.x = a;
  3655. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  3656. this.transforms();
  3657. return this
  3658. },
  3659. e.rotate = function(a) {
  3660. this.rotation = a;
  3661. this.transforms();
  3662. return this
  3663. },
  3664. e.resize = function(a, e) {
  3665. this.scale.x = a;
  3666. this.scale.y = e;
  3667. this.transforms();
  3668. return this
  3669. },
  3670. e.setSkew = function(a, e) {
  3671. this.skew.x = a;
  3672. this.skew.y = e;
  3673. this.transforms();
  3674. return this
  3675. };
  3676. return e
  3677. };
  3678. a.prototype.scale = function(a) {
  3679. return "scale(" + a.x + ", " + a.y + ") "
  3680. };
  3681. a.prototype.skew = function(a) {
  3682. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  3683. };
  3684. return a
  3685. } (b.HashObject);
  3686. b.Browser = c;
  3687. c.prototype.__class__ = "egret.Browser"
  3688. })(egret || (egret = {})); (function(b) {
  3689. var c = function() {
  3690. function d() {}
  3691. d.parse = function(a) {
  3692. a = b.SAXParser.getInstance().parserXML(a);
  3693. if (!a || !a.childNodes) return null;
  3694. for (var e = a.childNodes.length,
  3695. g = !1,
  3696. c = 0; c < e; c++) {
  3697. var m = a.childNodes[c];
  3698. if (1 == m.nodeType) {
  3699. g = !0;
  3700. break
  3701. }
  3702. }
  3703. return g ? d.parseNode(m) : null
  3704. };
  3705. d.parseNode = function(a) {
  3706. if (!a || 1 != a.nodeType) return null;
  3707. var e = {};
  3708. e.localName = a.localName;
  3709. e.name = a.nodeName;
  3710. a.namespaceURI && (e.namespace = a.namespaceURI);
  3711. a.prefix && (e.prefix = a.prefix);
  3712. for (var b = a.attributes,
  3713. c = b.length,
  3714. m = 0; m < c; m++) {
  3715. var l = b[m],
  3716. h = l.name;
  3717. 0 != h.indexOf("xmlns:") && (e["$" + h] = l.value)
  3718. }
  3719. b = a.childNodes;
  3720. c = b.length;
  3721. for (m = 0; m < c; m++) if (l = d.parseNode(b[m])) e.children || (e.children = []),
  3722. l.parent = e,
  3723. e.children.push(l); ! e.children && (a = a.textContent.trim()) && (e.text = a);
  3724. return e
  3725. };
  3726. d.findChildren = function(a, e, b) {
  3727. b ? b.length = 0 : b = [];
  3728. d.findByPath(a, e, b);
  3729. return b
  3730. };
  3731. d.findByPath = function(a, e, b) {
  3732. var c = e.indexOf("."),
  3733. m; - 1 == c ? (m = e, c = !0) : (m = e.substring(0, c), e = e.substring(c + 1), c = !1);
  3734. if (a = a.children) for (var l = a.length,
  3735. h = 0; h < l; h++) {
  3736. var k = a[h];
  3737. k.localName == m && (c ? b.push(k) : d.findByPath(k, e, b))
  3738. }
  3739. };
  3740. d.getAttributes = function(a, e) {
  3741. e ? e.length = 0 : e = [];
  3742. for (var b in a)"$" == b.charAt(0) && e.push(b.substring(1));
  3743. return e
  3744. };
  3745. return d
  3746. } ();
  3747. b.XML = c;
  3748. c.prototype.__class__ = "egret.XML"
  3749. })(egret || (egret = {})); (function(b) {
  3750. var c = function() {
  3751. function a() {}
  3752. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  3753. a.BIG_ENDIAN = "BIG_ENDIAN";
  3754. return a
  3755. } ();
  3756. b.Endian = c;
  3757. c.prototype.__class__ = "egret.Endian";
  3758. var d = function() {
  3759. function a() {
  3760. this.length = this.position = 0;
  3761. this._mode = "";
  3762. this.maxlength = 0;
  3763. this._endian = c.LITTLE_ENDIAN;
  3764. this.isLittleEndian = !1;
  3765. this._mode = "Typed array";
  3766. this.maxlength = 4;
  3767. this.arraybytes = new ArrayBuffer(this.maxlength);
  3768. this.unalignedarraybytestemp = new ArrayBuffer(16);
  3769. this.endian = a.DEFAULT_ENDIAN
  3770. }
  3771. Object.defineProperty(a.prototype, "endian", {
  3772. get: function() {
  3773. return this._endian
  3774. },
  3775. set: function(a) {
  3776. this._endian = a;
  3777. this.isLittleEndian = a == c.LITTLE_ENDIAN
  3778. },
  3779. enumerable: !0,
  3780. configurable: !0
  3781. });
  3782. a.prototype.ensureWriteableSpace = function(a) {
  3783. this.ensureSpace(a + this.position)
  3784. };
  3785. a.prototype.setArrayBuffer = function(a) {
  3786. this.ensureSpace(a.byteLength);
  3787. this.length = a.byteLength;
  3788. a = new Int8Array(a); (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  3789. this.position = 0
  3790. };
  3791. Object.defineProperty(a.prototype, "bytesAvailable", {
  3792. get: function() {
  3793. return this.length - this.position
  3794. },
  3795. enumerable: !0,
  3796. configurable: !0
  3797. });
  3798. a.prototype.ensureSpace = function(a) {
  3799. if (a > this.maxlength) {
  3800. a = a + 255 & -256;
  3801. var b = new ArrayBuffer(a),
  3802. d = new Uint8Array(this.arraybytes, 0, this.length); (new Uint8Array(b, 0, this.length)).set(d);
  3803. this.arraybytes = b;
  3804. this.maxlength = a
  3805. }
  3806. };
  3807. a.prototype.writeByte = function(a) {
  3808. this.ensureWriteableSpace(1); (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  3809. this.position > this.length && (this.length = this.position)
  3810. };
  3811. a.prototype.readByte = function() {
  3812. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3813. return (new Int8Array(this.arraybytes))[this.position++]
  3814. };
  3815. a.prototype.readBytes = function(a, b, d) {
  3816. "undefined" === typeof b && (b = 0);
  3817. "undefined" === typeof d && (d = 0);
  3818. null == d && (d = a.length);
  3819. a.ensureWriteableSpace(b + d);
  3820. var c = new Int8Array(a.arraybytes),
  3821. l = new Int8Array(this.arraybytes);
  3822. c.set(l.subarray(this.position, this.position + d), b);
  3823. this.position += d;
  3824. d + b > a.length && (a.length += d + b - a.length)
  3825. };
  3826. a.prototype.writeUnsignedByte = function(a) {
  3827. this.ensureWriteableSpace(1); (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  3828. this.position > this.length && (this.length = this.position)
  3829. };
  3830. a.prototype.readUnsignedByte = function() {
  3831. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3832. return (new Uint8Array(this.arraybytes))[this.position++]
  3833. };
  3834. a.prototype.writeUnsignedShort = function(a) {
  3835. this.ensureWriteableSpace(2);
  3836. if (0 == (this.position & 1)) {
  3837. var b = new Uint16Array(this.arraybytes);
  3838. b[this.position >> 1] = ~~a & 65535
  3839. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1),
  3840. b[0] = ~~a & 65535,
  3841. a = new Uint8Array(this.arraybytes, this.position, 2),
  3842. b = new Uint8Array(this.unalignedarraybytestemp, 0, 2),
  3843. a.set(b);
  3844. this.position += 2;
  3845. this.position > this.length && (this.length = this.position)
  3846. };
  3847. a.prototype.readUTFBytes = function(a) {
  3848. var b = "";
  3849. a = this.position + a;
  3850. for (var d = new DataView(this.arraybytes); this.position < a;) {
  3851. var c = d.getUint8(this.position++);
  3852. if (128 > c) {
  3853. if (0 == c) break;
  3854. b += String.fromCharCode(c)
  3855. } else if (224 > c) b += String.fromCharCode((c & 63) << 6 | d.getUint8(this.position++) & 127);
  3856. else if (240 > c) var l = d.getUint8(this.position++),
  3857. b = b + String.fromCharCode((c & 31) << 12 | (l & 127) << 6 | d.getUint8(this.position++) & 127);
  3858. else var l = d.getUint8(this.position++),
  3859. h = d.getUint8(this.position++),
  3860. b = b + String.fromCharCode((c & 15) << 18 | (l & 127) << 12 | h << 6 & 127 | d.getUint8(this.position++) & 127)
  3861. }
  3862. return b
  3863. };
  3864. a.prototype.readInt = function() {
  3865. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  3866. this.position += 4;
  3867. return a
  3868. };
  3869. a.prototype.readShort = function() {
  3870. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  3871. this.position += 2;
  3872. return a
  3873. };
  3874. a.prototype.readDouble = function() {
  3875. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  3876. this.position += 8;
  3877. return a
  3878. };
  3879. a.prototype.readUnsignedShort = function() {
  3880. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3881. if (0 == (this.position & 1)) {
  3882. var a = new Uint16Array(this.arraybytes),
  3883. b = this.position >> 1;
  3884. this.position += 2;
  3885. return a[b]
  3886. }
  3887. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  3888. b = new Uint8Array(this.arraybytes, this.position, 2); (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  3889. this.position += 2;
  3890. return a[0]
  3891. };
  3892. a.prototype.writeUnsignedInt = function(a) {
  3893. this.ensureWriteableSpace(4);
  3894. if (0 == (this.position & 3)) {
  3895. var b = new Uint32Array(this.arraybytes);
  3896. b[this.position >> 2] = ~~a & 4294967295
  3897. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1),
  3898. b[0] = ~~a & 4294967295,
  3899. a = new Uint8Array(this.arraybytes, this.position, 4),
  3900. b = new Uint8Array(this.unalignedarraybytestemp, 0, 4),
  3901. a.set(b);
  3902. this.position += 4;
  3903. this.position > this.length && (this.length = this.position)
  3904. };
  3905. a.prototype.readUnsignedInt = function() {
  3906. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3907. if (0 == (this.position & 3)) {
  3908. var a = new Uint32Array(this.arraybytes),
  3909. b = this.position >> 2;
  3910. this.position += 4;
  3911. return a[b]
  3912. }
  3913. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  3914. b = new Uint8Array(this.arraybytes, this.position, 4); (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3915. this.position += 4;
  3916. return a[0]
  3917. };
  3918. a.prototype.writeFloat = function(a) {
  3919. this.ensureWriteableSpace(4);
  3920. if (0 == (this.position & 3)) {
  3921. var b = new Float32Array(this.arraybytes);
  3922. b[this.position >> 2] = a
  3923. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1),
  3924. b[0] = a,
  3925. a = new Uint8Array(this.arraybytes, this.position, 4),
  3926. b = new Uint8Array(this.unalignedarraybytestemp, 0, 4),
  3927. a.set(b);
  3928. this.position += 4;
  3929. this.position > this.length && (this.length = this.position)
  3930. };
  3931. a.prototype.readFloat = function() {
  3932. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3933. if (0 == (this.position & 3)) {
  3934. var a = new Float32Array(this.arraybytes),
  3935. b = this.position >> 2;
  3936. this.position += 4;
  3937. return a[b]
  3938. }
  3939. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  3940. b = new Uint8Array(this.arraybytes, this.position, 4); (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3941. this.position += 4;
  3942. return a[0]
  3943. };
  3944. a.DEFAULT_ENDIAN = c.BIG_ENDIAN;
  3945. return a
  3946. } ();
  3947. b.ByteArray = d;
  3948. d.prototype.__class__ = "egret.ByteArray"
  3949. })(egret || (egret = {}));
  3950. __extends = this.__extends ||
  3951. function(b, c) {
  3952. function d() {
  3953. this.constructor = b
  3954. }
  3955. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3956. d.prototype = c.prototype;
  3957. b.prototype = new d
  3958. }; (function(b) {
  3959. var c = function(d) {
  3960. function a(a, b, c) {
  3961. d.call(this);
  3962. this._target = null;
  3963. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  3964. this._actions = this._steps = this.pluginData = null;
  3965. this.paused = !1;
  3966. this.duration = 0;
  3967. this._prevPos = -1;
  3968. this.position = null;
  3969. this._stepPosition = this._prevPosition = 0;
  3970. this.passive = !1;
  3971. this.initialize(a, b, c)
  3972. }
  3973. __extends(a, d);
  3974. a.get = function(e, b, d, c) {
  3975. "undefined" === typeof b && (b = null);
  3976. "undefined" === typeof d && (d = null);
  3977. "undefined" === typeof c && (c = !1);
  3978. c && a.removeTweens(e);
  3979. return new a(e, b, d)
  3980. };
  3981. a.removeTweens = function(e) {
  3982. if (e.tween_count) {
  3983. for (var b = a._tweens,
  3984. d = b.length - 1; 0 <= d; d--) b[d]._target == e && (b[d].paused = !0, b.splice(d, 1));
  3985. e.tween_count = 0
  3986. }
  3987. };
  3988. a.tick = function(e, b) {
  3989. "undefined" === typeof b && (b = !1);
  3990. for (var d = a._tweens.concat(), c = d.length - 1; 0 <= c; c--) {
  3991. var l = d[c];
  3992. b && !l.ignoreGlobalPause || l.paused || l.tick(l._useTicks ? 1 : e)
  3993. }
  3994. };
  3995. a._register = function(e, d) {
  3996. var c = e._target,
  3997. m = a._tweens;
  3998. if (d) c && (c.tween_count = c.tween_count ? c.tween_count + 1 : 1),
  3999. m.push(e),
  4000. a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  4001. else for (c && c.tween_count--, c = m.length; c--;) if (m[c] == e) {
  4002. m.splice(c, 1);
  4003. break
  4004. }
  4005. };
  4006. a.removeAllTweens = function() {
  4007. for (var e = a._tweens,
  4008. b = 0,
  4009. d = e.length; b < d; b++) {
  4010. var c = e[b];
  4011. c.paused = !0;
  4012. c._target.tweenjs_count = 0
  4013. }
  4014. e.length = 0
  4015. };
  4016. a.prototype.initialize = function(e, b, d) {
  4017. this._target = e;
  4018. 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));
  4019. this.pluginData = d || {};
  4020. this._curQueueProps = {};
  4021. this._initQueueProps = {};
  4022. this._steps = [];
  4023. this._actions = [];
  4024. b && b.paused ? this.paused = !0 : a._register(this, !0);
  4025. b && null != b.position && this.setPosition(b.position, a.NONE)
  4026. };
  4027. a.prototype.setPosition = function(a, b) {
  4028. "undefined" === typeof b && (b = 1);
  4029. 0 > a && (a = 0);
  4030. var d = a,
  4031. c = !1;
  4032. d >= this.duration && (this.loop ? d %= this.duration: (d = this.duration, c = !0));
  4033. if (d == this._prevPos) return c;
  4034. var l = this._prevPos;
  4035. this.position = this._prevPos = d;
  4036. this._prevPosition = a;
  4037. if (this._target) if (c) this._updateTargetProps(null, 1);
  4038. else if (0 < this._steps.length) {
  4039. for (var h = 0,
  4040. k = this._steps.length; h < k && !(this._steps[h].t > d); h++);
  4041. h = this._steps[h - 1];
  4042. this._updateTargetProps(h, (this._stepPosition = d - h.t) / h.d)
  4043. }
  4044. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < l ? (l != this.duration && this._runActions(l, this.duration), this._runActions(0, d, !0)) : this._runActions(l, d));
  4045. c && this.setPaused(!0);
  4046. this.dispatchEventWith("change");
  4047. return c
  4048. };
  4049. a.prototype._runActions = function(a, b, d) {
  4050. "undefined" === typeof d && (d = !1);
  4051. var c = a,
  4052. l = b,
  4053. h = -1,
  4054. k = this._actions.length,
  4055. p = 1;
  4056. a > b && (c = b, l = a, h = k, k = p = -1);
  4057. for (; (h += p) != k;) {
  4058. b = this._actions[h];
  4059. var n = b.t; (n == l || n > c && n < l || d && n == a) && b.f.apply(b.o, b.p)
  4060. }
  4061. };
  4062. a.prototype._updateTargetProps = function(e, b) {
  4063. var d, c, l, h;
  4064. if (e || 1 != b) {
  4065. if (this.passive = !!e.v) return;
  4066. e.e && (b = e.e(b, 0, 1, 1));
  4067. d = e.p0;
  4068. c = e.p1
  4069. } else this.passive = !1,
  4070. d = c = this._curQueueProps;
  4071. for (var k in this._initQueueProps) {
  4072. null == (l = d[k]) && (d[k] = l = this._initQueueProps[k]);
  4073. null == (h = c[k]) && (c[k] = h = l);
  4074. l = l == h || 0 == b || 1 == b || "number" != typeof l ? 1 == b ? h: l: l + (h - l) * b;
  4075. var p = !1;
  4076. if (h = a._plugins[k]) for (var n = 0,
  4077. q = h.length; n < q; n++) {
  4078. var t = h[n].tween(this, k, l, d, c, b, !!e && d == c, !e);
  4079. t == a.IGNORE ? p = !0 : l = t
  4080. }
  4081. p || (this._target[k] = l)
  4082. }
  4083. };
  4084. a.prototype.setPaused = function(e) {
  4085. this.paused = e;
  4086. a._register(this, !e);
  4087. return this
  4088. };
  4089. a.prototype._cloneProps = function(a) {
  4090. var b = {},
  4091. d;
  4092. for (d in a) b[d] = a[d];
  4093. return b
  4094. };
  4095. a.prototype._addStep = function(a) {
  4096. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  4097. return this
  4098. };
  4099. a.prototype._appendQueueProps = function(e) {
  4100. var b, d, c, l, h, k;
  4101. for (k in e) if (void 0 === this._initQueueProps[k]) {
  4102. d = this._target[k];
  4103. if (b = a._plugins[k]) for (c = 0, l = b.length; c < l; c++) d = b[c].init(this, k, d);
  4104. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null: d
  4105. }
  4106. for (k in e) {
  4107. d = this._curQueueProps[k];
  4108. if (b = a._plugins[k]) for (h = h || {},
  4109. c = 0, l = b.length; c < l; c++) b[c].step && b[c].step(this, k, d, e[k], h);
  4110. this._curQueueProps[k] = e[k]
  4111. }
  4112. h && this._appendQueueProps(h);
  4113. return this._curQueueProps
  4114. };
  4115. a.prototype._addAction = function(a) {
  4116. a.t = this.duration;
  4117. this._actions.push(a);
  4118. return this
  4119. };
  4120. a.prototype._set = function(a, b) {
  4121. for (var d in a) b[d] = a[d]
  4122. };
  4123. a.prototype.wait = function(a, b) {
  4124. if (null == a || 0 >= a) return this;
  4125. var d = this._cloneProps(this._curQueueProps);
  4126. return this._addStep({
  4127. d: a,
  4128. p0: d,
  4129. p1: d,
  4130. v: b
  4131. })
  4132. };
  4133. a.prototype.to = function(a, b, d) {
  4134. "undefined" === typeof d && (d = void 0);
  4135. if (isNaN(b) || 0 > b) b = 0;
  4136. return this._addStep({
  4137. d: b || 0,
  4138. p0: this._cloneProps(this._curQueueProps),
  4139. e: d,
  4140. p1: this._cloneProps(this._appendQueueProps(a))
  4141. })
  4142. };
  4143. a.prototype.call = function(a, b, d) {
  4144. "undefined" === typeof b && (b = void 0);
  4145. "undefined" === typeof d && (d = void 0);
  4146. return this._addAction({
  4147. f: a,
  4148. p: d ? d: [],
  4149. o: b ? b: this._target
  4150. })
  4151. };
  4152. a.prototype.set = function(a, b) {
  4153. "undefined" === typeof b && (b = null);
  4154. return this._addAction({
  4155. f: this._set,
  4156. o: this,
  4157. p: [a, b ? b: this._target]
  4158. })
  4159. };
  4160. a.prototype.play = function(a) {
  4161. a || (a = this);
  4162. return this.call(a.setPaused, a, [!1])
  4163. };
  4164. a.prototype.pause = function(a) {
  4165. a || (a = this);
  4166. return this.call(a.setPaused, a, [!0])
  4167. };
  4168. a.prototype.tick = function(a) {
  4169. this.paused || this.setPosition(this._prevPosition + a)
  4170. };
  4171. a.NONE = 0;
  4172. a.LOOP = 1;
  4173. a.REVERSE = 2;
  4174. a._tweens = [];
  4175. a.IGNORE = {};
  4176. a._plugins = {};
  4177. a._inited = !1;
  4178. return a
  4179. } (b.EventDispatcher);
  4180. b.Tween = c;
  4181. c.prototype.__class__ = "egret.Tween"
  4182. })(egret || (egret = {})); (function(b) {
  4183. var c = function() {
  4184. function d() {
  4185. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  4186. }
  4187. d.get = function(a) { - 1 > a && (a = -1);
  4188. 1 < a && (a = 1);
  4189. return function(b) {
  4190. return 0 == a ? b: 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  4191. }
  4192. };
  4193. d.getPowIn = function(a) {
  4194. return function(b) {
  4195. return Math.pow(b, a)
  4196. }
  4197. };
  4198. d.getPowOut = function(a) {
  4199. return function(b) {
  4200. return 1 - Math.pow(1 - b, a)
  4201. }
  4202. };
  4203. d.getPowInOut = function(a) {
  4204. return function(b) {
  4205. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  4206. }
  4207. };
  4208. d.sineIn = function(a) {
  4209. return 1 - Math.cos(a * Math.PI / 2)
  4210. };
  4211. d.sineOut = function(a) {
  4212. return Math.sin(a * Math.PI / 2)
  4213. };
  4214. d.sineInOut = function(a) {
  4215. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  4216. };
  4217. d.getBackIn = function(a) {
  4218. return function(b) {
  4219. return b * b * ((a + 1) * b - a)
  4220. }
  4221. };
  4222. d.getBackOut = function(a) {
  4223. return function(b) {
  4224. b -= 1;
  4225. return b * b * ((a + 1) * b + a) + 1
  4226. }
  4227. };
  4228. d.getBackInOut = function(a) {
  4229. a *= 1.525;
  4230. return function(b) {
  4231. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  4232. }
  4233. };
  4234. d.circIn = function(a) {
  4235. return - (Math.sqrt(1 - a * a) - 1)
  4236. };
  4237. d.circOut = function(a) {
  4238. return Math.sqrt(1 - a * a)
  4239. };
  4240. d.circInOut = function(a) {
  4241. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  4242. };
  4243. d.bounceIn = function(a) {
  4244. return 1 - d.bounceOut(1 - a)
  4245. };
  4246. d.bounceOut = function(a) {
  4247. 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
  4248. };
  4249. d.bounceInOut = function(a) {
  4250. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  4251. };
  4252. d.getElasticIn = function(a, b) {
  4253. var d = 2 * Math.PI;
  4254. return function(c) {
  4255. if (0 == c || 1 == c) return c;
  4256. var m = b / d * Math.asin(1 / a);
  4257. return - (a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - m) * d / b))
  4258. }
  4259. };
  4260. d.getElasticOut = function(a, b) {
  4261. var d = 2 * Math.PI;
  4262. return function(c) {
  4263. if (0 == c || 1 == c) return c;
  4264. var m = b / d * Math.asin(1 / a);
  4265. return a * Math.pow(2, -10 * c) * Math.sin((c - m) * d / b) + 1
  4266. }
  4267. };
  4268. d.getElasticInOut = function(a, b) {
  4269. var d = 2 * Math.PI;
  4270. return function(c) {
  4271. var m = b / d * Math.asin(1 / a);
  4272. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - m) * d / b) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - m) * d / b) * 0.5 + 1
  4273. }
  4274. };
  4275. d.quadIn = d.getPowIn(2);
  4276. d.quadOut = d.getPowOut(2);
  4277. d.quadInOut = d.getPowInOut(2);
  4278. d.cubicIn = d.getPowIn(3);
  4279. d.cubicOut = d.getPowOut(3);
  4280. d.cubicInOut = d.getPowInOut(3);
  4281. d.quartIn = d.getPowIn(4);
  4282. d.quartOut = d.getPowOut(4);
  4283. d.quartInOut = d.getPowInOut(4);
  4284. d.quintIn = d.getPowIn(5);
  4285. d.quintOut = d.getPowOut(5);
  4286. d.quintInOut = d.getPowInOut(5);
  4287. d.backIn = d.getBackIn(1.7);
  4288. d.backOut = d.getBackOut(1.7);
  4289. d.backInOut = d.getBackInOut(1.7);
  4290. d.elasticIn = d.getElasticIn(1, 0.3);
  4291. d.elasticOut = d.getElasticOut(1, 0.3);
  4292. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  4293. return d
  4294. } ();
  4295. b.Ease = c;
  4296. c.prototype.__class__ = "egret.Ease"
  4297. })(egret || (egret = {})); (function(b) {
  4298. var c = function() {
  4299. function b() {
  4300. this.type = b.EFFECT
  4301. }
  4302. b.prototype.play = function(a) {
  4303. "undefined" === typeof a && (a = !1);
  4304. var b = this.audio;
  4305. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  4306. };
  4307. b.prototype.pause = function() {
  4308. var a = this.audio;
  4309. a && a.pause()
  4310. };
  4311. b.prototype.load = function() {
  4312. var a = this.audio;
  4313. a && a.load()
  4314. };
  4315. b.prototype.addEventListener = function(a, b) {
  4316. this.audio && this.audio.addEventListener(a, b, !1)
  4317. };
  4318. b.prototype.removeEventListener = function(a, b) {
  4319. this.audio && this.audio.removeEventListener(a, b, !1)
  4320. };
  4321. b.prototype.setVolume = function(a) {
  4322. var b = this.audio;
  4323. b && (b.volume = a)
  4324. };
  4325. b.prototype.getVolume = function() {
  4326. return this.audio ? this.audio.volume: 0
  4327. };
  4328. b.prototype.preload = function(a) {
  4329. this.type = a
  4330. };
  4331. b.prototype._setAudio = function(a) {
  4332. this.audio = a
  4333. };
  4334. b.MUSIC = "music";
  4335. b.EFFECT = "effect";
  4336. return b
  4337. } ();
  4338. b.Sound = c;
  4339. c.prototype.__class__ = "egret.Sound"
  4340. })(egret || (egret = {})); (function(b) {
  4341. var c = function() {
  4342. function b() {}
  4343. b.isNumber = function(a) {
  4344. return "number" === typeof a && !isNaN(a)
  4345. };
  4346. return b
  4347. } ();
  4348. b.NumberUtils = c;
  4349. c.prototype.__class__ = "egret.NumberUtils"
  4350. })(egret || (egret = {}));
  4351. var __extends = this.__extends ||
  4352. function(b, c) {
  4353. function d() {
  4354. this.constructor = b
  4355. }
  4356. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4357. d.prototype = c.prototype;
  4358. b.prototype = new d
  4359. },
  4360. RES; (function(b) {
  4361. var c = function(b) {
  4362. function a(a, c, f) {
  4363. "undefined" === typeof c && (c = !1);
  4364. "undefined" === typeof f && (f = !1);
  4365. b.call(this, a, c, f);
  4366. this.itemsTotal = this.itemsLoaded = 0
  4367. }
  4368. __extends(a, b);
  4369. a.dispatchResourceEvent = function(b, d, c, m, l, h) {
  4370. "undefined" === typeof c && (c = "");
  4371. "undefined" === typeof m && (m = null);
  4372. "undefined" === typeof l && (l = 0);
  4373. "undefined" === typeof h && (h = 0);
  4374. var k = egret.Event._getPropertyData(a);
  4375. k.groupName = c;
  4376. k.resItem = m;
  4377. k.itemsLoaded = l;
  4378. k.itemsTotal = h;
  4379. egret.Event._dispatchByTarget(a, b, d, k)
  4380. };
  4381. a.ITEM_LOAD_ERROR = "itemLoadError";
  4382. a.CONFIG_COMPLETE = "configComplete";
  4383. a.GROUP_PROGRESS = "groupProgress";
  4384. a.GROUP_COMPLETE = "groupComplete";
  4385. return a
  4386. } (egret.Event);
  4387. b.ResourceEvent = c;
  4388. c.prototype.__class__ = "RES.ResourceEvent"
  4389. })(RES || (RES = {})); (function(b) {
  4390. var c = function() {
  4391. function b(a, e, c) {
  4392. this._loaded = !1;
  4393. this.name = a;
  4394. this.url = e;
  4395. this.type = c
  4396. }
  4397. Object.defineProperty(b.prototype, "loaded", {
  4398. get: function() {
  4399. return this.data ? this.data.loaded: this._loaded
  4400. },
  4401. set: function(a) {
  4402. this.data && (this.data.loaded = a);
  4403. this._loaded = a
  4404. },
  4405. enumerable: !0,
  4406. configurable: !0
  4407. });
  4408. b.prototype.toString = function() {
  4409. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  4410. };
  4411. b.TYPE_XML = "xml";
  4412. b.TYPE_IMAGE = "image";
  4413. b.TYPE_BIN = "bin";
  4414. b.TYPE_TEXT = "text";
  4415. b.TYPE_JSON = "json";
  4416. b.TYPE_SHEET = "sheet";
  4417. b.TYPE_FONT = "font";
  4418. b.TYPE_SOUND = "sound";
  4419. return b
  4420. } ();
  4421. b.ResourceItem = c;
  4422. c.prototype.__class__ = "RES.ResourceItem"
  4423. })(RES || (RES = {})); (function(b) {
  4424. var c = function() {
  4425. function c() {
  4426. this.keyMap = {};
  4427. this.groupDic = {}
  4428. }
  4429. c.prototype.getGroupByName = function(a) {
  4430. var b = [];
  4431. if (!this.groupDic[a]) return b;
  4432. a = this.groupDic[a];
  4433. for (var c = a.length,
  4434. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  4435. return b
  4436. };
  4437. c.prototype.getRawGroupByName = function(a) {
  4438. return this.groupDic[a] ? this.groupDic[a] : []
  4439. };
  4440. c.prototype.createGroup = function(a, b, c) {
  4441. "undefined" === typeof c && (c = !1);
  4442. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  4443. c = this.groupDic;
  4444. for (var d = [], m = b.length, l = 0; l < m; l++) {
  4445. var h = b[l],
  4446. k = c[h];
  4447. if (k) for (var h = k.length,
  4448. p = 0; p < h; p++) {
  4449. var n = k[p]; - 1 == d.indexOf(n) && d.push(n)
  4450. } else(n = this.keyMap[h]) && -1 == d.indexOf(n) && d.push(n)
  4451. }
  4452. if (0 == d.length) return ! 1;
  4453. this.groupDic[a] = d;
  4454. return ! 0
  4455. };
  4456. c.prototype.parseConfig = function(a, b) {
  4457. if (a) {
  4458. var c = a.resources;
  4459. if (c) for (var d = c.length,
  4460. m = 0; m < d; m++) {
  4461. var l = c[m],
  4462. h = l.url;
  4463. h && -1 == h.indexOf("://") && (l.url = b + h);
  4464. this.addItemToKeyMap(l)
  4465. }
  4466. if (c = a.groups) for (d = c.length, m = 0; m < d; m++) {
  4467. for (var h = c[m], k = [], p = h.keys.split(","), n = p.length, q = 0; q < n; q++) l = p[q].trim(),
  4468. (l = this.keyMap[l]) && -1 == k.indexOf(l) && k.push(l);
  4469. this.groupDic[h.name] = k
  4470. }
  4471. }
  4472. };
  4473. c.prototype.addItemToKeyMap = function(a) {
  4474. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  4475. if (a.hasOwnProperty("subkeys")) {
  4476. var b = a.subkeys.split(",");
  4477. a.subkeys = b;
  4478. for (var c = b.length,
  4479. d = 0; d < c; d++) {
  4480. var m = b[d];
  4481. null == this.keyMap[m] && (this.keyMap[m] = a)
  4482. }
  4483. }
  4484. };
  4485. c.prototype.getName = function(a) {
  4486. return (a = this.keyMap[a]) ? a.name: ""
  4487. };
  4488. c.prototype.getType = function(a) {
  4489. return (a = this.keyMap[a]) ? a.type: ""
  4490. };
  4491. c.prototype.getRawResourceItem = function(a) {
  4492. return this.keyMap[a]
  4493. };
  4494. c.prototype.getResourceItem = function(a) {
  4495. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  4496. };
  4497. c.prototype.parseResourceItem = function(a) {
  4498. var e = new b.ResourceItem(a.name, a.url, a.type);
  4499. e.data = a;
  4500. return e
  4501. };
  4502. return c
  4503. } ();
  4504. b.ResourceConfig = c;
  4505. c.prototype.__class__ = "RES.ResourceConfig"
  4506. })(RES || (RES = {}));
  4507. __extends = this.__extends ||
  4508. function(b, c) {
  4509. function d() {
  4510. this.constructor = b
  4511. }
  4512. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4513. d.prototype = c.prototype;
  4514. b.prototype = new d
  4515. }; (function(b) {
  4516. var c = function(c) {
  4517. function a() {
  4518. c.call(this);
  4519. this.thread = 2;
  4520. this.loadingCount = 0;
  4521. this.groupTotalDic = {};
  4522. this.numLoadedDic = {};
  4523. this.itemListDic = {};
  4524. this.priorityQueue = {};
  4525. this.lazyLoadList = [];
  4526. this.analyzerDic = {};
  4527. this.queueIndex = 0
  4528. }
  4529. __extends(a, c);
  4530. a.prototype.isGroupInLoading = function(a) {
  4531. return void 0 !== this.itemListDic[a]
  4532. };
  4533. a.prototype.loadGroup = function(a, c, d) {
  4534. "undefined" === typeof d && (d = 0);
  4535. if (!this.itemListDic[c] && c) if (a && 0 != a.length) {
  4536. this.priorityQueue[d] ? this.priorityQueue[d].push(c) : this.priorityQueue[d] = [c];
  4537. this.itemListDic[c] = a;
  4538. d = a.length;
  4539. for (var m = 0; m < d; m++) a[m].groupName = c;
  4540. this.groupTotalDic[c] = a.length;
  4541. this.numLoadedDic[c] = 0;
  4542. this.next()
  4543. } else a = new b.ResourceEvent(b.ResourceEvent.GROUP_COMPLETE),
  4544. a.groupName = c,
  4545. this.dispatchEvent(a)
  4546. };
  4547. a.prototype.loadItem = function(a) {
  4548. this.lazyLoadList.push(a);
  4549. a.groupName = "";
  4550. this.next()
  4551. };
  4552. a.prototype.next = function() {
  4553. for (; this.loadingCount < this.thread;) {
  4554. var a = this.getOneResourceItem();
  4555. if (!a) break;
  4556. this.loadingCount++;
  4557. if (a.loaded) this.onItemComplete(a);
  4558. else {
  4559. var c = this.analyzerDic[a.type];
  4560. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  4561. c.loadFile(a, this.onItemComplete, this)
  4562. }
  4563. }
  4564. };
  4565. a.prototype.getOneResourceItem = function() {
  4566. var a = Number.NEGATIVE_INFINITY,
  4567. b;
  4568. for (b in this.priorityQueue) a = Math.max(a, b);
  4569. a = this.priorityQueue[a];
  4570. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  4571. b = a.length;
  4572. for (var c, d = 0; d < b; d++) {
  4573. this.queueIndex >= b && (this.queueIndex = 0);
  4574. c = this.itemListDic[a[this.queueIndex]];
  4575. if (0 < c.length) break;
  4576. this.queueIndex++
  4577. }
  4578. return 0 == c.length ? null: c.shift()
  4579. };
  4580. a.prototype.onItemComplete = function(a) {
  4581. this.loadingCount--;
  4582. var c = a.groupName;
  4583. a.loaded || b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  4584. if (c) {
  4585. this.numLoadedDic[c]++;
  4586. var d = this.numLoadedDic[c],
  4587. m = this.groupTotalDic[c];
  4588. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, d, m);
  4589. d == m && (this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, c))
  4590. } else this.callBack.call(this.resInstance, a);
  4591. this.next()
  4592. };
  4593. a.prototype.removeGroupName = function(a) {
  4594. for (var b in this.priorityQueue) {
  4595. for (var c = this.priorityQueue[b], d = c.length, l = 0, h = !1, d = c.length, k = 0; k < d; k++) {
  4596. if (c[k] == a) {
  4597. c.splice(l, 1);
  4598. h = !0;
  4599. break
  4600. }
  4601. l++
  4602. }
  4603. if (h) {
  4604. 0 == c.length && delete this.priorityQueue[b];
  4605. break
  4606. }
  4607. }
  4608. };
  4609. return a
  4610. } (egret.EventDispatcher);
  4611. b.ResourceLoader = c;
  4612. c.prototype.__class__ = "RES.ResourceLoader"
  4613. })(RES || (RES = {}));
  4614. __extends = this.__extends ||
  4615. function(b, c) {
  4616. function d() {
  4617. this.constructor = b
  4618. }
  4619. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4620. d.prototype = c.prototype;
  4621. b.prototype = new d
  4622. }; (function(b) {
  4623. var c = function(b) {
  4624. function a() {
  4625. b.call(this)
  4626. }
  4627. __extends(a, b);
  4628. a.prototype.loadFile = function(a, b, c) {};
  4629. a.prototype.getRes = function(a) {};
  4630. a.prototype.destroyRes = function(a) {
  4631. return ! 1
  4632. };
  4633. a.getStringPrefix = function(a) {
  4634. if (!a) return "";
  4635. var b = a.indexOf(".");
  4636. return - 1 != b ? a.substring(0, b) : ""
  4637. };
  4638. a.getStringTail = function(a) {
  4639. if (!a) return "";
  4640. var b = a.indexOf(".");
  4641. return - 1 != b ? a.substring(b + 1) : ""
  4642. };
  4643. return a
  4644. } (egret.HashObject);
  4645. b.AnalyzerBase = c;
  4646. c.prototype.__class__ = "RES.AnalyzerBase"
  4647. })(RES || (RES = {}));
  4648. __extends = this.__extends ||
  4649. function(b, c) {
  4650. function d() {
  4651. this.constructor = b
  4652. }
  4653. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4654. d.prototype = c.prototype;
  4655. b.prototype = new d
  4656. }; (function(b) {
  4657. var c = function(b) {
  4658. function a() {
  4659. b.call(this);
  4660. this.fileDic = {};
  4661. this.resItemDic = [];
  4662. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  4663. this.recycler = new egret.Recycler
  4664. }
  4665. __extends(a, b);
  4666. a.prototype.loadFile = function(a, b, c) {
  4667. if (this.fileDic[a.name]) b.call(c, a);
  4668. else {
  4669. var d = this.getLoader();
  4670. this.resItemDic[d.hashCode] = {
  4671. item: a,
  4672. func: b,
  4673. thisObject: c
  4674. };
  4675. d.load(new egret.URLRequest(a.url))
  4676. }
  4677. };
  4678. a.prototype.getLoader = function() {
  4679. var a = this.recycler.pop();
  4680. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  4681. a.dataFormat = this._dataFormat;
  4682. return a
  4683. };
  4684. a.prototype.onLoadFinish = function(a) {
  4685. var b = a.target,
  4686. c = this.resItemDic[b.hashCode];
  4687. delete this.resItemDic[b.hashCode];
  4688. this.recycler.push(b);
  4689. var d = c.item,
  4690. l = c.func;
  4691. d.loaded = a.type == egret.Event.COMPLETE;
  4692. d.loaded && this.analyzeData(d, b.data);
  4693. l.call(c.thisObject, d)
  4694. };
  4695. a.prototype.analyzeData = function(a, b) {
  4696. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
  4697. };
  4698. a.prototype.getRes = function(a) {
  4699. return this.fileDic[a]
  4700. };
  4701. a.prototype.hasRes = function(a) {
  4702. return null != this.getRes(a)
  4703. };
  4704. a.prototype.destroyRes = function(a) {
  4705. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  4706. };
  4707. return a
  4708. } (b.AnalyzerBase);
  4709. b.BinAnalyzer = c;
  4710. c.prototype.__class__ = "RES.BinAnalyzer"
  4711. })(RES || (RES = {}));
  4712. __extends = this.__extends ||
  4713. function(b, c) {
  4714. function d() {
  4715. this.constructor = b
  4716. }
  4717. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4718. d.prototype = c.prototype;
  4719. b.prototype = new d
  4720. }; (function(b) {
  4721. var c = function(b) {
  4722. function a() {
  4723. b.call(this);
  4724. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  4725. }
  4726. __extends(a, b);
  4727. a.prototype.analyzeData = function(a, b) {
  4728. 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]))))
  4729. };
  4730. return a
  4731. } (b.BinAnalyzer);
  4732. b.ImageAnalyzer = c;
  4733. c.prototype.__class__ = "RES.ImageAnalyzer"
  4734. })(RES || (RES = {}));
  4735. __extends = this.__extends ||
  4736. function(b, c) {
  4737. function d() {
  4738. this.constructor = b
  4739. }
  4740. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4741. d.prototype = c.prototype;
  4742. b.prototype = new d
  4743. }; (function(b) {
  4744. var c = function(b) {
  4745. function a() {
  4746. b.call(this);
  4747. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4748. }
  4749. __extends(a, b);
  4750. a.prototype.analyzeData = function(a, b) {
  4751. var c = a.name;
  4752. if (!this.fileDic[c] && b) try {
  4753. this.fileDic[c] = JSON.parse(b)
  4754. } catch(d) {
  4755. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + NaN + b)
  4756. }
  4757. };
  4758. return a
  4759. } (b.BinAnalyzer);
  4760. b.JsonAnalyzer = c;
  4761. c.prototype.__class__ = "RES.JsonAnalyzer"
  4762. })(RES || (RES = {}));
  4763. __extends = this.__extends ||
  4764. function(b, c) {
  4765. function d() {
  4766. this.constructor = b
  4767. }
  4768. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4769. d.prototype = c.prototype;
  4770. b.prototype = new d
  4771. }; (function(b) {
  4772. var c = function(b) {
  4773. function a() {
  4774. b.call(this);
  4775. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4776. }
  4777. __extends(a, b);
  4778. return a
  4779. } (b.BinAnalyzer);
  4780. b.TextAnalyzer = c;
  4781. c.prototype.__class__ = "RES.TextAnalyzer"
  4782. })(RES || (RES = {}));
  4783. __extends = this.__extends ||
  4784. function(b, c) {
  4785. function d() {
  4786. this.constructor = b
  4787. }
  4788. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4789. d.prototype = c.prototype;
  4790. b.prototype = new d
  4791. }; (function(b) {
  4792. var c = function(c) {
  4793. function a() {
  4794. c.call(this);
  4795. this.sheetMap = {};
  4796. this.textureMap = {};
  4797. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4798. }
  4799. __extends(a, c);
  4800. a.prototype.getRes = function(a) {
  4801. var c = this.fileDic[a];
  4802. c || (c = this.textureMap[a]); ! c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  4803. return c
  4804. };
  4805. a.prototype.onLoadFinish = function(a) {
  4806. var b = a.target,
  4807. c = this.resItemDic[b.hashCode];
  4808. delete this.resItemDic[b.hashCode];
  4809. this.recycler.push(b);
  4810. var d = c.item,
  4811. l = c.func;
  4812. d.loaded = a.type == egret.Event.COMPLETE;
  4813. d.loaded && this.analyzeData(d, b.data);
  4814. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, l, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : l.call(c.thisObject, d)
  4815. };
  4816. a.prototype.analyzeData = function(a, b) {
  4817. var c = a.name;
  4818. if (!this.fileDic[c] && b) {
  4819. var d;
  4820. if ("string" == typeof b) {
  4821. try {
  4822. d = JSON.parse(b)
  4823. } catch(l) {
  4824. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4825. }
  4826. d && (this.sheetMap[c] = d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  4827. } else d = this.sheetMap[c],
  4828. delete this.sheetMap[c],
  4829. b && (d = this.parseSpriteSheet(b, d), this.fileDic[c] = d)
  4830. }
  4831. };
  4832. a.prototype.getRelativePath = function(a, b) {
  4833. a = a.split("\\").join("/");
  4834. var c = a.lastIndexOf("/");
  4835. return a = -1 != c ? a.substring(0, c + 1) + b: b
  4836. };
  4837. a.prototype.parseSpriteSheet = function(a, b) {
  4838. var c = b.frames;
  4839. if (!c) return null;
  4840. var d = new egret.SpriteSheet(a),
  4841. l = this.textureMap,
  4842. h;
  4843. for (h in c) {
  4844. var k = c[h];
  4845. a = d.createTexture(h, k.x, k.y, k.w, k.h, k.offX, k.offY, k.sourceW, k.sourceH);
  4846. k.scale9grid && (k = k.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(k[0]), parseInt(k[1]), parseInt(k[2]), parseInt(k[3])));
  4847. null == l[h] && (l[h] = a)
  4848. }
  4849. return d
  4850. };
  4851. return a
  4852. } (b.BinAnalyzer);
  4853. b.SheetAnalyzer = c;
  4854. c.prototype.__class__ = "RES.SheetAnalyzer"
  4855. })(RES || (RES = {}));
  4856. __extends = this.__extends ||
  4857. function(b, c) {
  4858. function d() {
  4859. this.constructor = b
  4860. }
  4861. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4862. d.prototype = c.prototype;
  4863. b.prototype = new d
  4864. }; (function(b) {
  4865. var c = function(b) {
  4866. function a() {
  4867. b.call(this)
  4868. }
  4869. __extends(a, b);
  4870. a.prototype.analyzeData = function(a, b) {
  4871. var c = a.name;
  4872. if (!this.fileDic[c] && b) {
  4873. var d;
  4874. "string" == typeof b ? (d = b, this.sheetMap[c] = d, a.loaded = !1, a.url = this.getTexturePath(a.url, d)) : (d = this.sheetMap[c], delete this.sheetMap[c], b && (d = new egret.BitmapTextSpriteSheet(b, d), this.fileDic[c] = d))
  4875. }
  4876. };
  4877. a.prototype.getTexturePath = function(a, b) {
  4878. var c = "",
  4879. d = b.split("\n")[2],
  4880. l = d.indexOf('file="'); - 1 != l && (d = d.substring(l + 6), l = d.indexOf('"'), c = d.substring(0, l));
  4881. a = a.split("\\").join("/");
  4882. l = a.lastIndexOf("/");
  4883. return a = -1 != l ? a.substring(0, l + 1) + c: c
  4884. };
  4885. return a
  4886. } (b.SheetAnalyzer);
  4887. b.FontAnalyzer = c;
  4888. c.prototype.__class__ = "RES.FontAnalyzer"
  4889. })(RES || (RES = {}));
  4890. __extends = this.__extends ||
  4891. function(b, c) {
  4892. function d() {
  4893. this.constructor = b
  4894. }
  4895. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4896. d.prototype = c.prototype;
  4897. b.prototype = new d
  4898. }; (function(b) {
  4899. var c = function(b) {
  4900. function a() {
  4901. b.call(this);
  4902. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  4903. }
  4904. __extends(a, b);
  4905. a.prototype.analyzeData = function(a, b) {
  4906. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.soundType && b.preload(c.soundType))
  4907. };
  4908. return a
  4909. } (b.BinAnalyzer);
  4910. b.SoundAnalyzer = c;
  4911. c.prototype.__class__ = "RES.SoundAnalyzer"
  4912. })(RES || (RES = {}));
  4913. __extends = this.__extends ||
  4914. function(b, c) {
  4915. function d() {
  4916. this.constructor = b
  4917. }
  4918. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4919. d.prototype = c.prototype;
  4920. b.prototype = new d
  4921. }; (function(b) {
  4922. var c = function(b) {
  4923. function a() {
  4924. b.call(this);
  4925. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4926. }
  4927. __extends(a, b);
  4928. a.prototype.analyzeData = function(a, b) {
  4929. var c = a.name;
  4930. if (!this.fileDic[c] && b) try {
  4931. var d = egret.XML.parse(b);
  4932. this.fileDic[c] = d
  4933. } catch(l) {}
  4934. };
  4935. return a
  4936. } (b.BinAnalyzer);
  4937. b.XMLAnalyzer = c;
  4938. c.prototype.__class__ = "RES.XMLAnalyzer"
  4939. })(RES || (RES = {}));
  4940. __extends = this.__extends ||
  4941. function(b, c) {
  4942. function d() {
  4943. this.constructor = b
  4944. }
  4945. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4946. d.prototype = c.prototype;
  4947. b.prototype = new d
  4948. }; (function(b) {
  4949. b.loadConfig = function(a, b, c) {
  4950. "undefined" === typeof b && (b = "");
  4951. "undefined" === typeof c && (c = "json");
  4952. d.loadConfig(a, b, c)
  4953. };
  4954. b.loadGroup = function(a, b) {
  4955. "undefined" === typeof b && (b = 0);
  4956. d.loadGroup(a, b)
  4957. };
  4958. b.isGroupLoaded = function(a) {
  4959. return d.isGroupLoaded(a)
  4960. };
  4961. b.getGroupByName = function(a) {
  4962. return d.getGroupByName(a)
  4963. };
  4964. b.createGroup = function(a, b, c) {
  4965. "undefined" === typeof c && (c = !1);
  4966. return d.createGroup(a, b, c)
  4967. };
  4968. b.hasRes = function(a) {
  4969. return d.hasRes(a)
  4970. };
  4971. b.getRes = function(a) {
  4972. return d.getRes(a)
  4973. };
  4974. b.getResAsync = function(a, b, c) {
  4975. d.getResAsync(a, b, c)
  4976. };
  4977. b.getResByUrl = function(a, b, c, f) {
  4978. "undefined" === typeof f && (f = "");
  4979. d.getResByUrl(a, b, c, f)
  4980. };
  4981. b.destroyRes = function(a) {
  4982. return d.destroyRes(a)
  4983. };
  4984. b.setMaxLoadingThread = function(a) {
  4985. d.setMaxLoadingThread(a)
  4986. };
  4987. b.addEventListener = function(a, b, c, f, m) {
  4988. "undefined" === typeof f && (f = !1);
  4989. "undefined" === typeof m && (m = 0);
  4990. d.addEventListener(a, b, c, f, m)
  4991. };
  4992. b.removeEventListener = function(a, b, c, f) {
  4993. "undefined" === typeof f && (f = !1);
  4994. d.removeEventListener(a, b, c, f)
  4995. };
  4996. var c = function(a) {
  4997. function e() {
  4998. a.call(this);
  4999. this.analyzerDic = {};
  5000. this.configItemList = [];
  5001. this.configComplete = this.callLaterFlag = !1;
  5002. this.loadedGroups = [];
  5003. this.groupNameList = [];
  5004. this.asyncDic = {};
  5005. this.init()
  5006. }
  5007. __extends(e, a);
  5008. e.prototype.getAnalyzerByType = function(a) {
  5009. var e = this.analyzerDic[a];
  5010. e || (e = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  5011. return e
  5012. };
  5013. e.prototype.init = function() {
  5014. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  5015. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  5016. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  5017. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  5018. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  5019. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  5020. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  5021. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  5022. this.resConfig = new b.ResourceConfig;
  5023. this.resLoader = new b.ResourceLoader;
  5024. this.resLoader.callBack = this.onResourceItemComp;
  5025. this.resLoader.resInstance = this;
  5026. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  5027. };
  5028. e.prototype.loadConfig = function(a, b, e) {
  5029. "undefined" === typeof e && (e = "json");
  5030. this.configItemList.push({
  5031. url: a,
  5032. resourceRoot: b,
  5033. type: e
  5034. });
  5035. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  5036. };
  5037. e.prototype.startLoadConfig = function() {
  5038. this.callLaterFlag = !1;
  5039. var a = this.configItemList;
  5040. this.configItemList = [];
  5041. this.loadingConfigList = a;
  5042. for (var c = a.length,
  5043. d = [], l = 0; l < c; l++) {
  5044. var h = a[l],
  5045. h = new b.ResourceItem(h.url, h.url, h.type);
  5046. d.push(h)
  5047. }
  5048. this.resLoader.loadGroup(d, e.GROUP_CONFIG, Number.MAX_VALUE)
  5049. };
  5050. e.prototype.isGroupLoaded = function(a) {
  5051. return - 1 != this.loadedGroups.indexOf(a)
  5052. };
  5053. e.prototype.getGroupByName = function(a) {
  5054. return this.resConfig.getGroupByName(a)
  5055. };
  5056. e.prototype.loadGroup = function(a, b) {
  5057. "undefined" === typeof b && (b = 0);
  5058. if ( - 1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  5059. var e = this.resConfig.getGroupByName(a);
  5060. this.resLoader.loadGroup(e, a, b)
  5061. } else this.groupNameList.push({
  5062. name: a,
  5063. priority: b
  5064. })
  5065. };
  5066. e.prototype.createGroup = function(a, b, e) {
  5067. "undefined" === typeof e && (e = !1);
  5068. if (e) {
  5069. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1)
  5070. }
  5071. return this.resConfig.createGroup(a, b, e)
  5072. };
  5073. e.prototype.onGroupComp = function(a) {
  5074. if (a.groupName == e.GROUP_CONFIG) {
  5075. a = this.loadingConfigList.length;
  5076. for (var c = 0; c < a; c++) {
  5077. var d = this.loadingConfigList[c],
  5078. l = this.getAnalyzerByType(d.type),
  5079. h = l.getRes(d.url);
  5080. l.destroyRes(d.url);
  5081. this.resConfig.parseConfig(h, d.resourceRoot)
  5082. }
  5083. this.configComplete = !0;
  5084. this.loadingConfigList = null;
  5085. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  5086. d = this.groupNameList;
  5087. a = d.length;
  5088. for (c = 0; c < a; c++) l = d[c],
  5089. this.loadGroup(l.name, l.priority);
  5090. this.groupNameList = []
  5091. } else this.loadedGroups.push(a.groupName),
  5092. this.dispatchEvent(a)
  5093. };
  5094. e.prototype.hasRes = function(a) {
  5095. var e = this.resConfig.getType(a);
  5096. return "" == e && (a = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(a), "" == e) ? !1 : !0
  5097. };
  5098. e.prototype.getRes = function(a) {
  5099. var e = this.resConfig.getType(a);
  5100. return "" == e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(e), "" == e) ? null: this.getAnalyzerByType(e).getRes(a)
  5101. };
  5102. e.prototype.getResAsync = function(a, e, c) {
  5103. var d = this.resConfig.getType(a),
  5104. h = this.resConfig.getName(a);
  5105. if ("" == d && (h = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(h), "" == d)) {
  5106. e.call(c, null);
  5107. return
  5108. } (d = this.getAnalyzerByType(d).getRes(a)) ? e.call(c, d) : (a = {
  5109. key: a,
  5110. compFunc: e,
  5111. thisObject: c
  5112. },
  5113. this.asyncDic[h] ? this.asyncDic[h].push(a) : (this.asyncDic[h] = [a], h = this.resConfig.getResourceItem(h), this.resLoader.loadItem(h)))
  5114. };
  5115. e.prototype.getResByUrl = function(a, e, c, d) {
  5116. "undefined" === typeof d && (d = "");
  5117. if (a) {
  5118. d || (d = this.getTypeByUrl(a));
  5119. var h = this.getAnalyzerByType(d).getRes(a);
  5120. h ? e.call(c, h) : (e = {
  5121. key: a,
  5122. compFunc: e,
  5123. thisObject: c
  5124. },
  5125. this.asyncDic[a] ? this.asyncDic[a].push(e) : (this.asyncDic[a] = [e], a = new b.ResourceItem(a, a, d), this.resLoader.loadItem(a)))
  5126. } else e.call(c, null)
  5127. };
  5128. e.prototype.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  5129. switch (a) {
  5130. case b.ResourceItem.TYPE_XML:
  5131. case b.ResourceItem.TYPE_JSON:
  5132. case b.ResourceItem.TYPE_SHEET:
  5133. break;
  5134. case "png":
  5135. case "jpg":
  5136. case "gif":
  5137. a = b.ResourceItem.TYPE_IMAGE;
  5138. break;
  5139. case "fnt":
  5140. a = b.ResourceItem.TYPE_FONT;
  5141. break;
  5142. case "txt":
  5143. a = b.ResourceItem.TYPE_TEXT;
  5144. break;
  5145. case "mp3":
  5146. case "ogg":
  5147. case "mpeg":
  5148. case "wav":
  5149. case "m4a":
  5150. case "mp4":
  5151. case "aiff":
  5152. case "wma":
  5153. case "mid":
  5154. a = b.ResourceItem.TYPE_SOUND;
  5155. break;
  5156. default:
  5157. a = b.ResourceItem.TYPE_BIN
  5158. }
  5159. return a
  5160. };
  5161. e.prototype.onResourceItemComp = function(a) {
  5162. var b = this.asyncDic[a.name];
  5163. delete this.asyncDic[a.name];
  5164. a = this.getAnalyzerByType(a.type);
  5165. for (var e = b.length,
  5166. c = 0; c < e; c++) {
  5167. var d = b[c],
  5168. k = a.getRes(d.key);
  5169. d.compFunc.call(d.thisObject, k, d.key)
  5170. }
  5171. };
  5172. e.prototype.destroyRes = function(a) {
  5173. var b = this.resConfig.getRawGroupByName(a);
  5174. if (b) {
  5175. var e = this.loadedGroups.indexOf(a); - 1 != e && this.loadedGroups.splice(e, 1);
  5176. a = b.length;
  5177. for (var c = 0; c < a; c++) {
  5178. e = b[c];
  5179. e.loaded = !1;
  5180. var d = this.getAnalyzerByType(e.type);
  5181. d.destroyRes(e.name)
  5182. }
  5183. return ! 0
  5184. }
  5185. b = this.resConfig.getType(a);
  5186. if ("" == b) return ! 1;
  5187. e = this.resConfig.getRawResourceItem(a);
  5188. e.loaded = !1;
  5189. d = this.getAnalyzerByType(b);
  5190. return d.destroyRes(a)
  5191. };
  5192. e.prototype.setMaxLoadingThread = function(a) {
  5193. 1 > a && (a = 1);
  5194. this.resLoader.thread = a
  5195. };
  5196. e.GROUP_CONFIG = "RES__CONFIG";
  5197. return e
  5198. } (egret.EventDispatcher);
  5199. c.prototype.__class__ = "Resource";
  5200. var d = new c
  5201. })(RES || (RES = {}));
  5202. __extends = this.__extends ||
  5203. function(b, c) {
  5204. function d() {
  5205. this.constructor = b
  5206. }
  5207. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5208. d.prototype = c.prototype;
  5209. b.prototype = new d
  5210. }; (function(b) {
  5211. var c = function(c) {
  5212. function a(b) {
  5213. "undefined" === typeof b && (b = 60);
  5214. c.call(this);
  5215. this.frameRate = b;
  5216. this._time = 0;
  5217. 60 == b && (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);
  5218. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  5219. return window.setTimeout(a, 1E3 / b)
  5220. });
  5221. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  5222. return window.clearTimeout(a)
  5223. });
  5224. a.instance = this;
  5225. this.registerListener()
  5226. }
  5227. __extends(a, c);
  5228. a.prototype.enterFrame = function() {
  5229. var e = a.instance,
  5230. c = a._thisObject,
  5231. d = a._callback,
  5232. m = b.getTimer(),
  5233. l = m - e._time;
  5234. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  5235. d.call(c, l);
  5236. e._time = m
  5237. };
  5238. a.prototype.executeMainLoop = function(b, c) {
  5239. a._callback = b;
  5240. a._thisObject = c;
  5241. this.enterFrame()
  5242. };
  5243. a.prototype.reset = function() {
  5244. var e = a.instance;
  5245. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  5246. };
  5247. a.prototype.registerListener = function() {
  5248. var b = function() {
  5249. a.instance.reset()
  5250. },
  5251. c = function() {
  5252. document[d] || b()
  5253. };
  5254. window.onfocus = b;
  5255. window.onblur = function() {};
  5256. var d, m;
  5257. "undefined" !== typeof document.hidden ? (d = "hidden", m = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", m = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", m = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", m = "webkitvisibilitychange");
  5258. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  5259. d && m && document.addEventListener(m, c, !1)
  5260. };
  5261. return a
  5262. } (b.DeviceContext);
  5263. b.HTML5DeviceContext = c;
  5264. c.prototype.__class__ = "egret.HTML5DeviceContext"
  5265. })(egret || (egret = {}));
  5266. __extends = this.__extends ||
  5267. function(b, c) {
  5268. function d() {
  5269. this.constructor = b
  5270. }
  5271. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5272. d.prototype = c.prototype;
  5273. b.prototype = new d
  5274. }; (function(b) {
  5275. var c = function(c) {
  5276. function a(a) {
  5277. this.canvas = a;
  5278. this.canvasContext = a.getContext("2d");
  5279. var b = this.canvasContext.setTransform,
  5280. f = this;
  5281. this.canvasContext.setTransform = function(a, c, e, d, p, n) {
  5282. f._matrixA = a;
  5283. f._matrixB = c;
  5284. f._matrixC = e;
  5285. f._matrixD = d;
  5286. f._matrixTx = p;
  5287. f._matrixTy = n;
  5288. b.call(f.canvasContext, a, c, e, d, p, n)
  5289. };
  5290. this._matrixA = 1;
  5291. this._matrixC = this._matrixB = 0;
  5292. this._matrixD = 1;
  5293. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  5294. c.call(this)
  5295. }
  5296. __extends(a, c);
  5297. a.prototype.clearScreen = function() {
  5298. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, d = a.length; c < d; c++) {
  5299. var m = a[c];
  5300. this.clearRect(m.x + this._transformTx, m.y + this._transformTy, m.width, m.height)
  5301. }
  5302. this.renderCost = 0
  5303. };
  5304. a.prototype.clearRect = function(a, b, c, d) {
  5305. this.canvasContext.clearRect(a, b, c, d)
  5306. };
  5307. a.prototype.drawImage = function(a, g, f, m, l, h, k, p, n) {
  5308. g /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5309. f /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5310. m /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5311. l /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5312. a = a._bitmapData;
  5313. h += this._transformTx;
  5314. k += this._transformTy;
  5315. var q = b.getTimer();
  5316. this.canvasContext.drawImage(a, g, f, m, l, h, k, p, n);
  5317. c.prototype.drawImage.call(this, a, g, f, m, l, h, k, p, n);
  5318. this.renderCost += b.getTimer() - q
  5319. };
  5320. a.prototype.setTransform = function(a) {
  5321. 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.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  5322. };
  5323. a.prototype.setAlpha = function(a, c) {
  5324. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  5325. c ? (this.blendValue = c, this.canvasContext.globalCompositeOperation = c) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = b.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = b.BlendMode.NORMAL)
  5326. };
  5327. a.prototype.setupFont = function(a) {
  5328. var b = this.canvasContext,
  5329. c = a.italic ? "italic ": "normal ",
  5330. c = c + (a.bold ? "bold ": "normal "),
  5331. c = c + (a.size + "px " + a.fontFamily);
  5332. b.font = c;
  5333. b.textAlign = "left";
  5334. b.textBaseline = "middle"
  5335. };
  5336. a.prototype.measureText = function(a) {
  5337. return this.canvasContext.measureText(a).width
  5338. };
  5339. a.prototype.drawText = function(a, b, f, m, l) {
  5340. var h = a._strokeColorString,
  5341. k = a.stroke,
  5342. p = this.canvasContext;
  5343. p.fillStyle = a._textColorString;
  5344. p.strokeStyle = h;
  5345. k && (p.lineWidth = 2 * k, p.strokeText(b, f + this._transformTx, m + this._transformTy, l || 65535));
  5346. p.fillText(b, f + this._transformTx, m + this._transformTy, l || 65535);
  5347. c.prototype.drawText.call(this, a, b, f, m, l)
  5348. };
  5349. a.prototype.strokeRect = function(a, b, c, d, l) {
  5350. this.canvasContext.strokeStyle = l;
  5351. this.canvasContext.strokeRect(a, b, c, d)
  5352. };
  5353. a.prototype.pushMask = function(a) {
  5354. this.canvasContext.save();
  5355. this.canvasContext.beginPath();
  5356. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  5357. this.canvasContext.clip();
  5358. this.canvasContext.closePath()
  5359. };
  5360. a.prototype.popMask = function() {
  5361. this.canvasContext.restore();
  5362. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  5363. };
  5364. a.prototype.onRenderStart = function() {
  5365. this.canvasContext.save()
  5366. };
  5367. a.prototype.onRenderFinish = function() {
  5368. this.canvasContext.restore();
  5369. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  5370. };
  5371. return a
  5372. } (b.RendererContext);
  5373. b.HTML5CanvasRenderer = c;
  5374. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  5375. })(egret || (egret = {}));
  5376. var egret_h5_graphics; (function(b) {
  5377. b.beginFill = function(b, a) {
  5378. "undefined" === typeof a && (a = 1);
  5379. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  5380. this.fillStyleColor = e;
  5381. this.commandQueue.push(new c(this._setStyle, this, [e]))
  5382. };
  5383. b.drawRect = function(b, a, e, g) {
  5384. this.commandQueue.push(new c(function(a, b, c, e) {
  5385. var d = this.renderContext;
  5386. this.canvasContext.beginPath();
  5387. this.canvasContext.rect(d._transformTx + a, d._transformTy + b, c, e);
  5388. this.canvasContext.closePath()
  5389. },
  5390. this, [b, a, e, g]));
  5391. this._fill()
  5392. };
  5393. b.drawCircle = function(b, a, e) {
  5394. this.commandQueue.push(new c(function(a, b, c) {
  5395. var e = this.renderContext;
  5396. this.canvasContext.beginPath();
  5397. this.canvasContext.arc(e._transformTx + a, e._transformTy + b, c, 0, 2 * Math.PI);
  5398. this.canvasContext.closePath()
  5399. },
  5400. this, [b, a, e]));
  5401. this._fill()
  5402. };
  5403. b.drawRoundRect = function(b, a, e, g, f, m) {
  5404. this.commandQueue.push(new c(function(a, b, c, e, d, g) {
  5405. var f = this.renderContext;
  5406. a = f._transformTx + a;
  5407. b = f._transformTy + b;
  5408. d /= 2;
  5409. g = g ? g / 2 : d;
  5410. c = a + c;
  5411. e = b + e;
  5412. f = e - g;
  5413. this.canvasContext.beginPath();
  5414. this.canvasContext.moveTo(c, f);
  5415. this.canvasContext.quadraticCurveTo(c, e, c - d, e);
  5416. this.canvasContext.lineTo(a + d, e);
  5417. this.canvasContext.quadraticCurveTo(a, e, a, e - g);
  5418. this.canvasContext.lineTo(a, b + g);
  5419. this.canvasContext.quadraticCurveTo(a, b, a + d, b);
  5420. this.canvasContext.lineTo(c - d, b);
  5421. this.canvasContext.quadraticCurveTo(c, b, c, b + g);
  5422. this.canvasContext.lineTo(c, f);
  5423. this.canvasContext.closePath()
  5424. },
  5425. this, [b, a, e, g, f, m]));
  5426. this._fill()
  5427. };
  5428. b.drawEllipse = function(b, a, e, g) {
  5429. this.commandQueue.push(new c(function(a, b, c, e) {
  5430. var d = this.renderContext;
  5431. this.canvasContext.save();
  5432. a = d._transformTx + a;
  5433. b = d._transformTy + b;
  5434. var d = c > e ? c: e,
  5435. g = c / d;
  5436. e /= d;
  5437. this.canvasContext.scale(g, e);
  5438. this.canvasContext.beginPath();
  5439. this.canvasContext.moveTo((a + c) / g, b / e);
  5440. this.canvasContext.arc(a / g, b / e, d, 0, 2 * Math.PI);
  5441. this.canvasContext.closePath();
  5442. this.canvasContext.restore();
  5443. this.canvasContext.stroke()
  5444. },
  5445. this, [b, a, e, g]));
  5446. this._fill()
  5447. };
  5448. b.lineStyle = function(b, a, e, g, f, m, l, h) {
  5449. "undefined" === typeof b && (b = NaN);
  5450. "undefined" === typeof a && (a = 0);
  5451. "undefined" === typeof e && (e = 1);
  5452. "undefined" === typeof g && (g = !1);
  5453. "undefined" === typeof f && (f = "normal");
  5454. "undefined" === typeof m && (m = null);
  5455. "undefined" === typeof l && (l = null);
  5456. "undefined" === typeof h && (h = 3);
  5457. this.strokeStyleColor && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  5458. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  5459. this.commandQueue.push(new c(function(a, b) {
  5460. this.canvasContext.lineWidth = a;
  5461. this.canvasContext.strokeStyle = b;
  5462. this.canvasContext.beginPath()
  5463. },
  5464. this, [b, a]));
  5465. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  5466. this.moveTo(this.lineX, this.lineY)
  5467. };
  5468. b.lineTo = function(b, a) {
  5469. this.commandQueue.push(new c(function(a, b) {
  5470. var c = this.renderContext;
  5471. this.canvasContext.lineTo(c._transformTx + a, c._transformTy + b)
  5472. },
  5473. this, [b, a]));
  5474. this.lineX = b;
  5475. this.lineY = a
  5476. };
  5477. b.curveTo = function(b, a, e, g) {
  5478. this.commandQueue.push(new c(function(a, b, c, e) {
  5479. var d = this.renderContext;
  5480. this.canvasContext.quadraticCurveTo(d._transformTx + a, d._transformTy + b, c, e)
  5481. },
  5482. this, [b, a, e, g]));
  5483. this.lineX = e;
  5484. this.lineY = g
  5485. };
  5486. b.moveTo = function(b, a) {
  5487. this.commandQueue.push(new c(function(a, b) {
  5488. var c = this.renderContext;
  5489. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  5490. },
  5491. this, [b, a]))
  5492. };
  5493. b.clear = function() {
  5494. this.lineY = this.lineX = this.commandQueue.length = 0;
  5495. this.fillStyleColor = this.strokeStyleColor = null
  5496. };
  5497. b.createEndFillCommand = function() {
  5498. this.endFillCommand || (this.endFillCommand = new c(function() {
  5499. this.canvasContext.fill();
  5500. this.canvasContext.closePath()
  5501. },
  5502. this, null))
  5503. };
  5504. b.endFill = function() {
  5505. null != this.fillStyleColor && this._fill();
  5506. this.fillStyleColor = null
  5507. };
  5508. b._fill = function() {
  5509. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  5510. };
  5511. b.createEndLineCommand = function() {
  5512. this.endLineCommand || (this.endLineCommand = new c(function() {
  5513. this.canvasContext.stroke();
  5514. this.canvasContext.closePath()
  5515. },
  5516. this, null))
  5517. };
  5518. b._draw = function(b) {
  5519. this.renderContext = b;
  5520. b = this.canvasContext = this.renderContext.canvasContext;
  5521. b.save();
  5522. var a = this.commandQueue.length;
  5523. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  5524. for (var c = 0; c < a; c++) {
  5525. var g = this.commandQueue[c];
  5526. g.method.apply(g.thisObject, g.args)
  5527. }
  5528. b.restore()
  5529. };
  5530. var c = function() {
  5531. return function(b, a, c) {
  5532. this.method = b;
  5533. this.thisObject = a;
  5534. this.args = c
  5535. }
  5536. } ();
  5537. c.prototype.__class__ = "Command";
  5538. b._setStyle = function(b) {
  5539. this.canvasContext.fillStyle = b;
  5540. this.canvasContext.beginPath()
  5541. };
  5542. b.init = function() {
  5543. for (var c in b) egret.Graphics.prototype[c] = b[c];
  5544. egret.RendererContext.createRendererContext = function(a) {
  5545. return new egret.HTML5CanvasRenderer(a)
  5546. }
  5547. }
  5548. })(egret_h5_graphics || (egret_h5_graphics = {}));
  5549. egret_h5_graphics.init();
  5550. __extends = this.__extends ||
  5551. function(b, c) {
  5552. function d() {
  5553. this.constructor = b
  5554. }
  5555. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5556. d.prototype = c.prototype;
  5557. b.prototype = new d
  5558. }; (function(b) {
  5559. var c = function(c) {
  5560. function a(a) {
  5561. c.call(this);
  5562. this.size = 2E3;
  5563. this.vertSize = 6;
  5564. this.contextLost = !1;
  5565. this.glContextId = 0;
  5566. this.currentBlendMode = "";
  5567. this.currentBaseTexture = null;
  5568. this.currentBatchSize = 0;
  5569. this.maskList = [];
  5570. this.maskDataFreeList = [];
  5571. this.canvasContext = document.createElement("canvas").getContext("2d");
  5572. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  5573. this.canvas = a;
  5574. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  5575. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  5576. this.projectionX = a.width / 2;
  5577. this.projectionY = -a.height / 2;
  5578. a = 6 * this.size;
  5579. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  5580. this.indices = new Uint16Array(a);
  5581. for (var g = 0,
  5582. f = 0; g < a; g += 6, f += 4) this.indices[g + 0] = f + 0,
  5583. this.indices[g + 1] = f + 1,
  5584. this.indices[g + 2] = f + 2,
  5585. this.indices[g + 3] = f + 0,
  5586. this.indices[g + 4] = f + 2,
  5587. this.indices[g + 5] = f + 3;
  5588. this.initWebGL();
  5589. this.shaderManager = new b.WebGLShaderManager(this.gl);
  5590. this.worldTransform = new b.Matrix;
  5591. this.initBlendMode();
  5592. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  5593. b.TextField.prototype._draw = function(a) {
  5594. this.getDirty() && (this.cacheAsBitmap = !0);
  5595. b.DisplayObject.prototype._draw.call(this, a)
  5596. }
  5597. }
  5598. __extends(a, c);
  5599. a.prototype.handleContextLost = function() {
  5600. this.contextLost = !0
  5601. };
  5602. a.prototype.handleContextRestored = function() {
  5603. this.initWebGL();
  5604. this.shaderManager.setContext(this.gl);
  5605. this.contextLost = !1
  5606. };
  5607. a.prototype.initWebGL = function() {
  5608. for (var a = {
  5609. stencil: !0
  5610. },
  5611. b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  5612. try {
  5613. b = this.canvas.getContext(c[d], a)
  5614. } catch(l) {}
  5615. if (b) break
  5616. }
  5617. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  5618. this.setContext(b)
  5619. };
  5620. a.prototype.setContext = function(a) {
  5621. this.gl = a;
  5622. a.id = this.glContextId++;
  5623. this.vertexBuffer = a.createBuffer();
  5624. this.indexBuffer = a.createBuffer();
  5625. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5626. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  5627. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5628. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  5629. a.disable(a.DEPTH_TEST);
  5630. a.disable(a.CULL_FACE);
  5631. a.enable(a.BLEND);
  5632. a.colorMask(!0, !0, !0, !0)
  5633. };
  5634. a.prototype.initBlendMode = function() {
  5635. a.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  5636. a.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  5637. };
  5638. a.prototype.start = function() {
  5639. if (!this.contextLost) {
  5640. var a = this.gl;
  5641. a.activeTexture(a.TEXTURE0);
  5642. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5643. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5644. var b = this.shaderManager.defaultShader;
  5645. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  5646. var c = 4 * this.vertSize;
  5647. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  5648. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  5649. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  5650. }
  5651. };
  5652. a.prototype.clearScreen = function() {
  5653. var a = this.gl;
  5654. a.colorMask(!0, !0, !0, !0);
  5655. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, m = c.length; d < m; d++) {
  5656. var l = c[d];
  5657. a.viewport(l.x, l.y, l.width, l.height);
  5658. a.bindFramebuffer(a.FRAMEBUFFER, null);
  5659. a.clearColor(0, 0, 0, 0);
  5660. a.clear(a.COLOR_BUFFER_BIT)
  5661. }
  5662. this.renderCost = 0
  5663. };
  5664. a.prototype.setBlendMode = function(c) {
  5665. c || (c = b.BlendMode.NORMAL);
  5666. if (this.currentBlendMode != c) {
  5667. var d = a.blendModesWebGL[c];
  5668. d && (this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = c)
  5669. }
  5670. };
  5671. a.prototype.drawImage = function(a, c, d, m, l, h, k, p, n) {
  5672. if (!this.contextLost) {
  5673. var q = b.MainContext.instance.rendererContext.texture_scale_factor;
  5674. c /= q;
  5675. d /= q;
  5676. m /= q;
  5677. l /= q;
  5678. this.createWebGLTexture(a);
  5679. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(),
  5680. this.currentBaseTexture = a.webGLTexture;
  5681. var t = this.worldTransform,
  5682. r = t.a,
  5683. s = t.b,
  5684. u = t.c,
  5685. v = t.d,
  5686. x = t.tx,
  5687. y = t.ty;
  5688. 0 == h && 0 == k || t.append(1, 0, 0, 1, h, k);
  5689. 1 == m / p && 1 == l / n || t.append(p / m, 0, 0, n / l, 0, 0);
  5690. h = t.a;
  5691. k = t.b;
  5692. p = t.c;
  5693. n = t.d;
  5694. var q = t.tx,
  5695. w = t.ty;
  5696. t.a = r;
  5697. t.b = s;
  5698. t.c = u;
  5699. t.d = v;
  5700. t.tx = x;
  5701. t.ty = y;
  5702. r = a._sourceWidth;
  5703. s = a._sourceHeight;
  5704. a = m;
  5705. t = l;
  5706. c /= r;
  5707. d /= s;
  5708. m /= r;
  5709. l /= s;
  5710. r = this.vertices;
  5711. s = 4 * this.currentBatchSize * this.vertSize;
  5712. u = this.worldAlpha;
  5713. r[s++] = q;
  5714. r[s++] = w;
  5715. r[s++] = c;
  5716. r[s++] = d;
  5717. r[s++] = u;
  5718. r[s++] = 16777215;
  5719. r[s++] = h * a + q;
  5720. r[s++] = k * a + w;
  5721. r[s++] = m + c;
  5722. r[s++] = d;
  5723. r[s++] = u;
  5724. r[s++] = 16777215;
  5725. r[s++] = h * a + p * t + q;
  5726. r[s++] = n * t + k * a + w;
  5727. r[s++] = m + c;
  5728. r[s++] = l + d;
  5729. r[s++] = u;
  5730. r[s++] = 16777215;
  5731. r[s++] = p * t + q;
  5732. r[s++] = n * t + w;
  5733. r[s++] = c;
  5734. r[s++] = l + d;
  5735. r[s++] = u;
  5736. r[s++] = 16777215;
  5737. this.currentBatchSize++
  5738. }
  5739. };
  5740. a.prototype._draw = function() {
  5741. if (0 != this.currentBatchSize && !this.contextLost) {
  5742. var a = b.getTimer();
  5743. this.start();
  5744. var c = this.gl;
  5745. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  5746. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  5747. c.bufferSubData(c.ARRAY_BUFFER, 0, d);
  5748. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  5749. this.currentBatchSize = 0;
  5750. this.renderCost += b.getTimer() - a;
  5751. b.Profiler.getInstance().onDrawImage()
  5752. }
  5753. };
  5754. a.prototype.setTransform = function(a) {
  5755. var b = this.worldTransform;
  5756. b.a = a.a;
  5757. b.b = a.b;
  5758. b.c = a.c;
  5759. b.d = a.d;
  5760. b.tx = a.tx;
  5761. b.ty = a.ty
  5762. };
  5763. a.prototype.setAlpha = function(a, b) {
  5764. this.worldAlpha = a;
  5765. this.setBlendMode(b)
  5766. };
  5767. a.prototype.createWebGLTexture = function(a) {
  5768. if (!a.webGLTexture) {
  5769. var b = this.gl;
  5770. a.webGLTexture = b.createTexture();
  5771. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  5772. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  5773. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  5774. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  5775. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  5776. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  5777. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  5778. b.bindTexture(b.TEXTURE_2D, null)
  5779. }
  5780. };
  5781. a.prototype.pushMask = function(a) {
  5782. this._draw();
  5783. var b = this.gl;
  5784. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  5785. var c = this.maskDataFreeList.pop();
  5786. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  5787. x: a.x,
  5788. y: a.y,
  5789. w: a.width,
  5790. h: a.height
  5791. };
  5792. this.maskList.push(c);
  5793. b.colorMask(!1, !1, !1, !1);
  5794. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  5795. this.renderGraphics(c);
  5796. b.colorMask(!0, !0, !0, !0);
  5797. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  5798. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  5799. };
  5800. a.prototype.popMask = function() {
  5801. this._draw();
  5802. var a = this.gl,
  5803. b = this.maskList.pop();
  5804. b && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(b), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(b));
  5805. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  5806. };
  5807. a.prototype.setupFont = function(a) {
  5808. var b = this.canvasContext,
  5809. c = a.italic ? "italic ": "normal ",
  5810. c = c + (a.bold ? "bold ": "normal "),
  5811. c = c + (a.size + "px " + a.fontFamily);
  5812. b.font = c;
  5813. b.textAlign = "left";
  5814. b.textBaseline = "middle"
  5815. };
  5816. a.prototype.measureText = function(a) {
  5817. return this.canvasContext.measureText(a).width
  5818. };
  5819. a.prototype.renderGraphics = function(a) {
  5820. var b = this.gl,
  5821. c = this.shaderManager.primitiveShader;
  5822. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  5823. this.updateGraphics(a);
  5824. this.shaderManager.activateShader(c);
  5825. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  5826. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  5827. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  5828. b.uniform2f(c.offsetVector, 0, 0);
  5829. b.uniform3fv(c.tintColor, [1, 1, 1]);
  5830. b.uniform1f(c.alpha, this.worldAlpha);
  5831. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5832. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  5833. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  5834. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5835. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  5836. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  5837. };
  5838. a.prototype.updateGraphics = function(a) {
  5839. var b = this.gl;
  5840. this.buildRectangle(a);
  5841. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5842. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  5843. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5844. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  5845. };
  5846. a.prototype.buildRectangle = function(a) {
  5847. var b = a.x,
  5848. c = a.y,
  5849. d = a.w;
  5850. a = a.h;
  5851. var l = this.graphicsPoints,
  5852. h = this.graphicsIndices,
  5853. k = l.length / 6;
  5854. l.push(b, c);
  5855. l.push(0, 0, 0, 1);
  5856. l.push(b + d, c);
  5857. l.push(0, 0, 0, 1);
  5858. l.push(b, c + a);
  5859. l.push(0, 0, 0, 1);
  5860. l.push(b + d, c + a);
  5861. l.push(0, 0, 0, 1);
  5862. h.push(k, k, k + 1, k + 2, k + 3, k + 3)
  5863. };
  5864. a.blendModesWebGL = {};
  5865. return a
  5866. } (b.RendererContext);
  5867. b.WebGLRenderer = c;
  5868. c.prototype.__class__ = "egret.WebGLRenderer"
  5869. })(egret || (egret = {})); (function(b) {
  5870. var c = function() {
  5871. function b() {}
  5872. b.compileProgram = function(a, c, g) {
  5873. g = b.compileFragmentShader(a, g);
  5874. c = b.compileVertexShader(a, c);
  5875. var f = a.createProgram();
  5876. a.attachShader(f, c);
  5877. a.attachShader(f, g);
  5878. a.linkProgram(f);
  5879. a.getProgramParameter(f, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  5880. return f
  5881. };
  5882. b.compileFragmentShader = function(a, c) {
  5883. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  5884. };
  5885. b.compileVertexShader = function(a, c) {
  5886. return b._compileShader(a, c, a.VERTEX_SHADER)
  5887. };
  5888. b._compileShader = function(a, b, c) {
  5889. c = a.createShader(c);
  5890. a.shaderSource(c, b);
  5891. a.compileShader(c);
  5892. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (console.log(a.getShaderInfoLog(c)), null)
  5893. };
  5894. b.checkCanUseWebGL = function() {
  5895. if (void 0 == b.canUseWebGL) try {
  5896. var a = document.createElement("canvas");
  5897. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  5898. } catch(c) {
  5899. b.canUseWebGL = !1
  5900. }
  5901. return b.canUseWebGL
  5902. };
  5903. return b
  5904. } ();
  5905. b.WebGLUtils = c;
  5906. c.prototype.__class__ = "egret.WebGLUtils"
  5907. })(egret || (egret = {})); (function(b) {
  5908. var c = function() {
  5909. function b(a) {
  5910. this.maxAttibs = 10;
  5911. this.attribState = [];
  5912. this.tempAttribState = [];
  5913. for (var c = 0; c < this.maxAttibs; c++) this.attribState[c] = !1;
  5914. this.setContext(a)
  5915. }
  5916. b.prototype.setContext = function(b) {
  5917. this.gl = b;
  5918. this.primitiveShader = new a(b);
  5919. this.defaultShader = new d(b);
  5920. this.activateShader(this.defaultShader)
  5921. };
  5922. b.prototype.activateShader = function(a) {
  5923. this.gl.useProgram(a.program);
  5924. this.setAttribs(a.attributes)
  5925. };
  5926. b.prototype.setAttribs = function(a) {
  5927. var b, c;
  5928. c = this.tempAttribState.length;
  5929. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  5930. c = a.length;
  5931. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  5932. a = this.gl;
  5933. c = this.attribState.length;
  5934. 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))
  5935. };
  5936. return b
  5937. } ();
  5938. b.WebGLShaderManager = c;
  5939. c.prototype.__class__ = "egret.WebGLShaderManager";
  5940. var d = function() {
  5941. function a(b) {
  5942. 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 vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  5943. this.program = null;
  5944. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  5945. this.gl = b;
  5946. this.init()
  5947. }
  5948. a.prototype.init = function() {
  5949. var a = this.gl,
  5950. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  5951. a.useProgram(c);
  5952. this.uSampler = a.getUniformLocation(c, "uSampler");
  5953. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  5954. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  5955. this.dimensions = a.getUniformLocation(c, "dimensions");
  5956. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  5957. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  5958. this.colorAttribute = a.getAttribLocation(c, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  5959. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  5960. this.program = c
  5961. };
  5962. return a
  5963. } ();
  5964. b.EgretShader = d;
  5965. d.prototype.__class__ = "egret.EgretShader";
  5966. var a = function() {
  5967. function a(b) {
  5968. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  5969. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  5970. 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}";
  5971. this.gl = b;
  5972. this.init()
  5973. }
  5974. a.prototype.init = function() {
  5975. var a = this.gl,
  5976. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  5977. a.useProgram(c);
  5978. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  5979. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  5980. this.tintColor = a.getUniformLocation(c, "tint");
  5981. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  5982. this.colorAttribute = a.getAttribLocation(c, "aColor");
  5983. this.attributes = [this.aVertexPosition, this.colorAttribute];
  5984. this.translationMatrix = a.getUniformLocation(c, "translationMatrix");
  5985. this.alpha = a.getUniformLocation(c, "alpha");
  5986. this.program = c
  5987. };
  5988. return a
  5989. } ();
  5990. b.PrimitiveShader = a;
  5991. a.prototype.__class__ = "egret.PrimitiveShader"
  5992. })(egret || (egret = {}));
  5993. __extends = this.__extends ||
  5994. function(b, c) {
  5995. function d() {
  5996. this.constructor = b
  5997. }
  5998. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5999. d.prototype = c.prototype;
  6000. b.prototype = new d
  6001. }; (function(b) {
  6002. var c = function(c) {
  6003. function a() {
  6004. c.call(this)
  6005. }
  6006. __extends(a, c);
  6007. a.prototype.proceed = function(a) {
  6008. function c(d) {
  6009. b.IOErrorEvent.dispatchIOErrorEvent(a)
  6010. }
  6011. function d(c) {
  6012. switch (a.dataFormat) {
  6013. case b.URLLoaderDataFormat.TEXT:
  6014. a.data = l.responseText;
  6015. break;
  6016. case b.URLLoaderDataFormat.VARIABLES:
  6017. a.data = new b.URLVariables(l.responseText);
  6018. break;
  6019. case b.URLLoaderDataFormat.BINARY:
  6020. a.data = l.response;
  6021. break;
  6022. default:
  6023. a.data = l.responseText
  6024. }
  6025. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  6026. }
  6027. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  6028. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  6029. else {
  6030. var m = a._request,
  6031. l = this.getXHR();
  6032. l.onerror = c;
  6033. l.onload = d;
  6034. l.open(m.method, m.url, !0);
  6035. this.setResponseType(l, a.dataFormat);
  6036. m.method != b.URLRequestMethod.GET && m.data ? m.data instanceof b.URLVariables ? (l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), l.send(m.data.toString())) : (l.setRequestHeader("Content-Type", "multipart/form-data"), l.send(m.data)) : l.send()
  6037. }
  6038. };
  6039. a.prototype.loadSound = function(a) {
  6040. function c(l) {
  6041. window.clearTimeout(m.__timeoutId);
  6042. m.removeEventListener("canplaythrough", c, !1);
  6043. m.removeEventListener("error", d, !1);
  6044. l = new b.Sound;
  6045. l._setAudio(m);
  6046. a.data = l;
  6047. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  6048. }
  6049. function d(l) {
  6050. window.clearTimeout(m.__timeoutId);
  6051. m.removeEventListener("canplaythrough", c, !1);
  6052. m.removeEventListener("error", d, !1);
  6053. b.IOErrorEvent.dispatchIOErrorEvent(a)
  6054. }
  6055. var m = new Audio(a._request.url);
  6056. m.__timeoutId = window.setTimeout(c, 100);
  6057. m.addEventListener("canplaythrough", c, !1);
  6058. m.addEventListener("error", d, !1);
  6059. m.load()
  6060. };
  6061. a.prototype.getXHR = function() {
  6062. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  6063. };
  6064. a.prototype.setResponseType = function(a, c) {
  6065. switch (c) {
  6066. case b.URLLoaderDataFormat.TEXT:
  6067. case b.URLLoaderDataFormat.VARIABLES:
  6068. a.responseType = b.URLLoaderDataFormat.TEXT;
  6069. break;
  6070. case b.URLLoaderDataFormat.BINARY:
  6071. a.responseType = "arraybuffer";
  6072. break;
  6073. default:
  6074. a.responseType = c
  6075. }
  6076. };
  6077. a.prototype.loadTexture = function(a) {
  6078. var c = a._request,
  6079. d = new Image;
  6080. d.crossOrigin = "Anonymous";
  6081. d.onload = function(c) {
  6082. d.onerror = null;
  6083. d.onload = null;
  6084. c = new b.Texture;
  6085. c._setBitmapData(d);
  6086. a.data = c;
  6087. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  6088. };
  6089. d.onerror = function(c) {
  6090. d.onerror = null;
  6091. d.onload = null;
  6092. b.IOErrorEvent.dispatchIOErrorEvent(a)
  6093. };
  6094. d.src = c.url
  6095. };
  6096. return a
  6097. } (b.NetContext);
  6098. b.HTML5NetContext = c;
  6099. c.prototype.__class__ = "egret.HTML5NetContext"
  6100. })(egret || (egret = {}));
  6101. __extends = this.__extends ||
  6102. function(b, c) {
  6103. function d() {
  6104. this.constructor = b
  6105. }
  6106. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6107. d.prototype = c.prototype;
  6108. b.prototype = new d
  6109. }; (function(b) {
  6110. var c = function(c) {
  6111. function a(a) {
  6112. c.call(this);
  6113. this.canvas = a;
  6114. this._isTouchDown = !1
  6115. }
  6116. __extends(a, c);
  6117. a.prototype.run = function() {
  6118. var a = this;
  6119. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  6120. function(b) {
  6121. a._onTouchBegin(b);
  6122. b.stopPropagation();
  6123. b.preventDefault()
  6124. },
  6125. !1), this.canvas.addEventListener("MSPointerMove",
  6126. function(b) {
  6127. a._onTouchMove(b);
  6128. b.stopPropagation();
  6129. b.preventDefault()
  6130. },
  6131. !1), this.canvas.addEventListener("MSPointerUp",
  6132. function(b) {
  6133. a._onTouchEnd(b);
  6134. b.stopPropagation();
  6135. b.preventDefault()
  6136. },
  6137. !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  6138. window.addEventListener("mousedown",
  6139. function(b) {
  6140. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  6141. });
  6142. window.addEventListener("mouseup",
  6143. function(b) {
  6144. a._isTouchDown && a.inOutOfCanvas(b) && a.dispatchLeaveStageEvent();
  6145. a._isTouchDown = !1
  6146. })
  6147. };
  6148. a.prototype.addMouseListener = function() {
  6149. var a = this;
  6150. this.canvas.addEventListener("mousedown",
  6151. function(b) {
  6152. a._onTouchBegin(b)
  6153. });
  6154. this.canvas.addEventListener("mousemove",
  6155. function(b) {
  6156. a._onTouchMove(b)
  6157. });
  6158. this.canvas.addEventListener("mouseup",
  6159. function(b) {
  6160. a._onTouchEnd(b)
  6161. })
  6162. };
  6163. a.prototype.addTouchListener = function() {
  6164. var a = this;
  6165. this.canvas.addEventListener("touchstart",
  6166. function(b) {
  6167. for (var c = b.changedTouches.length,
  6168. d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  6169. b.stopPropagation();
  6170. b.preventDefault()
  6171. },
  6172. !1);
  6173. this.canvas.addEventListener("touchmove",
  6174. function(b) {
  6175. for (var c = b.changedTouches.length,
  6176. d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  6177. b.stopPropagation();
  6178. b.preventDefault()
  6179. },
  6180. !1);
  6181. this.canvas.addEventListener("touchend",
  6182. function(b) {
  6183. for (var c = b.changedTouches.length,
  6184. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  6185. b.stopPropagation();
  6186. b.preventDefault()
  6187. },
  6188. !1);
  6189. this.canvas.addEventListener("touchcancel",
  6190. function(b) {
  6191. for (var c = b.changedTouches.length,
  6192. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  6193. b.stopPropagation();
  6194. b.preventDefault()
  6195. },
  6196. !1)
  6197. };
  6198. a.prototype.inOutOfCanvas = function(a) {
  6199. a = this.getLocation(this.canvas, a);
  6200. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  6201. };
  6202. a.prototype.dispatchLeaveStageEvent = function() {
  6203. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  6204. };
  6205. a.prototype._onTouchBegin = function(a) {
  6206. var b = this.getLocation(this.canvas, a),
  6207. c = -1;
  6208. a.hasOwnProperty("identifier") && (c = a.identifier);
  6209. this.onTouchBegan(b.x, b.y, c)
  6210. };
  6211. a.prototype._onTouchMove = function(a) {
  6212. var b = this.getLocation(this.canvas, a),
  6213. c = -1;
  6214. a.hasOwnProperty("identifier") && (c = a.identifier);
  6215. this.onTouchMove(b.x, b.y, c)
  6216. };
  6217. a.prototype._onTouchEnd = function(a) {
  6218. var b = this.getLocation(this.canvas, a),
  6219. c = -1;
  6220. a.hasOwnProperty("identifier") && (c = a.identifier);
  6221. this.onTouchEnd(b.x, b.y, c)
  6222. };
  6223. a.prototype.getLocation = function(a, c) {
  6224. var d = document.documentElement,
  6225. m = window,
  6226. l, h;
  6227. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), l = h.left, h = h.top) : h = l = 0;
  6228. l += m.pageXOffset - d.clientLeft;
  6229. h += m.pageYOffset - d.clientTop;
  6230. null != c.pageX ? (d = c.pageX, m = c.pageY) : (l -= document.body.scrollLeft, h -= document.body.scrollTop, d = c.clientX, m = c.clientY);
  6231. var k = b.Point.identity;
  6232. k.x = (d - l) / b.StageDelegate.getInstance().getScaleX();
  6233. k.y = (m - h) / b.StageDelegate.getInstance().getScaleY();
  6234. return k
  6235. };
  6236. return a
  6237. } (b.TouchContext);
  6238. b.HTML5TouchContext = c;
  6239. c.prototype.__class__ = "egret.HTML5TouchContext"
  6240. })(egret || (egret = {}));
  6241. var __extends = this.__extends ||
  6242. function(b, c) {
  6243. function d() {
  6244. this.constructor = b
  6245. }
  6246. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6247. d.prototype = c.prototype;
  6248. b.prototype = new d
  6249. },
  6250. LoadingUI = function(b) {
  6251. function c() {
  6252. b.call(this);
  6253. this.createView()
  6254. }
  6255. __extends(c, b);
  6256. c.prototype.createView = function() {
  6257. this.textField = new egret.TextField;
  6258. this.addChild(this.textField);
  6259. this.textField.y = 300;
  6260. this.textField.width = 480;
  6261. this.textField.height = 100;
  6262. this.textField.textAlign = "center"
  6263. };
  6264. c.prototype.setProgress = function(b, a) {
  6265. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + b + "/" + a
  6266. };
  6267. return c
  6268. } (egret.Sprite);
  6269. LoadingUI.prototype.__class__ = "LoadingUI";
  6270. var __extends = this.__extends ||
  6271. function(b, c) {
  6272. function d() {
  6273. this.constructor = b
  6274. }
  6275. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6276. d.prototype = c.prototype;
  6277. b.prototype = new d
  6278. },
  6279. MyBtn = function(b) {
  6280. function c() {
  6281. b.call(this);
  6282. this.isRight = !1
  6283. }
  6284. __extends(c, b);
  6285. c.prototype.createView = function(b, a, c) {
  6286. this.touchChildren = !1;
  6287. this.touchEnabled = !0;
  6288. this.sprite = new egret.Sprite;
  6289. this.sprite.graphics.beginFill(c);
  6290. this.sprite.graphics.drawRect(0, 0, 130, 60);
  6291. this.sprite.graphics.endFill();
  6292. this.addChild(this.sprite);
  6293. this.textField = new egret.TextField;
  6294. this.addChild(this.textField);
  6295. this.textField.width = 130;
  6296. this.textField.text = b;
  6297. this.textField.textColor = a;
  6298. this.textField.textAlign = "center";
  6299. this.textField.bold = !0;
  6300. this.textField.size = 40;
  6301. this.textField.y = (60 - this.textField.height) / 2
  6302. };
  6303. c.prototype.setLabelText = function(b) {
  6304. this.textField.text = b
  6305. };
  6306. return c
  6307. } (egret.Sprite);
  6308. MyBtn.prototype.__class__ = "MyBtn";
  6309. var __extends = this.__extends ||
  6310. function(b, c) {
  6311. function d() {
  6312. this.constructor = b
  6313. }
  6314. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6315. d.prototype = c.prototype;
  6316. b.prototype = new d
  6317. },
  6318. Main = function(b) {
  6319. function c() {
  6320. b.call(this);
  6321. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  6322. }
  6323. __extends(c, b);
  6324. c.prototype.onAddToStage = function(b) {
  6325. this.loadingView = new LoadingUI;
  6326. this.stage.addChild(this.loadingView);
  6327. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  6328. RES.loadConfig("resource/resource.json", "resource/")
  6329. };
  6330. c.prototype.onConfigComplete = function(b) {
  6331. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  6332. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  6333. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  6334. RES.loadGroup("preload")
  6335. };
  6336. c.prototype.onResourceLoadComplete = function(b) {
  6337. "preload" == b.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  6338. };
  6339. c.prototype.onResourceProgress = function(b) {
  6340. "preload" == b.groupName && this.loadingView.setProgress(b.itemsLoaded, b.itemsTotal)
  6341. };
  6342. c.prototype.createGameScene = function() {
  6343. document.title = "\u662f\u7537\u4eba\u575a\u630160\u79d2\uff01";
  6344. this.gameText = new egret.TextField;
  6345. this.gameText.width = 405;
  6346. this.gameText.size = 40;
  6347. this.gameText.text = "\u662f\u7537\u4eba\u575a\u630160\u79d2";
  6348. this.addChild(this.gameText);
  6349. this.gameText.textAlign = "center";
  6350. this.gameText.bold = !0;
  6351. this.gameText.textColor = 7349024;
  6352. this.gameText.y = 30;
  6353. var b = this.createBitmapByName("man");
  6354. this.man = new egret.Sprite;
  6355. this.man.addChild(b);
  6356. this.man.anchorOffsetX = 96;
  6357. this.man.anchorOffsetY = 270;
  6358. this.man.x = 215;
  6359. this.man.y = 380;
  6360. this.addChild(this.man);
  6361. this.gameBtn = new MyBtn;
  6362. this.gameBtn.createView("\u5f00\u59cb", 16777215, 7349024);
  6363. this.addChild(this.gameBtn);
  6364. this.gameBtn.x = 138;
  6365. this.gameBtn.y = 490;
  6366. this.gameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGameBtnClick, this);
  6367. b = this.createBitmapByName("btn");
  6368. b.rotation = 180;
  6369. this.lBtn = new egret.Sprite;
  6370. this.lBtn.addChild(b);
  6371. this.lBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.lBtnClick, this);
  6372. this.lBtn.x = 75;
  6373. this.lBtn.y = 500;
  6374. this.lBtn.touchEnabled = !0;
  6375. b = this.createBitmapByName("btn");
  6376. this.rBtn = new egret.Sprite;
  6377. this.rBtn.addChild(b);
  6378. this.rBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.rBtnClick, this);
  6379. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.thisTap, this);
  6380. this.rBtn.touchEnabled = !0;
  6381. this.rBtn.x = 330;
  6382. this.rBtn.y = 460;
  6383. this.gameTimer = new egret.Timer(100);
  6384. this.gameTimer.addEventListener(egret.TimerEvent.TIMER, this.onGameTimer, this);
  6385. this.touchEnabled = !0
  6386. };
  6387. c.prototype.thisTap = function(b) {
  6388. this.nr = 202.5 < b.stageX ? this.nr + (1 * Math.random() + 1) : this.nr + -(1 * Math.random() + 1)
  6389. };
  6390. c.prototype.onGameTimer = function(b) {
  6391. this.nr *= 1.1;
  6392. this.man.rotation += this.nr;
  6393. this.gameText.text = (this.gameTimer.currentCount() / 10).toString();
  6394. if (75 < this.man.rotation || -75 > this.man.rotation) {
  6395. this.wx = this.createBitmapByName("wx");
  6396. this.addChild(this.wx);
  6397. b = this.stage.stageWidth;
  6398. this.wx.width = 80;
  6399. this.wx.height = 21.6;
  6400. this.wx.x = b - this.wx.width;
  6401. this.wx.y = 0;
  6402. b = this.gameText.text;
  6403. this.gameText.text = "\u4f60\u624d\u575a\u6301\u4e86" + b + "\u79d2";
  6404. // updateShare(b);
  6405. // Play68.setRankingScoreDesc(b);
  6406. var a = this.gameTimer.currentCount() / 10 / 100 + 0.5;
  6407. 0.99 < a && (a = 0.99);
  6408. a = 1E4 * a >> 0;
  6409. a /= 100;
  6410. document.title = "\u6211\u575a\u6301\u4e86" + b + "\u79d2\uff0c\u8d85\u8fc7\u4e86\u5168\u56fd" + a + "%\u7684\u4eba\uff01\u4f60\u80fd\u8d85\u8fc7\u6211\u5417\uff1f\u5feb\u6765\u6311\u6218\u5427\uff01";
  6411. this.gameBtn.setLabelText("\u91cd\u6765");
  6412. this.addChild(this.gameBtn);
  6413. this.gameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onReGameBtnClick, this);
  6414. this.gameTimer.reset()
  6415. }
  6416. };
  6417. c.prototype.onReGameBtnClick = function(b) {
  6418. document.title = "\u662f\u7537\u4eba\u575a\u630160\u79d2\uff01";
  6419. this.removeChild(this.wx);
  6420. this.removeChild(this.gameBtn);
  6421. this.gameBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onReGameBtnClick, this);
  6422. this.beginGame()
  6423. };
  6424. c.prototype.onGameBtnClick = function(b) {
  6425. this.removeChild(this.gameBtn);
  6426. this.gameBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGameBtnClick, this);
  6427. this.beginGame()
  6428. };
  6429. c.prototype.beginGame = function() {
  6430. // updateShare(0);
  6431. this.man.rotation = 0;
  6432. this.nr = Math.random() + 0.5;
  6433. this.gameTimer.reset();
  6434. this.gameTimer.start();
  6435. this.addChild(this.lBtn);
  6436. this.addChild(this.rBtn)
  6437. };
  6438. c.prototype.lBtnClick = function(b) {};
  6439. c.prototype.rBtnClick = function(b) {};
  6440. c.prototype.createBitmapByName = function(b) {
  6441. var a = new egret.Bitmap;
  6442. b = RES.getRes(b);
  6443. a.texture = b;
  6444. return a
  6445. };
  6446. c.prototype.mySort = function(b, a) {
  6447. return b > a ? 1 : -1
  6448. };
  6449. return c
  6450. } (egret.DisplayObjectContainer);
  6451. Main.prototype.__class__ = "Main";var egret; (function(b) {
  6452. var c = function() {
  6453. function b() {
  6454. this._hashCode = b.hashCount++
  6455. }
  6456. Object.defineProperty(b.prototype, "hashCode", {
  6457. get: function() {
  6458. return this._hashCode
  6459. },
  6460. enumerable: !0,
  6461. configurable: !0
  6462. });
  6463. b.hashCount = 1;
  6464. return b
  6465. } ();
  6466. b.HashObject = c;
  6467. c.prototype.__class__ = "egret.HashObject"
  6468. })(egret || (egret = {}));
  6469. var __extends = this.__extends ||
  6470. function(b, c) {
  6471. function d() {
  6472. this.constructor = b
  6473. }
  6474. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6475. d.prototype = c.prototype;
  6476. b.prototype = new d
  6477. }; (function(b) {
  6478. var c = function(b) {
  6479. function a(e) {
  6480. "undefined" === typeof e && (e = 300);
  6481. b.call(this);
  6482. this.objectPool = [];
  6483. this._length = 0;
  6484. 1 > e && (e = 1);
  6485. this.autoDisposeTime = e;
  6486. this.frameCount = 0
  6487. }
  6488. __extends(a, b);
  6489. a.prototype._checkFrame = function() {
  6490. this.frameCount--;
  6491. 0 >= this.frameCount && this.dispose()
  6492. };
  6493. Object.defineProperty(a.prototype, "length", {
  6494. get: function() {
  6495. return this._length
  6496. },
  6497. enumerable: !0,
  6498. configurable: !0
  6499. });
  6500. a.prototype.push = function(e) {
  6501. var g = this.objectPool; - 1 == g.indexOf(e) && (g.push(e), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  6502. };
  6503. a.prototype.pop = function() {
  6504. if (0 == this._length) return null;
  6505. this._length--;
  6506. return this.objectPool.pop()
  6507. };
  6508. a.prototype.dispose = function() {
  6509. 0 < this._length && (this.objectPool = [], this._length = 0);
  6510. this.frameCount = 0;
  6511. var e = a._callBackList,
  6512. g = e.indexOf(this); - 1 != g && e.splice(g, 1)
  6513. };
  6514. a._callBackList = [];
  6515. return a
  6516. } (b.HashObject);
  6517. b.Recycler = c;
  6518. c.prototype.__class__ = "egret.Recycler"
  6519. })(egret || (egret = {})); (function(b) {
  6520. b.__START_TIME;
  6521. b.getTimer = function() {
  6522. return Date.now() - b.__START_TIME
  6523. }
  6524. })(egret || (egret = {})); (function(b) {
  6525. b.__callLaterFunctionList = [];
  6526. b.__callLaterThisList = [];
  6527. b.__callLaterArgsList = [];
  6528. b.callLater = function(c, d) {
  6529. for (var a = [], e = 0; e < arguments.length - 2; e++) a[e] = arguments[e + 2];
  6530. b.__callLaterFunctionList.push(c);
  6531. b.__callLaterThisList.push(d);
  6532. b.__callLaterArgsList.push(a)
  6533. }
  6534. })(egret || (egret = {}));
  6535. var egret_dom; (function(b) {
  6536. function c() {
  6537. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < a.length; e++) if (a[e] + "ransform" in b) return a[e];
  6538. return a[0]
  6539. }
  6540. b.header = "";
  6541. b.getHeader = c;
  6542. b.getTrans = function(d) {
  6543. "" == b.header && (b.header = c());
  6544. return b.header + d.substring(1, d.length)
  6545. }
  6546. })(egret_dom || (egret_dom = {}));
  6547. __extends = this.__extends ||
  6548. function(b, c) {
  6549. function d() {
  6550. this.constructor = b
  6551. }
  6552. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6553. d.prototype = c.prototype;
  6554. b.prototype = new d
  6555. }; (function(b) {
  6556. var c = function(d) {
  6557. function a(e, a, f) {
  6558. "undefined" === typeof a && (a = !1);
  6559. "undefined" === typeof f && (f = !1);
  6560. d.call(this);
  6561. this._eventPhase = 2;
  6562. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  6563. this.isNew = !0;
  6564. this._type = e;
  6565. this._bubbles = a;
  6566. this._cancelable = f
  6567. }
  6568. __extends(a, d);
  6569. Object.defineProperty(a.prototype, "type", {
  6570. get: function() {
  6571. return this._type
  6572. },
  6573. enumerable: !0,
  6574. configurable: !0
  6575. });
  6576. Object.defineProperty(a.prototype, "bubbles", {
  6577. get: function() {
  6578. return this._bubbles
  6579. },
  6580. enumerable: !0,
  6581. configurable: !0
  6582. });
  6583. Object.defineProperty(a.prototype, "cancelable", {
  6584. get: function() {
  6585. return this._cancelable
  6586. },
  6587. enumerable: !0,
  6588. configurable: !0
  6589. });
  6590. Object.defineProperty(a.prototype, "eventPhase", {
  6591. get: function() {
  6592. return this._eventPhase
  6593. },
  6594. enumerable: !0,
  6595. configurable: !0
  6596. });
  6597. Object.defineProperty(a.prototype, "currentTarget", {
  6598. get: function() {
  6599. return this._currentTarget
  6600. },
  6601. enumerable: !0,
  6602. configurable: !0
  6603. });
  6604. a.prototype._setCurrentTarget = function(e) {
  6605. this._currentTarget = e
  6606. };
  6607. Object.defineProperty(a.prototype, "target", {
  6608. get: function() {
  6609. return this._target
  6610. },
  6611. enumerable: !0,
  6612. configurable: !0
  6613. });
  6614. a.prototype.isDefaultPrevented = function() {
  6615. return this._isDefaultPrevented
  6616. };
  6617. a.prototype.preventDefault = function() {
  6618. this._cancelable && (this._isDefaultPrevented = !0)
  6619. };
  6620. a.prototype.stopPropagation = function() {
  6621. this._bubbles && (this._isPropagationStopped = !0)
  6622. };
  6623. a.prototype.stopImmediatePropagation = function() {
  6624. this._bubbles && (this._isPropagationImmediateStopped = !0)
  6625. };
  6626. a.prototype._reset = function() {
  6627. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  6628. };
  6629. a._dispatchByTarget = function(e, a, f, d, c, h) {
  6630. "undefined" === typeof c && (c = !1);
  6631. "undefined" === typeof h && (h = !1);
  6632. var k = e.eventRecycler;
  6633. k || (k = e.eventRecycler = new b.Recycler);
  6634. var p = k.pop();
  6635. p ? p._type = f: p = new e(f);
  6636. p._bubbles = c;
  6637. p._cancelable = h;
  6638. if (d) for (var n in d) p[n] = d[n],
  6639. null !== p[n] && (d[n] = null);
  6640. e = a.dispatchEvent(p);
  6641. k.push(p);
  6642. return e
  6643. };
  6644. a._getPropertyData = function(e) {
  6645. var a = e._props;
  6646. a || (a = e._props = {});
  6647. return a
  6648. };
  6649. a.dispatchEvent = function(e, g, f, b) {
  6650. "undefined" === typeof f && (f = !1);
  6651. var d = a._getPropertyData(a);
  6652. b && (d.data = b);
  6653. a._dispatchByTarget(a, e, g, d, f)
  6654. };
  6655. a.ADDED_TO_STAGE = "addedToStage";
  6656. a.REMOVED_FROM_STAGE = "removedFromStage";
  6657. a.ADDED = "added";
  6658. a.REMOVED = "removed";
  6659. a.COMPLETE = "complete";
  6660. a.ENTER_FRAME = "enterFrame";
  6661. a.RENDER = "render";
  6662. a.FINISH_RENDER = "finishRender";
  6663. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  6664. a.LEAVE_STAGE = "leaveStage";
  6665. a.RESIZE = "resize";
  6666. a.CHANGE = "change";
  6667. return a
  6668. } (b.HashObject);
  6669. b.Event = c;
  6670. c.prototype.__class__ = "egret.Event"
  6671. })(egret || (egret = {}));
  6672. __extends = this.__extends ||
  6673. function(b, c) {
  6674. function d() {
  6675. this.constructor = b
  6676. }
  6677. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6678. d.prototype = c.prototype;
  6679. b.prototype = new d
  6680. }; (function(b) {
  6681. var c = function(d) {
  6682. function a(e, a, f) {
  6683. "undefined" === typeof a && (a = !1);
  6684. "undefined" === typeof f && (f = !1);
  6685. d.call(this, e, a, f)
  6686. }
  6687. __extends(a, d);
  6688. a.dispatchIOErrorEvent = function(e) {
  6689. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  6690. };
  6691. a.IO_ERROR = "ioError";
  6692. return a
  6693. } (b.Event);
  6694. b.IOErrorEvent = c;
  6695. c.prototype.__class__ = "egret.IOErrorEvent"
  6696. })(egret || (egret = {}));
  6697. __extends = this.__extends ||
  6698. function(b, c) {
  6699. function d() {
  6700. this.constructor = b
  6701. }
  6702. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6703. d.prototype = c.prototype;
  6704. b.prototype = new d
  6705. }; (function(b) {
  6706. var c = function(d) {
  6707. function a(e, a, f, b, c, h, k, p, n, q) {
  6708. "undefined" === typeof a && (a = !0);
  6709. "undefined" === typeof f && (f = !0);
  6710. "undefined" === typeof b && (b = 0);
  6711. "undefined" === typeof c && (c = 0);
  6712. "undefined" === typeof h && (h = 0);
  6713. "undefined" === typeof k && (k = !1);
  6714. "undefined" === typeof p && (p = !1);
  6715. "undefined" === typeof q && (q = !1);
  6716. d.call(this, e, a, f);
  6717. this._localY = this._localX = this._stageY = this._stageX = 0;
  6718. this.touchPointID = b;
  6719. this._stageX = c;
  6720. this._stageY = h;
  6721. this.ctrlKey = k;
  6722. this.altKey = p;
  6723. this.touchDown = q
  6724. }
  6725. __extends(a, d);
  6726. Object.defineProperty(a.prototype, "stageX", {
  6727. get: function() {
  6728. return this._stageX
  6729. },
  6730. enumerable: !0,
  6731. configurable: !0
  6732. });
  6733. Object.defineProperty(a.prototype, "stageY", {
  6734. get: function() {
  6735. return this._stageY
  6736. },
  6737. enumerable: !0,
  6738. configurable: !0
  6739. });
  6740. Object.defineProperty(a.prototype, "localX", {
  6741. get: function() {
  6742. return this._localX
  6743. },
  6744. enumerable: !0,
  6745. configurable: !0
  6746. });
  6747. Object.defineProperty(a.prototype, "localY", {
  6748. get: function() {
  6749. return this._localY
  6750. },
  6751. enumerable: !0,
  6752. configurable: !0
  6753. });
  6754. a.prototype._setCurrentTarget = function(e) {
  6755. d.prototype._setCurrentTarget.call(this, e);
  6756. e instanceof b.DisplayObject && (e = e.globalToLocal(this._stageX, this._stageY, b.Point.identity), this._localX = e.x, this._localY = e.y)
  6757. };
  6758. a.dispatchTouchEvent = function(e, g, f, d, c, h, k, p, n) {
  6759. "undefined" === typeof f && (f = 0);
  6760. "undefined" === typeof d && (d = 0);
  6761. "undefined" === typeof c && (c = 0);
  6762. "undefined" === typeof h && (h = !1);
  6763. "undefined" === typeof k && (k = !1);
  6764. "undefined" === typeof p && (p = !1);
  6765. "undefined" === typeof n && (n = !1);
  6766. var q = b.Event._getPropertyData(a);
  6767. q.touchPointID = f;
  6768. q._stageX = d;
  6769. q._stageY = c;
  6770. q.ctrlKey = h;
  6771. q.altKey = k;
  6772. q.shiftKey = p;
  6773. q.touchDown = n;
  6774. b.Event._dispatchByTarget(a, e, g, q, !0, !0)
  6775. };
  6776. a.TOUCH_TAP = "touchTap";
  6777. a.TOUCH_MOVE = "touchMove";
  6778. a.TOUCH_BEGIN = "touchBegin";
  6779. a.TOUCH_END = "touchEnd";
  6780. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  6781. a.TOUCH_ROLL_OUT = "touchRollOut";
  6782. a.TOUCH_ROLL_OVER = "touchRollOver";
  6783. a.TOUCH_OUT = "touchOut";
  6784. a.TOUCH_OVER = "touchOver";
  6785. return a
  6786. } (b.Event);
  6787. b.TouchEvent = c;
  6788. c.prototype.__class__ = "egret.TouchEvent"
  6789. })(egret || (egret = {}));
  6790. __extends = this.__extends ||
  6791. function(b, c) {
  6792. function d() {
  6793. this.constructor = b
  6794. }
  6795. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6796. d.prototype = c.prototype;
  6797. b.prototype = new d
  6798. }; (function(b) {
  6799. var c = function(d) {
  6800. function a(e, a, f) {
  6801. "undefined" === typeof a && (a = !1);
  6802. "undefined" === typeof f && (f = !1);
  6803. d.call(this, e, a, f)
  6804. }
  6805. __extends(a, d);
  6806. a.dispatchTimerEvent = function(e, g) {
  6807. b.Event._dispatchByTarget(a, e, g)
  6808. };
  6809. a.TIMER = "timer";
  6810. a.TIMER_COMPLETE = "timerComplete";
  6811. return a
  6812. } (b.Event);
  6813. b.TimerEvent = c;
  6814. c.prototype.__class__ = "egret.TimerEvent"
  6815. })(egret || (egret = {})); (function(b) {
  6816. var c = function() {
  6817. function b() {}
  6818. b.CAPTURING_PHASE = 1;
  6819. b.AT_TARGET = 2;
  6820. b.BUBBLING_PHASE = 3;
  6821. return b
  6822. } ();
  6823. b.EventPhase = c;
  6824. c.prototype.__class__ = "egret.EventPhase"
  6825. })(egret || (egret = {}));
  6826. __extends = this.__extends ||
  6827. function(b, c) {
  6828. function d() {
  6829. this.constructor = b
  6830. }
  6831. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6832. d.prototype = c.prototype;
  6833. b.prototype = new d
  6834. }; (function(b) {
  6835. var c = function(d) {
  6836. function a(e) {
  6837. "undefined" === typeof e && (e = null);
  6838. d.call(this);
  6839. this._eventTarget = e ? e: this
  6840. }
  6841. __extends(a, d);
  6842. a.prototype.addEventListener = function(e, a, f, d, c) {
  6843. "undefined" === typeof d && (d = !1);
  6844. "undefined" === typeof c && (c = 0);
  6845. "undefined" === typeof d && (d = !1);
  6846. "undefined" === typeof c && (c = 0);
  6847. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  6848. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  6849. var h = d[e];
  6850. h || (h = d[e] = []);
  6851. this._insertEventBin(h, a, f, c)
  6852. };
  6853. a.prototype._insertEventBin = function(e, a, f, b) {
  6854. for (var d = -1,
  6855. c = e.length,
  6856. k = 0; k < c; k++) {
  6857. var p = e[k];
  6858. if (p.listener === a && p.thisObject === f) return ! 1; - 1 == d && p.priority < b && (d = k)
  6859. }
  6860. a = {
  6861. listener: a,
  6862. thisObject: f,
  6863. priority: b
  6864. }; - 1 != d ? e.splice(d, 0, a) : e.push(a);
  6865. return ! 0
  6866. };
  6867. a.prototype.removeEventListener = function(e, a, f, b) {
  6868. "undefined" === typeof b && (b = !1);
  6869. if (b = b ? this._captureEventsMap: this._eventsMap) {
  6870. var d = b[e];
  6871. d && (this._removeEventBin(d, a, f), 0 == d.length && delete b[e])
  6872. }
  6873. };
  6874. a.prototype._removeEventBin = function(e, a, f) {
  6875. for (var b = e.length,
  6876. d = 0; d < b; d++) {
  6877. var c = e[d];
  6878. if (c.listener === a && c.thisObject === f) return e.splice(d, 1),
  6879. !0
  6880. }
  6881. return ! 1
  6882. };
  6883. a.prototype.hasEventListener = function(e) {
  6884. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  6885. };
  6886. a.prototype.willTrigger = function(e) {
  6887. return this.hasEventListener(e)
  6888. };
  6889. a.prototype.dispatchEvent = function(e) {
  6890. e._reset();
  6891. e._target = this._eventTarget;
  6892. e._setCurrentTarget(this._eventTarget);
  6893. return this._notifyListener(e)
  6894. };
  6895. a.prototype._notifyListener = function(e) {
  6896. var a = 1 == e._eventPhase ? this._captureEventsMap: this._eventsMap;
  6897. if (!a) return ! 0;
  6898. a = a[e.type];
  6899. if (!a) return ! 0;
  6900. for (var a = a.concat(), f = a.length, b = 0; b < f; b++) {
  6901. var d = a[b];
  6902. d.listener.call(d.thisObject, e);
  6903. if (e._isPropagationImmediateStopped) break
  6904. }
  6905. return ! e.isDefaultPrevented()
  6906. };
  6907. a.prototype.dispatchEventWith = function(e, a, f) {
  6908. "undefined" === typeof a && (a = !1);
  6909. b.Event.dispatchEvent(this, e, a, f)
  6910. };
  6911. return a
  6912. } (b.HashObject);
  6913. b.EventDispatcher = c;
  6914. c.prototype.__class__ = "egret.EventDispatcher"
  6915. })(egret || (egret = {}));
  6916. __extends = this.__extends ||
  6917. function(b, c) {
  6918. function d() {
  6919. this.constructor = b
  6920. }
  6921. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6922. d.prototype = c.prototype;
  6923. b.prototype = new d
  6924. }; (function(b) {
  6925. var c = function(d) {
  6926. function a() {
  6927. d.call(this);
  6928. this.reuseEvent = new b.Event("")
  6929. }
  6930. __extends(a, d);
  6931. a.prototype.run = function() {
  6932. b.Ticker.getInstance().run();
  6933. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  6934. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  6935. this.touchContext.run()
  6936. };
  6937. a.prototype.renderLoop = function(e) {
  6938. if (0 < b.__callLaterFunctionList.length) {
  6939. var a = b.__callLaterFunctionList;
  6940. b.__callLaterFunctionList = [];
  6941. var f = b.__callLaterThisList;
  6942. b.__callLaterThisList = [];
  6943. var d = b.__callLaterArgsList;
  6944. b.__callLaterArgsList = []
  6945. }
  6946. this.dispatchEventWith(b.Event.RENDER);
  6947. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  6948. a && this.doCallLaterList(a, f, d);
  6949. e = this.rendererContext;
  6950. e.onRenderStart();
  6951. e.clearScreen();
  6952. this.stage._updateTransform();
  6953. this.dispatchEventWith(b.Event.FINISH_UPDATE_TRANSFORM);
  6954. this.stage._draw(e);
  6955. this.dispatchEventWith(b.Event.FINISH_RENDER);
  6956. e.onRenderFinish()
  6957. };
  6958. a.prototype.broadcastEnterFrame = function(e) {
  6959. e = this.reuseEvent;
  6960. e._type = b.Event.ENTER_FRAME;
  6961. this.dispatchEvent(e);
  6962. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  6963. var c = a[d];
  6964. e._target = c.display;
  6965. e._setCurrentTarget(c.display);
  6966. c.listener.call(c.thisObject, e)
  6967. }
  6968. a = b.Recycler._callBackList;
  6969. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  6970. };
  6971. a.prototype.broadcastRender = function() {
  6972. var e = this.reuseEvent;
  6973. e._type = b.Event.RENDER;
  6974. for (var a = b.DisplayObject._renderCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  6975. var c = a[d];
  6976. e._target = c.display;
  6977. e._setCurrentTarget(c.display);
  6978. c.listener.call(c.thisObject, e)
  6979. }
  6980. };
  6981. a.prototype.doCallLaterList = function(e, a, f) {
  6982. for (var b = e.length,
  6983. d = 0; d < b; d++) {
  6984. var c = e[d];
  6985. null != c && c.apply(a[d], f[d])
  6986. }
  6987. };
  6988. a.DEVICE_PC = "web";
  6989. a.DEVICE_MOBILE = "native";
  6990. return a
  6991. } (b.EventDispatcher);
  6992. b.MainContext = c;
  6993. c.prototype.__class__ = "egret.MainContext"
  6994. })(egret || (egret = {}));
  6995. var testDeviceType = function() {
  6996. if (!this.navigator) return ! 0;
  6997. var b = navigator.userAgent.toLowerCase();
  6998. return - 1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  6999. };
  7000. egret.MainContext.instance = new egret.MainContext;
  7001. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC; (function(b) {
  7002. var c = function() {
  7003. function d() {
  7004. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  7005. this._maxDeltaTime = 500;
  7006. this._totalDeltaTime = 0
  7007. }
  7008. d.getInstance = function() {
  7009. null == d.instance && (d.instance = new d);
  7010. return d.instance
  7011. };
  7012. d.prototype.run = function() {
  7013. b.Ticker.getInstance().register(this.update, this);
  7014. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, b.MainContext.instance.stage.addChild(this._txt));
  7015. var a = b.MainContext.instance;
  7016. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  7017. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  7018. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  7019. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  7020. };
  7021. d.prototype.onEnterFrame = function(a) {
  7022. this._lastTime = b.getTimer()
  7023. };
  7024. d.prototype.onStartRender = function(a) {
  7025. a = b.getTimer();
  7026. this._logicPerformanceCost = a - this._lastTime;
  7027. this._lastTime = a
  7028. };
  7029. d.prototype.onFinishUpdateTransform = function(a) {
  7030. a = b.getTimer();
  7031. this._updateTransformPerformanceCost = a - this._lastTime;
  7032. this._lastTime = a
  7033. };
  7034. d.prototype.onFinishRender = function(a) {
  7035. a = b.getTimer();
  7036. this._renderPerformanceCost = a - this._lastTime;
  7037. this._lastTime = a
  7038. };
  7039. d.prototype.update = function(a) {
  7040. this._tick++;
  7041. this._totalDeltaTime += a;
  7042. if (this._totalDeltaTime >= this._maxDeltaTime) {
  7043. a = (this._preDrawCount - 1).toString();
  7044. 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();
  7045. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  7046. this._tick = this._totalDeltaTime = 0
  7047. }
  7048. this._preDrawCount = 0
  7049. };
  7050. d.prototype.onDrawImage = function() {
  7051. this._preDrawCount++
  7052. };
  7053. return d
  7054. } ();
  7055. b.Profiler = c;
  7056. c.prototype.__class__ = "egret.Profiler"
  7057. })(egret || (egret = {}));
  7058. __extends = this.__extends ||
  7059. function(b, c) {
  7060. function d() {
  7061. this.constructor = b
  7062. }
  7063. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7064. d.prototype = c.prototype;
  7065. b.prototype = new d
  7066. }; (function(b) {
  7067. var c = function(d) {
  7068. function a() {
  7069. d.apply(this, arguments);
  7070. this._timeScale = 1;
  7071. this._paused = !1;
  7072. this.callBackList = []
  7073. }
  7074. __extends(a, d);
  7075. a.prototype.run = function() {
  7076. b.__START_TIME = (new Date).getTime();
  7077. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  7078. };
  7079. a.prototype.update = function(e) {
  7080. var a = this.callBackList.concat(),
  7081. f = a.length;
  7082. e *= this._timeScale;
  7083. e *= this._timeScale;
  7084. for (var b = 0; b < f; b++) {
  7085. var d = a[b];
  7086. d.listener.call(d.thisObject, e)
  7087. }
  7088. };
  7089. a.prototype.register = function(e, a, f) {
  7090. "undefined" === typeof f && (f = 0);
  7091. this._insertEventBin(this.callBackList, e, a, f)
  7092. };
  7093. a.prototype.unregister = function(e, a) {
  7094. this._removeEventBin(this.callBackList, e, a)
  7095. };
  7096. a.prototype.setTimeout = function(e, a, f) {
  7097. for (var d = [], c = 0; c < arguments.length - 3; c++) d[c] = arguments[c + 3];
  7098. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  7099. b.setTimeout.apply(null, [e, a, f].concat(d))
  7100. };
  7101. a.prototype.setTimeScale = function(e) {
  7102. this._timeScale = e
  7103. };
  7104. a.prototype.getTimeScale = function() {
  7105. return this._timeScale
  7106. };
  7107. a.prototype.pause = function() {
  7108. this._paused = !0
  7109. };
  7110. a.prototype.resume = function() {
  7111. this._paused = !1
  7112. };
  7113. a.getInstance = function() {
  7114. null == a.instance && (a.instance = new a);
  7115. return a.instance
  7116. };
  7117. return a
  7118. } (b.EventDispatcher);
  7119. b.Ticker = c;
  7120. c.prototype.__class__ = "egret.Ticker"
  7121. })(egret || (egret = {})); (function(b) {
  7122. var c = function() {
  7123. function b() {}
  7124. b.LEFT = "left";
  7125. b.RIGHT = "right";
  7126. b.CENTER = "center";
  7127. b.JUSTIFY = "justify";
  7128. b.CONTENT_JUSTIFY = "contentJustify";
  7129. return b
  7130. } ();
  7131. b.HorizontalAlign = c;
  7132. c.prototype.__class__ = "egret.HorizontalAlign"
  7133. })(egret || (egret = {})); (function(b) {
  7134. var c = function() {
  7135. function b() {}
  7136. b.TOP = "top";
  7137. b.BOTTOM = "bottom";
  7138. b.MIDDLE = "middle";
  7139. b.JUSTIFY = "justify";
  7140. b.CONTENT_JUSTIFY = "contentJustify";
  7141. return b
  7142. } ();
  7143. b.VerticalAlign = c;
  7144. c.prototype.__class__ = "egret.VerticalAlign"
  7145. })(egret || (egret = {}));
  7146. __extends = this.__extends ||
  7147. function(b, c) {
  7148. function d() {
  7149. this.constructor = b
  7150. }
  7151. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7152. d.prototype = c.prototype;
  7153. b.prototype = new d
  7154. }; (function(b) {
  7155. var c = function(d) {
  7156. function a(e, a) {
  7157. "undefined" === typeof a && (a = 0);
  7158. d.call(this);
  7159. this._currentCount = 0;
  7160. this.delay = e;
  7161. this.repeatCount = a
  7162. }
  7163. __extends(a, d);
  7164. a.prototype.currentCount = function() {
  7165. return this._currentCount
  7166. };
  7167. Object.defineProperty(a.prototype, "running", {
  7168. get: function() {
  7169. return this._running
  7170. },
  7171. enumerable: !0,
  7172. configurable: !0
  7173. });
  7174. a.prototype.reset = function() {
  7175. this.stop();
  7176. this._currentCount = 0
  7177. };
  7178. a.prototype.start = function() {
  7179. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount = 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  7180. };
  7181. a.prototype.stop = function() {
  7182. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  7183. };
  7184. a.prototype.onEnterFrame = function(e) {
  7185. e = b.getTimer();
  7186. 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)))
  7187. };
  7188. return a
  7189. } (b.EventDispatcher);
  7190. b.Timer = c;
  7191. c.prototype.__class__ = "egret.Timer"
  7192. })(egret || (egret = {})); (function(b) {
  7193. b.getQualifiedClassName = function(b) {
  7194. b = b.prototype ? b.prototype: b.__proto__;
  7195. if (b.hasOwnProperty("__class__")) return b.__class__;
  7196. var d = b.constructor.toString(),
  7197. a = d.indexOf("("),
  7198. d = d.substring(9, a);
  7199. return b.__class__ = d
  7200. }
  7201. })(egret || (egret = {})); (function(b) {
  7202. var c = {};
  7203. b.getDefinitionByName = function(b) {
  7204. if (!b) return null;
  7205. var a = c[b];
  7206. if (a) return a;
  7207. for (var e = b.split("."), g = e.length, a = __global, f = 0; f < g; f++) if (a = a[e[f]], !a) return null;
  7208. return c[b] = a
  7209. }
  7210. })(egret || (egret = {}));
  7211. var __global = __global || this; (function(b) {
  7212. function c(e) {
  7213. for (var a in d) {
  7214. var f = d[a];
  7215. f.delay -= e;
  7216. 0 >= f.delay && (f.listener.apply(f.thisObject, f.params), delete d[a])
  7217. }
  7218. }
  7219. var d = {},
  7220. a = 0;
  7221. b.setTimeout = function(e, g, f) {
  7222. for (var m = [], l = 0; l < arguments.length - 3; l++) m[l] = arguments[l + 3];
  7223. m = {
  7224. listener: e,
  7225. thisObject: g,
  7226. delay: f,
  7227. params: m
  7228. };
  7229. 0 == a && b.Ticker.getInstance().register(c, null);
  7230. a++;
  7231. d[a] = m;
  7232. return a
  7233. };
  7234. b.clearTimeout = function(e) {
  7235. delete d[e]
  7236. }
  7237. })(egret || (egret = {})); (function(b) {
  7238. b.hasDefinition = function(c) {
  7239. return b.getDefinitionByName(c) ? !0 : !1
  7240. }
  7241. })(egret || (egret = {})); (function(b) {
  7242. b.toColorString = function(b) {
  7243. if (isNaN(b) || 0 > b) b = 0;
  7244. 16777215 < b && (b = 16777215);
  7245. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  7246. return "#" + b
  7247. }
  7248. })(egret || (egret = {}));
  7249. __extends = this.__extends ||
  7250. function(b, c) {
  7251. function d() {
  7252. this.constructor = b
  7253. }
  7254. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7255. d.prototype = c.prototype;
  7256. b.prototype = new d
  7257. }; (function(b) {
  7258. var c = function(d) {
  7259. function a(e, a, b, c, l, h) {
  7260. "undefined" === typeof e && (e = 1);
  7261. "undefined" === typeof a && (a = 0);
  7262. "undefined" === typeof b && (b = 0);
  7263. "undefined" === typeof c && (c = 1);
  7264. "undefined" === typeof l && (l = 0);
  7265. "undefined" === typeof h && (h = 0);
  7266. d.call(this);
  7267. this.a = e;
  7268. this.b = a;
  7269. this.c = b;
  7270. this.d = c;
  7271. this.tx = l;
  7272. this.ty = h
  7273. }
  7274. __extends(a, d);
  7275. a.prototype.prepend = function(e, a, b, d, c, h) {
  7276. var k = this.tx;
  7277. if (1 != e || 0 != a || 0 != b || 1 != d) {
  7278. var p = this.a,
  7279. n = this.c;
  7280. this.a = p * e + this.b * b;
  7281. this.b = p * a + this.b * d;
  7282. this.c = n * e + this.d * b;
  7283. this.d = n * a + this.d * d
  7284. }
  7285. this.tx = k * e + this.ty * b + c;
  7286. this.ty = k * a + this.ty * d + h;
  7287. return this
  7288. };
  7289. a.prototype.append = function(e, a, b, d, c, h) {
  7290. var k = this.a,
  7291. p = this.b,
  7292. n = this.c,
  7293. q = this.d;
  7294. this.a = e * k + a * n;
  7295. this.b = e * p + a * q;
  7296. this.c = b * k + d * n;
  7297. this.d = b * p + d * q;
  7298. this.tx = c * k + h * n + this.tx;
  7299. this.ty = c * p + h * q + this.ty;
  7300. return this
  7301. };
  7302. a.prototype.prependMatrix = function(e) {
  7303. this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty);
  7304. return this
  7305. };
  7306. a.prototype.appendMatrix = function(e) {
  7307. this.append(e.a, e.b, e.c, e.d, e.tx, e.ty);
  7308. return this
  7309. };
  7310. a.prototype.prependTransform = function(e, g, b, d, c, h, k, p, n) {
  7311. if (c % 360) {
  7312. var q = c * a.DEG_TO_RAD;
  7313. c = Math.cos(q);
  7314. q = Math.sin(q)
  7315. } else c = 1,
  7316. q = 0;
  7317. if (p || n) this.tx -= p,
  7318. this.ty -= n;
  7319. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(c * b, q * b, -q * d, c * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), e, g)) : this.prepend(c * b, q * b, -q * d, c * d, e, g);
  7320. return this
  7321. };
  7322. a.prototype.appendTransform = function(e, g, b, d, c, h, k, p, n) {
  7323. if (c % 360) {
  7324. var q = c * a.DEG_TO_RAD;
  7325. c = Math.cos(q);
  7326. q = Math.sin(q)
  7327. } else c = 1,
  7328. q = 0;
  7329. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), e, g), this.append(c * b, q * b, -q * d, c * d, 0, 0)) : this.append(c * b, q * b, -q * d, c * d, e, g);
  7330. if (p || n) this.tx -= p * this.a + n * this.c,
  7331. this.ty -= p * this.b + n * this.d;
  7332. return this
  7333. };
  7334. a.prototype.rotate = function(e) {
  7335. var a = Math.cos(e);
  7336. e = Math.sin(e);
  7337. var b = this.a,
  7338. d = this.c,
  7339. c = this.tx;
  7340. this.a = b * a - this.b * e;
  7341. this.b = b * e + this.b * a;
  7342. this.c = d * a - this.d * e;
  7343. this.d = d * e + this.d * a;
  7344. this.tx = c * a - this.ty * e;
  7345. this.ty = c * e + this.ty * a;
  7346. return this
  7347. };
  7348. a.prototype.skew = function(e, g) {
  7349. e *= a.DEG_TO_RAD;
  7350. g *= a.DEG_TO_RAD;
  7351. this.append(Math.cos(g), Math.sin(g), -Math.sin(e), Math.cos(e), 0, 0);
  7352. return this
  7353. };
  7354. a.prototype.scale = function(e, a) {
  7355. this.a *= e;
  7356. this.d *= a;
  7357. this.c *= e;
  7358. this.b *= a;
  7359. this.tx *= e;
  7360. this.ty *= a;
  7361. return this
  7362. };
  7363. a.prototype.translate = function(e, a) {
  7364. this.tx += e;
  7365. this.ty += a;
  7366. return this
  7367. };
  7368. a.prototype.identity = function() {
  7369. this.a = this.d = 1;
  7370. this.b = this.c = this.tx = this.ty = 0;
  7371. return this
  7372. };
  7373. a.prototype.invert = function() {
  7374. var e = this.a,
  7375. a = this.b,
  7376. b = this.c,
  7377. d = this.d,
  7378. c = this.tx,
  7379. h = e * d - a * b;
  7380. this.a = d / h;
  7381. this.b = -a / h;
  7382. this.c = -b / h;
  7383. this.d = e / h;
  7384. this.tx = (b * this.ty - d * c) / h;
  7385. this.ty = -(e * this.ty - a * c) / h;
  7386. return this
  7387. };
  7388. a.transformCoords = function(e, a, f) {
  7389. var d = b.Point.identity;
  7390. d.x = e.a * a + e.c * f + e.tx;
  7391. d.y = e.d * f + e.b * a + e.ty;
  7392. return d
  7393. };
  7394. a.prototype.toArray = function(e) {
  7395. this.array || (this.array = new Float32Array(9));
  7396. 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);
  7397. this.array[8] = 1;
  7398. return this.array
  7399. };
  7400. a.identity = new a;
  7401. a.DEG_TO_RAD = Math.PI / 180;
  7402. return a
  7403. } (b.HashObject);
  7404. b.Matrix = c;
  7405. c.prototype.__class__ = "egret.Matrix"
  7406. })(egret || (egret = {}));
  7407. __extends = this.__extends ||
  7408. function(b, c) {
  7409. function d() {
  7410. this.constructor = b
  7411. }
  7412. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7413. d.prototype = c.prototype;
  7414. b.prototype = new d
  7415. }; (function(b) {
  7416. var c = function(b) {
  7417. function a(e, a) {
  7418. "undefined" === typeof e && (e = 0);
  7419. "undefined" === typeof a && (a = 0);
  7420. b.call(this);
  7421. this.x = e;
  7422. this.y = a
  7423. }
  7424. __extends(a, b);
  7425. a.prototype.clone = function() {
  7426. return new a(this.x, this.y)
  7427. };
  7428. a.prototype.equals = function(e) {
  7429. return this.x == e.x && this.y == e.y
  7430. };
  7431. a.distance = function(e, a) {
  7432. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  7433. };
  7434. a.identity = new a(0, 0);
  7435. return a
  7436. } (b.HashObject);
  7437. b.Point = c;
  7438. c.prototype.__class__ = "egret.Point"
  7439. })(egret || (egret = {}));
  7440. __extends = this.__extends ||
  7441. function(b, c) {
  7442. function d() {
  7443. this.constructor = b
  7444. }
  7445. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7446. d.prototype = c.prototype;
  7447. b.prototype = new d
  7448. }; (function(b) {
  7449. var c = function(b) {
  7450. function a(e, a, f, c) {
  7451. "undefined" === typeof e && (e = 0);
  7452. "undefined" === typeof a && (a = 0);
  7453. "undefined" === typeof f && (f = 0);
  7454. "undefined" === typeof c && (c = 0);
  7455. b.call(this);
  7456. this.x = e;
  7457. this.y = a;
  7458. this.width = f;
  7459. this.height = c
  7460. }
  7461. __extends(a, b);
  7462. Object.defineProperty(a.prototype, "right", {
  7463. get: function() {
  7464. return this.x + this.width
  7465. },
  7466. set: function(e) {
  7467. this.width = e - this.x
  7468. },
  7469. enumerable: !0,
  7470. configurable: !0
  7471. });
  7472. Object.defineProperty(a.prototype, "bottom", {
  7473. get: function() {
  7474. return this.y + this.height
  7475. },
  7476. set: function(e) {
  7477. this.height = e - this.y
  7478. },
  7479. enumerable: !0,
  7480. configurable: !0
  7481. });
  7482. a.prototype.initialize = function(e, a, b, d) {
  7483. this.x = e;
  7484. this.y = a;
  7485. this.width = b;
  7486. this.height = d;
  7487. return this
  7488. };
  7489. a.prototype.contains = function(e, a) {
  7490. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  7491. };
  7492. a.prototype.intersects = function(e) {
  7493. return this.contains(e.x, e.y) || this.contains(e.x, e.bottom) || this.contains(e.right, e.y) || this.contains(e.right, e.bottom) ? !0 : !1
  7494. };
  7495. a.prototype.clone = function() {
  7496. return new a(this.x, this.y, this.width, this.height)
  7497. };
  7498. a.prototype.containsPoint = function(e) {
  7499. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  7500. };
  7501. a.identity = new a(0, 0, 0, 0);
  7502. return a
  7503. } (b.HashObject);
  7504. b.Rectangle = c;
  7505. c.prototype.__class__ = "egret.Rectangle"
  7506. })(egret || (egret = {})); (function(b) {
  7507. var c = function() {
  7508. function d() {}
  7509. d.fatal = function(a, e) {
  7510. "undefined" === typeof e && (e = null);
  7511. b.Logger.traceToConsole("Fatal", a, e);
  7512. throw Error(b.Logger.getTraceCode("Fatal", a, e));
  7513. };
  7514. d.info = function(a, e) {
  7515. "undefined" === typeof e && (e = null);
  7516. b.Logger.traceToConsole("Info", a, e)
  7517. };
  7518. d.warning = function(a, e) {
  7519. "undefined" === typeof e && (e = null);
  7520. b.Logger.traceToConsole("Warning", a, e)
  7521. };
  7522. d.traceToConsole = function(a, e, g) {
  7523. console.log(b.Logger.getTraceCode(a, e, g))
  7524. };
  7525. d.getTraceCode = function(a, e, g) {
  7526. return "[" + a + "]" + e + ":" + (null == g ? "": g)
  7527. };
  7528. return d
  7529. } ();
  7530. b.Logger = c;
  7531. c.prototype.__class__ = "egret.Logger"
  7532. })(egret || (egret = {}));
  7533. __extends = this.__extends ||
  7534. function(b, c) {
  7535. function d() {
  7536. this.constructor = b
  7537. }
  7538. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7539. d.prototype = c.prototype;
  7540. b.prototype = new d
  7541. }; (function(b) {
  7542. var c = function(d) {
  7543. function a() {
  7544. d.call(this);
  7545. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  7546. this._xmlDict = {};
  7547. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  7548. }
  7549. __extends(a, d);
  7550. a.getInstance = function() {
  7551. a._instance || (a._instance = new a);
  7552. return a._instance
  7553. };
  7554. a.prototype.parserXML = function(e) {
  7555. for (var a = 0;
  7556. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  7557. 0 != a && (e = e.substring(a, e.length));
  7558. this._isSupportDOMParser ? a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  7559. null == a && b.Logger.info("xml not found!");
  7560. return a
  7561. };
  7562. a._instance = null;
  7563. return a
  7564. } (b.HashObject);
  7565. b.SAXParser = c;
  7566. c.prototype.__class__ = "egret.SAXParser"
  7567. })(egret || (egret = {}));
  7568. __extends = this.__extends ||
  7569. function(b, c) {
  7570. function d() {
  7571. this.constructor = b
  7572. }
  7573. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7574. d.prototype = c.prototype;
  7575. b.prototype = new d
  7576. }; (function(b) {
  7577. var c = function(e) {
  7578. function g() {
  7579. e.call(this);
  7580. this._designHeight = this._designWidth = 0;
  7581. this._scaleY = this._scaleX = 1;
  7582. var a = document.getElementById(g.canvas_name),
  7583. b = a.height;
  7584. this._designWidth = a.width;
  7585. this._designHeight = b
  7586. }
  7587. __extends(g, e);
  7588. g.getInstance = function() {
  7589. null == g.instance && (a.initialize(), g.instance = new g);
  7590. return g.instance
  7591. };
  7592. g.prototype.setDesignSize = function(e, a, g) {
  7593. this._designWidth = e;
  7594. this._designHeight = a;
  7595. g && (b.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"), this._setResolutionPolicy(g))
  7596. };
  7597. g.prototype._setResolutionPolicy = function(e) {
  7598. this._resolutionPolicy = e;
  7599. e.init(this);
  7600. e._apply(this, this._designWidth, this._designHeight)
  7601. };
  7602. g.prototype.getScaleX = function() {
  7603. return this._scaleX
  7604. };
  7605. g.prototype.getScaleY = function() {
  7606. return this._scaleY
  7607. };
  7608. g.canvas_name = "gameCanvas";
  7609. g.canvas_div_name = "gameDiv";
  7610. return g
  7611. } (b.HashObject);
  7612. b.StageDelegate = c;
  7613. c.prototype.__class__ = "egret.StageDelegate";
  7614. var d = function() {
  7615. function e(a, g) {
  7616. this._containerStrategy = a;
  7617. this._contentStrategy = g
  7618. }
  7619. e.prototype.init = function(e) {
  7620. this._containerStrategy.init(e);
  7621. this._contentStrategy.init(e)
  7622. };
  7623. e.prototype._apply = function(e, a, g) {
  7624. this._containerStrategy._apply(e, a, g);
  7625. this._contentStrategy._apply(e, a, g)
  7626. };
  7627. return e
  7628. } ();
  7629. b.ResolutionPolicy = d;
  7630. d.prototype.__class__ = "egret.ResolutionPolicy";
  7631. var a = function() {
  7632. function a() {}
  7633. a.initialize = function() {
  7634. a.EQUAL_TO_FRAME = new e
  7635. };
  7636. a.prototype.init = function(e) {};
  7637. a.prototype._apply = function(e, a, g) {};
  7638. a.prototype._setupContainer = function() {
  7639. var e = document.body,
  7640. a;
  7641. 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")
  7642. };
  7643. return a
  7644. } ();
  7645. b.ContainerStrategy = a;
  7646. a.prototype.__class__ = "egret.ContainerStrategy";
  7647. var e = function(e) {
  7648. function a() {
  7649. e.apply(this, arguments)
  7650. }
  7651. __extends(a, e);
  7652. a.prototype._apply = function(e) {
  7653. this._setupContainer()
  7654. };
  7655. return a
  7656. } (a);
  7657. b.EqualToFrame = e;
  7658. e.prototype.__class__ = "egret.EqualToFrame";
  7659. d = function() {
  7660. function e() {}
  7661. e.prototype.init = function(e) {};
  7662. e.prototype._apply = function(e, a, g) {};
  7663. return e
  7664. } ();
  7665. b.ContentStrategy = d;
  7666. d.prototype.__class__ = "egret.ContentStrategy";
  7667. var g = function(e) {
  7668. function a(g) {
  7669. "undefined" === typeof g && (g = 0);
  7670. e.call(this);
  7671. this.minWidth = g
  7672. }
  7673. __extends(a, e);
  7674. a.prototype._apply = function(e, a, g) {
  7675. a = document.getElementById(c.canvas_name);
  7676. var b = document.getElementById(c.canvas_div_name),
  7677. f = document.documentElement.clientWidth,
  7678. d = document.documentElement.clientHeight,
  7679. m = d / g,
  7680. r = f / m,
  7681. s = 1;
  7682. 0 != this.minWidth && (s = Math.min(1, r / this.minWidth));
  7683. a.width = r / s;
  7684. a.height = g;
  7685. a.style.width = f + "px";
  7686. a.style.height = d * s + "px";
  7687. b.style.width = f + "px";
  7688. b.style.height = d * s + "px";
  7689. e._scaleX = m * s;
  7690. e._scaleY = m * s
  7691. };
  7692. return a
  7693. } (d);
  7694. b.FixedHeight = g;
  7695. g.prototype.__class__ = "egret.FixedHeight";
  7696. g = function(e) {
  7697. function a(g) {
  7698. "undefined" === typeof g && (g = 0);
  7699. e.call(this);
  7700. this.minHeight = g
  7701. }
  7702. __extends(a, e);
  7703. a.prototype._apply = function(e, a, g) {
  7704. g = document.getElementById(c.canvas_name);
  7705. var b = document.getElementById(c.canvas_div_name),
  7706. f = document.documentElement.clientWidth,
  7707. d = document.documentElement.clientHeight,
  7708. m = f / a,
  7709. r = d / m,
  7710. s = 1;
  7711. 0 != this.minHeight && (s = Math.min(1, r / this.minHeight));
  7712. g.width = a;
  7713. g.height = r / s;
  7714. g.style.width = f * s + "px";
  7715. g.style.height = d + "px";
  7716. b.style.width = f * s + "px";
  7717. b.style.height = d + "px";
  7718. e._scaleX = m * s;
  7719. e._scaleY = m * s
  7720. };
  7721. return a
  7722. } (d);
  7723. b.FixedWidth = g;
  7724. g.prototype.__class__ = "egret.FixedWidth";
  7725. g = function(e) {
  7726. function a(g, b) {
  7727. e.call(this);
  7728. this.width = g;
  7729. this.height = b
  7730. }
  7731. __extends(a, e);
  7732. a.prototype._apply = function(e, a, g) {
  7733. g = document.getElementById(c.canvas_name);
  7734. var b = document.getElementById(c.canvas_div_name),
  7735. f = this.width,
  7736. d = this.height,
  7737. m = f / a;
  7738. g.width = a;
  7739. g.height = d / m;
  7740. g.style.width = f + "px";
  7741. g.style.height = d + "px";
  7742. b.style.width = f + "px";
  7743. b.style.height = d + "px";
  7744. e._scaleX = m;
  7745. e._scaleY = m
  7746. };
  7747. return a
  7748. } (d);
  7749. b.FixedSize = g;
  7750. g.prototype.__class__ = "egret.FixedSize";
  7751. g = function(e) {
  7752. function a() {
  7753. e.call(this)
  7754. }
  7755. __extends(a, e);
  7756. a.prototype._apply = function(e, a, g) {
  7757. a = document.getElementById(c.canvas_name);
  7758. a.style.width = a.width + "px";
  7759. a.style.height = a.height + "px";
  7760. e._scaleX = 1;
  7761. e._scaleY = 1
  7762. };
  7763. return a
  7764. } (d);
  7765. b.NoScale = g;
  7766. g.prototype.__class__ = "egret.NoScale";
  7767. d = function(e) {
  7768. function a() {
  7769. e.call(this)
  7770. }
  7771. __extends(a, e);
  7772. a.prototype._apply = function(e, a, g) {
  7773. var b = document.getElementById(c.canvas_name),
  7774. f = document.getElementById(c.canvas_div_name),
  7775. d = document.documentElement.clientWidth,
  7776. m = document.documentElement.clientHeight,
  7777. r = d / a < m / g ? d / a: m / g,
  7778. d = a * r,
  7779. m = g * r;
  7780. b.width = a;
  7781. b.height = g / 1;
  7782. b.style.width = 1 * d + "px";
  7783. b.style.height = m + "px";
  7784. b.style.top = Math.floor((document.documentElement.clientHeight - m) / 2) + "px";
  7785. f.style.width = 1 * d + "px";
  7786. f.style.height = m + "px";
  7787. e._scaleX = 1 * r;
  7788. e._scaleY = 1 * r
  7789. };
  7790. return a
  7791. } (d);
  7792. b.ShowAll = d;
  7793. d.prototype.__class__ = "egret.ShowAll"
  7794. })(egret || (egret = {}));
  7795. __extends = this.__extends ||
  7796. function(b, c) {
  7797. function d() {
  7798. this.constructor = b
  7799. }
  7800. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7801. d.prototype = c.prototype;
  7802. b.prototype = new d
  7803. }; (function(b) {
  7804. var c = function(d) {
  7805. function a() {
  7806. d.call(this);
  7807. this._originalData = {};
  7808. this._drawAreaList = []
  7809. }
  7810. __extends(a, d);
  7811. a.getInstance = function() {
  7812. null == a.instance && (a.instance = new a);
  7813. return a.instance
  7814. };
  7815. a.prototype.addDrawArea = function(e) {
  7816. this._drawAreaList.push(e)
  7817. };
  7818. a.prototype.clearDrawArea = function() {
  7819. this._drawAreaList = []
  7820. };
  7821. a.prototype.drawImage = function(e, a, f, d, c, h, k, p, n, q) {
  7822. k = k || 0;
  7823. p = p || 0;
  7824. var t = a._texture_to_render;
  7825. if (null != t && 0 != h && 0 != c && 0 != n && 0 != q) if (a._worldBounds) {
  7826. var r = this._originalData;
  7827. r.sourceX = f;
  7828. r.sourceY = d;
  7829. r.sourceWidth = c;
  7830. r.sourceHeight = h;
  7831. r.destX = k;
  7832. r.destY = p;
  7833. r.destWidth = n;
  7834. r.destHeight = q;
  7835. for (var s = this.getDrawAreaList(), u = 0; u < s.length; u++) {
  7836. var v = s[u];
  7837. if (!this.ignoreRender(a, v, r.destX, r.destY)) {
  7838. if (0 != this._drawAreaList.length) if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  7839. if (a._worldBounds.x + r.destX < v.x || a._worldBounds.y + r.destY < v.y || a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width || a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height) {
  7840. b.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  7841. break
  7842. }
  7843. } else {
  7844. var x = a._worldTransform.a,
  7845. y = a._worldTransform.d,
  7846. w;
  7847. a._worldBounds.x + r.destX < v.x && (w = (v.x - a._worldBounds.x) / x - r.destX, f += w / (n / c), c -= w / (n / c), n -= w, k += w);
  7848. a._worldBounds.y + r.destY < v.y && (w = (v.y - a._worldBounds.y) / y - r.destY, d += w / (q / h), h -= w / (q / h), q -= w, p += w);
  7849. a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width && (w = (a._worldBounds.x + a._worldBounds.width - v.x - v.width) / x + r.destX, c -= w / (n / c), n -= w);
  7850. a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height && (w = (a._worldBounds.y + a._worldBounds.height - v.y - v.height) / y + r.destY, h -= w / (q / h), q -= w)
  7851. }
  7852. e.drawImage(t, f, d, c, h, k, p, n, q)
  7853. }
  7854. }
  7855. } else e.drawImage(t, f, d, c, h, k, p, n, q)
  7856. };
  7857. a.prototype.ignoreRender = function(e, a, b, d) {
  7858. var c = e._worldBounds;
  7859. b *= e._worldTransform.a;
  7860. d *= e._worldTransform.d;
  7861. return c.x + c.width + b <= a.x || c.x + b >= a.x + a.width || c.y + c.height + d <= a.y || c.y + d >= a.y + a.height ? !0 : !1
  7862. };
  7863. a.prototype.getDrawAreaList = function() {
  7864. var e;
  7865. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)]), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  7866. return e
  7867. };
  7868. return a
  7869. } (b.HashObject);
  7870. b.RenderFilter = c;
  7871. c.prototype.__class__ = "egret.RenderFilter"
  7872. })(egret || (egret = {})); (function(b) {
  7873. var c = function() {
  7874. function d() {}
  7875. d.mapClass = function(a, e, g) {
  7876. "undefined" === typeof g && (g = "");
  7877. a = this.getKey(a) + "#" + g;
  7878. this.mapClassDic[a] = e
  7879. };
  7880. d.getKey = function(a) {
  7881. return "string" == typeof a ? a: b.getQualifiedClassName(a)
  7882. };
  7883. d.mapValue = function(a, e, g) {
  7884. "undefined" === typeof g && (g = "");
  7885. a = this.getKey(a) + "#" + g;
  7886. this.mapValueDic[a] = e
  7887. };
  7888. d.hasMapRule = function(a, e) {
  7889. "undefined" === typeof e && (e = "");
  7890. var g = this.getKey(a) + "#" + e;
  7891. return this.mapValueDic[g] || this.mapClassDic[g] ? !0 : !1
  7892. };
  7893. d.getInstance = function(a, e) {
  7894. "undefined" === typeof e && (e = "");
  7895. var g = this.getKey(a) + "#" + e;
  7896. if (this.mapValueDic[g]) return this.mapValueDic[g];
  7897. var b = this.mapClassDic[g];
  7898. if (b) return b = new b,
  7899. this.mapValueDic[g] = b,
  7900. delete this.mapClassDic[g],
  7901. b;
  7902. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + g + "\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");
  7903. };
  7904. d.mapClassDic = {};
  7905. d.mapValueDic = {};
  7906. return d
  7907. } ();
  7908. b.Injector = c;
  7909. c.prototype.__class__ = "egret.Injector"
  7910. })(egret || (egret = {})); (function(b) {
  7911. var c = function() {
  7912. function b() {}
  7913. b.NORMAL = "normal";
  7914. b.ADD = "add";
  7915. b.LAYER = "layer";
  7916. return b
  7917. } ();
  7918. b.BlendMode = c;
  7919. c.prototype.__class__ = "egret.BlendMode"
  7920. })(egret || (egret = {}));
  7921. __extends = this.__extends ||
  7922. function(b, c) {
  7923. function d() {
  7924. this.constructor = b
  7925. }
  7926. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7927. d.prototype = c.prototype;
  7928. b.prototype = new d
  7929. }; (function(b) {
  7930. var c = function(d) {
  7931. function a() {
  7932. d.call(this);
  7933. this._sizeDirty = this._normalDirty = !0;
  7934. this._parent = null;
  7935. this._cacheAsBitmap = !1;
  7936. this._y = this._x = 0;
  7937. this._scaleY = this._scaleX = 1;
  7938. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  7939. this._visible = !0;
  7940. this._rotation = 0;
  7941. this._alpha = 1;
  7942. this._skewY = this._skewX = 0;
  7943. this._hasHeightSet = this._hasWidthSet = !1;
  7944. this.worldAlpha = 1;
  7945. this._rectH = this._rectW = 0;
  7946. this._stage = null;
  7947. this._worldTransform = new b.Matrix;
  7948. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  7949. }
  7950. __extends(a, d);
  7951. a.prototype._setDirty = function() {
  7952. this._normalDirty = !0
  7953. };
  7954. a.prototype.getDirty = function() {
  7955. return this._normalDirty || this._sizeDirty
  7956. };
  7957. a.prototype._setParentSizeDirty = function() { ! this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  7958. };
  7959. a.prototype._setSizeDirty = function() {
  7960. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  7961. };
  7962. a.prototype._clearDirty = function() {
  7963. this._normalDirty = !1
  7964. };
  7965. a.prototype._clearSizeDirty = function() {
  7966. this._sizeDirty = !1
  7967. };
  7968. Object.defineProperty(a.prototype, "parent", {
  7969. get: function() {
  7970. return this._parent
  7971. },
  7972. enumerable: !0,
  7973. configurable: !0
  7974. });
  7975. a.prototype._parentChanged = function(e) {
  7976. this._parent = e
  7977. };
  7978. Object.defineProperty(a.prototype, "x", {
  7979. get: function() {
  7980. return this._x
  7981. },
  7982. set: function(e) {
  7983. b.NumberUtils.isNumber(e) && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  7984. },
  7985. enumerable: !0,
  7986. configurable: !0
  7987. });
  7988. Object.defineProperty(a.prototype, "y", {
  7989. get: function() {
  7990. return this._y
  7991. },
  7992. set: function(e) {
  7993. b.NumberUtils.isNumber(e) && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  7994. },
  7995. enumerable: !0,
  7996. configurable: !0
  7997. });
  7998. Object.defineProperty(a.prototype, "scaleX", {
  7999. get: function() {
  8000. return this._scaleX
  8001. },
  8002. set: function(e) {
  8003. b.NumberUtils.isNumber(e) && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  8004. },
  8005. enumerable: !0,
  8006. configurable: !0
  8007. });
  8008. Object.defineProperty(a.prototype, "scaleY", {
  8009. get: function() {
  8010. return this._scaleY
  8011. },
  8012. set: function(e) {
  8013. b.NumberUtils.isNumber(e) && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  8014. },
  8015. enumerable: !0,
  8016. configurable: !0
  8017. });
  8018. Object.defineProperty(a.prototype, "anchorOffsetX", {
  8019. get: function() {
  8020. return this._anchorOffsetX
  8021. },
  8022. set: function(e) {
  8023. b.NumberUtils.isNumber(e) && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  8024. },
  8025. enumerable: !0,
  8026. configurable: !0
  8027. });
  8028. Object.defineProperty(a.prototype, "anchorOffsetY", {
  8029. get: function() {
  8030. return this._anchorOffsetY
  8031. },
  8032. set: function(e) {
  8033. b.NumberUtils.isNumber(e) && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  8034. },
  8035. enumerable: !0,
  8036. configurable: !0
  8037. });
  8038. Object.defineProperty(a.prototype, "anchorX", {
  8039. get: function() {
  8040. return this._anchorX
  8041. },
  8042. set: function(e) {
  8043. b.NumberUtils.isNumber(e) && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  8044. },
  8045. enumerable: !0,
  8046. configurable: !0
  8047. });
  8048. Object.defineProperty(a.prototype, "anchorY", {
  8049. get: function() {
  8050. return this._anchorY
  8051. },
  8052. set: function(e) {
  8053. b.NumberUtils.isNumber(e) && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  8054. },
  8055. enumerable: !0,
  8056. configurable: !0
  8057. });
  8058. Object.defineProperty(a.prototype, "visible", {
  8059. get: function() {
  8060. return this._visible
  8061. },
  8062. set: function(e) {
  8063. this._visible = e;
  8064. this._setSizeDirty()
  8065. },
  8066. enumerable: !0,
  8067. configurable: !0
  8068. });
  8069. Object.defineProperty(a.prototype, "rotation", {
  8070. get: function() {
  8071. return this._rotation
  8072. },
  8073. set: function(e) {
  8074. b.NumberUtils.isNumber(e) && (this._rotation = e, this._setSizeDirty())
  8075. },
  8076. enumerable: !0,
  8077. configurable: !0
  8078. });
  8079. Object.defineProperty(a.prototype, "alpha", {
  8080. get: function() {
  8081. return this._alpha
  8082. },
  8083. set: function(e) {
  8084. b.NumberUtils.isNumber(e) && (this._alpha = e, this._setDirty())
  8085. },
  8086. enumerable: !0,
  8087. configurable: !0
  8088. });
  8089. Object.defineProperty(a.prototype, "skewX", {
  8090. get: function() {
  8091. return this._skewX
  8092. },
  8093. set: function(e) {
  8094. b.NumberUtils.isNumber(e) && (this._skewX = e, this._setSizeDirty())
  8095. },
  8096. enumerable: !0,
  8097. configurable: !0
  8098. });
  8099. Object.defineProperty(a.prototype, "skewY", {
  8100. get: function() {
  8101. return this._skewY
  8102. },
  8103. set: function(e) {
  8104. b.NumberUtils.isNumber(e) && (this._skewY = e, this._setSizeDirty())
  8105. },
  8106. enumerable: !0,
  8107. configurable: !0
  8108. });
  8109. Object.defineProperty(a.prototype, "touchEnabled", {
  8110. get: function() {
  8111. return this._touchEnabled
  8112. },
  8113. set: function(e) {
  8114. this._touchEnabled = e
  8115. },
  8116. enumerable: !0,
  8117. configurable: !0
  8118. });
  8119. Object.defineProperty(a.prototype, "scrollRect", {
  8120. get: function() {
  8121. return this._scrollRect
  8122. },
  8123. set: function(e) {
  8124. this._scrollRect = e;
  8125. this._setSizeDirty()
  8126. },
  8127. enumerable: !0,
  8128. configurable: !0
  8129. });
  8130. Object.defineProperty(a.prototype, "measuredWidth", {
  8131. get: function() {
  8132. return this._measureBounds().width
  8133. },
  8134. enumerable: !0,
  8135. configurable: !0
  8136. });
  8137. Object.defineProperty(a.prototype, "measuredHeight", {
  8138. get: function() {
  8139. return this._measureBounds().height
  8140. },
  8141. enumerable: !0,
  8142. configurable: !0
  8143. });
  8144. Object.defineProperty(a.prototype, "explicitWidth", {
  8145. get: function() {
  8146. return this._explicitWidth
  8147. },
  8148. enumerable: !0,
  8149. configurable: !0
  8150. });
  8151. Object.defineProperty(a.prototype, "explicitHeight", {
  8152. get: function() {
  8153. return this._explicitHeight
  8154. },
  8155. enumerable: !0,
  8156. configurable: !0
  8157. });
  8158. Object.defineProperty(a.prototype, "width", {
  8159. get: function() {
  8160. return this._getSize(b.Rectangle.identity).width
  8161. },
  8162. set: function(e) {
  8163. this._setWidth(e)
  8164. },
  8165. enumerable: !0,
  8166. configurable: !0
  8167. });
  8168. Object.defineProperty(a.prototype, "height", {
  8169. get: function() {
  8170. return this._getSize(b.Rectangle.identity).height
  8171. },
  8172. set: function(e) {
  8173. this._setHeight(e)
  8174. },
  8175. enumerable: !0,
  8176. configurable: !0
  8177. });
  8178. a.prototype._setWidth = function(e) {
  8179. this._setSizeDirty();
  8180. this._explicitWidth = e;
  8181. this._hasWidthSet = b.NumberUtils.isNumber(e)
  8182. };
  8183. a.prototype._setHeight = function(e) {
  8184. this._setSizeDirty();
  8185. this._explicitHeight = e;
  8186. this._hasHeightSet = b.NumberUtils.isNumber(e)
  8187. };
  8188. a.prototype._draw = function(e) {
  8189. if (this.visible && !this.drawCacheTexture(e)) {
  8190. e.setAlpha(this.worldAlpha, this.blendMode);
  8191. e.setTransform(this._worldTransform);
  8192. var a = this.mask || this._scrollRect;
  8193. a && e.pushMask(a);
  8194. this._render(e);
  8195. a && e.popMask()
  8196. }
  8197. this.destroyCacheBounds()
  8198. };
  8199. a.prototype.drawCacheTexture = function(e) {
  8200. if (this._cacheAsBitmap) {
  8201. var a = this._texture_to_render,
  8202. f = a._offsetX,
  8203. d = a._offsetY,
  8204. c = a._textureWidth,
  8205. a = a._textureHeight;
  8206. this._updateTransform();
  8207. e.setAlpha(this.worldAlpha, this.blendMode);
  8208. e.setTransform(this._worldTransform);
  8209. var h = b.MainContext.instance.rendererContext.texture_scale_factor;
  8210. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, c * h, a * h, f, d, c, a);
  8211. return ! 0
  8212. }
  8213. return ! 1
  8214. };
  8215. a.prototype._updateTransform = function() {
  8216. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  8217. var e = this._getOffsetPoint();
  8218. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, e.x, e.y);
  8219. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  8220. this.worldAlpha = this._parent.worldAlpha * this._alpha
  8221. };
  8222. a.prototype._render = function(e) {};
  8223. a.prototype.getBounds = function(e) {
  8224. var a = this._measureBounds(),
  8225. f = this._hasWidthSet ? this._explicitWidth: a.width,
  8226. d = this._hasHeightSet ? this._explicitHeight: a.height,
  8227. c = a.x,
  8228. a = a.y,
  8229. h,
  8230. k;
  8231. 0 != this._anchorX || 0 != this._anchorY ? (h = f * this._anchorX, k = d * this._anchorY) : (h = this._anchorOffsetX, k = this._anchorOffsetY);
  8232. this._cacheBounds.initialize(c - h, a - k, f, d);
  8233. f = this._cacheBounds;
  8234. e || (e = new b.Rectangle);
  8235. return e.initialize(f.x, f.y, f.width, f.height)
  8236. };
  8237. a.prototype.destroyCacheBounds = function() {
  8238. this._cacheBounds.x = 0;
  8239. this._cacheBounds.y = 0;
  8240. this._cacheBounds.width = 0;
  8241. this._cacheBounds.height = 0
  8242. };
  8243. a.prototype._getConcatenatedMatrix = function() {
  8244. for (var e = a.identityMatrixForGetConcatenated.identity(), g = this; null != g;) {
  8245. if (0 != g._anchorX || 0 != g._anchorY) {
  8246. var f = g._getSize(b.Rectangle.identity);
  8247. e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, f.width * g._anchorX, f.height * g._anchorY)
  8248. } else e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, g._anchorOffsetX, g._anchorOffsetY);
  8249. g = g._parent
  8250. }
  8251. return e
  8252. };
  8253. a.prototype.localToGlobal = function(e, a, f) {
  8254. "undefined" === typeof e && (e = 0);
  8255. "undefined" === typeof a && (a = 0);
  8256. var d = this._getConcatenatedMatrix();
  8257. d.append(1, 0, 0, 1, e, a);
  8258. f || (f = new b.Point);
  8259. f.x = d.tx;
  8260. f.y = d.ty;
  8261. return f
  8262. };
  8263. a.prototype.globalToLocal = function(e, a, f) {
  8264. "undefined" === typeof e && (e = 0);
  8265. "undefined" === typeof a && (a = 0);
  8266. var d = this._getConcatenatedMatrix();
  8267. d.invert();
  8268. d.append(1, 0, 0, 1, e, a);
  8269. f || (f = new b.Point);
  8270. f.x = d.tx;
  8271. f.y = d.ty;
  8272. return f
  8273. };
  8274. a.prototype.hitTest = function(e, a, f) {
  8275. "undefined" === typeof f && (f = !1);
  8276. if (!this.visible || !f && !this._touchEnabled) return null;
  8277. f = this._getSize(b.Rectangle.identity);
  8278. return 0 <= e && e < f.width && 0 <= a && a < f.height ? this.mask || this._scrollRect ? this._scrollRect && e < this._scrollRect.width && a < 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
  8279. };
  8280. a.prototype.hitTestPoint = function(e, a, f) {
  8281. e = this.globalToLocal(e, a);
  8282. return f ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), f = this._hitTestPointTexture, f.drawToTexture(this), 0 != f.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  8283. };
  8284. a.prototype._getMatrix = function() {
  8285. var e = b.Matrix.identity.identity(),
  8286. a = this._getOffsetPoint();
  8287. e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  8288. return e
  8289. };
  8290. a.prototype._getSize = function(e) {
  8291. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(b.Rectangle.identity)
  8292. };
  8293. a.prototype._measureSize = function(e) {
  8294. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  8295. return e
  8296. };
  8297. a.prototype._measureBounds = function() {
  8298. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  8299. };
  8300. a.prototype._getOffsetPoint = function() {
  8301. var e = this._anchorOffsetX,
  8302. a = this._anchorOffsetY;
  8303. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity),
  8304. e = this._anchorX * a.width,
  8305. a = this._anchorY * a.height;
  8306. var f = b.Point.identity;
  8307. f.x = e;
  8308. f.y = a;
  8309. return f
  8310. };
  8311. a.prototype._onAddToStage = function() {
  8312. this._stage = b.MainContext.instance.stage;
  8313. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  8314. };
  8315. a.prototype._onRemoveFromStage = function() {
  8316. this._stage = null;
  8317. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  8318. };
  8319. Object.defineProperty(a.prototype, "stage", {
  8320. get: function() {
  8321. return this._stage
  8322. },
  8323. enumerable: !0,
  8324. configurable: !0
  8325. });
  8326. a.prototype.addEventListener = function(e, g, f, c, l) {
  8327. "undefined" === typeof c && (c = !1);
  8328. "undefined" === typeof l && (l = 0);
  8329. d.prototype.addEventListener.call(this, e, g, f, c, l); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, g, f, l)
  8330. };
  8331. a.prototype.removeEventListener = function(e, g, f, c) {
  8332. "undefined" === typeof c && (c = !1);
  8333. d.prototype.removeEventListener.call(this, e, g, f, c); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, g, f)
  8334. };
  8335. a.prototype.dispatchEvent = function(e) {
  8336. if (!e._bubbles) return d.prototype.dispatchEvent.call(this, e);
  8337. for (var a = [], b = this; b;) a.unshift(b),
  8338. b = b.parent;
  8339. for (var c = a.length,
  8340. b = c - 1,
  8341. c = c - 2; 0 <= c; c--) a.push(a[c]);
  8342. e._reset();
  8343. this._dispatchPropagationEvent(e, a, b);
  8344. return ! e.isDefaultPrevented()
  8345. };
  8346. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  8347. for (var d = a.length,
  8348. c = 0; c < d; c++) {
  8349. var h = a[c];
  8350. e._setCurrentTarget(h);
  8351. e._target = this;
  8352. e._eventPhase = c < b ? 1 : c == b ? 2 : 3;
  8353. h._notifyListener(e);
  8354. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  8355. }
  8356. };
  8357. a.prototype.willTrigger = function(e) {
  8358. for (var a = this; a;) {
  8359. if (a.hasEventListener(e)) return ! 0;
  8360. a = a._parent
  8361. }
  8362. return ! 1
  8363. };
  8364. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  8365. get: function() {
  8366. return this._cacheAsBitmap
  8367. },
  8368. set: function(e) { (this._cacheAsBitmap = e) ? (this.renderTexture || (this.renderTexture = new b.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  8369. },
  8370. enumerable: !0,
  8371. configurable: !0
  8372. });
  8373. a.getTransformBounds = function(e, a) {
  8374. var b, d, c = e.width,
  8375. h = e.height,
  8376. k = c * a.a,
  8377. c = c * a.b,
  8378. p = h * a.c,
  8379. h = h * a.d,
  8380. n = a.tx,
  8381. q = a.ty,
  8382. t = n,
  8383. r = n,
  8384. s = q,
  8385. u = q; (b = k + n) < t ? t = b: b > r && (r = b); (b = k + p + n) < t ? t = b: b > r && (r = b); (b = p + n) < t ? t = b: b > r && (r = b); (d = c + q) < s ? s = d: d > u && (u = d); (d = c + h + q) < s ? s = d: d > u && (u = d); (d = h + q) < s ? s = d: d > u && (u = d);
  8386. return e.initialize(t, s, r - t, u - s)
  8387. };
  8388. a.identityMatrixForGetConcatenated = new b.Matrix;
  8389. a._enterFrameCallBackList = [];
  8390. a._renderCallBackList = [];
  8391. return a
  8392. } (b.EventDispatcher);
  8393. b.DisplayObject = c;
  8394. c.prototype.__class__ = "egret.DisplayObject"
  8395. })(egret || (egret = {}));
  8396. __extends = this.__extends ||
  8397. function(b, c) {
  8398. function d() {
  8399. this.constructor = b
  8400. }
  8401. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8402. d.prototype = c.prototype;
  8403. b.prototype = new d
  8404. }; (function(b) {
  8405. var c = function(d) {
  8406. function a() {
  8407. d.call(this);
  8408. this._touchChildren = !0;
  8409. this._children = []
  8410. }
  8411. __extends(a, d);
  8412. Object.defineProperty(a.prototype, "touchChildren", {
  8413. get: function() {
  8414. return this._touchChildren
  8415. },
  8416. set: function(e) {
  8417. this._touchChildren = e
  8418. },
  8419. enumerable: !0,
  8420. configurable: !0
  8421. });
  8422. Object.defineProperty(a.prototype, "numChildren", {
  8423. get: function() {
  8424. return this._children.length
  8425. },
  8426. enumerable: !0,
  8427. configurable: !0
  8428. });
  8429. a.prototype.setChildIndex = function(e, a) {
  8430. this.doSetChildIndex(e, a)
  8431. };
  8432. a.prototype.doSetChildIndex = function(e, a) {
  8433. var f = this._children.indexOf(e);
  8434. 0 > f && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  8435. this._children.splice(f, 1);
  8436. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  8437. };
  8438. a.prototype.addChild = function(e) {
  8439. var a = this.numChildren;
  8440. e._parent == this && a--;
  8441. return this._doAddChild(e, a)
  8442. };
  8443. a.prototype.addChildAt = function(e, a) {
  8444. return this._doAddChild(e, a)
  8445. };
  8446. a.prototype._doAddChild = function(e, g, f) {
  8447. "undefined" === typeof f && (f = !0);
  8448. if (e == this) return e;
  8449. if (0 > g || g > this._children.length) return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  8450. e;
  8451. var d = e.parent;
  8452. if (d == this) return this.doSetChildIndex(e, g),
  8453. e;
  8454. d && d.removeChild(e);
  8455. this._children.splice(g, 0, e);
  8456. e._parentChanged(this);
  8457. f && e.dispatchEventWith(b.Event.ADDED, !0);
  8458. if (this._stage) for (e._onAddToStage(), g = a.__EVENT__ADD_TO_STAGE_LIST; 0 < g.length;) g.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  8459. e._setDirty();
  8460. this._setSizeDirty();
  8461. return e
  8462. };
  8463. a.prototype.removeChild = function(e) {
  8464. e = this._children.indexOf(e);
  8465. if (0 <= e) return this._doRemoveChild(e);
  8466. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  8467. return null
  8468. };
  8469. a.prototype.removeChildAt = function(e) {
  8470. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  8471. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  8472. return null
  8473. };
  8474. a.prototype._doRemoveChild = function(e, g) {
  8475. "undefined" === typeof g && (g = !0);
  8476. var f = this._children,
  8477. d = f[e];
  8478. g && d.dispatchEventWith(b.Event.REMOVED, !0);
  8479. if (this._stage) {
  8480. d._onRemoveFromStage();
  8481. for (var c = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < c.length;) c.shift().dispatchEventWith(b.Event.REMOVED_FROM_STAGE)
  8482. }
  8483. d._parentChanged(null);
  8484. f.splice(e, 1);
  8485. this._setSizeDirty();
  8486. return d
  8487. };
  8488. a.prototype.getChildAt = function(e) {
  8489. if (0 <= e && e < this._children.length) return this._children[e];
  8490. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  8491. return null
  8492. };
  8493. a.prototype.contains = function(e) {
  8494. for (; e;) {
  8495. if (e == this) return ! 0;
  8496. e = e._parent
  8497. }
  8498. return ! 1
  8499. };
  8500. a.prototype.swapChildrenAt = function(e, a) {
  8501. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  8502. };
  8503. a.prototype.swapChildren = function(e, a) {
  8504. var f = this._children.indexOf(e),
  8505. d = this._children.indexOf(a); - 1 == f || -1 == d ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(f, d)
  8506. };
  8507. a.prototype._swapChildrenAt = function(e, a) {
  8508. if (e != a) {
  8509. var b = this._children,
  8510. d = b[e];
  8511. b[e] = b[a];
  8512. b[a] = d
  8513. }
  8514. };
  8515. a.prototype.getChildIndex = function(e) {
  8516. return this._children.indexOf(e)
  8517. };
  8518. a.prototype.removeChildren = function() {
  8519. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  8520. };
  8521. a.prototype._updateTransform = function() {
  8522. if (this.visible) {
  8523. d.prototype._updateTransform.call(this);
  8524. for (var e = 0,
  8525. a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  8526. }
  8527. };
  8528. a.prototype._render = function(e) {
  8529. for (var a = 0,
  8530. b = this._children.length; a < b; a++) this._children[a]._draw(e)
  8531. };
  8532. a.prototype._measureBounds = function() {
  8533. for (var e = 0,
  8534. a = 0,
  8535. f = 0,
  8536. d = 0,
  8537. c = this._children.length,
  8538. h = 0; h < c; h++) {
  8539. var k = this._children[h],
  8540. p;
  8541. if (k.visible && (p = b.DisplayObject.getTransformBounds(k._getSize(b.Rectangle.identity), k._getMatrix()))) {
  8542. var k = p.x,
  8543. n = p.y,
  8544. q = p.width + p.x,
  8545. t = p.height + p.y;
  8546. if (k < e || 0 == h) e = k;
  8547. if (q > a || 0 == h) a = q;
  8548. if (n < f || 0 == h) f = n;
  8549. if (t > d || 0 == h) d = t
  8550. }
  8551. }
  8552. return b.Rectangle.identity.initialize(e, f, a - e, d - f)
  8553. };
  8554. a.prototype.hitTest = function(e, a, f) {
  8555. "undefined" === typeof f && (f = !1);
  8556. var c;
  8557. if (!this.visible) return null;
  8558. if (this._scrollRect) {
  8559. if (0 > e || 0 > a || e > this._scrollRect.width || a > this._scrollRect.height) return null
  8560. } 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;
  8561. for (var l = this._children,
  8562. h = this._touchChildren,
  8563. k = l.length - 1; 0 <= k; k--) {
  8564. var p = l[k],
  8565. n = p,
  8566. q = n._getOffsetPoint(),
  8567. t = n._x,
  8568. r = n._y;
  8569. this._scrollRect && (t -= this._scrollRect.x, r -= this._scrollRect.y);
  8570. n = b.Matrix.identity.identity().prependTransform(t, r, n._scaleX, n._scaleY, n._rotation, 0, 0, q.x, q.y);
  8571. n.invert();
  8572. n = b.Matrix.transformCoords(n, e, a);
  8573. if (p = p.hitTest(n.x, n.y, !0)) {
  8574. if (p._touchEnabled && h) return p;
  8575. if (this._touchEnabled) return this;
  8576. null == c && (c = p)
  8577. }
  8578. }
  8579. return c ? c: d.prototype.hitTest.call(this, e, a, f)
  8580. };
  8581. a.prototype._onAddToStage = function() {
  8582. d.prototype._onAddToStage.call(this);
  8583. for (var e = this.numChildren,
  8584. a = 0; a < e; a++) this._children[a]._onAddToStage()
  8585. };
  8586. a.prototype._onRemoveFromStage = function() {
  8587. d.prototype._onRemoveFromStage.call(this);
  8588. for (var e = this.numChildren,
  8589. a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
  8590. };
  8591. a.prototype.getChildByName = function(e) {
  8592. for (var a = this._children,
  8593. b = this.numChildren,
  8594. d, c = 0; c < b; c++) if (d = a[c], d.name == e) return d;
  8595. return null
  8596. };
  8597. a.__EVENT__ADD_TO_STAGE_LIST = [];
  8598. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  8599. return a
  8600. } (b.DisplayObject);
  8601. b.DisplayObjectContainer = c;
  8602. c.prototype.__class__ = "egret.DisplayObjectContainer"
  8603. })(egret || (egret = {}));
  8604. __extends = this.__extends ||
  8605. function(b, c) {
  8606. function d() {
  8607. this.constructor = b
  8608. }
  8609. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8610. d.prototype = c.prototype;
  8611. b.prototype = new d
  8612. }; (function(b) {
  8613. var c = function(d) {
  8614. function a(e, a) {
  8615. "undefined" === typeof e && (e = 480);
  8616. "undefined" === typeof a && (a = 800);
  8617. d.call(this);
  8618. this.touchEnabled = !0;
  8619. this._stage = this;
  8620. this._stageWidth = e;
  8621. this._stageHeight = a
  8622. }
  8623. __extends(a, d);
  8624. a.prototype.invalidate = function() {
  8625. a._invalidateRenderFlag = !0
  8626. };
  8627. Object.defineProperty(a.prototype, "scaleMode", {
  8628. get: function() {
  8629. return this._scaleMode
  8630. },
  8631. set: function(e) {
  8632. if (this._scaleMode != e) {
  8633. this._scaleMode = e;
  8634. var a = {};
  8635. a[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  8636. a[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  8637. a[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  8638. e = a[e];
  8639. if (!e) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  8640. a = new b.EqualToFrame;
  8641. e = new b.ResolutionPolicy(a, e);
  8642. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  8643. e = document.getElementById(b.StageDelegate.canvas_name);
  8644. this._stageWidth = e.width;
  8645. this._stageHeight = e.height;
  8646. this.dispatchEventWith(b.Event.RESIZE)
  8647. }
  8648. },
  8649. enumerable: !0,
  8650. configurable: !0
  8651. });
  8652. Object.defineProperty(a.prototype, "stageWidth", {
  8653. get: function() {
  8654. return this._stageWidth
  8655. },
  8656. enumerable: !0,
  8657. configurable: !0
  8658. });
  8659. Object.defineProperty(a.prototype, "stageHeight", {
  8660. get: function() {
  8661. return this._stageHeight
  8662. },
  8663. enumerable: !0,
  8664. configurable: !0
  8665. });
  8666. a.prototype.hitTest = function(a, g) {
  8667. if (!this.touchEnabled) return null;
  8668. var f;
  8669. if (!this.visible) return this;
  8670. for (var d = this._children,
  8671. c = d.length - 1; 0 <= c; c--) {
  8672. var h = f = d[c],
  8673. k = h._getOffsetPoint(),
  8674. h = b.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, k.x, k.y);
  8675. h.invert();
  8676. h = b.Matrix.transformCoords(h, a, g);
  8677. if ((f = f.hitTest(h.x, h.y, !0)) && f.touchEnabled) return f
  8678. }
  8679. return this
  8680. };
  8681. a.prototype.getBounds = function(a) {
  8682. a || (a = new b.Rectangle);
  8683. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  8684. };
  8685. a.prototype._updateTransform = function() {
  8686. for (var a = 0,
  8687. g = this._children.length; a < g; a++) this._children[a]._updateTransform()
  8688. };
  8689. a._invalidateRenderFlag = !1;
  8690. return a
  8691. } (b.DisplayObjectContainer);
  8692. b.Stage = c;
  8693. c.prototype.__class__ = "egret.Stage"
  8694. })(egret || (egret = {})); (function(b) {
  8695. var c = function() {
  8696. function b() {}
  8697. b.NO_BORDER = "noBorder";
  8698. b.NO_SCALE = "noScale";
  8699. b.SHOW_ALL = "showAll";
  8700. return b
  8701. } ();
  8702. b.StageScaleMode = c;
  8703. c.prototype.__class__ = "egret.StageScaleMode"
  8704. })(egret || (egret = {})); (function(b) {
  8705. var c = function() {
  8706. function b() {}
  8707. b.REPEAT = "repeat";
  8708. b.SCALE = "scale";
  8709. return b
  8710. } ();
  8711. b.BitmapFillMode = c;
  8712. c.prototype.__class__ = "egret.BitmapFillMode"
  8713. })(egret || (egret = {}));
  8714. __extends = this.__extends ||
  8715. function(b, c) {
  8716. function d() {
  8717. this.constructor = b
  8718. }
  8719. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8720. d.prototype = c.prototype;
  8721. b.prototype = new d
  8722. }; (function(b) {
  8723. var c = function(d) {
  8724. function a(a) {
  8725. d.call(this);
  8726. this.debug = !1;
  8727. this.debugColor = 16711680;
  8728. this.fillMode = "scale";
  8729. a && (this._texture = a, this._setSizeDirty())
  8730. }
  8731. __extends(a, d);
  8732. Object.defineProperty(a.prototype, "texture", {
  8733. get: function() {
  8734. return this._texture
  8735. },
  8736. set: function(a) {
  8737. a != this._texture && (this._setSizeDirty(), this._texture = a)
  8738. },
  8739. enumerable: !0,
  8740. configurable: !0
  8741. });
  8742. a.prototype._render = function(e) {
  8743. var b = this._texture;
  8744. 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
  8745. };
  8746. a._drawBitmap = function(e, g, f, d) {
  8747. var c = d._texture_to_render;
  8748. if (c) {
  8749. var h = c._textureWidth,
  8750. k = c._textureHeight;
  8751. if ("scale" == d.fillMode) {
  8752. var p = d.scale9Grid || c.scale9Grid;
  8753. if (p && h - p.width < g && k - p.height < f) a.drawScale9GridImage(e, d, p, g, f);
  8754. else {
  8755. var p = c._offsetX,
  8756. n = c._offsetY,
  8757. q = c._bitmapWidth || h,
  8758. t = c._bitmapHeight || k;
  8759. g /= h;
  8760. p = Math.round(p * g);
  8761. g = Math.round(q * g);
  8762. f /= k;
  8763. n = Math.round(n * f);
  8764. f = Math.round(t * f);
  8765. b.RenderFilter.getInstance().drawImage(e, d, c._bitmapX, c._bitmapY, q, t, p, n, g, f)
  8766. }
  8767. } else a.drawRepeatImage(e, d, g, f)
  8768. }
  8769. };
  8770. a.drawRepeatImage = function(a, g, f, d) {
  8771. var c = g._texture_to_render;
  8772. if (c) for (var h = c._textureWidth,
  8773. k = c._textureHeight,
  8774. p = c._bitmapX,
  8775. n = c._bitmapY,
  8776. q = c._bitmapWidth || h,
  8777. t = c._bitmapHeight || k,
  8778. r = c._offsetX,
  8779. c = c._offsetY,
  8780. s = b.RenderFilter.getInstance(); r < f; r += h) for (var u = c; u < d; u += k) {
  8781. var v = Math.min(q, f - r),
  8782. x = Math.min(t, d - u);
  8783. s.drawImage(a, g, p, n, v, x, r, u, v, x)
  8784. }
  8785. };
  8786. a.drawScale9GridImage = function(a, g, f, d, c) {
  8787. var h = g._texture_to_render;
  8788. if (h && f) {
  8789. var k = b.RenderFilter.getInstance(),
  8790. p = h._textureWidth,
  8791. n = h._textureHeight,
  8792. q = h._bitmapX,
  8793. t = h._bitmapY,
  8794. r = h._bitmapWidth || p,
  8795. s = h._bitmapHeight || n,
  8796. u = h._offsetX,
  8797. h = h._offsetY;
  8798. f = b.Rectangle.identity.initialize(f.x - Math.round(u), f.y - Math.round(u), f.width, f.height);
  8799. u = Math.round(u);
  8800. h = Math.round(h);
  8801. d -= p - r;
  8802. c -= n - s;
  8803. f.y == f.bottom && (f.bottom < s ? f.bottom++:f.y--);
  8804. f.x == f.right && (f.right < r ? f.right++:f.x--);
  8805. var p = q + f.x,
  8806. n = q + f.right,
  8807. v = r - f.right,
  8808. x = t + f.y,
  8809. y = t + f.bottom,
  8810. w = s - f.bottom,
  8811. z = u + f.x,
  8812. A = h + f.y,
  8813. s = c - (s - f.bottom),
  8814. r = d - (r - f.right);
  8815. k.drawImage(a, g, q, t, f.x, f.y, u, h, f.x, f.y);
  8816. k.drawImage(a, g, p, t, f.width, f.y, z, h, r - f.x, f.y);
  8817. k.drawImage(a, g, n, t, v, f.y, u + r, h, d - r, f.y);
  8818. k.drawImage(a, g, q, x, f.x, f.height, u, A, f.x, s - f.y);
  8819. k.drawImage(a, g, p, x, f.width, f.height, z, A, r - f.x, s - f.y);
  8820. k.drawImage(a, g, n, x, v, f.height, u + r, A, d - r, s - f.y);
  8821. k.drawImage(a, g, q, y, f.x, w, u, h + s, f.x, c - s);
  8822. k.drawImage(a, g, p, y, f.width, w, z, h + s, r - f.x, c - s);
  8823. k.drawImage(a, g, n, y, v, w, u + r, h + s, d - r, c - s)
  8824. }
  8825. };
  8826. a.prototype._measureBounds = function() {
  8827. var a = this._texture;
  8828. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : d.prototype._measureBounds.call(this)
  8829. };
  8830. a.debug = !1;
  8831. return a
  8832. } (b.DisplayObject);
  8833. b.Bitmap = c;
  8834. c.prototype.__class__ = "egret.Bitmap"
  8835. })(egret || (egret = {}));
  8836. __extends = this.__extends ||
  8837. function(b, c) {
  8838. function d() {
  8839. this.constructor = b
  8840. }
  8841. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8842. d.prototype = c.prototype;
  8843. b.prototype = new d
  8844. }; (function(b) {
  8845. var c = function(d) {
  8846. function a() {
  8847. d.call(this);
  8848. this._text = "";
  8849. this._textChanged = !1;
  8850. this._bitmapPool = []
  8851. }
  8852. __extends(a, d);
  8853. Object.defineProperty(a.prototype, "text", {
  8854. get: function() {
  8855. return this._text
  8856. },
  8857. set: function(a) {
  8858. this._textChanged = !0;
  8859. this._text = a
  8860. },
  8861. enumerable: !0,
  8862. configurable: !0
  8863. });
  8864. a.prototype._updateTransform = function() {
  8865. this.visible && (this._textChanged && this._renderText(), d.prototype._updateTransform.call(this))
  8866. };
  8867. a.prototype._renderText = function(a) {
  8868. var g = a = 0;
  8869. this._textChanged && this.removeChildren();
  8870. for (var f = 0,
  8871. d = this.text.length; f < d; f++) {
  8872. var c = this.text.charAt(f),
  8873. h = this.spriteSheet.getTexture(c);
  8874. if (null == h) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + c);
  8875. else {
  8876. var c = h._offsetX,
  8877. k = h._offsetY,
  8878. p = h._textureWidth;
  8879. if (this._textChanged) {
  8880. var n = this._bitmapPool[f];
  8881. n || (n = new b.Bitmap, this._bitmapPool.push(n));
  8882. n.texture = h;
  8883. this.addChild(n);
  8884. n.x = a
  8885. }
  8886. a += p + c;
  8887. k + h._textureHeight > g && (g = k + h._textureHeight)
  8888. }
  8889. }
  8890. this._textChanged = !1;
  8891. return b.Rectangle.identity.initialize(0, 0, a, g)
  8892. };
  8893. a.prototype._measureBounds = function() {
  8894. return this._renderText(!0)
  8895. };
  8896. return a
  8897. } (b.DisplayObjectContainer);
  8898. b.BitmapText = c;
  8899. c.prototype.__class__ = "egret.BitmapText"
  8900. })(egret || (egret = {})); (function(b) {
  8901. var c = function() {
  8902. function b() {
  8903. this.commandQueue = []
  8904. }
  8905. b.prototype.beginFill = function(a, e) {};
  8906. b.prototype._setStyle = function(a) {};
  8907. b.prototype.drawRect = function(a, e, b, f) {};
  8908. b.prototype.drawCircle = function(a, e, b) {};
  8909. b.prototype.drawRoundRect = function(a, e, b, f, d, c) {};
  8910. b.prototype.drawEllipse = function(a, e, b, f) {};
  8911. b.prototype.lineStyle = function(a, e, b, f, d, c, h, k) {};
  8912. b.prototype.lineTo = function(a, e) {};
  8913. b.prototype.curveTo = function(a, e, b, f) {};
  8914. b.prototype.moveTo = function(a, e) {};
  8915. b.prototype.clear = function() {};
  8916. b.prototype.endFill = function() {};
  8917. b.prototype._draw = function(a) {};
  8918. return b
  8919. } ();
  8920. b.Graphics = c;
  8921. c.prototype.__class__ = "egret.Graphics"; (function() {
  8922. return function(b, a, e) {
  8923. this.method = b;
  8924. this.thisObject = a;
  8925. this.args = e
  8926. }
  8927. })().prototype.__class__ = "Command"
  8928. })(egret || (egret = {}));
  8929. __extends = this.__extends ||
  8930. function(b, c) {
  8931. function d() {
  8932. this.constructor = b
  8933. }
  8934. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8935. d.prototype = c.prototype;
  8936. b.prototype = new d
  8937. }; (function(b) {
  8938. var c = function(d) {
  8939. function a() {
  8940. d.call(this)
  8941. }
  8942. __extends(a, d);
  8943. Object.defineProperty(a.prototype, "graphics", {
  8944. get: function() {
  8945. this._graphics || (this._graphics = new b.Graphics);
  8946. return this._graphics
  8947. },
  8948. enumerable: !0,
  8949. configurable: !0
  8950. });
  8951. a.prototype._render = function(a) {
  8952. this._graphics && this._graphics._draw(a)
  8953. };
  8954. return a
  8955. } (b.DisplayObject);
  8956. b.Shape = c;
  8957. c.prototype.__class__ = "egret.Shape"
  8958. })(egret || (egret = {}));
  8959. __extends = this.__extends ||
  8960. function(b, c) {
  8961. function d() {
  8962. this.constructor = b
  8963. }
  8964. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8965. d.prototype = c.prototype;
  8966. b.prototype = new d
  8967. }; (function(b) {
  8968. var c = function(d) {
  8969. function a() {
  8970. d.call(this)
  8971. }
  8972. __extends(a, d);
  8973. Object.defineProperty(a.prototype, "graphics", {
  8974. get: function() {
  8975. this._graphics || (this._graphics = new b.Graphics);
  8976. return this._graphics
  8977. },
  8978. enumerable: !0,
  8979. configurable: !0
  8980. });
  8981. a.prototype._render = function(a) {
  8982. this._graphics && this._graphics._draw(a);
  8983. d.prototype._render.call(this, a)
  8984. };
  8985. return a
  8986. } (b.DisplayObjectContainer);
  8987. b.Sprite = c;
  8988. c.prototype.__class__ = "egret.Sprite"
  8989. })(egret || (egret = {}));
  8990. __extends = this.__extends ||
  8991. function(b, c) {
  8992. function d() {
  8993. this.constructor = b
  8994. }
  8995. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8996. d.prototype = c.prototype;
  8997. b.prototype = new d
  8998. }; (function(b) {
  8999. var c = function(d) {
  9000. function a() {
  9001. d.call(this);
  9002. this._fontFamily = "Arial";
  9003. this._size = 30;
  9004. this._textColorString = "#FFFFFF";
  9005. this._textColor = 16777215;
  9006. this._strokeColorString = "#000000";
  9007. this._stroke = this._strokeColor = 0;
  9008. this._textAlign = "left";
  9009. this._verticalAlign = "top";
  9010. this._numLines = this._lineSpacing = 0;
  9011. this.measuredWidths = []
  9012. }
  9013. __extends(a, d);
  9014. Object.defineProperty(a.prototype, "text", {
  9015. get: function() {
  9016. return this._text
  9017. },
  9018. set: function(a) {
  9019. this._text != a && (this._setTextDirty(), this._text = a)
  9020. },
  9021. enumerable: !0,
  9022. configurable: !0
  9023. });
  9024. a.prototype._setTextDirty = function() {
  9025. this._setSizeDirty()
  9026. };
  9027. Object.defineProperty(a.prototype, "fontFamily", {
  9028. get: function() {
  9029. return this._fontFamily
  9030. },
  9031. set: function(a) {
  9032. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  9033. },
  9034. enumerable: !0,
  9035. configurable: !0
  9036. });
  9037. Object.defineProperty(a.prototype, "size", {
  9038. get: function() {
  9039. return this._size
  9040. },
  9041. set: function(a) {
  9042. this._size != a && (this._setTextDirty(), this._size = a)
  9043. },
  9044. enumerable: !0,
  9045. configurable: !0
  9046. });
  9047. Object.defineProperty(a.prototype, "italic", {
  9048. get: function() {
  9049. return this._italic
  9050. },
  9051. set: function(a) {
  9052. this._italic != a && (this._setTextDirty(), this._italic = a)
  9053. },
  9054. enumerable: !0,
  9055. configurable: !0
  9056. });
  9057. Object.defineProperty(a.prototype, "bold", {
  9058. get: function() {
  9059. return this._bold
  9060. },
  9061. set: function(a) {
  9062. this._bold != a && (this._setTextDirty(), this._bold = a)
  9063. },
  9064. enumerable: !0,
  9065. configurable: !0
  9066. });
  9067. Object.defineProperty(a.prototype, "textColor", {
  9068. get: function() {
  9069. return this._textColor
  9070. },
  9071. set: function(a) {
  9072. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = b.toColorString(a))
  9073. },
  9074. enumerable: !0,
  9075. configurable: !0
  9076. });
  9077. Object.defineProperty(a.prototype, "strokeColor", {
  9078. get: function() {
  9079. return this._strokeColor
  9080. },
  9081. set: function(a) {
  9082. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = b.toColorString(a))
  9083. },
  9084. enumerable: !0,
  9085. configurable: !0
  9086. });
  9087. Object.defineProperty(a.prototype, "stroke", {
  9088. get: function() {
  9089. return this._stroke
  9090. },
  9091. set: function(a) {
  9092. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  9093. },
  9094. enumerable: !0,
  9095. configurable: !0
  9096. });
  9097. Object.defineProperty(a.prototype, "textAlign", {
  9098. get: function() {
  9099. return this._textAlign
  9100. },
  9101. set: function(a) {
  9102. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  9103. },
  9104. enumerable: !0,
  9105. configurable: !0
  9106. });
  9107. Object.defineProperty(a.prototype, "verticalAlign", {
  9108. get: function() {
  9109. return this._verticalAlign
  9110. },
  9111. set: function(a) {
  9112. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  9113. },
  9114. enumerable: !0,
  9115. configurable: !0
  9116. });
  9117. Object.defineProperty(a.prototype, "lineSpacing", {
  9118. get: function() {
  9119. return this._lineSpacing
  9120. },
  9121. set: function(a) {
  9122. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  9123. },
  9124. enumerable: !0,
  9125. configurable: !0
  9126. });
  9127. Object.defineProperty(a.prototype, "numLines", {
  9128. get: function() {
  9129. return this._numLines
  9130. },
  9131. enumerable: !0,
  9132. configurable: !0
  9133. });
  9134. a.prototype._render = function(a) {
  9135. this.drawText(a, !1);
  9136. this._clearDirty()
  9137. };
  9138. a.prototype._measureBounds = function() {
  9139. return this.drawText(b.MainContext.instance.rendererContext, !0)
  9140. };
  9141. a.prototype.drawText = function(a, g) {
  9142. var f = this.getTextLines(a);
  9143. if (!f) return b.Rectangle.identity.initialize(0, 0, 0, 0);
  9144. var d = f.length,
  9145. c = 0.5 * this._size,
  9146. h = this._size + this._lineSpacing,
  9147. k = d * h - this._lineSpacing;
  9148. this._textHeight = k;
  9149. var p = this._hasHeightSet ? this._explicitHeight: Number.POSITIVE_INFINITY;
  9150. if (this._hasHeightSet && k < p) {
  9151. var n = 0;
  9152. this._verticalAlign == b.VerticalAlign.MIDDLE ? n = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (n = 1);
  9153. c += n * (p - k)
  9154. }
  9155. var n = c = Math.round(c),
  9156. q = 0;
  9157. this._textAlign == b.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (q = 1);
  9158. var t = this.measuredWidths,
  9159. r;
  9160. r = this._hasWidthSet ? this._explicitWidth: this._textWidth;
  9161. for (var s = Number.POSITIVE_INFINITY,
  9162. u = 0; u < d; u++) {
  9163. var v = f[u],
  9164. x = Math.round((r - t[u]) * q);
  9165. x < s && (s = x); ! g && c < p && a.drawText(this, v, x, c, r);
  9166. c += h
  9167. }
  9168. return b.Rectangle.identity.initialize(s, n, r, k)
  9169. };
  9170. a.prototype.getTextLines = function(a) {
  9171. var b = this.text ? this.text.toString() : "";
  9172. if (!b) return null;
  9173. var f = this.measuredWidths;
  9174. f.length = 0;
  9175. a.setupFont(this);
  9176. var b = b.split(/(?:\r\n|\r|\n)/),
  9177. d = b.length,
  9178. c = 0;
  9179. if (this._hasWidthSet) for (var h = this._explicitWidth,
  9180. k = 0; k < d; k++) {
  9181. var p = b[k],
  9182. n = a.measureText(p);
  9183. if (n > h) {
  9184. for (var q = "",
  9185. t = 0,
  9186. r = p.length,
  9187. s = 0; s < r; s++) {
  9188. var u = p.charAt(s),
  9189. n = a.measureText(u);
  9190. t + n > h && (0 == t ? (b.splice(k, 0, u), f[k] = n, c < n && (c = n), n = 0, u = "") : (b.splice(k, 0, q), f[k] = t, c < t && (c = t), q = "", t = 0), k++, d++);
  9191. t += n;
  9192. q += u
  9193. }
  9194. b[k] = q;
  9195. f[k] = t
  9196. } else f[k] = n,
  9197. c < n && (c = n)
  9198. } else for (k = 0; k < d; k++) p = b[k],
  9199. n = a.measureText(p),
  9200. f[k] = n,
  9201. c < n && (c = n);
  9202. this._textWidth = c;
  9203. return b
  9204. };
  9205. return a
  9206. } (b.DisplayObject);
  9207. b.TextField = c;
  9208. c.prototype.__class__ = "egret.TextField"
  9209. })(egret || (egret = {})); (function(b) {
  9210. var c = function() {
  9211. function b() {}
  9212. b.DYNAMIC = "dynamic";
  9213. b.INPUT = "input";
  9214. return b
  9215. } ();
  9216. b.TextFieldType = c;
  9217. c.prototype.__class__ = "egret.TextFieldType"
  9218. })(egret || (egret = {}));
  9219. __extends = this.__extends ||
  9220. function(b, c) {
  9221. function d() {
  9222. this.constructor = b
  9223. }
  9224. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9225. d.prototype = c.prototype;
  9226. b.prototype = new d
  9227. }; (function(b) {
  9228. var c = function(d) {
  9229. function a(a) {
  9230. d.call(this);
  9231. var b = a.bitmapData;
  9232. this.bitmapData = b;
  9233. this._textureMap = {};
  9234. this._sourceWidth = b.width;
  9235. this._sourceHeight = b.height;
  9236. this._bitmapX = a._bitmapX - a._offsetX;
  9237. this._bitmapY = a._bitmapY - a._offsetY
  9238. }
  9239. __extends(a, d);
  9240. a.prototype.getTexture = function(a) {
  9241. return this._textureMap[a]
  9242. };
  9243. a.prototype.createTexture = function(a, g, f, d, c, h, k, p, n) {
  9244. "undefined" === typeof h && (h = 0);
  9245. "undefined" === typeof k && (k = 0);
  9246. "undefined" === typeof p && (p = h + d);
  9247. "undefined" === typeof n && (n = k + c);
  9248. var q = new b.Texture;
  9249. q._bitmapData = this.bitmapData;
  9250. q._bitmapX = this._bitmapX + g;
  9251. q._bitmapY = this._bitmapY + f;
  9252. q._bitmapWidth = d;
  9253. q._bitmapHeight = c;
  9254. q._offsetX = h;
  9255. q._offsetY = k;
  9256. q._textureWidth = p;
  9257. q._textureHeight = n;
  9258. q._sourceWidth = this._sourceWidth;
  9259. q._sourceHeight = this._sourceHeight;
  9260. return this._textureMap[a] = q
  9261. };
  9262. return a
  9263. } (b.HashObject);
  9264. b.SpriteSheet = c;
  9265. c.prototype.__class__ = "egret.SpriteSheet"
  9266. })(egret || (egret = {}));
  9267. __extends = this.__extends ||
  9268. function(b, c) {
  9269. function d() {
  9270. this.constructor = b
  9271. }
  9272. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9273. d.prototype = c.prototype;
  9274. b.prototype = new d
  9275. }; (function(b) {
  9276. var c = function(d) {
  9277. function a() {
  9278. d.call(this);
  9279. this._size = 30;
  9280. this._textColorString = "#FFFFFF";
  9281. this._textColor = 16777215;
  9282. this.stageText = new b.StageText;
  9283. var a = this.localToGlobal();
  9284. this.stageText._open(a.x, a.y, this._explicitWidth, this._explicitHeight)
  9285. }
  9286. __extends(a, d);
  9287. a.prototype._onAddToStage = function() {
  9288. d.prototype._onAddToStage.call(this);
  9289. this.stageText._add();
  9290. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this)
  9291. };
  9292. a.prototype.setText = function(a) {
  9293. this.stageText._setText(a)
  9294. };
  9295. a.prototype.getText = function() {
  9296. return this.stageText._getText()
  9297. };
  9298. a.prototype.setTextType = function(a) {
  9299. this.stageText._setTextType(a)
  9300. };
  9301. a.prototype.getTextType = function() {
  9302. return this.stageText._getTextType()
  9303. };
  9304. a.prototype.onMouseDownHandler = function(a) {};
  9305. a.prototype._onRemoveFromStage = function() {
  9306. this.stageText._remove()
  9307. };
  9308. a.prototype._measureBounds = function() {
  9309. return b.Rectangle.identity
  9310. };
  9311. a.prototype.hitTest = function(a, b, f) {
  9312. return null
  9313. };
  9314. a.prototype._updateTransform = function() {
  9315. var a = this._worldTransform.a,
  9316. b = this._worldTransform.b,
  9317. f = this._worldTransform.c,
  9318. c = this._worldTransform.d,
  9319. l = this._worldTransform.tx,
  9320. h = this._worldTransform.ty;
  9321. d.prototype._updateTransform.call(this);
  9322. var k = this._worldTransform;
  9323. if (a != k.a || b != k.b || f != k.c || c != k.d || l != k.tx || h != k.ty) a = this.localToGlobal(),
  9324. this.stageText.changePosition(a.x, a.y),
  9325. this.stageText.changeSize(this._explicitWidth, this._explicitHeight)
  9326. };
  9327. Object.defineProperty(a.prototype, "size", {
  9328. get: function() {
  9329. return this._size
  9330. },
  9331. set: function(a) {
  9332. this._size != a && (this._size = a, this.stageText.setSize(this._size))
  9333. },
  9334. enumerable: !0,
  9335. configurable: !0
  9336. });
  9337. Object.defineProperty(a.prototype, "textColor", {
  9338. get: function() {
  9339. return this._textColor
  9340. },
  9341. set: function(a) {
  9342. this._textColor != a && (this._textColor = a, this._textColorString = b.toColorString(a), this.stageText.setTextColor(this._textColorString))
  9343. },
  9344. enumerable: !0,
  9345. configurable: !0
  9346. });
  9347. return a
  9348. } (b.DisplayObject);
  9349. b.TextInput = c;
  9350. c.prototype.__class__ = "egret.TextInput"
  9351. })(egret || (egret = {}));
  9352. __extends = this.__extends ||
  9353. function(b, c) {
  9354. function d() {
  9355. this.constructor = b
  9356. }
  9357. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9358. d.prototype = c.prototype;
  9359. b.prototype = new d
  9360. }; (function(b) {
  9361. var c = function(b) {
  9362. function a(a, g) {
  9363. b.call(this, a);
  9364. this.charList = this.parseConfig(g)
  9365. }
  9366. __extends(a, b);
  9367. a.prototype.getTexture = function(a) {
  9368. var b = this._textureMap[a];
  9369. if (!b) {
  9370. b = this.charList[a];
  9371. if (!b) return null;
  9372. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  9373. this._textureMap[a] = b
  9374. }
  9375. return b
  9376. };
  9377. a.prototype.parseConfig = function(a) {
  9378. a = a.split("\r\n").join("\n");
  9379. a = a.split("\n");
  9380. for (var b = this.getConfigByKey(a[3], "count"), f = {},
  9381. d = 4; d < 4 + b; d++) {
  9382. var c = a[d],
  9383. h = String.fromCharCode(this.getConfigByKey(c, "id")),
  9384. k = {};
  9385. f[h] = k;
  9386. k.x = this.getConfigByKey(c, "x");
  9387. k.y = this.getConfigByKey(c, "y");
  9388. k.width = this.getConfigByKey(c, "width");
  9389. k.height = this.getConfigByKey(c, "height");
  9390. k.offsetX = this.getConfigByKey(c, "xoffset");
  9391. k.offsetY = this.getConfigByKey(c, "yoffset")
  9392. }
  9393. return f
  9394. };
  9395. a.prototype.getConfigByKey = function(a, b) {
  9396. for (var f = a.split(" "), d = 0, c = f.length; d < c; d++) {
  9397. var h = f[d];
  9398. if (b == h.substring(0, b.length)) return f = h.substring(b.length + 1),
  9399. parseInt(f)
  9400. }
  9401. return 0
  9402. };
  9403. return a
  9404. } (b.SpriteSheet);
  9405. b.BitmapTextSpriteSheet = c;
  9406. c.prototype.__class__ = "egret.BitmapTextSpriteSheet"
  9407. })(egret || (egret = {}));
  9408. __extends = this.__extends ||
  9409. function(b, c) {
  9410. function d() {
  9411. this.constructor = b
  9412. }
  9413. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9414. d.prototype = c.prototype;
  9415. b.prototype = new d
  9416. }; (function(b) {
  9417. var c = function(a) {
  9418. function e(e, f) {
  9419. a.call(this);
  9420. this.frameRate = 60;
  9421. e instanceof d ? (b.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new d(e, f);
  9422. this.delegate.setMovieClip(this)
  9423. }
  9424. __extends(e, a);
  9425. e.prototype.gotoAndPlay = function(a) {
  9426. this.delegate.gotoAndPlay(a)
  9427. };
  9428. e.prototype.gotoAndStop = function(a) {
  9429. this.delegate.gotoAndStop(a)
  9430. };
  9431. e.prototype.stop = function() {
  9432. this.delegate.stop()
  9433. };
  9434. e.prototype.dispose = function() {
  9435. this.delegate.dispose()
  9436. };
  9437. e.prototype.release = function() {
  9438. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  9439. this.dispose()
  9440. };
  9441. e.prototype.getCurrentFrameIndex = function() {
  9442. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  9443. return this.delegate._currentFrameIndex
  9444. };
  9445. e.prototype.getTotalFrame = function() {
  9446. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  9447. return this.delegate._totalFrame
  9448. };
  9449. e.prototype.setInterval = function(a) {
  9450. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  9451. this.frameRate = 60 / a
  9452. };
  9453. e.prototype.getIsPlaying = function() {
  9454. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  9455. return this.delegate.isPlaying
  9456. };
  9457. return e
  9458. } (b.DisplayObjectContainer);
  9459. b.MovieClip = c;
  9460. c.prototype.__class__ = "egret.MovieClip";
  9461. var d = function() {
  9462. function a(a, g) {
  9463. this.data = a;
  9464. this._currentFrameIndex = this._passTime = this._totalFrame = 0;
  9465. this._isPlaying = !1;
  9466. this._frameData = a;
  9467. this._spriteSheet = new b.SpriteSheet(g)
  9468. }
  9469. a.prototype.setMovieClip = function(a) {
  9470. this.movieClip = a;
  9471. this.bitmap = new b.Bitmap;
  9472. this.movieClip.addChild(this.bitmap)
  9473. };
  9474. a.prototype.gotoAndPlay = function(a) {
  9475. this.checkHasFrame(a);
  9476. this._isPlaying = !0;
  9477. this._currentFrameIndex = 0;
  9478. this._currentFrameName = a;
  9479. this._totalFrame = this._frameData.frames[a].totalFrame;
  9480. this.playNextFrame();
  9481. this._passTime = 0;
  9482. b.Ticker.getInstance().register(this.update, this)
  9483. };
  9484. a.prototype.gotoAndStop = function(a) {
  9485. this.checkHasFrame(a);
  9486. this.stop();
  9487. this._currentFrameIndex = this._passTime = 0;
  9488. this._currentFrameName = a;
  9489. this._totalFrame = this._frameData.frames[a].totalFrame;
  9490. this.playNextFrame()
  9491. };
  9492. a.prototype.stop = function() {
  9493. this._isPlaying = !1;
  9494. b.Ticker.getInstance().unregister(this.update, this)
  9495. };
  9496. a.prototype.dispose = function() {};
  9497. a.prototype.checkHasFrame = function(a) {
  9498. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  9499. };
  9500. a.prototype.update = function(a) {
  9501. for (var b = 1E3 / this.movieClip.frameRate,
  9502. b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1),
  9503. b--;
  9504. this._passTime += a
  9505. };
  9506. a.prototype.playNextFrame = function(a) {
  9507. "undefined" === typeof a && (a = !0);
  9508. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  9509. if (a) {
  9510. a = this.getTexture(b.res);
  9511. var f = this.bitmap;
  9512. f.x = b.x;
  9513. f.y = b.y;
  9514. f.texture = a
  9515. }
  9516. null != b.action && this.movieClip.dispatchEventWith(b.action);
  9517. this._currentFrameIndex++;
  9518. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0)
  9519. };
  9520. a.prototype.getTexture = function(a) {
  9521. var b = this._frameData.res[a],
  9522. f = this._spriteSheet.getTexture(a);
  9523. f || (f = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  9524. return f
  9525. };
  9526. return a
  9527. } ();
  9528. b.DefaultMovieClipDelegate = d;
  9529. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  9530. })(egret || (egret = {}));
  9531. __extends = this.__extends ||
  9532. function(b, c) {
  9533. function d() {
  9534. this.constructor = b
  9535. }
  9536. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9537. d.prototype = c.prototype;
  9538. b.prototype = new d
  9539. }; (function(b) {
  9540. var c = function(d) {
  9541. function a() {
  9542. d.call(this);
  9543. this._size = 20
  9544. }
  9545. __extends(a, d);
  9546. a.prototype._getText = function() {
  9547. return this.inputElement.value
  9548. };
  9549. a.prototype._setText = function(a) {
  9550. this.inputElement.value = a
  9551. };
  9552. a.prototype._setTextType = function(a) {
  9553. this.inputElement.type = a
  9554. };
  9555. a.prototype._getTextType = function() {
  9556. return this.inputElement.type
  9557. };
  9558. a.prototype._open = function(a, g, f, d) {
  9559. "undefined" === typeof f && (f = 160);
  9560. d = b.StageDelegate.getInstance().getScaleX();
  9561. var c = b.StageDelegate.getInstance().getScaleY(),
  9562. h = document.createElement("input");
  9563. h.type = "text";
  9564. h.style.fontSize = this._size + "px";
  9565. h.style.color = "#FFFFFF";
  9566. h.style.border = "none";
  9567. h.style.background = "none";
  9568. h.style.width = f + "px";
  9569. h.style.padding = "0";
  9570. h.style.outline = "medium";
  9571. var k = b.Browser.getInstance().$new("div");
  9572. k.position.x = a * d;
  9573. k.position.y = g * c;
  9574. k.style.width = f + "px";
  9575. k.scale.x = d;
  9576. k.scale.y = c;
  9577. k.transforms();
  9578. k.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  9579. k.appendChild(h);
  9580. this.div = k;
  9581. this.inputElement = h
  9582. };
  9583. a.prototype.getStageDelegateDiv = function() {
  9584. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  9585. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  9586. return a
  9587. };
  9588. a.prototype._add = function() {
  9589. var a = this.div;
  9590. a && !a.parentNode && this.getStageDelegateDiv().appendChild(a)
  9591. };
  9592. a.prototype._remove = function() {
  9593. var a = this.div;
  9594. a && a.parentNode && a.parentNode.removeChild(a)
  9595. };
  9596. a.prototype.changePosition = function(a, g) {
  9597. var f = b.StageDelegate.getInstance().getScaleX(),
  9598. d = b.StageDelegate.getInstance().getScaleY();
  9599. this.div.position.x = a * f;
  9600. this.div.position.y = g * d;
  9601. this.div.transforms()
  9602. };
  9603. a.prototype.changeSize = function(a, b) {
  9604. this.inputElement.style.width = a + "px";
  9605. this.div.style.width = a + "px";
  9606. this.div.transforms()
  9607. };
  9608. a.prototype.setSize = function(a) {
  9609. this._size = a;
  9610. this.inputElement.style.fontSize = this._size + "px"
  9611. };
  9612. a.prototype.setTextColor = function(a) {
  9613. this.inputElement.style.color = a
  9614. };
  9615. return a
  9616. } (b.HashObject);
  9617. b.StageText = c;
  9618. c.prototype.__class__ = "egret.StageText"
  9619. })(egret || (egret = {})); (function(b) {
  9620. var c = function() {
  9621. function b() {}
  9622. b.GET = "GET";
  9623. b.POST = "POST";
  9624. return b
  9625. } ();
  9626. b.URLRequestMethod = c;
  9627. c.prototype.__class__ = "egret.URLRequestMethod"
  9628. })(egret || (egret = {})); (function(b) {
  9629. var c = function() {
  9630. function b() {}
  9631. b.BINARY = "binary";
  9632. b.TEXT = "text";
  9633. b.VARIABLES = "variables";
  9634. b.TEXTURE = "texture";
  9635. b.SOUND = "sound";
  9636. return b
  9637. } ();
  9638. b.URLLoaderDataFormat = c;
  9639. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  9640. })(egret || (egret = {}));
  9641. __extends = this.__extends ||
  9642. function(b, c) {
  9643. function d() {
  9644. this.constructor = b
  9645. }
  9646. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9647. d.prototype = c.prototype;
  9648. b.prototype = new d
  9649. }; (function(b) {
  9650. var c = function(b) {
  9651. function a(a) {
  9652. "undefined" === typeof a && (a = null);
  9653. b.call(this);
  9654. null !== a && this.decode(a)
  9655. }
  9656. __extends(a, b);
  9657. a.prototype.decode = function(a) {
  9658. this.variables || (this.variables = {});
  9659. a = a.split("+").join(" ");
  9660. for (var b, f = /[?&]?([^=]+)=([^&]*)/g; b = f.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  9661. };
  9662. a.prototype.toString = function() {
  9663. if (!this.variables) return "";
  9664. var a = this.variables,
  9665. b = "",
  9666. f = !0,
  9667. d;
  9668. for (d in a) f ? f = !1 : b += "&",
  9669. b += d + "=" + a[d];
  9670. return b
  9671. };
  9672. return a
  9673. } (b.HashObject);
  9674. b.URLVariables = c;
  9675. c.prototype.__class__ = "egret.URLVariables"
  9676. })(egret || (egret = {}));
  9677. __extends = this.__extends ||
  9678. function(b, c) {
  9679. function d() {
  9680. this.constructor = b
  9681. }
  9682. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9683. d.prototype = c.prototype;
  9684. b.prototype = new d
  9685. }; (function(b) {
  9686. var c = function(d) {
  9687. function a(a) {
  9688. "undefined" === typeof a && (a = null);
  9689. d.call(this);
  9690. this.method = b.URLRequestMethod.GET;
  9691. this.url = a
  9692. }
  9693. __extends(a, d);
  9694. return a
  9695. } (b.HashObject);
  9696. b.URLRequest = c;
  9697. c.prototype.__class__ = "egret.URLRequest"
  9698. })(egret || (egret = {}));
  9699. __extends = this.__extends ||
  9700. function(b, c) {
  9701. function d() {
  9702. this.constructor = b
  9703. }
  9704. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9705. d.prototype = c.prototype;
  9706. b.prototype = new d
  9707. }; (function(b) {
  9708. var c = function(d) {
  9709. function a(a) {
  9710. "undefined" === typeof a && (a = null);
  9711. d.call(this);
  9712. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  9713. a && this.load(a)
  9714. }
  9715. __extends(a, d);
  9716. a.prototype.load = function(a) {
  9717. this._request = a;
  9718. this.data = null;
  9719. b.MainContext.instance.netContext.proceed(this)
  9720. };
  9721. return a
  9722. } (b.EventDispatcher);
  9723. b.URLLoader = c;
  9724. c.prototype.__class__ = "egret.URLLoader"
  9725. })(egret || (egret = {}));
  9726. __extends = this.__extends ||
  9727. function(b, c) {
  9728. function d() {
  9729. this.constructor = b
  9730. }
  9731. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9732. d.prototype = c.prototype;
  9733. b.prototype = new d
  9734. }; (function(b) {
  9735. var c = function(d) {
  9736. function a() {
  9737. d.call(this);
  9738. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  9739. }
  9740. __extends(a, d);
  9741. Object.defineProperty(a.prototype, "textureWidth", {
  9742. get: function() {
  9743. return this._textureWidth
  9744. },
  9745. enumerable: !0,
  9746. configurable: !0
  9747. });
  9748. Object.defineProperty(a.prototype, "textureHeight", {
  9749. get: function() {
  9750. return this._textureHeight
  9751. },
  9752. enumerable: !0,
  9753. configurable: !0
  9754. });
  9755. Object.defineProperty(a.prototype, "bitmapData", {
  9756. get: function() {
  9757. return this._bitmapData
  9758. },
  9759. enumerable: !0,
  9760. configurable: !0
  9761. });
  9762. a.prototype._setBitmapData = function(a) {
  9763. var g = b.MainContext.instance.rendererContext.texture_scale_factor;
  9764. this._bitmapData = a;
  9765. this._sourceWidth = a.width;
  9766. this._sourceHeight = a.height;
  9767. this._textureWidth = this._sourceWidth * g;
  9768. this._textureHeight = this._sourceHeight * g;
  9769. this._bitmapWidth = this._textureWidth;
  9770. this._bitmapHeight = this._textureHeight;
  9771. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  9772. };
  9773. a.prototype.getPixel32 = function(a, b) {
  9774. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  9775. };
  9776. return a
  9777. } (b.HashObject);
  9778. b.Texture = c;
  9779. c.prototype.__class__ = "egret.Texture"
  9780. })(egret || (egret = {}));
  9781. __extends = this.__extends ||
  9782. function(b, c) {
  9783. function d() {
  9784. this.constructor = b
  9785. }
  9786. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9787. d.prototype = c.prototype;
  9788. b.prototype = new d
  9789. }; (function(b) {
  9790. var c = function(d) {
  9791. function a() {
  9792. d.call(this);
  9793. this._bitmapData = document.createElement("canvas");
  9794. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  9795. }
  9796. __extends(a, d);
  9797. a.prototype.drawToTexture = function(a) {
  9798. var g = this._bitmapData,
  9799. f = a.getBounds(b.Rectangle.identity);
  9800. g.width = f.width;
  9801. g.height = f.height;
  9802. a._worldTransform.identity();
  9803. a.worldAlpha = 1;
  9804. if (a instanceof b.DisplayObjectContainer) {
  9805. this._offsetX = f.x;
  9806. this._offsetY = f.y;
  9807. a._worldTransform.append(1, 0, 0, 1, -f.x, -f.y);
  9808. for (var g = a._children,
  9809. f = 0,
  9810. d = g.length; f < d; f++) g[f]._updateTransform()
  9811. }
  9812. g = b.RenderFilter.getInstance();
  9813. f = g._drawAreaList.concat();
  9814. g._drawAreaList.length = 0;
  9815. this.renderContext.clearScreen();
  9816. this.webGLTexture = null; (d = a.mask || a._scrollRect) && this.renderContext.pushMask(d);
  9817. a._render(this.renderContext);
  9818. d && this.renderContext.popMask();
  9819. g._drawAreaList = f;
  9820. this._textureWidth = this._bitmapData.width;
  9821. this._textureHeight = this._bitmapData.height;
  9822. this._sourceWidth = this._textureWidth;
  9823. this._sourceHeight = this._textureHeight
  9824. };
  9825. return a
  9826. } (b.Texture);
  9827. b.RenderTexture = c;
  9828. c.prototype.__class__ = "egret.RenderTexture"
  9829. })(egret || (egret = {}));
  9830. __extends = this.__extends ||
  9831. function(b, c) {
  9832. function d() {
  9833. this.constructor = b
  9834. }
  9835. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9836. d.prototype = c.prototype;
  9837. b.prototype = new d
  9838. }; (function(b) {
  9839. var c = function(d) {
  9840. function a() {
  9841. d.call(this);
  9842. this.renderCost = 0;
  9843. this.texture_scale_factor = 1
  9844. }
  9845. __extends(a, d);
  9846. a.prototype.clearScreen = function() {};
  9847. a.prototype.clearRect = function(a, b, f, d) {};
  9848. a.prototype.drawImage = function(a, g, f, d, c, h, k, p, n) {
  9849. b.Profiler.getInstance().onDrawImage()
  9850. };
  9851. a.prototype.setTransform = function(a) {};
  9852. a.prototype.setAlpha = function(a, b) {};
  9853. a.prototype.setupFont = function(a) {};
  9854. a.prototype.measureText = function(a) {
  9855. return 0
  9856. };
  9857. a.prototype.drawText = function(a, g, f, d, c) {
  9858. b.Profiler.getInstance().onDrawImage()
  9859. };
  9860. a.prototype.strokeRect = function(a, b, f, d, c) {};
  9861. a.prototype.pushMask = function(a) {};
  9862. a.prototype.popMask = function() {};
  9863. a.prototype.onRenderStart = function() {};
  9864. a.prototype.onRenderFinish = function() {};
  9865. a.createRendererContext = function(a) {
  9866. return null
  9867. };
  9868. return a
  9869. } (b.HashObject);
  9870. b.RendererContext = c;
  9871. c.prototype.__class__ = "egret.RendererContext"
  9872. })(egret || (egret = {})); (function(b) {
  9873. var c = function() {
  9874. function b() {}
  9875. b.MOUSE = "mouse";
  9876. b.TOUCH = "touch";
  9877. b.mode = "touch";
  9878. return b
  9879. } ();
  9880. b.InteractionMode = c;
  9881. c.prototype.__class__ = "egret.InteractionMode"
  9882. })(egret || (egret = {}));
  9883. __extends = this.__extends ||
  9884. function(b, c) {
  9885. function d() {
  9886. this.constructor = b
  9887. }
  9888. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9889. d.prototype = c.prototype;
  9890. b.prototype = new d
  9891. }; (function(b) {
  9892. var c = function(d) {
  9893. function a() {
  9894. d.call(this);
  9895. this._currentTouchTarget = {};
  9896. this.maxTouches = 2;
  9897. this.touchDownTarget = {};
  9898. this.touchingIdentifiers = [];
  9899. this.lastTouchY = this.lastTouchX = -1
  9900. }
  9901. __extends(a, d);
  9902. a.prototype.run = function() {};
  9903. a.prototype.getTouchData = function(a, b, f) {
  9904. var d = this._currentTouchTarget[a];
  9905. null == d && (d = {},
  9906. this._currentTouchTarget[a] = d);
  9907. d.stageX = b;
  9908. d.stageY = f;
  9909. d.identifier = a;
  9910. return d
  9911. };
  9912. a.prototype.dispatchEvent = function(a, g) {
  9913. b.TouchEvent.dispatchTouchEvent(g.target, a, g.identifier, g.stageX, g.stageY, !1, !1, !1, !0 == this.touchDownTarget[g.identifier])
  9914. };
  9915. a.prototype.onTouchBegan = function(a, g, d) {
  9916. if (this.touchingIdentifiers.length != this.maxTouches) {
  9917. var c = b.MainContext.instance.stage.hitTest(a, g);
  9918. c && (a = this.getTouchData(d, a, g), this.touchDownTarget[d] = !0, a.target = c, a.beginTarget = c, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  9919. this.touchingIdentifiers.push(d)
  9920. }
  9921. };
  9922. a.prototype.onTouchMove = function(a, g, d) {
  9923. if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || g != this.lastTouchY)) {
  9924. this.lastTouchX = a;
  9925. this.lastTouchY = g;
  9926. var c = b.MainContext.instance.stage.hitTest(a, g);
  9927. c && (a = this.getTouchData(d, a, g), a.target = c, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  9928. }
  9929. };
  9930. a.prototype.onTouchEnd = function(a, g, d) {
  9931. var c = this.touchingIdentifiers.indexOf(d); - 1 != c && (this.touchingIdentifiers.splice(c, 1), c = b.MainContext.instance.stage.hitTest(a, g)) && (a = this.getTouchData(d, a, g), delete this.touchDownTarget[d], d = a.beginTarget, a.target = c, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == c ? 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])
  9932. };
  9933. return a
  9934. } (b.HashObject);
  9935. b.TouchContext = c;
  9936. c.prototype.__class__ = "egret.TouchContext"
  9937. })(egret || (egret = {}));
  9938. __extends = this.__extends ||
  9939. function(b, c) {
  9940. function d() {
  9941. this.constructor = b
  9942. }
  9943. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9944. d.prototype = c.prototype;
  9945. b.prototype = new d
  9946. }; (function(b) {
  9947. var c = function(b) {
  9948. function a() {
  9949. b.call(this)
  9950. }
  9951. __extends(a, b);
  9952. a.prototype.proceed = function(a) {};
  9953. return a
  9954. } (b.HashObject);
  9955. b.NetContext = c;
  9956. c.prototype.__class__ = "egret.NetContext"
  9957. })(egret || (egret = {}));
  9958. __extends = this.__extends ||
  9959. function(b, c) {
  9960. function d() {
  9961. this.constructor = b
  9962. }
  9963. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9964. d.prototype = c.prototype;
  9965. b.prototype = new d
  9966. }; (function(b) {
  9967. var c = function(b) {
  9968. function a() {
  9969. b.call(this);
  9970. this.frameRate = 60
  9971. }
  9972. __extends(a, b);
  9973. a.prototype.executeMainLoop = function(a, b) {};
  9974. return a
  9975. } (b.HashObject);
  9976. b.DeviceContext = c;
  9977. c.prototype.__class__ = "egret.DeviceContext"
  9978. })(egret || (egret = {})); (function(b) {
  9979. var c = function() {
  9980. function b() {}
  9981. b.call = function(a, e) {};
  9982. b.addCallback = function(a, e) {};
  9983. return b
  9984. } ();
  9985. b.ExternalInterface = c;
  9986. c.prototype.__class__ = "egret.ExternalInterface"
  9987. })(egret || (egret = {}));
  9988. __extends = this.__extends ||
  9989. function(b, c) {
  9990. function d() {
  9991. this.constructor = b
  9992. }
  9993. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9994. d.prototype = c.prototype;
  9995. b.prototype = new d
  9996. }; (function(b) {
  9997. var c = function(d) {
  9998. function a() {
  9999. d.call(this);
  10000. this.translate = this.isHD ?
  10001. function(a) {
  10002. return "translate3d(" + a.x + "px, " + (a.y - b.MainContext.instance.stage.stageHeight) + "px, 0) "
  10003. }: function(a) {
  10004. return "translate(" + a.x + "px, " + a.y + "px) "
  10005. };
  10006. this.rotate = this.isHD ?
  10007. function(a) {
  10008. return "rotateZ(" + a + "deg) "
  10009. }: function(a) {
  10010. return "rotate(" + a + "deg) "
  10011. };
  10012. this.ua = navigator.userAgent.toLowerCase();
  10013. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  10014. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  10015. this.type = "unknow";
  10016. switch (this.type) {
  10017. case "firefox":
  10018. this.pfx = "Moz";
  10019. this.isHD = !0;
  10020. break;
  10021. case "chrome":
  10022. case "safari":
  10023. this.pfx = "webkit";
  10024. this.isHD = !0;
  10025. break;
  10026. case "opera":
  10027. this.pfx = "O";
  10028. this.isHD = !1;
  10029. break;
  10030. case "ie":
  10031. this.pfx = "ms";
  10032. this.isHD = !1;
  10033. break;
  10034. default:
  10035. this.pfx = "webkit",
  10036. this.isHD = !0
  10037. }
  10038. this.trans = this.pfx + "Transform"
  10039. }
  10040. __extends(a, d);
  10041. a.getInstance = function() {
  10042. null == a.instance && (a.instance = new a);
  10043. return a.instance
  10044. };
  10045. Object.defineProperty(a.prototype, "isMobile", {
  10046. get: function() {
  10047. b.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  10048. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  10049. },
  10050. enumerable: !0,
  10051. configurable: !0
  10052. });
  10053. a.prototype.$new = function(a) {
  10054. return this.$(document.createElement(a))
  10055. };
  10056. a.prototype.$ = function(e) {
  10057. var g = document;
  10058. if (e = e instanceof HTMLElement ? e: g.querySelector(e)) e.find = e.find || this.$,
  10059. e.hasClass = e.hasClass ||
  10060. function(a) {
  10061. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  10062. },
  10063. e.addClass = e.addClass ||
  10064. function(a) {
  10065. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  10066. return this
  10067. },
  10068. e.removeClass = e.removeClass ||
  10069. function(a) {
  10070. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  10071. return this
  10072. },
  10073. e.remove = e.remove ||
  10074. function() {},
  10075. e.appendTo = e.appendTo ||
  10076. function(a) {
  10077. a.appendChild(this);
  10078. return this
  10079. },
  10080. e.prependTo = e.prependTo ||
  10081. function(a) {
  10082. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  10083. return this
  10084. },
  10085. e.transforms = e.transforms ||
  10086. function() {
  10087. 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);
  10088. return this
  10089. },
  10090. e.position = e.position || {
  10091. x: 0,
  10092. y: 0
  10093. },
  10094. e.rotation = e.rotation || 0,
  10095. e.scale = e.scale || {
  10096. x: 1,
  10097. y: 1
  10098. },
  10099. e.skew = e.skew || {
  10100. x: 0,
  10101. y: 0
  10102. },
  10103. e.translates = function(a, e) {
  10104. this.position.x = a;
  10105. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  10106. this.transforms();
  10107. return this
  10108. },
  10109. e.rotate = function(a) {
  10110. this.rotation = a;
  10111. this.transforms();
  10112. return this
  10113. },
  10114. e.resize = function(a, e) {
  10115. this.scale.x = a;
  10116. this.scale.y = e;
  10117. this.transforms();
  10118. return this
  10119. },
  10120. e.setSkew = function(a, e) {
  10121. this.skew.x = a;
  10122. this.skew.y = e;
  10123. this.transforms();
  10124. return this
  10125. };
  10126. return e
  10127. };
  10128. a.prototype.scale = function(a) {
  10129. return "scale(" + a.x + ", " + a.y + ") "
  10130. };
  10131. a.prototype.skew = function(a) {
  10132. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  10133. };
  10134. return a
  10135. } (b.HashObject);
  10136. b.Browser = c;
  10137. c.prototype.__class__ = "egret.Browser"
  10138. })(egret || (egret = {})); (function(b) {
  10139. var c = function() {
  10140. function d() {}
  10141. d.parse = function(a) {
  10142. a = b.SAXParser.getInstance().parserXML(a);
  10143. if (!a || !a.childNodes) return null;
  10144. for (var e = a.childNodes.length,
  10145. g = !1,
  10146. c = 0; c < e; c++) {
  10147. var m = a.childNodes[c];
  10148. if (1 == m.nodeType) {
  10149. g = !0;
  10150. break
  10151. }
  10152. }
  10153. return g ? d.parseNode(m) : null
  10154. };
  10155. d.parseNode = function(a) {
  10156. if (!a || 1 != a.nodeType) return null;
  10157. var e = {};
  10158. e.localName = a.localName;
  10159. e.name = a.nodeName;
  10160. a.namespaceURI && (e.namespace = a.namespaceURI);
  10161. a.prefix && (e.prefix = a.prefix);
  10162. for (var b = a.attributes,
  10163. c = b.length,
  10164. m = 0; m < c; m++) {
  10165. var l = b[m],
  10166. h = l.name;
  10167. 0 != h.indexOf("xmlns:") && (e["$" + h] = l.value)
  10168. }
  10169. b = a.childNodes;
  10170. c = b.length;
  10171. for (m = 0; m < c; m++) if (l = d.parseNode(b[m])) e.children || (e.children = []),
  10172. l.parent = e,
  10173. e.children.push(l); ! e.children && (a = a.textContent.trim()) && (e.text = a);
  10174. return e
  10175. };
  10176. d.findChildren = function(a, e, b) {
  10177. b ? b.length = 0 : b = [];
  10178. d.findByPath(a, e, b);
  10179. return b
  10180. };
  10181. d.findByPath = function(a, e, b) {
  10182. var c = e.indexOf("."),
  10183. m; - 1 == c ? (m = e, c = !0) : (m = e.substring(0, c), e = e.substring(c + 1), c = !1);
  10184. if (a = a.children) for (var l = a.length,
  10185. h = 0; h < l; h++) {
  10186. var k = a[h];
  10187. k.localName == m && (c ? b.push(k) : d.findByPath(k, e, b))
  10188. }
  10189. };
  10190. d.getAttributes = function(a, e) {
  10191. e ? e.length = 0 : e = [];
  10192. for (var b in a)"$" == b.charAt(0) && e.push(b.substring(1));
  10193. return e
  10194. };
  10195. return d
  10196. } ();
  10197. b.XML = c;
  10198. c.prototype.__class__ = "egret.XML"
  10199. })(egret || (egret = {})); (function(b) {
  10200. var c = function() {
  10201. function a() {}
  10202. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  10203. a.BIG_ENDIAN = "BIG_ENDIAN";
  10204. return a
  10205. } ();
  10206. b.Endian = c;
  10207. c.prototype.__class__ = "egret.Endian";
  10208. var d = function() {
  10209. function a() {
  10210. this.length = this.position = 0;
  10211. this._mode = "";
  10212. this.maxlength = 0;
  10213. this._endian = c.LITTLE_ENDIAN;
  10214. this.isLittleEndian = !1;
  10215. this._mode = "Typed array";
  10216. this.maxlength = 4;
  10217. this.arraybytes = new ArrayBuffer(this.maxlength);
  10218. this.unalignedarraybytestemp = new ArrayBuffer(16);
  10219. this.endian = a.DEFAULT_ENDIAN
  10220. }
  10221. Object.defineProperty(a.prototype, "endian", {
  10222. get: function() {
  10223. return this._endian
  10224. },
  10225. set: function(a) {
  10226. this._endian = a;
  10227. this.isLittleEndian = a == c.LITTLE_ENDIAN
  10228. },
  10229. enumerable: !0,
  10230. configurable: !0
  10231. });
  10232. a.prototype.ensureWriteableSpace = function(a) {
  10233. this.ensureSpace(a + this.position)
  10234. };
  10235. a.prototype.setArrayBuffer = function(a) {
  10236. this.ensureSpace(a.byteLength);
  10237. this.length = a.byteLength;
  10238. a = new Int8Array(a); (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  10239. this.position = 0
  10240. };
  10241. Object.defineProperty(a.prototype, "bytesAvailable", {
  10242. get: function() {
  10243. return this.length - this.position
  10244. },
  10245. enumerable: !0,
  10246. configurable: !0
  10247. });
  10248. a.prototype.ensureSpace = function(a) {
  10249. if (a > this.maxlength) {
  10250. a = a + 255 & -256;
  10251. var b = new ArrayBuffer(a),
  10252. d = new Uint8Array(this.arraybytes, 0, this.length); (new Uint8Array(b, 0, this.length)).set(d);
  10253. this.arraybytes = b;
  10254. this.maxlength = a
  10255. }
  10256. };
  10257. a.prototype.writeByte = function(a) {
  10258. this.ensureWriteableSpace(1); (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  10259. this.position > this.length && (this.length = this.position)
  10260. };
  10261. a.prototype.readByte = function() {
  10262. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  10263. return (new Int8Array(this.arraybytes))[this.position++]
  10264. };
  10265. a.prototype.readBytes = function(a, b, d) {
  10266. "undefined" === typeof b && (b = 0);
  10267. "undefined" === typeof d && (d = 0);
  10268. null == d && (d = a.length);
  10269. a.ensureWriteableSpace(b + d);
  10270. var c = new Int8Array(a.arraybytes),
  10271. l = new Int8Array(this.arraybytes);
  10272. c.set(l.subarray(this.position, this.position + d), b);
  10273. this.position += d;
  10274. d + b > a.length && (a.length += d + b - a.length)
  10275. };
  10276. a.prototype.writeUnsignedByte = function(a) {
  10277. this.ensureWriteableSpace(1); (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  10278. this.position > this.length && (this.length = this.position)
  10279. };
  10280. a.prototype.readUnsignedByte = function() {
  10281. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  10282. return (new Uint8Array(this.arraybytes))[this.position++]
  10283. };
  10284. a.prototype.writeUnsignedShort = function(a) {
  10285. this.ensureWriteableSpace(2);
  10286. if (0 == (this.position & 1)) {
  10287. var b = new Uint16Array(this.arraybytes);
  10288. b[this.position >> 1] = ~~a & 65535
  10289. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1),
  10290. b[0] = ~~a & 65535,
  10291. a = new Uint8Array(this.arraybytes, this.position, 2),
  10292. b = new Uint8Array(this.unalignedarraybytestemp, 0, 2),
  10293. a.set(b);
  10294. this.position += 2;
  10295. this.position > this.length && (this.length = this.position)
  10296. };
  10297. a.prototype.readUTFBytes = function(a) {
  10298. var b = "";
  10299. a = this.position + a;
  10300. for (var d = new DataView(this.arraybytes); this.position < a;) {
  10301. var c = d.getUint8(this.position++);
  10302. if (128 > c) {
  10303. if (0 == c) break;
  10304. b += String.fromCharCode(c)
  10305. } else if (224 > c) b += String.fromCharCode((c & 63) << 6 | d.getUint8(this.position++) & 127);
  10306. else if (240 > c) var l = d.getUint8(this.position++),
  10307. b = b + String.fromCharCode((c & 31) << 12 | (l & 127) << 6 | d.getUint8(this.position++) & 127);
  10308. else var l = d.getUint8(this.position++),
  10309. h = d.getUint8(this.position++),
  10310. b = b + String.fromCharCode((c & 15) << 18 | (l & 127) << 12 | h << 6 & 127 | d.getUint8(this.position++) & 127)
  10311. }
  10312. return b
  10313. };
  10314. a.prototype.readInt = function() {
  10315. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  10316. this.position += 4;
  10317. return a
  10318. };
  10319. a.prototype.readShort = function() {
  10320. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  10321. this.position += 2;
  10322. return a
  10323. };
  10324. a.prototype.readDouble = function() {
  10325. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  10326. this.position += 8;
  10327. return a
  10328. };
  10329. a.prototype.readUnsignedShort = function() {
  10330. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  10331. if (0 == (this.position & 1)) {
  10332. var a = new Uint16Array(this.arraybytes),
  10333. b = this.position >> 1;
  10334. this.position += 2;
  10335. return a[b]
  10336. }
  10337. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  10338. b = new Uint8Array(this.arraybytes, this.position, 2); (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  10339. this.position += 2;
  10340. return a[0]
  10341. };
  10342. a.prototype.writeUnsignedInt = function(a) {
  10343. this.ensureWriteableSpace(4);
  10344. if (0 == (this.position & 3)) {
  10345. var b = new Uint32Array(this.arraybytes);
  10346. b[this.position >> 2] = ~~a & 4294967295
  10347. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1),
  10348. b[0] = ~~a & 4294967295,
  10349. a = new Uint8Array(this.arraybytes, this.position, 4),
  10350. b = new Uint8Array(this.unalignedarraybytestemp, 0, 4),
  10351. a.set(b);
  10352. this.position += 4;
  10353. this.position > this.length && (this.length = this.position)
  10354. };
  10355. a.prototype.readUnsignedInt = function() {
  10356. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  10357. if (0 == (this.position & 3)) {
  10358. var a = new Uint32Array(this.arraybytes),
  10359. b = this.position >> 2;
  10360. this.position += 4;
  10361. return a[b]
  10362. }
  10363. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  10364. b = new Uint8Array(this.arraybytes, this.position, 4); (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  10365. this.position += 4;
  10366. return a[0]
  10367. };
  10368. a.prototype.writeFloat = function(a) {
  10369. this.ensureWriteableSpace(4);
  10370. if (0 == (this.position & 3)) {
  10371. var b = new Float32Array(this.arraybytes);
  10372. b[this.position >> 2] = a
  10373. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1),
  10374. b[0] = a,
  10375. a = new Uint8Array(this.arraybytes, this.position, 4),
  10376. b = new Uint8Array(this.unalignedarraybytestemp, 0, 4),
  10377. a.set(b);
  10378. this.position += 4;
  10379. this.position > this.length && (this.length = this.position)
  10380. };
  10381. a.prototype.readFloat = function() {
  10382. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  10383. if (0 == (this.position & 3)) {
  10384. var a = new Float32Array(this.arraybytes),
  10385. b = this.position >> 2;
  10386. this.position += 4;
  10387. return a[b]
  10388. }
  10389. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  10390. b = new Uint8Array(this.arraybytes, this.position, 4); (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  10391. this.position += 4;
  10392. return a[0]
  10393. };
  10394. a.DEFAULT_ENDIAN = c.BIG_ENDIAN;
  10395. return a
  10396. } ();
  10397. b.ByteArray = d;
  10398. d.prototype.__class__ = "egret.ByteArray"
  10399. })(egret || (egret = {}));
  10400. __extends = this.__extends ||
  10401. function(b, c) {
  10402. function d() {
  10403. this.constructor = b
  10404. }
  10405. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10406. d.prototype = c.prototype;
  10407. b.prototype = new d
  10408. }; (function(b) {
  10409. var c = function(d) {
  10410. function a(a, b, c) {
  10411. d.call(this);
  10412. this._target = null;
  10413. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  10414. this._actions = this._steps = this.pluginData = null;
  10415. this.paused = !1;
  10416. this.duration = 0;
  10417. this._prevPos = -1;
  10418. this.position = null;
  10419. this._stepPosition = this._prevPosition = 0;
  10420. this.passive = !1;
  10421. this.initialize(a, b, c)
  10422. }
  10423. __extends(a, d);
  10424. a.get = function(e, b, d, c) {
  10425. "undefined" === typeof b && (b = null);
  10426. "undefined" === typeof d && (d = null);
  10427. "undefined" === typeof c && (c = !1);
  10428. c && a.removeTweens(e);
  10429. return new a(e, b, d)
  10430. };
  10431. a.removeTweens = function(e) {
  10432. if (e.tween_count) {
  10433. for (var b = a._tweens,
  10434. d = b.length - 1; 0 <= d; d--) b[d]._target == e && (b[d].paused = !0, b.splice(d, 1));
  10435. e.tween_count = 0
  10436. }
  10437. };
  10438. a.tick = function(e, b) {
  10439. "undefined" === typeof b && (b = !1);
  10440. for (var d = a._tweens.concat(), c = d.length - 1; 0 <= c; c--) {
  10441. var l = d[c];
  10442. b && !l.ignoreGlobalPause || l.paused || l.tick(l._useTicks ? 1 : e)
  10443. }
  10444. };
  10445. a._register = function(e, d) {
  10446. var c = e._target,
  10447. m = a._tweens;
  10448. if (d) c && (c.tween_count = c.tween_count ? c.tween_count + 1 : 1),
  10449. m.push(e),
  10450. a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  10451. else for (c && c.tween_count--, c = m.length; c--;) if (m[c] == e) {
  10452. m.splice(c, 1);
  10453. break
  10454. }
  10455. };
  10456. a.removeAllTweens = function() {
  10457. for (var e = a._tweens,
  10458. b = 0,
  10459. d = e.length; b < d; b++) {
  10460. var c = e[b];
  10461. c.paused = !0;
  10462. c._target.tweenjs_count = 0
  10463. }
  10464. e.length = 0
  10465. };
  10466. a.prototype.initialize = function(e, b, d) {
  10467. this._target = e;
  10468. 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));
  10469. this.pluginData = d || {};
  10470. this._curQueueProps = {};
  10471. this._initQueueProps = {};
  10472. this._steps = [];
  10473. this._actions = [];
  10474. b && b.paused ? this.paused = !0 : a._register(this, !0);
  10475. b && null != b.position && this.setPosition(b.position, a.NONE)
  10476. };
  10477. a.prototype.setPosition = function(a, b) {
  10478. "undefined" === typeof b && (b = 1);
  10479. 0 > a && (a = 0);
  10480. var d = a,
  10481. c = !1;
  10482. d >= this.duration && (this.loop ? d %= this.duration: (d = this.duration, c = !0));
  10483. if (d == this._prevPos) return c;
  10484. var l = this._prevPos;
  10485. this.position = this._prevPos = d;
  10486. this._prevPosition = a;
  10487. if (this._target) if (c) this._updateTargetProps(null, 1);
  10488. else if (0 < this._steps.length) {
  10489. for (var h = 0,
  10490. k = this._steps.length; h < k && !(this._steps[h].t > d); h++);
  10491. h = this._steps[h - 1];
  10492. this._updateTargetProps(h, (this._stepPosition = d - h.t) / h.d)
  10493. }
  10494. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < l ? (l != this.duration && this._runActions(l, this.duration), this._runActions(0, d, !0)) : this._runActions(l, d));
  10495. c && this.setPaused(!0);
  10496. this.dispatchEventWith("change");
  10497. return c
  10498. };
  10499. a.prototype._runActions = function(a, b, d) {
  10500. "undefined" === typeof d && (d = !1);
  10501. var c = a,
  10502. l = b,
  10503. h = -1,
  10504. k = this._actions.length,
  10505. p = 1;
  10506. a > b && (c = b, l = a, h = k, k = p = -1);
  10507. for (; (h += p) != k;) {
  10508. b = this._actions[h];
  10509. var n = b.t; (n == l || n > c && n < l || d && n == a) && b.f.apply(b.o, b.p)
  10510. }
  10511. };
  10512. a.prototype._updateTargetProps = function(e, b) {
  10513. var d, c, l, h;
  10514. if (e || 1 != b) {
  10515. if (this.passive = !!e.v) return;
  10516. e.e && (b = e.e(b, 0, 1, 1));
  10517. d = e.p0;
  10518. c = e.p1
  10519. } else this.passive = !1,
  10520. d = c = this._curQueueProps;
  10521. for (var k in this._initQueueProps) {
  10522. null == (l = d[k]) && (d[k] = l = this._initQueueProps[k]);
  10523. null == (h = c[k]) && (c[k] = h = l);
  10524. l = l == h || 0 == b || 1 == b || "number" != typeof l ? 1 == b ? h: l: l + (h - l) * b;
  10525. var p = !1;
  10526. if (h = a._plugins[k]) for (var n = 0,
  10527. q = h.length; n < q; n++) {
  10528. var t = h[n].tween(this, k, l, d, c, b, !!e && d == c, !e);
  10529. t == a.IGNORE ? p = !0 : l = t
  10530. }
  10531. p || (this._target[k] = l)
  10532. }
  10533. };
  10534. a.prototype.setPaused = function(e) {
  10535. this.paused = e;
  10536. a._register(this, !e);
  10537. return this
  10538. };
  10539. a.prototype._cloneProps = function(a) {
  10540. var b = {},
  10541. d;
  10542. for (d in a) b[d] = a[d];
  10543. return b
  10544. };
  10545. a.prototype._addStep = function(a) {
  10546. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  10547. return this
  10548. };
  10549. a.prototype._appendQueueProps = function(e) {
  10550. var b, d, c, l, h, k;
  10551. for (k in e) if (void 0 === this._initQueueProps[k]) {
  10552. d = this._target[k];
  10553. if (b = a._plugins[k]) for (c = 0, l = b.length; c < l; c++) d = b[c].init(this, k, d);
  10554. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null: d
  10555. }
  10556. for (k in e) {
  10557. d = this._curQueueProps[k];
  10558. if (b = a._plugins[k]) for (h = h || {},
  10559. c = 0, l = b.length; c < l; c++) b[c].step && b[c].step(this, k, d, e[k], h);
  10560. this._curQueueProps[k] = e[k]
  10561. }
  10562. h && this._appendQueueProps(h);
  10563. return this._curQueueProps
  10564. };
  10565. a.prototype._addAction = function(a) {
  10566. a.t = this.duration;
  10567. this._actions.push(a);
  10568. return this
  10569. };
  10570. a.prototype._set = function(a, b) {
  10571. for (var d in a) b[d] = a[d]
  10572. };
  10573. a.prototype.wait = function(a, b) {
  10574. if (null == a || 0 >= a) return this;
  10575. var d = this._cloneProps(this._curQueueProps);
  10576. return this._addStep({
  10577. d: a,
  10578. p0: d,
  10579. p1: d,
  10580. v: b
  10581. })
  10582. };
  10583. a.prototype.to = function(a, b, d) {
  10584. "undefined" === typeof d && (d = void 0);
  10585. if (isNaN(b) || 0 > b) b = 0;
  10586. return this._addStep({
  10587. d: b || 0,
  10588. p0: this._cloneProps(this._curQueueProps),
  10589. e: d,
  10590. p1: this._cloneProps(this._appendQueueProps(a))
  10591. })
  10592. };
  10593. a.prototype.call = function(a, b, d) {
  10594. "undefined" === typeof b && (b = void 0);
  10595. "undefined" === typeof d && (d = void 0);
  10596. return this._addAction({
  10597. f: a,
  10598. p: d ? d: [],
  10599. o: b ? b: this._target
  10600. })
  10601. };
  10602. a.prototype.set = function(a, b) {
  10603. "undefined" === typeof b && (b = null);
  10604. return this._addAction({
  10605. f: this._set,
  10606. o: this,
  10607. p: [a, b ? b: this._target]
  10608. })
  10609. };
  10610. a.prototype.play = function(a) {
  10611. a || (a = this);
  10612. return this.call(a.setPaused, a, [!1])
  10613. };
  10614. a.prototype.pause = function(a) {
  10615. a || (a = this);
  10616. return this.call(a.setPaused, a, [!0])
  10617. };
  10618. a.prototype.tick = function(a) {
  10619. this.paused || this.setPosition(this._prevPosition + a)
  10620. };
  10621. a.NONE = 0;
  10622. a.LOOP = 1;
  10623. a.REVERSE = 2;
  10624. a._tweens = [];
  10625. a.IGNORE = {};
  10626. a._plugins = {};
  10627. a._inited = !1;
  10628. return a
  10629. } (b.EventDispatcher);
  10630. b.Tween = c;
  10631. c.prototype.__class__ = "egret.Tween"
  10632. })(egret || (egret = {})); (function(b) {
  10633. var c = function() {
  10634. function d() {
  10635. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  10636. }
  10637. d.get = function(a) { - 1 > a && (a = -1);
  10638. 1 < a && (a = 1);
  10639. return function(b) {
  10640. return 0 == a ? b: 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  10641. }
  10642. };
  10643. d.getPowIn = function(a) {
  10644. return function(b) {
  10645. return Math.pow(b, a)
  10646. }
  10647. };
  10648. d.getPowOut = function(a) {
  10649. return function(b) {
  10650. return 1 - Math.pow(1 - b, a)
  10651. }
  10652. };
  10653. d.getPowInOut = function(a) {
  10654. return function(b) {
  10655. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  10656. }
  10657. };
  10658. d.sineIn = function(a) {
  10659. return 1 - Math.cos(a * Math.PI / 2)
  10660. };
  10661. d.sineOut = function(a) {
  10662. return Math.sin(a * Math.PI / 2)
  10663. };
  10664. d.sineInOut = function(a) {
  10665. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  10666. };
  10667. d.getBackIn = function(a) {
  10668. return function(b) {
  10669. return b * b * ((a + 1) * b - a)
  10670. }
  10671. };
  10672. d.getBackOut = function(a) {
  10673. return function(b) {
  10674. b -= 1;
  10675. return b * b * ((a + 1) * b + a) + 1
  10676. }
  10677. };
  10678. d.getBackInOut = function(a) {
  10679. a *= 1.525;
  10680. return function(b) {
  10681. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  10682. }
  10683. };
  10684. d.circIn = function(a) {
  10685. return - (Math.sqrt(1 - a * a) - 1)
  10686. };
  10687. d.circOut = function(a) {
  10688. return Math.sqrt(1 - a * a)
  10689. };
  10690. d.circInOut = function(a) {
  10691. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  10692. };
  10693. d.bounceIn = function(a) {
  10694. return 1 - d.bounceOut(1 - a)
  10695. };
  10696. d.bounceOut = function(a) {
  10697. 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
  10698. };
  10699. d.bounceInOut = function(a) {
  10700. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  10701. };
  10702. d.getElasticIn = function(a, b) {
  10703. var d = 2 * Math.PI;
  10704. return function(c) {
  10705. if (0 == c || 1 == c) return c;
  10706. var m = b / d * Math.asin(1 / a);
  10707. return - (a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - m) * d / b))
  10708. }
  10709. };
  10710. d.getElasticOut = function(a, b) {
  10711. var d = 2 * Math.PI;
  10712. return function(c) {
  10713. if (0 == c || 1 == c) return c;
  10714. var m = b / d * Math.asin(1 / a);
  10715. return a * Math.pow(2, -10 * c) * Math.sin((c - m) * d / b) + 1
  10716. }
  10717. };
  10718. d.getElasticInOut = function(a, b) {
  10719. var d = 2 * Math.PI;
  10720. return function(c) {
  10721. var m = b / d * Math.asin(1 / a);
  10722. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - m) * d / b) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - m) * d / b) * 0.5 + 1
  10723. }
  10724. };
  10725. d.quadIn = d.getPowIn(2);
  10726. d.quadOut = d.getPowOut(2);
  10727. d.quadInOut = d.getPowInOut(2);
  10728. d.cubicIn = d.getPowIn(3);
  10729. d.cubicOut = d.getPowOut(3);
  10730. d.cubicInOut = d.getPowInOut(3);
  10731. d.quartIn = d.getPowIn(4);
  10732. d.quartOut = d.getPowOut(4);
  10733. d.quartInOut = d.getPowInOut(4);
  10734. d.quintIn = d.getPowIn(5);
  10735. d.quintOut = d.getPowOut(5);
  10736. d.quintInOut = d.getPowInOut(5);
  10737. d.backIn = d.getBackIn(1.7);
  10738. d.backOut = d.getBackOut(1.7);
  10739. d.backInOut = d.getBackInOut(1.7);
  10740. d.elasticIn = d.getElasticIn(1, 0.3);
  10741. d.elasticOut = d.getElasticOut(1, 0.3);
  10742. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  10743. return d
  10744. } ();
  10745. b.Ease = c;
  10746. c.prototype.__class__ = "egret.Ease"
  10747. })(egret || (egret = {})); (function(b) {
  10748. var c = function() {
  10749. function b() {
  10750. this.type = b.EFFECT
  10751. }
  10752. b.prototype.play = function(a) {
  10753. "undefined" === typeof a && (a = !1);
  10754. var b = this.audio;
  10755. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  10756. };
  10757. b.prototype.pause = function() {
  10758. var a = this.audio;
  10759. a && a.pause()
  10760. };
  10761. b.prototype.load = function() {
  10762. var a = this.audio;
  10763. a && a.load()
  10764. };
  10765. b.prototype.addEventListener = function(a, b) {
  10766. this.audio && this.audio.addEventListener(a, b, !1)
  10767. };
  10768. b.prototype.removeEventListener = function(a, b) {
  10769. this.audio && this.audio.removeEventListener(a, b, !1)
  10770. };
  10771. b.prototype.setVolume = function(a) {
  10772. var b = this.audio;
  10773. b && (b.volume = a)
  10774. };
  10775. b.prototype.getVolume = function() {
  10776. return this.audio ? this.audio.volume: 0
  10777. };
  10778. b.prototype.preload = function(a) {
  10779. this.type = a
  10780. };
  10781. b.prototype._setAudio = function(a) {
  10782. this.audio = a
  10783. };
  10784. b.MUSIC = "music";
  10785. b.EFFECT = "effect";
  10786. return b
  10787. } ();
  10788. b.Sound = c;
  10789. c.prototype.__class__ = "egret.Sound"
  10790. })(egret || (egret = {})); (function(b) {
  10791. var c = function() {
  10792. function b() {}
  10793. b.isNumber = function(a) {
  10794. return "number" === typeof a && !isNaN(a)
  10795. };
  10796. return b
  10797. } ();
  10798. b.NumberUtils = c;
  10799. c.prototype.__class__ = "egret.NumberUtils"
  10800. })(egret || (egret = {}));
  10801. var __extends = this.__extends ||
  10802. function(b, c) {
  10803. function d() {
  10804. this.constructor = b
  10805. }
  10806. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10807. d.prototype = c.prototype;
  10808. b.prototype = new d
  10809. },
  10810. RES; (function(b) {
  10811. var c = function(b) {
  10812. function a(a, c, f) {
  10813. "undefined" === typeof c && (c = !1);
  10814. "undefined" === typeof f && (f = !1);
  10815. b.call(this, a, c, f);
  10816. this.itemsTotal = this.itemsLoaded = 0
  10817. }
  10818. __extends(a, b);
  10819. a.dispatchResourceEvent = function(b, d, c, m, l, h) {
  10820. "undefined" === typeof c && (c = "");
  10821. "undefined" === typeof m && (m = null);
  10822. "undefined" === typeof l && (l = 0);
  10823. "undefined" === typeof h && (h = 0);
  10824. var k = egret.Event._getPropertyData(a);
  10825. k.groupName = c;
  10826. k.resItem = m;
  10827. k.itemsLoaded = l;
  10828. k.itemsTotal = h;
  10829. egret.Event._dispatchByTarget(a, b, d, k)
  10830. };
  10831. a.ITEM_LOAD_ERROR = "itemLoadError";
  10832. a.CONFIG_COMPLETE = "configComplete";
  10833. a.GROUP_PROGRESS = "groupProgress";
  10834. a.GROUP_COMPLETE = "groupComplete";
  10835. return a
  10836. } (egret.Event);
  10837. b.ResourceEvent = c;
  10838. c.prototype.__class__ = "RES.ResourceEvent"
  10839. })(RES || (RES = {})); (function(b) {
  10840. var c = function() {
  10841. function b(a, e, c) {
  10842. this._loaded = !1;
  10843. this.name = a;
  10844. this.url = e;
  10845. this.type = c
  10846. }
  10847. Object.defineProperty(b.prototype, "loaded", {
  10848. get: function() {
  10849. return this.data ? this.data.loaded: this._loaded
  10850. },
  10851. set: function(a) {
  10852. this.data && (this.data.loaded = a);
  10853. this._loaded = a
  10854. },
  10855. enumerable: !0,
  10856. configurable: !0
  10857. });
  10858. b.prototype.toString = function() {
  10859. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  10860. };
  10861. b.TYPE_XML = "xml";
  10862. b.TYPE_IMAGE = "image";
  10863. b.TYPE_BIN = "bin";
  10864. b.TYPE_TEXT = "text";
  10865. b.TYPE_JSON = "json";
  10866. b.TYPE_SHEET = "sheet";
  10867. b.TYPE_FONT = "font";
  10868. b.TYPE_SOUND = "sound";
  10869. return b
  10870. } ();
  10871. b.ResourceItem = c;
  10872. c.prototype.__class__ = "RES.ResourceItem"
  10873. })(RES || (RES = {})); (function(b) {
  10874. var c = function() {
  10875. function c() {
  10876. this.keyMap = {};
  10877. this.groupDic = {}
  10878. }
  10879. c.prototype.getGroupByName = function(a) {
  10880. var b = [];
  10881. if (!this.groupDic[a]) return b;
  10882. a = this.groupDic[a];
  10883. for (var c = a.length,
  10884. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  10885. return b
  10886. };
  10887. c.prototype.getRawGroupByName = function(a) {
  10888. return this.groupDic[a] ? this.groupDic[a] : []
  10889. };
  10890. c.prototype.createGroup = function(a, b, c) {
  10891. "undefined" === typeof c && (c = !1);
  10892. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  10893. c = this.groupDic;
  10894. for (var d = [], m = b.length, l = 0; l < m; l++) {
  10895. var h = b[l],
  10896. k = c[h];
  10897. if (k) for (var h = k.length,
  10898. p = 0; p < h; p++) {
  10899. var n = k[p]; - 1 == d.indexOf(n) && d.push(n)
  10900. } else(n = this.keyMap[h]) && -1 == d.indexOf(n) && d.push(n)
  10901. }
  10902. if (0 == d.length) return ! 1;
  10903. this.groupDic[a] = d;
  10904. return ! 0
  10905. };
  10906. c.prototype.parseConfig = function(a, b) {
  10907. if (a) {
  10908. var c = a.resources;
  10909. if (c) for (var d = c.length,
  10910. m = 0; m < d; m++) {
  10911. var l = c[m],
  10912. h = l.url;
  10913. h && -1 == h.indexOf("://") && (l.url = b + h);
  10914. this.addItemToKeyMap(l)
  10915. }
  10916. if (c = a.groups) for (d = c.length, m = 0; m < d; m++) {
  10917. for (var h = c[m], k = [], p = h.keys.split(","), n = p.length, q = 0; q < n; q++) l = p[q].trim(),
  10918. (l = this.keyMap[l]) && -1 == k.indexOf(l) && k.push(l);
  10919. this.groupDic[h.name] = k
  10920. }
  10921. }
  10922. };
  10923. c.prototype.addItemToKeyMap = function(a) {
  10924. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  10925. if (a.hasOwnProperty("subkeys")) {
  10926. var b = a.subkeys.split(",");
  10927. a.subkeys = b;
  10928. for (var c = b.length,
  10929. d = 0; d < c; d++) {
  10930. var m = b[d];
  10931. null == this.keyMap[m] && (this.keyMap[m] = a)
  10932. }
  10933. }
  10934. };
  10935. c.prototype.getName = function(a) {
  10936. return (a = this.keyMap[a]) ? a.name: ""
  10937. };
  10938. c.prototype.getType = function(a) {
  10939. return (a = this.keyMap[a]) ? a.type: ""
  10940. };
  10941. c.prototype.getRawResourceItem = function(a) {
  10942. return this.keyMap[a]
  10943. };
  10944. c.prototype.getResourceItem = function(a) {
  10945. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  10946. };
  10947. c.prototype.parseResourceItem = function(a) {
  10948. var e = new b.ResourceItem(a.name, a.url, a.type);
  10949. e.data = a;
  10950. return e
  10951. };
  10952. return c
  10953. } ();
  10954. b.ResourceConfig = c;
  10955. c.prototype.__class__ = "RES.ResourceConfig"
  10956. })(RES || (RES = {}));
  10957. __extends = this.__extends ||
  10958. function(b, c) {
  10959. function d() {
  10960. this.constructor = b
  10961. }
  10962. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10963. d.prototype = c.prototype;
  10964. b.prototype = new d
  10965. }; (function(b) {
  10966. var c = function(c) {
  10967. function a() {
  10968. c.call(this);
  10969. this.thread = 2;
  10970. this.loadingCount = 0;
  10971. this.groupTotalDic = {};
  10972. this.numLoadedDic = {};
  10973. this.itemListDic = {};
  10974. this.priorityQueue = {};
  10975. this.lazyLoadList = [];
  10976. this.analyzerDic = {};
  10977. this.queueIndex = 0
  10978. }
  10979. __extends(a, c);
  10980. a.prototype.isGroupInLoading = function(a) {
  10981. return void 0 !== this.itemListDic[a]
  10982. };
  10983. a.prototype.loadGroup = function(a, c, d) {
  10984. "undefined" === typeof d && (d = 0);
  10985. if (!this.itemListDic[c] && c) if (a && 0 != a.length) {
  10986. this.priorityQueue[d] ? this.priorityQueue[d].push(c) : this.priorityQueue[d] = [c];
  10987. this.itemListDic[c] = a;
  10988. d = a.length;
  10989. for (var m = 0; m < d; m++) a[m].groupName = c;
  10990. this.groupTotalDic[c] = a.length;
  10991. this.numLoadedDic[c] = 0;
  10992. this.next()
  10993. } else a = new b.ResourceEvent(b.ResourceEvent.GROUP_COMPLETE),
  10994. a.groupName = c,
  10995. this.dispatchEvent(a)
  10996. };
  10997. a.prototype.loadItem = function(a) {
  10998. this.lazyLoadList.push(a);
  10999. a.groupName = "";
  11000. this.next()
  11001. };
  11002. a.prototype.next = function() {
  11003. for (; this.loadingCount < this.thread;) {
  11004. var a = this.getOneResourceItem();
  11005. if (!a) break;
  11006. this.loadingCount++;
  11007. if (a.loaded) this.onItemComplete(a);
  11008. else {
  11009. var c = this.analyzerDic[a.type];
  11010. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  11011. c.loadFile(a, this.onItemComplete, this)
  11012. }
  11013. }
  11014. };
  11015. a.prototype.getOneResourceItem = function() {
  11016. var a = Number.NEGATIVE_INFINITY,
  11017. b;
  11018. for (b in this.priorityQueue) a = Math.max(a, b);
  11019. a = this.priorityQueue[a];
  11020. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  11021. b = a.length;
  11022. for (var c, d = 0; d < b; d++) {
  11023. this.queueIndex >= b && (this.queueIndex = 0);
  11024. c = this.itemListDic[a[this.queueIndex]];
  11025. if (0 < c.length) break;
  11026. this.queueIndex++
  11027. }
  11028. return 0 == c.length ? null: c.shift()
  11029. };
  11030. a.prototype.onItemComplete = function(a) {
  11031. this.loadingCount--;
  11032. var c = a.groupName;
  11033. a.loaded || b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  11034. if (c) {
  11035. this.numLoadedDic[c]++;
  11036. var d = this.numLoadedDic[c],
  11037. m = this.groupTotalDic[c];
  11038. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, d, m);
  11039. d == m && (this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, c))
  11040. } else this.callBack.call(this.resInstance, a);
  11041. this.next()
  11042. };
  11043. a.prototype.removeGroupName = function(a) {
  11044. for (var b in this.priorityQueue) {
  11045. for (var c = this.priorityQueue[b], d = c.length, l = 0, h = !1, d = c.length, k = 0; k < d; k++) {
  11046. if (c[k] == a) {
  11047. c.splice(l, 1);
  11048. h = !0;
  11049. break
  11050. }
  11051. l++
  11052. }
  11053. if (h) {
  11054. 0 == c.length && delete this.priorityQueue[b];
  11055. break
  11056. }
  11057. }
  11058. };
  11059. return a
  11060. } (egret.EventDispatcher);
  11061. b.ResourceLoader = c;
  11062. c.prototype.__class__ = "RES.ResourceLoader"
  11063. })(RES || (RES = {}));
  11064. __extends = this.__extends ||
  11065. function(b, c) {
  11066. function d() {
  11067. this.constructor = b
  11068. }
  11069. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11070. d.prototype = c.prototype;
  11071. b.prototype = new d
  11072. }; (function(b) {
  11073. var c = function(b) {
  11074. function a() {
  11075. b.call(this)
  11076. }
  11077. __extends(a, b);
  11078. a.prototype.loadFile = function(a, b, c) {};
  11079. a.prototype.getRes = function(a) {};
  11080. a.prototype.destroyRes = function(a) {
  11081. return ! 1
  11082. };
  11083. a.getStringPrefix = function(a) {
  11084. if (!a) return "";
  11085. var b = a.indexOf(".");
  11086. return - 1 != b ? a.substring(0, b) : ""
  11087. };
  11088. a.getStringTail = function(a) {
  11089. if (!a) return "";
  11090. var b = a.indexOf(".");
  11091. return - 1 != b ? a.substring(b + 1) : ""
  11092. };
  11093. return a
  11094. } (egret.HashObject);
  11095. b.AnalyzerBase = c;
  11096. c.prototype.__class__ = "RES.AnalyzerBase"
  11097. })(RES || (RES = {}));
  11098. __extends = this.__extends ||
  11099. function(b, c) {
  11100. function d() {
  11101. this.constructor = b
  11102. }
  11103. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11104. d.prototype = c.prototype;
  11105. b.prototype = new d
  11106. }; (function(b) {
  11107. var c = function(b) {
  11108. function a() {
  11109. b.call(this);
  11110. this.fileDic = {};
  11111. this.resItemDic = [];
  11112. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  11113. this.recycler = new egret.Recycler
  11114. }
  11115. __extends(a, b);
  11116. a.prototype.loadFile = function(a, b, c) {
  11117. if (this.fileDic[a.name]) b.call(c, a);
  11118. else {
  11119. var d = this.getLoader();
  11120. this.resItemDic[d.hashCode] = {
  11121. item: a,
  11122. func: b,
  11123. thisObject: c
  11124. };
  11125. d.load(new egret.URLRequest(a.url))
  11126. }
  11127. };
  11128. a.prototype.getLoader = function() {
  11129. var a = this.recycler.pop();
  11130. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  11131. a.dataFormat = this._dataFormat;
  11132. return a
  11133. };
  11134. a.prototype.onLoadFinish = function(a) {
  11135. var b = a.target,
  11136. c = this.resItemDic[b.hashCode];
  11137. delete this.resItemDic[b.hashCode];
  11138. this.recycler.push(b);
  11139. var d = c.item,
  11140. l = c.func;
  11141. d.loaded = a.type == egret.Event.COMPLETE;
  11142. d.loaded && this.analyzeData(d, b.data);
  11143. l.call(c.thisObject, d)
  11144. };
  11145. a.prototype.analyzeData = function(a, b) {
  11146. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
  11147. };
  11148. a.prototype.getRes = function(a) {
  11149. return this.fileDic[a]
  11150. };
  11151. a.prototype.hasRes = function(a) {
  11152. return null != this.getRes(a)
  11153. };
  11154. a.prototype.destroyRes = function(a) {
  11155. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  11156. };
  11157. return a
  11158. } (b.AnalyzerBase);
  11159. b.BinAnalyzer = c;
  11160. c.prototype.__class__ = "RES.BinAnalyzer"
  11161. })(RES || (RES = {}));
  11162. __extends = this.__extends ||
  11163. function(b, c) {
  11164. function d() {
  11165. this.constructor = b
  11166. }
  11167. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11168. d.prototype = c.prototype;
  11169. b.prototype = new d
  11170. }; (function(b) {
  11171. var c = function(b) {
  11172. function a() {
  11173. b.call(this);
  11174. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  11175. }
  11176. __extends(a, b);
  11177. a.prototype.analyzeData = function(a, b) {
  11178. 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]))))
  11179. };
  11180. return a
  11181. } (b.BinAnalyzer);
  11182. b.ImageAnalyzer = c;
  11183. c.prototype.__class__ = "RES.ImageAnalyzer"
  11184. })(RES || (RES = {}));
  11185. __extends = this.__extends ||
  11186. function(b, c) {
  11187. function d() {
  11188. this.constructor = b
  11189. }
  11190. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11191. d.prototype = c.prototype;
  11192. b.prototype = new d
  11193. }; (function(b) {
  11194. var c = function(b) {
  11195. function a() {
  11196. b.call(this);
  11197. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  11198. }
  11199. __extends(a, b);
  11200. a.prototype.analyzeData = function(a, b) {
  11201. var c = a.name;
  11202. if (!this.fileDic[c] && b) try {
  11203. this.fileDic[c] = JSON.parse(b)
  11204. } catch(d) {
  11205. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + NaN + b)
  11206. }
  11207. };
  11208. return a
  11209. } (b.BinAnalyzer);
  11210. b.JsonAnalyzer = c;
  11211. c.prototype.__class__ = "RES.JsonAnalyzer"
  11212. })(RES || (RES = {}));
  11213. __extends = this.__extends ||
  11214. function(b, c) {
  11215. function d() {
  11216. this.constructor = b
  11217. }
  11218. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11219. d.prototype = c.prototype;
  11220. b.prototype = new d
  11221. }; (function(b) {
  11222. var c = function(b) {
  11223. function a() {
  11224. b.call(this);
  11225. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  11226. }
  11227. __extends(a, b);
  11228. return a
  11229. } (b.BinAnalyzer);
  11230. b.TextAnalyzer = c;
  11231. c.prototype.__class__ = "RES.TextAnalyzer"
  11232. })(RES || (RES = {}));
  11233. __extends = this.__extends ||
  11234. function(b, c) {
  11235. function d() {
  11236. this.constructor = b
  11237. }
  11238. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11239. d.prototype = c.prototype;
  11240. b.prototype = new d
  11241. }; (function(b) {
  11242. var c = function(c) {
  11243. function a() {
  11244. c.call(this);
  11245. this.sheetMap = {};
  11246. this.textureMap = {};
  11247. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  11248. }
  11249. __extends(a, c);
  11250. a.prototype.getRes = function(a) {
  11251. var c = this.fileDic[a];
  11252. c || (c = this.textureMap[a]); ! c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  11253. return c
  11254. };
  11255. a.prototype.onLoadFinish = function(a) {
  11256. var b = a.target,
  11257. c = this.resItemDic[b.hashCode];
  11258. delete this.resItemDic[b.hashCode];
  11259. this.recycler.push(b);
  11260. var d = c.item,
  11261. l = c.func;
  11262. d.loaded = a.type == egret.Event.COMPLETE;
  11263. d.loaded && this.analyzeData(d, b.data);
  11264. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, l, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : l.call(c.thisObject, d)
  11265. };
  11266. a.prototype.analyzeData = function(a, b) {
  11267. var c = a.name;
  11268. if (!this.fileDic[c] && b) {
  11269. var d;
  11270. if ("string" == typeof b) {
  11271. try {
  11272. d = JSON.parse(b)
  11273. } catch(l) {
  11274. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  11275. }
  11276. d && (this.sheetMap[c] = d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  11277. } else d = this.sheetMap[c],
  11278. delete this.sheetMap[c],
  11279. b && (d = this.parseSpriteSheet(b, d), this.fileDic[c] = d)
  11280. }
  11281. };
  11282. a.prototype.getRelativePath = function(a, b) {
  11283. a = a.split("\\").join("/");
  11284. var c = a.lastIndexOf("/");
  11285. return a = -1 != c ? a.substring(0, c + 1) + b: b
  11286. };
  11287. a.prototype.parseSpriteSheet = function(a, b) {
  11288. var c = b.frames;
  11289. if (!c) return null;
  11290. var d = new egret.SpriteSheet(a),
  11291. l = this.textureMap,
  11292. h;
  11293. for (h in c) {
  11294. var k = c[h];
  11295. a = d.createTexture(h, k.x, k.y, k.w, k.h, k.offX, k.offY, k.sourceW, k.sourceH);
  11296. k.scale9grid && (k = k.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(k[0]), parseInt(k[1]), parseInt(k[2]), parseInt(k[3])));
  11297. null == l[h] && (l[h] = a)
  11298. }
  11299. return d
  11300. };
  11301. return a
  11302. } (b.BinAnalyzer);
  11303. b.SheetAnalyzer = c;
  11304. c.prototype.__class__ = "RES.SheetAnalyzer"
  11305. })(RES || (RES = {}));
  11306. __extends = this.__extends ||
  11307. function(b, c) {
  11308. function d() {
  11309. this.constructor = b
  11310. }
  11311. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11312. d.prototype = c.prototype;
  11313. b.prototype = new d
  11314. }; (function(b) {
  11315. var c = function(b) {
  11316. function a() {
  11317. b.call(this)
  11318. }
  11319. __extends(a, b);
  11320. a.prototype.analyzeData = function(a, b) {
  11321. var c = a.name;
  11322. if (!this.fileDic[c] && b) {
  11323. var d;
  11324. "string" == typeof b ? (d = b, this.sheetMap[c] = d, a.loaded = !1, a.url = this.getTexturePath(a.url, d)) : (d = this.sheetMap[c], delete this.sheetMap[c], b && (d = new egret.BitmapTextSpriteSheet(b, d), this.fileDic[c] = d))
  11325. }
  11326. };
  11327. a.prototype.getTexturePath = function(a, b) {
  11328. var c = "",
  11329. d = b.split("\n")[2],
  11330. l = d.indexOf('file="'); - 1 != l && (d = d.substring(l + 6), l = d.indexOf('"'), c = d.substring(0, l));
  11331. a = a.split("\\").join("/");
  11332. l = a.lastIndexOf("/");
  11333. return a = -1 != l ? a.substring(0, l + 1) + c: c
  11334. };
  11335. return a
  11336. } (b.SheetAnalyzer);
  11337. b.FontAnalyzer = c;
  11338. c.prototype.__class__ = "RES.FontAnalyzer"
  11339. })(RES || (RES = {}));
  11340. __extends = this.__extends ||
  11341. function(b, c) {
  11342. function d() {
  11343. this.constructor = b
  11344. }
  11345. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11346. d.prototype = c.prototype;
  11347. b.prototype = new d
  11348. }; (function(b) {
  11349. var c = function(b) {
  11350. function a() {
  11351. b.call(this);
  11352. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  11353. }
  11354. __extends(a, b);
  11355. a.prototype.analyzeData = function(a, b) {
  11356. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.soundType && b.preload(c.soundType))
  11357. };
  11358. return a
  11359. } (b.BinAnalyzer);
  11360. b.SoundAnalyzer = c;
  11361. c.prototype.__class__ = "RES.SoundAnalyzer"
  11362. })(RES || (RES = {}));
  11363. __extends = this.__extends ||
  11364. function(b, c) {
  11365. function d() {
  11366. this.constructor = b
  11367. }
  11368. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11369. d.prototype = c.prototype;
  11370. b.prototype = new d
  11371. }; (function(b) {
  11372. var c = function(b) {
  11373. function a() {
  11374. b.call(this);
  11375. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  11376. }
  11377. __extends(a, b);
  11378. a.prototype.analyzeData = function(a, b) {
  11379. var c = a.name;
  11380. if (!this.fileDic[c] && b) try {
  11381. var d = egret.XML.parse(b);
  11382. this.fileDic[c] = d
  11383. } catch(l) {}
  11384. };
  11385. return a
  11386. } (b.BinAnalyzer);
  11387. b.XMLAnalyzer = c;
  11388. c.prototype.__class__ = "RES.XMLAnalyzer"
  11389. })(RES || (RES = {}));
  11390. __extends = this.__extends ||
  11391. function(b, c) {
  11392. function d() {
  11393. this.constructor = b
  11394. }
  11395. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11396. d.prototype = c.prototype;
  11397. b.prototype = new d
  11398. }; (function(b) {
  11399. b.loadConfig = function(a, b, c) {
  11400. "undefined" === typeof b && (b = "");
  11401. "undefined" === typeof c && (c = "json");
  11402. d.loadConfig(a, b, c)
  11403. };
  11404. b.loadGroup = function(a, b) {
  11405. "undefined" === typeof b && (b = 0);
  11406. d.loadGroup(a, b)
  11407. };
  11408. b.isGroupLoaded = function(a) {
  11409. return d.isGroupLoaded(a)
  11410. };
  11411. b.getGroupByName = function(a) {
  11412. return d.getGroupByName(a)
  11413. };
  11414. b.createGroup = function(a, b, c) {
  11415. "undefined" === typeof c && (c = !1);
  11416. return d.createGroup(a, b, c)
  11417. };
  11418. b.hasRes = function(a) {
  11419. return d.hasRes(a)
  11420. };
  11421. b.getRes = function(a) {
  11422. return d.getRes(a)
  11423. };
  11424. b.getResAsync = function(a, b, c) {
  11425. d.getResAsync(a, b, c)
  11426. };
  11427. b.getResByUrl = function(a, b, c, f) {
  11428. "undefined" === typeof f && (f = "");
  11429. d.getResByUrl(a, b, c, f)
  11430. };
  11431. b.destroyRes = function(a) {
  11432. return d.destroyRes(a)
  11433. };
  11434. b.setMaxLoadingThread = function(a) {
  11435. d.setMaxLoadingThread(a)
  11436. };
  11437. b.addEventListener = function(a, b, c, f, m) {
  11438. "undefined" === typeof f && (f = !1);
  11439. "undefined" === typeof m && (m = 0);
  11440. d.addEventListener(a, b, c, f, m)
  11441. };
  11442. b.removeEventListener = function(a, b, c, f) {
  11443. "undefined" === typeof f && (f = !1);
  11444. d.removeEventListener(a, b, c, f)
  11445. };
  11446. var c = function(a) {
  11447. function e() {
  11448. a.call(this);
  11449. this.analyzerDic = {};
  11450. this.configItemList = [];
  11451. this.configComplete = this.callLaterFlag = !1;
  11452. this.loadedGroups = [];
  11453. this.groupNameList = [];
  11454. this.asyncDic = {};
  11455. this.init()
  11456. }
  11457. __extends(e, a);
  11458. e.prototype.getAnalyzerByType = function(a) {
  11459. var e = this.analyzerDic[a];
  11460. e || (e = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  11461. return e
  11462. };
  11463. e.prototype.init = function() {
  11464. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  11465. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  11466. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  11467. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  11468. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  11469. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  11470. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  11471. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  11472. this.resConfig = new b.ResourceConfig;
  11473. this.resLoader = new b.ResourceLoader;
  11474. this.resLoader.callBack = this.onResourceItemComp;
  11475. this.resLoader.resInstance = this;
  11476. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  11477. };
  11478. e.prototype.loadConfig = function(a, b, e) {
  11479. "undefined" === typeof e && (e = "json");
  11480. this.configItemList.push({
  11481. url: a,
  11482. resourceRoot: b,
  11483. type: e
  11484. });
  11485. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  11486. };
  11487. e.prototype.startLoadConfig = function() {
  11488. this.callLaterFlag = !1;
  11489. var a = this.configItemList;
  11490. this.configItemList = [];
  11491. this.loadingConfigList = a;
  11492. for (var c = a.length,
  11493. d = [], l = 0; l < c; l++) {
  11494. var h = a[l],
  11495. h = new b.ResourceItem(h.url, h.url, h.type);
  11496. d.push(h)
  11497. }
  11498. this.resLoader.loadGroup(d, e.GROUP_CONFIG, Number.MAX_VALUE)
  11499. };
  11500. e.prototype.isGroupLoaded = function(a) {
  11501. return - 1 != this.loadedGroups.indexOf(a)
  11502. };
  11503. e.prototype.getGroupByName = function(a) {
  11504. return this.resConfig.getGroupByName(a)
  11505. };
  11506. e.prototype.loadGroup = function(a, b) {
  11507. "undefined" === typeof b && (b = 0);
  11508. if ( - 1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  11509. var e = this.resConfig.getGroupByName(a);
  11510. this.resLoader.loadGroup(e, a, b)
  11511. } else this.groupNameList.push({
  11512. name: a,
  11513. priority: b
  11514. })
  11515. };
  11516. e.prototype.createGroup = function(a, b, e) {
  11517. "undefined" === typeof e && (e = !1);
  11518. if (e) {
  11519. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1)
  11520. }
  11521. return this.resConfig.createGroup(a, b, e)
  11522. };
  11523. e.prototype.onGroupComp = function(a) {
  11524. if (a.groupName == e.GROUP_CONFIG) {
  11525. a = this.loadingConfigList.length;
  11526. for (var c = 0; c < a; c++) {
  11527. var d = this.loadingConfigList[c],
  11528. l = this.getAnalyzerByType(d.type),
  11529. h = l.getRes(d.url);
  11530. l.destroyRes(d.url);
  11531. this.resConfig.parseConfig(h, d.resourceRoot)
  11532. }
  11533. this.configComplete = !0;
  11534. this.loadingConfigList = null;
  11535. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  11536. d = this.groupNameList;
  11537. a = d.length;
  11538. for (c = 0; c < a; c++) l = d[c],
  11539. this.loadGroup(l.name, l.priority);
  11540. this.groupNameList = []
  11541. } else this.loadedGroups.push(a.groupName),
  11542. this.dispatchEvent(a)
  11543. };
  11544. e.prototype.hasRes = function(a) {
  11545. var e = this.resConfig.getType(a);
  11546. return "" == e && (a = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(a), "" == e) ? !1 : !0
  11547. };
  11548. e.prototype.getRes = function(a) {
  11549. var e = this.resConfig.getType(a);
  11550. return "" == e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(e), "" == e) ? null: this.getAnalyzerByType(e).getRes(a)
  11551. };
  11552. e.prototype.getResAsync = function(a, e, c) {
  11553. var d = this.resConfig.getType(a),
  11554. h = this.resConfig.getName(a);
  11555. if ("" == d && (h = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(h), "" == d)) {
  11556. e.call(c, null);
  11557. return
  11558. } (d = this.getAnalyzerByType(d).getRes(a)) ? e.call(c, d) : (a = {
  11559. key: a,
  11560. compFunc: e,
  11561. thisObject: c
  11562. },
  11563. this.asyncDic[h] ? this.asyncDic[h].push(a) : (this.asyncDic[h] = [a], h = this.resConfig.getResourceItem(h), this.resLoader.loadItem(h)))
  11564. };
  11565. e.prototype.getResByUrl = function(a, e, c, d) {
  11566. "undefined" === typeof d && (d = "");
  11567. if (a) {
  11568. d || (d = this.getTypeByUrl(a));
  11569. var h = this.getAnalyzerByType(d).getRes(a);
  11570. h ? e.call(c, h) : (e = {
  11571. key: a,
  11572. compFunc: e,
  11573. thisObject: c
  11574. },
  11575. this.asyncDic[a] ? this.asyncDic[a].push(e) : (this.asyncDic[a] = [e], a = new b.ResourceItem(a, a, d), this.resLoader.loadItem(a)))
  11576. } else e.call(c, null)
  11577. };
  11578. e.prototype.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  11579. switch (a) {
  11580. case b.ResourceItem.TYPE_XML:
  11581. case b.ResourceItem.TYPE_JSON:
  11582. case b.ResourceItem.TYPE_SHEET:
  11583. break;
  11584. case "png":
  11585. case "jpg":
  11586. case "gif":
  11587. a = b.ResourceItem.TYPE_IMAGE;
  11588. break;
  11589. case "fnt":
  11590. a = b.ResourceItem.TYPE_FONT;
  11591. break;
  11592. case "txt":
  11593. a = b.ResourceItem.TYPE_TEXT;
  11594. break;
  11595. case "mp3":
  11596. case "ogg":
  11597. case "mpeg":
  11598. case "wav":
  11599. case "m4a":
  11600. case "mp4":
  11601. case "aiff":
  11602. case "wma":
  11603. case "mid":
  11604. a = b.ResourceItem.TYPE_SOUND;
  11605. break;
  11606. default:
  11607. a = b.ResourceItem.TYPE_BIN
  11608. }
  11609. return a
  11610. };
  11611. e.prototype.onResourceItemComp = function(a) {
  11612. var b = this.asyncDic[a.name];
  11613. delete this.asyncDic[a.name];
  11614. a = this.getAnalyzerByType(a.type);
  11615. for (var e = b.length,
  11616. c = 0; c < e; c++) {
  11617. var d = b[c],
  11618. k = a.getRes(d.key);
  11619. d.compFunc.call(d.thisObject, k, d.key)
  11620. }
  11621. };
  11622. e.prototype.destroyRes = function(a) {
  11623. var b = this.resConfig.getRawGroupByName(a);
  11624. if (b) {
  11625. var e = this.loadedGroups.indexOf(a); - 1 != e && this.loadedGroups.splice(e, 1);
  11626. a = b.length;
  11627. for (var c = 0; c < a; c++) {
  11628. e = b[c];
  11629. e.loaded = !1;
  11630. var d = this.getAnalyzerByType(e.type);
  11631. d.destroyRes(e.name)
  11632. }
  11633. return ! 0
  11634. }
  11635. b = this.resConfig.getType(a);
  11636. if ("" == b) return ! 1;
  11637. e = this.resConfig.getRawResourceItem(a);
  11638. e.loaded = !1;
  11639. d = this.getAnalyzerByType(b);
  11640. return d.destroyRes(a)
  11641. };
  11642. e.prototype.setMaxLoadingThread = function(a) {
  11643. 1 > a && (a = 1);
  11644. this.resLoader.thread = a
  11645. };
  11646. e.GROUP_CONFIG = "RES__CONFIG";
  11647. return e
  11648. } (egret.EventDispatcher);
  11649. c.prototype.__class__ = "Resource";
  11650. var d = new c
  11651. })(RES || (RES = {}));
  11652. __extends = this.__extends ||
  11653. function(b, c) {
  11654. function d() {
  11655. this.constructor = b
  11656. }
  11657. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11658. d.prototype = c.prototype;
  11659. b.prototype = new d
  11660. }; (function(b) {
  11661. var c = function(c) {
  11662. function a(b) {
  11663. "undefined" === typeof b && (b = 60);
  11664. c.call(this);
  11665. this.frameRate = b;
  11666. this._time = 0;
  11667. 60 == b && (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);
  11668. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  11669. return window.setTimeout(a, 1E3 / b)
  11670. });
  11671. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  11672. return window.clearTimeout(a)
  11673. });
  11674. a.instance = this;
  11675. this.registerListener()
  11676. }
  11677. __extends(a, c);
  11678. a.prototype.enterFrame = function() {
  11679. var e = a.instance,
  11680. c = a._thisObject,
  11681. d = a._callback,
  11682. m = b.getTimer(),
  11683. l = m - e._time;
  11684. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  11685. d.call(c, l);
  11686. e._time = m
  11687. };
  11688. a.prototype.executeMainLoop = function(b, c) {
  11689. a._callback = b;
  11690. a._thisObject = c;
  11691. this.enterFrame()
  11692. };
  11693. a.prototype.reset = function() {
  11694. var e = a.instance;
  11695. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  11696. };
  11697. a.prototype.registerListener = function() {
  11698. var b = function() {
  11699. a.instance.reset()
  11700. },
  11701. c = function() {
  11702. document[d] || b()
  11703. };
  11704. window.onfocus = b;
  11705. window.onblur = function() {};
  11706. var d, m;
  11707. "undefined" !== typeof document.hidden ? (d = "hidden", m = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", m = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", m = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", m = "webkitvisibilitychange");
  11708. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  11709. d && m && document.addEventListener(m, c, !1)
  11710. };
  11711. return a
  11712. } (b.DeviceContext);
  11713. b.HTML5DeviceContext = c;
  11714. c.prototype.__class__ = "egret.HTML5DeviceContext"
  11715. })(egret || (egret = {}));
  11716. __extends = this.__extends ||
  11717. function(b, c) {
  11718. function d() {
  11719. this.constructor = b
  11720. }
  11721. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  11722. d.prototype = c.prototype;
  11723. b.prototype = new d
  11724. }; (function(b) {
  11725. var c = function(c) {
  11726. function a(a) {
  11727. this.canvas = a;
  11728. this.canvasContext = a.getContext("2d");
  11729. var b = this.canvasContext.setTransform,
  11730. f = this;
  11731. this.canvasContext.setTransform = function(a, c, e, d, p, n) {
  11732. f._matrixA = a;
  11733. f._matrixB = c;
  11734. f._matrixC = e;
  11735. f._matrixD = d;
  11736. f._matrixTx = p;
  11737. f._matrixTy = n;
  11738. b.call(f.canvasContext, a, c, e, d, p, n)
  11739. };
  11740. this._matrixA = 1;
  11741. this._matrixC = this._matrixB = 0;
  11742. this._matrixD = 1;
  11743. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  11744. c.call(this)
  11745. }
  11746. __extends(a, c);
  11747. a.prototype.clearScreen = function() {
  11748. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, d = a.length; c < d; c++) {
  11749. var m = a[c];
  11750. this.clearRect(m.x + this._transformTx, m.y + this._transformTy, m.width, m.height)
  11751. }
  11752. this.renderCost = 0
  11753. };
  11754. a.prototype.clearRect = function(a, b, c, d) {
  11755. this.canvasContext.clearRect(a, b, c, d)
  11756. };
  11757. a.prototype.drawImage = function(a, g, f, m, l, h, k, p, n) {
  11758. g /= b.MainContext.instance.rendererContext.texture_scale_factor;
  11759. f /= b.MainContext.instance.rendererContext.texture_scale_factor;
  11760. m /= b.MainContext.instance.rendererContext.texture_scale_factor;
  11761. l /= b.MainContext.instance.rendererContext.texture_scale_factor;
  11762. a = a._bitmapData;
  11763. h += this._transformTx;
  11764. k += this._transformTy;
  11765. var q = b.getTimer();
  11766. this.canvasContext.drawImage(a, g, f, m, l, h, k, p, n);
  11767. c.prototype.drawImage.call(this, a, g, f, m, l, h, k, p, n);
  11768. this.renderCost += b.getTimer() - q
  11769. };
  11770. a.prototype.setTransform = function(a) {
  11771. 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.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  11772. };
  11773. a.prototype.setAlpha = function(a, c) {
  11774. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  11775. c ? (this.blendValue = c, this.canvasContext.globalCompositeOperation = c) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = b.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = b.BlendMode.NORMAL)
  11776. };
  11777. a.prototype.setupFont = function(a) {
  11778. var b = this.canvasContext,
  11779. c = a.italic ? "italic ": "normal ",
  11780. c = c + (a.bold ? "bold ": "normal "),
  11781. c = c + (a.size + "px " + a.fontFamily);
  11782. b.font = c;
  11783. b.textAlign = "left";
  11784. b.textBaseline = "middle"
  11785. };
  11786. a.prototype.measureText = function(a) {
  11787. return this.canvasContext.measureText(a).width
  11788. };
  11789. a.prototype.drawText = function(a, b, f, m, l) {
  11790. var h = a._strokeColorString,
  11791. k = a.stroke,
  11792. p = this.canvasContext;
  11793. p.fillStyle = a._textColorString;
  11794. p.strokeStyle = h;
  11795. k && (p.lineWidth = 2 * k, p.strokeText(b, f + this._transformTx, m + this._transformTy, l || 65535));
  11796. p.fillText(b, f + this._transformTx, m + this._transformTy, l || 65535);
  11797. c.prototype.drawText.call(this, a, b, f, m, l)
  11798. };
  11799. a.prototype.strokeRect = function(a, b, c, d, l) {
  11800. this.canvasContext.strokeStyle = l;
  11801. this.canvasContext.strokeRect(a, b, c, d)
  11802. };
  11803. a.prototype.pushMask = function(a) {
  11804. this.canvasContext.save();
  11805. this.canvasContext.beginPath();
  11806. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  11807. this.canvasContext.clip();
  11808. this.canvasContext.closePath()
  11809. };
  11810. a.prototype.popMask = function() {
  11811. this.canvasContext.restore();
  11812. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  11813. };
  11814. a.prototype.onRenderStart = function() {
  11815. this.canvasContext.save()
  11816. };
  11817. a.prototype.onRenderFinish = function() {
  11818. this.canvasContext.restore();
  11819. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  11820. };
  11821. return a
  11822. } (b.RendererContext);
  11823. b.HTML5CanvasRenderer = c;
  11824. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  11825. })(egret || (egret = {}));
  11826. var egret_h5_graphics; (function(b) {
  11827. b.beginFill = function(b, a) {
  11828. "undefined" === typeof a && (a = 1);
  11829. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  11830. this.fillStyleColor = e;
  11831. this.commandQueue.push(new c(this._setStyle, this, [e]))
  11832. };
  11833. b.drawRect = function(b, a, e, g) {
  11834. this.commandQueue.push(new c(function(a, b, c, e) {
  11835. var d = this.renderContext;
  11836. this.canvasContext.beginPath();
  11837. this.canvasContext.rect(d._transformTx + a, d._transformTy + b, c, e);
  11838. this.canvasContext.closePath()
  11839. },
  11840. this, [b, a, e, g]));
  11841. this._fill()
  11842. };
  11843. b.drawCircle = function(b, a, e) {
  11844. this.commandQueue.push(new c(function(a, b, c) {
  11845. var e = this.renderContext;
  11846. this.canvasContext.beginPath();
  11847. this.canvasContext.arc(e._transformTx + a, e._transformTy + b, c, 0, 2 * Math.PI);
  11848. this.canvasContext.closePath()
  11849. },
  11850. this, [b, a, e]));
  11851. this._fill()
  11852. };
  11853. b.drawRoundRect = function(b, a, e, g, f, m) {
  11854. this.commandQueue.push(new c(function(a, b, c, e, d, g) {
  11855. var f = this.renderContext;
  11856. a = f._transformTx + a;
  11857. b = f._transformTy + b;
  11858. d /= 2;
  11859. g = g ? g / 2 : d;
  11860. c = a + c;
  11861. e = b + e;
  11862. f = e - g;
  11863. this.canvasContext.beginPath();
  11864. this.canvasContext.moveTo(c, f);
  11865. this.canvasContext.quadraticCurveTo(c, e, c - d, e);
  11866. this.canvasContext.lineTo(a + d, e);
  11867. this.canvasContext.quadraticCurveTo(a, e, a, e - g);
  11868. this.canvasContext.lineTo(a, b + g);
  11869. this.canvasContext.quadraticCurveTo(a, b, a + d, b);
  11870. this.canvasContext.lineTo(c - d, b);
  11871. this.canvasContext.quadraticCurveTo(c, b, c, b + g);
  11872. this.canvasContext.lineTo(c, f);
  11873. this.canvasContext.closePath()
  11874. },
  11875. this, [b, a, e, g, f, m]));
  11876. this._fill()
  11877. };
  11878. b.drawEllipse = function(b, a, e, g) {
  11879. this.commandQueue.push(new c(function(a, b, c, e) {
  11880. var d = this.renderContext;
  11881. this.canvasContext.save();
  11882. a = d._transformTx + a;
  11883. b = d._transformTy + b;
  11884. var d = c > e ? c: e,
  11885. g = c / d;
  11886. e /= d;
  11887. this.canvasContext.scale(g, e);
  11888. this.canvasContext.beginPath();
  11889. this.canvasContext.moveTo((a + c) / g, b / e);
  11890. this.canvasContext.arc(a / g, b / e, d, 0, 2 * Math.PI);
  11891. this.canvasContext.closePath();
  11892. this.canvasContext.restore();
  11893. this.canvasContext.stroke()
  11894. },
  11895. this, [b, a, e, g]));
  11896. this._fill()
  11897. };
  11898. b.lineStyle = function(b, a, e, g, f, m, l, h) {
  11899. "undefined" === typeof b && (b = NaN);
  11900. "undefined" === typeof a && (a = 0);
  11901. "undefined" === typeof e && (e = 1);
  11902. "undefined" === typeof g && (g = !1);
  11903. "undefined" === typeof f && (f = "normal");
  11904. "undefined" === typeof m && (m = null);
  11905. "undefined" === typeof l && (l = null);
  11906. "undefined" === typeof h && (h = 3);
  11907. this.strokeStyleColor && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  11908. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  11909. this.commandQueue.push(new c(function(a, b) {
  11910. this.canvasContext.lineWidth = a;
  11911. this.canvasContext.strokeStyle = b;
  11912. this.canvasContext.beginPath()
  11913. },
  11914. this, [b, a]));
  11915. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  11916. this.moveTo(this.lineX, this.lineY)
  11917. };
  11918. b.lineTo = function(b, a) {
  11919. this.commandQueue.push(new c(function(a, b) {
  11920. var c = this.renderContext;
  11921. this.canvasContext.lineTo(c._transformTx + a, c._transformTy + b)
  11922. },
  11923. this, [b, a]));
  11924. this.lineX = b;
  11925. this.lineY = a
  11926. };
  11927. b.curveTo = function(b, a, e, g) {
  11928. this.commandQueue.push(new c(function(a, b, c, e) {
  11929. var d = this.renderContext;
  11930. this.canvasContext.quadraticCurveTo(d._transformTx + a, d._transformTy + b, c, e)
  11931. },
  11932. this, [b, a, e, g]));
  11933. this.lineX = e;
  11934. this.lineY = g
  11935. };
  11936. b.moveTo = function(b, a) {
  11937. this.commandQueue.push(new c(function(a, b) {
  11938. var c = this.renderContext;
  11939. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  11940. },
  11941. this, [b, a]))
  11942. };
  11943. b.clear = function() {
  11944. this.lineY = this.lineX = this.commandQueue.length = 0;
  11945. this.fillStyleColor = this.strokeStyleColor = null
  11946. };
  11947. b.createEndFillCommand = function() {
  11948. this.endFillCommand || (this.endFillCommand = new c(function() {
  11949. this.canvasContext.fill();
  11950. this.canvasContext.closePath()
  11951. },
  11952. this, null))
  11953. };
  11954. b.endFill = function() {
  11955. null != this.fillStyleColor && this._fill();
  11956. this.fillStyleColor = null
  11957. };
  11958. b._fill = function() {
  11959. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  11960. };
  11961. b.createEndLineCommand = function() {
  11962. this.endLineCommand || (this.endLineCommand = new c(function() {
  11963. this.canvasContext.stroke();
  11964. this.canvasContext.closePath()
  11965. },
  11966. this, null))
  11967. };
  11968. b._draw = function(b) {
  11969. this.renderContext = b;
  11970. b = this.canvasContext = this.renderContext.canvasContext;
  11971. b.save();
  11972. var a = this.commandQueue.length;
  11973. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  11974. for (var c = 0; c < a; c++) {
  11975. var g = this.commandQueue[c];
  11976. g.method.apply(g.thisObject, g.args)
  11977. }
  11978. b.restore()
  11979. };
  11980. var c = function() {
  11981. return function(b, a, c) {
  11982. this.method = b;
  11983. this.thisObject = a;
  11984. this.args = c
  11985. }
  11986. } ();
  11987. c.prototype.__class__ = "Command";
  11988. b._setStyle = function(b) {
  11989. this.canvasContext.fillStyle = b;
  11990. this.canvasContext.beginPath()
  11991. };
  11992. b.init = function() {
  11993. for (var c in b) egret.Graphics.prototype[c] = b[c];
  11994. egret.RendererContext.createRendererContext = function(a) {
  11995. return new egret.HTML5CanvasRenderer(a)
  11996. }
  11997. }
  11998. })(egret_h5_graphics || (egret_h5_graphics = {}));
  11999. egret_h5_graphics.init();
  12000. __extends = this.__extends ||
  12001. function(b, c) {
  12002. function d() {
  12003. this.constructor = b
  12004. }
  12005. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12006. d.prototype = c.prototype;
  12007. b.prototype = new d
  12008. }; (function(b) {
  12009. var c = function(c) {
  12010. function a(a) {
  12011. c.call(this);
  12012. this.size = 2E3;
  12013. this.vertSize = 6;
  12014. this.contextLost = !1;
  12015. this.glContextId = 0;
  12016. this.currentBlendMode = "";
  12017. this.currentBaseTexture = null;
  12018. this.currentBatchSize = 0;
  12019. this.maskList = [];
  12020. this.maskDataFreeList = [];
  12021. this.canvasContext = document.createElement("canvas").getContext("2d");
  12022. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  12023. this.canvas = a;
  12024. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  12025. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  12026. this.projectionX = a.width / 2;
  12027. this.projectionY = -a.height / 2;
  12028. a = 6 * this.size;
  12029. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  12030. this.indices = new Uint16Array(a);
  12031. for (var g = 0,
  12032. f = 0; g < a; g += 6, f += 4) this.indices[g + 0] = f + 0,
  12033. this.indices[g + 1] = f + 1,
  12034. this.indices[g + 2] = f + 2,
  12035. this.indices[g + 3] = f + 0,
  12036. this.indices[g + 4] = f + 2,
  12037. this.indices[g + 5] = f + 3;
  12038. this.initWebGL();
  12039. this.shaderManager = new b.WebGLShaderManager(this.gl);
  12040. this.worldTransform = new b.Matrix;
  12041. this.initBlendMode();
  12042. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  12043. b.TextField.prototype._draw = function(a) {
  12044. this.getDirty() && (this.cacheAsBitmap = !0);
  12045. b.DisplayObject.prototype._draw.call(this, a)
  12046. }
  12047. }
  12048. __extends(a, c);
  12049. a.prototype.handleContextLost = function() {
  12050. this.contextLost = !0
  12051. };
  12052. a.prototype.handleContextRestored = function() {
  12053. this.initWebGL();
  12054. this.shaderManager.setContext(this.gl);
  12055. this.contextLost = !1
  12056. };
  12057. a.prototype.initWebGL = function() {
  12058. for (var a = {
  12059. stencil: !0
  12060. },
  12061. b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  12062. try {
  12063. b = this.canvas.getContext(c[d], a)
  12064. } catch(l) {}
  12065. if (b) break
  12066. }
  12067. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  12068. this.setContext(b)
  12069. };
  12070. a.prototype.setContext = function(a) {
  12071. this.gl = a;
  12072. a.id = this.glContextId++;
  12073. this.vertexBuffer = a.createBuffer();
  12074. this.indexBuffer = a.createBuffer();
  12075. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  12076. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  12077. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  12078. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  12079. a.disable(a.DEPTH_TEST);
  12080. a.disable(a.CULL_FACE);
  12081. a.enable(a.BLEND);
  12082. a.colorMask(!0, !0, !0, !0)
  12083. };
  12084. a.prototype.initBlendMode = function() {
  12085. a.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  12086. a.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  12087. };
  12088. a.prototype.start = function() {
  12089. if (!this.contextLost) {
  12090. var a = this.gl;
  12091. a.activeTexture(a.TEXTURE0);
  12092. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  12093. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  12094. var b = this.shaderManager.defaultShader;
  12095. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  12096. var c = 4 * this.vertSize;
  12097. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  12098. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  12099. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  12100. }
  12101. };
  12102. a.prototype.clearScreen = function() {
  12103. var a = this.gl;
  12104. a.colorMask(!0, !0, !0, !0);
  12105. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, m = c.length; d < m; d++) {
  12106. var l = c[d];
  12107. a.viewport(l.x, l.y, l.width, l.height);
  12108. a.bindFramebuffer(a.FRAMEBUFFER, null);
  12109. a.clearColor(0, 0, 0, 0);
  12110. a.clear(a.COLOR_BUFFER_BIT)
  12111. }
  12112. this.renderCost = 0
  12113. };
  12114. a.prototype.setBlendMode = function(c) {
  12115. c || (c = b.BlendMode.NORMAL);
  12116. if (this.currentBlendMode != c) {
  12117. var d = a.blendModesWebGL[c];
  12118. d && (this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = c)
  12119. }
  12120. };
  12121. a.prototype.drawImage = function(a, c, d, m, l, h, k, p, n) {
  12122. if (!this.contextLost) {
  12123. var q = b.MainContext.instance.rendererContext.texture_scale_factor;
  12124. c /= q;
  12125. d /= q;
  12126. m /= q;
  12127. l /= q;
  12128. this.createWebGLTexture(a);
  12129. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(),
  12130. this.currentBaseTexture = a.webGLTexture;
  12131. var t = this.worldTransform,
  12132. r = t.a,
  12133. s = t.b,
  12134. u = t.c,
  12135. v = t.d,
  12136. x = t.tx,
  12137. y = t.ty;
  12138. 0 == h && 0 == k || t.append(1, 0, 0, 1, h, k);
  12139. 1 == m / p && 1 == l / n || t.append(p / m, 0, 0, n / l, 0, 0);
  12140. h = t.a;
  12141. k = t.b;
  12142. p = t.c;
  12143. n = t.d;
  12144. var q = t.tx,
  12145. w = t.ty;
  12146. t.a = r;
  12147. t.b = s;
  12148. t.c = u;
  12149. t.d = v;
  12150. t.tx = x;
  12151. t.ty = y;
  12152. r = a._sourceWidth;
  12153. s = a._sourceHeight;
  12154. a = m;
  12155. t = l;
  12156. c /= r;
  12157. d /= s;
  12158. m /= r;
  12159. l /= s;
  12160. r = this.vertices;
  12161. s = 4 * this.currentBatchSize * this.vertSize;
  12162. u = this.worldAlpha;
  12163. r[s++] = q;
  12164. r[s++] = w;
  12165. r[s++] = c;
  12166. r[s++] = d;
  12167. r[s++] = u;
  12168. r[s++] = 16777215;
  12169. r[s++] = h * a + q;
  12170. r[s++] = k * a + w;
  12171. r[s++] = m + c;
  12172. r[s++] = d;
  12173. r[s++] = u;
  12174. r[s++] = 16777215;
  12175. r[s++] = h * a + p * t + q;
  12176. r[s++] = n * t + k * a + w;
  12177. r[s++] = m + c;
  12178. r[s++] = l + d;
  12179. r[s++] = u;
  12180. r[s++] = 16777215;
  12181. r[s++] = p * t + q;
  12182. r[s++] = n * t + w;
  12183. r[s++] = c;
  12184. r[s++] = l + d;
  12185. r[s++] = u;
  12186. r[s++] = 16777215;
  12187. this.currentBatchSize++
  12188. }
  12189. };
  12190. a.prototype._draw = function() {
  12191. if (0 != this.currentBatchSize && !this.contextLost) {
  12192. var a = b.getTimer();
  12193. this.start();
  12194. var c = this.gl;
  12195. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  12196. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  12197. c.bufferSubData(c.ARRAY_BUFFER, 0, d);
  12198. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  12199. this.currentBatchSize = 0;
  12200. this.renderCost += b.getTimer() - a;
  12201. b.Profiler.getInstance().onDrawImage()
  12202. }
  12203. };
  12204. a.prototype.setTransform = function(a) {
  12205. var b = this.worldTransform;
  12206. b.a = a.a;
  12207. b.b = a.b;
  12208. b.c = a.c;
  12209. b.d = a.d;
  12210. b.tx = a.tx;
  12211. b.ty = a.ty
  12212. };
  12213. a.prototype.setAlpha = function(a, b) {
  12214. this.worldAlpha = a;
  12215. this.setBlendMode(b)
  12216. };
  12217. a.prototype.createWebGLTexture = function(a) {
  12218. if (!a.webGLTexture) {
  12219. var b = this.gl;
  12220. a.webGLTexture = b.createTexture();
  12221. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  12222. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  12223. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  12224. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  12225. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  12226. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  12227. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  12228. b.bindTexture(b.TEXTURE_2D, null)
  12229. }
  12230. };
  12231. a.prototype.pushMask = function(a) {
  12232. this._draw();
  12233. var b = this.gl;
  12234. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  12235. var c = this.maskDataFreeList.pop();
  12236. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  12237. x: a.x,
  12238. y: a.y,
  12239. w: a.width,
  12240. h: a.height
  12241. };
  12242. this.maskList.push(c);
  12243. b.colorMask(!1, !1, !1, !1);
  12244. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  12245. this.renderGraphics(c);
  12246. b.colorMask(!0, !0, !0, !0);
  12247. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  12248. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  12249. };
  12250. a.prototype.popMask = function() {
  12251. this._draw();
  12252. var a = this.gl,
  12253. b = this.maskList.pop();
  12254. b && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(b), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(b));
  12255. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  12256. };
  12257. a.prototype.setupFont = function(a) {
  12258. var b = this.canvasContext,
  12259. c = a.italic ? "italic ": "normal ",
  12260. c = c + (a.bold ? "bold ": "normal "),
  12261. c = c + (a.size + "px " + a.fontFamily);
  12262. b.font = c;
  12263. b.textAlign = "left";
  12264. b.textBaseline = "middle"
  12265. };
  12266. a.prototype.measureText = function(a) {
  12267. return this.canvasContext.measureText(a).width
  12268. };
  12269. a.prototype.renderGraphics = function(a) {
  12270. var b = this.gl,
  12271. c = this.shaderManager.primitiveShader;
  12272. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  12273. this.updateGraphics(a);
  12274. this.shaderManager.activateShader(c);
  12275. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  12276. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  12277. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  12278. b.uniform2f(c.offsetVector, 0, 0);
  12279. b.uniform3fv(c.tintColor, [1, 1, 1]);
  12280. b.uniform1f(c.alpha, this.worldAlpha);
  12281. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  12282. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  12283. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  12284. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  12285. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  12286. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  12287. };
  12288. a.prototype.updateGraphics = function(a) {
  12289. var b = this.gl;
  12290. this.buildRectangle(a);
  12291. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  12292. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  12293. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  12294. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  12295. };
  12296. a.prototype.buildRectangle = function(a) {
  12297. var b = a.x,
  12298. c = a.y,
  12299. d = a.w;
  12300. a = a.h;
  12301. var l = this.graphicsPoints,
  12302. h = this.graphicsIndices,
  12303. k = l.length / 6;
  12304. l.push(b, c);
  12305. l.push(0, 0, 0, 1);
  12306. l.push(b + d, c);
  12307. l.push(0, 0, 0, 1);
  12308. l.push(b, c + a);
  12309. l.push(0, 0, 0, 1);
  12310. l.push(b + d, c + a);
  12311. l.push(0, 0, 0, 1);
  12312. h.push(k, k, k + 1, k + 2, k + 3, k + 3)
  12313. };
  12314. a.blendModesWebGL = {};
  12315. return a
  12316. } (b.RendererContext);
  12317. b.WebGLRenderer = c;
  12318. c.prototype.__class__ = "egret.WebGLRenderer"
  12319. })(egret || (egret = {})); (function(b) {
  12320. var c = function() {
  12321. function b() {}
  12322. b.compileProgram = function(a, c, g) {
  12323. g = b.compileFragmentShader(a, g);
  12324. c = b.compileVertexShader(a, c);
  12325. var f = a.createProgram();
  12326. a.attachShader(f, c);
  12327. a.attachShader(f, g);
  12328. a.linkProgram(f);
  12329. a.getProgramParameter(f, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  12330. return f
  12331. };
  12332. b.compileFragmentShader = function(a, c) {
  12333. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  12334. };
  12335. b.compileVertexShader = function(a, c) {
  12336. return b._compileShader(a, c, a.VERTEX_SHADER)
  12337. };
  12338. b._compileShader = function(a, b, c) {
  12339. c = a.createShader(c);
  12340. a.shaderSource(c, b);
  12341. a.compileShader(c);
  12342. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (console.log(a.getShaderInfoLog(c)), null)
  12343. };
  12344. b.checkCanUseWebGL = function() {
  12345. if (void 0 == b.canUseWebGL) try {
  12346. var a = document.createElement("canvas");
  12347. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  12348. } catch(c) {
  12349. b.canUseWebGL = !1
  12350. }
  12351. return b.canUseWebGL
  12352. };
  12353. return b
  12354. } ();
  12355. b.WebGLUtils = c;
  12356. c.prototype.__class__ = "egret.WebGLUtils"
  12357. })(egret || (egret = {})); (function(b) {
  12358. var c = function() {
  12359. function b(a) {
  12360. this.maxAttibs = 10;
  12361. this.attribState = [];
  12362. this.tempAttribState = [];
  12363. for (var c = 0; c < this.maxAttibs; c++) this.attribState[c] = !1;
  12364. this.setContext(a)
  12365. }
  12366. b.prototype.setContext = function(b) {
  12367. this.gl = b;
  12368. this.primitiveShader = new a(b);
  12369. this.defaultShader = new d(b);
  12370. this.activateShader(this.defaultShader)
  12371. };
  12372. b.prototype.activateShader = function(a) {
  12373. this.gl.useProgram(a.program);
  12374. this.setAttribs(a.attributes)
  12375. };
  12376. b.prototype.setAttribs = function(a) {
  12377. var b, c;
  12378. c = this.tempAttribState.length;
  12379. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  12380. c = a.length;
  12381. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  12382. a = this.gl;
  12383. c = this.attribState.length;
  12384. 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))
  12385. };
  12386. return b
  12387. } ();
  12388. b.WebGLShaderManager = c;
  12389. c.prototype.__class__ = "egret.WebGLShaderManager";
  12390. var d = function() {
  12391. function a(b) {
  12392. 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 vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  12393. this.program = null;
  12394. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  12395. this.gl = b;
  12396. this.init()
  12397. }
  12398. a.prototype.init = function() {
  12399. var a = this.gl,
  12400. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  12401. a.useProgram(c);
  12402. this.uSampler = a.getUniformLocation(c, "uSampler");
  12403. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  12404. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  12405. this.dimensions = a.getUniformLocation(c, "dimensions");
  12406. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  12407. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  12408. this.colorAttribute = a.getAttribLocation(c, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  12409. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  12410. this.program = c
  12411. };
  12412. return a
  12413. } ();
  12414. b.EgretShader = d;
  12415. d.prototype.__class__ = "egret.EgretShader";
  12416. var a = function() {
  12417. function a(b) {
  12418. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  12419. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  12420. 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}";
  12421. this.gl = b;
  12422. this.init()
  12423. }
  12424. a.prototype.init = function() {
  12425. var a = this.gl,
  12426. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  12427. a.useProgram(c);
  12428. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  12429. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  12430. this.tintColor = a.getUniformLocation(c, "tint");
  12431. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  12432. this.colorAttribute = a.getAttribLocation(c, "aColor");
  12433. this.attributes = [this.aVertexPosition, this.colorAttribute];
  12434. this.translationMatrix = a.getUniformLocation(c, "translationMatrix");
  12435. this.alpha = a.getUniformLocation(c, "alpha");
  12436. this.program = c
  12437. };
  12438. return a
  12439. } ();
  12440. b.PrimitiveShader = a;
  12441. a.prototype.__class__ = "egret.PrimitiveShader"
  12442. })(egret || (egret = {}));
  12443. __extends = this.__extends ||
  12444. function(b, c) {
  12445. function d() {
  12446. this.constructor = b
  12447. }
  12448. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12449. d.prototype = c.prototype;
  12450. b.prototype = new d
  12451. }; (function(b) {
  12452. var c = function(c) {
  12453. function a() {
  12454. c.call(this)
  12455. }
  12456. __extends(a, c);
  12457. a.prototype.proceed = function(a) {
  12458. function c(d) {
  12459. b.IOErrorEvent.dispatchIOErrorEvent(a)
  12460. }
  12461. function d(c) {
  12462. switch (a.dataFormat) {
  12463. case b.URLLoaderDataFormat.TEXT:
  12464. a.data = l.responseText;
  12465. break;
  12466. case b.URLLoaderDataFormat.VARIABLES:
  12467. a.data = new b.URLVariables(l.responseText);
  12468. break;
  12469. case b.URLLoaderDataFormat.BINARY:
  12470. a.data = l.response;
  12471. break;
  12472. default:
  12473. a.data = l.responseText
  12474. }
  12475. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  12476. }
  12477. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  12478. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  12479. else {
  12480. var m = a._request,
  12481. l = this.getXHR();
  12482. l.onerror = c;
  12483. l.onload = d;
  12484. l.open(m.method, m.url, !0);
  12485. this.setResponseType(l, a.dataFormat);
  12486. m.method != b.URLRequestMethod.GET && m.data ? m.data instanceof b.URLVariables ? (l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), l.send(m.data.toString())) : (l.setRequestHeader("Content-Type", "multipart/form-data"), l.send(m.data)) : l.send()
  12487. }
  12488. };
  12489. a.prototype.loadSound = function(a) {
  12490. function c(l) {
  12491. window.clearTimeout(m.__timeoutId);
  12492. m.removeEventListener("canplaythrough", c, !1);
  12493. m.removeEventListener("error", d, !1);
  12494. l = new b.Sound;
  12495. l._setAudio(m);
  12496. a.data = l;
  12497. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  12498. }
  12499. function d(l) {
  12500. window.clearTimeout(m.__timeoutId);
  12501. m.removeEventListener("canplaythrough", c, !1);
  12502. m.removeEventListener("error", d, !1);
  12503. b.IOErrorEvent.dispatchIOErrorEvent(a)
  12504. }
  12505. var m = new Audio(a._request.url);
  12506. m.__timeoutId = window.setTimeout(c, 100);
  12507. m.addEventListener("canplaythrough", c, !1);
  12508. m.addEventListener("error", d, !1);
  12509. m.load()
  12510. };
  12511. a.prototype.getXHR = function() {
  12512. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  12513. };
  12514. a.prototype.setResponseType = function(a, c) {
  12515. switch (c) {
  12516. case b.URLLoaderDataFormat.TEXT:
  12517. case b.URLLoaderDataFormat.VARIABLES:
  12518. a.responseType = b.URLLoaderDataFormat.TEXT;
  12519. break;
  12520. case b.URLLoaderDataFormat.BINARY:
  12521. a.responseType = "arraybuffer";
  12522. break;
  12523. default:
  12524. a.responseType = c
  12525. }
  12526. };
  12527. a.prototype.loadTexture = function(a) {
  12528. var c = a._request,
  12529. d = new Image;
  12530. d.crossOrigin = "Anonymous";
  12531. d.onload = function(c) {
  12532. d.onerror = null;
  12533. d.onload = null;
  12534. c = new b.Texture;
  12535. c._setBitmapData(d);
  12536. a.data = c;
  12537. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  12538. };
  12539. d.onerror = function(c) {
  12540. d.onerror = null;
  12541. d.onload = null;
  12542. b.IOErrorEvent.dispatchIOErrorEvent(a)
  12543. };
  12544. d.src = c.url
  12545. };
  12546. return a
  12547. } (b.NetContext);
  12548. b.HTML5NetContext = c;
  12549. c.prototype.__class__ = "egret.HTML5NetContext"
  12550. })(egret || (egret = {}));
  12551. __extends = this.__extends ||
  12552. function(b, c) {
  12553. function d() {
  12554. this.constructor = b
  12555. }
  12556. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12557. d.prototype = c.prototype;
  12558. b.prototype = new d
  12559. }; (function(b) {
  12560. var c = function(c) {
  12561. function a(a) {
  12562. c.call(this);
  12563. this.canvas = a;
  12564. this._isTouchDown = !1
  12565. }
  12566. __extends(a, c);
  12567. a.prototype.run = function() {
  12568. var a = this;
  12569. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  12570. function(b) {
  12571. a._onTouchBegin(b);
  12572. b.stopPropagation();
  12573. b.preventDefault()
  12574. },
  12575. !1), this.canvas.addEventListener("MSPointerMove",
  12576. function(b) {
  12577. a._onTouchMove(b);
  12578. b.stopPropagation();
  12579. b.preventDefault()
  12580. },
  12581. !1), this.canvas.addEventListener("MSPointerUp",
  12582. function(b) {
  12583. a._onTouchEnd(b);
  12584. b.stopPropagation();
  12585. b.preventDefault()
  12586. },
  12587. !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  12588. window.addEventListener("mousedown",
  12589. function(b) {
  12590. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  12591. });
  12592. window.addEventListener("mouseup",
  12593. function(b) {
  12594. a._isTouchDown && a.inOutOfCanvas(b) && a.dispatchLeaveStageEvent();
  12595. a._isTouchDown = !1
  12596. })
  12597. };
  12598. a.prototype.addMouseListener = function() {
  12599. var a = this;
  12600. this.canvas.addEventListener("mousedown",
  12601. function(b) {
  12602. a._onTouchBegin(b)
  12603. });
  12604. this.canvas.addEventListener("mousemove",
  12605. function(b) {
  12606. a._onTouchMove(b)
  12607. });
  12608. this.canvas.addEventListener("mouseup",
  12609. function(b) {
  12610. a._onTouchEnd(b)
  12611. })
  12612. };
  12613. a.prototype.addTouchListener = function() {
  12614. var a = this;
  12615. this.canvas.addEventListener("touchstart",
  12616. function(b) {
  12617. for (var c = b.changedTouches.length,
  12618. d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  12619. b.stopPropagation();
  12620. b.preventDefault()
  12621. },
  12622. !1);
  12623. this.canvas.addEventListener("touchmove",
  12624. function(b) {
  12625. for (var c = b.changedTouches.length,
  12626. d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  12627. b.stopPropagation();
  12628. b.preventDefault()
  12629. },
  12630. !1);
  12631. this.canvas.addEventListener("touchend",
  12632. function(b) {
  12633. for (var c = b.changedTouches.length,
  12634. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  12635. b.stopPropagation();
  12636. b.preventDefault()
  12637. },
  12638. !1);
  12639. this.canvas.addEventListener("touchcancel",
  12640. function(b) {
  12641. for (var c = b.changedTouches.length,
  12642. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  12643. b.stopPropagation();
  12644. b.preventDefault()
  12645. },
  12646. !1)
  12647. };
  12648. a.prototype.inOutOfCanvas = function(a) {
  12649. a = this.getLocation(this.canvas, a);
  12650. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  12651. };
  12652. a.prototype.dispatchLeaveStageEvent = function() {
  12653. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  12654. };
  12655. a.prototype._onTouchBegin = function(a) {
  12656. var b = this.getLocation(this.canvas, a),
  12657. c = -1;
  12658. a.hasOwnProperty("identifier") && (c = a.identifier);
  12659. this.onTouchBegan(b.x, b.y, c)
  12660. };
  12661. a.prototype._onTouchMove = function(a) {
  12662. var b = this.getLocation(this.canvas, a),
  12663. c = -1;
  12664. a.hasOwnProperty("identifier") && (c = a.identifier);
  12665. this.onTouchMove(b.x, b.y, c)
  12666. };
  12667. a.prototype._onTouchEnd = function(a) {
  12668. var b = this.getLocation(this.canvas, a),
  12669. c = -1;
  12670. a.hasOwnProperty("identifier") && (c = a.identifier);
  12671. this.onTouchEnd(b.x, b.y, c)
  12672. };
  12673. a.prototype.getLocation = function(a, c) {
  12674. var d = document.documentElement,
  12675. m = window,
  12676. l, h;
  12677. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), l = h.left, h = h.top) : h = l = 0;
  12678. l += m.pageXOffset - d.clientLeft;
  12679. h += m.pageYOffset - d.clientTop;
  12680. null != c.pageX ? (d = c.pageX, m = c.pageY) : (l -= document.body.scrollLeft, h -= document.body.scrollTop, d = c.clientX, m = c.clientY);
  12681. var k = b.Point.identity;
  12682. k.x = (d - l) / b.StageDelegate.getInstance().getScaleX();
  12683. k.y = (m - h) / b.StageDelegate.getInstance().getScaleY();
  12684. return k
  12685. };
  12686. return a
  12687. } (b.TouchContext);
  12688. b.HTML5TouchContext = c;
  12689. c.prototype.__class__ = "egret.HTML5TouchContext"
  12690. })(egret || (egret = {}));
  12691. var __extends = this.__extends ||
  12692. function(b, c) {
  12693. function d() {
  12694. this.constructor = b
  12695. }
  12696. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12697. d.prototype = c.prototype;
  12698. b.prototype = new d
  12699. },
  12700. LoadingUI = function(b) {
  12701. function c() {
  12702. b.call(this);
  12703. this.createView()
  12704. }
  12705. __extends(c, b);
  12706. c.prototype.createView = function() {
  12707. this.textField = new egret.TextField;
  12708. this.addChild(this.textField);
  12709. this.textField.y = 300;
  12710. this.textField.width = 480;
  12711. this.textField.height = 100;
  12712. this.textField.textAlign = "center"
  12713. };
  12714. c.prototype.setProgress = function(b, a) {
  12715. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + b + "/" + a
  12716. };
  12717. return c
  12718. } (egret.Sprite);
  12719. LoadingUI.prototype.__class__ = "LoadingUI";
  12720. var __extends = this.__extends ||
  12721. function(b, c) {
  12722. function d() {
  12723. this.constructor = b
  12724. }
  12725. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12726. d.prototype = c.prototype;
  12727. b.prototype = new d
  12728. },
  12729. MyBtn = function(b) {
  12730. function c() {
  12731. b.call(this);
  12732. this.isRight = !1
  12733. }
  12734. __extends(c, b);
  12735. c.prototype.createView = function(b, a, c) {
  12736. this.touchChildren = !1;
  12737. this.touchEnabled = !0;
  12738. this.sprite = new egret.Sprite;
  12739. this.sprite.graphics.beginFill(c);
  12740. this.sprite.graphics.drawRect(0, 0, 130, 60);
  12741. this.sprite.graphics.endFill();
  12742. this.addChild(this.sprite);
  12743. this.textField = new egret.TextField;
  12744. this.addChild(this.textField);
  12745. this.textField.width = 130;
  12746. this.textField.text = b;
  12747. this.textField.textColor = a;
  12748. this.textField.textAlign = "center";
  12749. this.textField.bold = !0;
  12750. this.textField.size = 40;
  12751. this.textField.y = (60 - this.textField.height) / 2
  12752. };
  12753. c.prototype.setLabelText = function(b) {
  12754. this.textField.text = b
  12755. };
  12756. return c
  12757. } (egret.Sprite);
  12758. MyBtn.prototype.__class__ = "MyBtn";
  12759. var __extends = this.__extends ||
  12760. function(b, c) {
  12761. function d() {
  12762. this.constructor = b
  12763. }
  12764. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  12765. d.prototype = c.prototype;
  12766. b.prototype = new d
  12767. },
  12768. Main = function(b) {
  12769. function c() {
  12770. b.call(this);
  12771. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  12772. }
  12773. __extends(c, b);
  12774. c.prototype.onAddToStage = function(b) {
  12775. this.loadingView = new LoadingUI;
  12776. this.stage.addChild(this.loadingView);
  12777. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  12778. RES.loadConfig("resource/resource.json", "resource/")
  12779. };
  12780. c.prototype.onConfigComplete = function(b) {
  12781. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  12782. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  12783. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  12784. RES.loadGroup("preload")
  12785. };
  12786. c.prototype.onResourceLoadComplete = function(b) {
  12787. "preload" == b.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  12788. };
  12789. c.prototype.onResourceProgress = function(b) {
  12790. "preload" == b.groupName && this.loadingView.setProgress(b.itemsLoaded, b.itemsTotal)
  12791. };
  12792. c.prototype.createGameScene = function() {
  12793. document.title = "\u662f\u7537\u4eba\u575a\u630160\u79d2\uff01";
  12794. this.gameText = new egret.TextField;
  12795. this.gameText.width = 405;
  12796. this.gameText.size = 40;
  12797. this.gameText.text = "\u662f\u7537\u4eba\u575a\u630160\u79d2";
  12798. this.addChild(this.gameText);
  12799. this.gameText.textAlign = "center";
  12800. this.gameText.bold = !0;
  12801. this.gameText.textColor = 7349024;
  12802. this.gameText.y = 30;
  12803. var b = this.createBitmapByName("man");
  12804. this.man = new egret.Sprite;
  12805. this.man.addChild(b);
  12806. this.man.anchorOffsetX = 96;
  12807. this.man.anchorOffsetY = 270;
  12808. this.man.x = 215;
  12809. this.man.y = 380;
  12810. this.addChild(this.man);
  12811. this.gameBtn = new MyBtn;
  12812. this.gameBtn.createView("\u5f00\u59cb", 16777215, 7349024);
  12813. this.addChild(this.gameBtn);
  12814. this.gameBtn.x = 138;
  12815. this.gameBtn.y = 490;
  12816. this.gameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGameBtnClick, this);
  12817. b = this.createBitmapByName("btn");
  12818. b.rotation = 180;
  12819. this.lBtn = new egret.Sprite;
  12820. this.lBtn.addChild(b);
  12821. this.lBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.lBtnClick, this);
  12822. this.lBtn.x = 75;
  12823. this.lBtn.y = 500;
  12824. this.lBtn.touchEnabled = !0;
  12825. b = this.createBitmapByName("btn");
  12826. this.rBtn = new egret.Sprite;
  12827. this.rBtn.addChild(b);
  12828. this.rBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.rBtnClick, this);
  12829. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.thisTap, this);
  12830. this.rBtn.touchEnabled = !0;
  12831. this.rBtn.x = 330;
  12832. this.rBtn.y = 460;
  12833. this.gameTimer = new egret.Timer(100);
  12834. this.gameTimer.addEventListener(egret.TimerEvent.TIMER, this.onGameTimer, this);
  12835. this.touchEnabled = !0
  12836. };
  12837. c.prototype.thisTap = function(b) {
  12838. this.nr = 202.5 < b.stageX ? this.nr + (1 * Math.random() + 1) : this.nr + -(1 * Math.random() + 1)
  12839. };
  12840. c.prototype.onGameTimer = function(b) {
  12841. this.nr *= 1.1;
  12842. this.man.rotation += this.nr;
  12843. this.gameText.text = (this.gameTimer.currentCount() / 10).toString();
  12844. if (75 < this.man.rotation || -75 > this.man.rotation) {
  12845. this.wx = this.createBitmapByName("wx");
  12846. this.addChild(this.wx);
  12847. b = this.stage.stageWidth;
  12848. this.wx.width = 80;
  12849. this.wx.height = 21.6;
  12850. this.wx.x = b - this.wx.width;
  12851. this.wx.y = 0;
  12852. b = this.gameText.text;
  12853. this.gameText.text = "\u4f60\u624d\u575a\u6301\u4e86" + b + "\u79d2";
  12854. // updateShare(b);
  12855. // Play68.setRankingScoreDesc(b);
  12856. var a = this.gameTimer.currentCount() / 10 / 100 + 0.5;
  12857. 0.99 < a && (a = 0.99);
  12858. a = 1E4 * a >> 0;
  12859. a /= 100;
  12860. document.title = "\u6211\u575a\u6301\u4e86" + b + "\u79d2\uff0c\u8d85\u8fc7\u4e86\u5168\u56fd" + a + "%\u7684\u4eba\uff01\u4f60\u80fd\u8d85\u8fc7\u6211\u5417\uff1f\u5feb\u6765\u6311\u6218\u5427\uff01";
  12861. this.gameBtn.setLabelText("\u91cd\u6765");
  12862. this.addChild(this.gameBtn);
  12863. this.gameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onReGameBtnClick, this);
  12864. this.gameTimer.reset()
  12865. }
  12866. };
  12867. c.prototype.onReGameBtnClick = function(b) {
  12868. document.title = "\u662f\u7537\u4eba\u575a\u630160\u79d2\uff01";
  12869. this.removeChild(this.wx);
  12870. this.removeChild(this.gameBtn);
  12871. this.gameBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onReGameBtnClick, this);
  12872. this.beginGame()
  12873. };
  12874. c.prototype.onGameBtnClick = function(b) {
  12875. this.removeChild(this.gameBtn);
  12876. this.gameBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGameBtnClick, this);
  12877. this.beginGame()
  12878. };
  12879. c.prototype.beginGame = function() {
  12880. // updateShare(0);
  12881. this.man.rotation = 0;
  12882. this.nr = Math.random() + 0.5;
  12883. this.gameTimer.reset();
  12884. this.gameTimer.start();
  12885. this.addChild(this.lBtn);
  12886. this.addChild(this.rBtn)
  12887. };
  12888. c.prototype.lBtnClick = function(b) {};
  12889. c.prototype.rBtnClick = function(b) {};
  12890. c.prototype.createBitmapByName = function(b) {
  12891. var a = new egret.Bitmap;
  12892. b = RES.getRes(b);
  12893. a.texture = b;
  12894. return a
  12895. };
  12896. c.prototype.mySort = function(b, a) {
  12897. return b > a ? 1 : -1
  12898. };
  12899. return c
  12900. } (egret.DisplayObjectContainer);
  12901. Main.prototype.__class__ = "Main";