game-min.js 290 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858
  1. !function(){
  2. window.egret = {};
  3. (function(b) {
  4. var d = function() {
  5. function b() {
  6. this._hashCode = b.hashCount++
  7. }
  8. Object.defineProperty(b.prototype, "hashCode", {
  9. get: function() {
  10. return this._hashCode
  11. },
  12. enumerable: !0,
  13. configurable: !0
  14. });
  15. b.hashCount = 1;
  16. return b
  17. }();
  18. b.HashObject = d;
  19. d.prototype.__class__ = "egret.HashObject"
  20. })(egret);
  21. var __extends = this.__extends || function(b, d) {
  22. function c() {
  23. this.constructor = b
  24. }
  25. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  26. c.prototype = d.prototype;
  27. b.prototype = new c
  28. };
  29. (function(b) {
  30. var d = function(b) {
  31. function a(e) {
  32. "undefined" === typeof e && (e = 300);
  33. b.call(this);
  34. this.objectPool = [];
  35. this._length = 0;
  36. 1 > e && (e = 1);
  37. this.autoDisposeTime = e;
  38. this.frameCount = 0
  39. }
  40. __extends(a, b);
  41. a.prototype._checkFrame = function() {
  42. this.frameCount--;
  43. 0 >= this.frameCount && this.dispose()
  44. };
  45. Object.defineProperty(a.prototype, "length", {
  46. get: function() {
  47. return this._length
  48. },
  49. enumerable: !0,
  50. configurable: !0
  51. });
  52. a.prototype.push = function(e) {
  53. var h = this.objectPool; - 1 == h.indexOf(e) && (h.push(e), this._length++, 0 == this.frameCount &&
  54. (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  55. };
  56. a.prototype.pop = function() {
  57. if (0 == this._length) return null;
  58. this._length--;
  59. return this.objectPool.pop()
  60. };
  61. a.prototype.dispose = function() {
  62. 0 < this._length && (this.objectPool = [], this._length = 0);
  63. this.frameCount = 0;
  64. var e = a._callBackList,
  65. h = e.indexOf(this); - 1 != h && e.splice(h, 1)
  66. };
  67. a._callBackList = [];
  68. return a
  69. }(b.HashObject);
  70. b.Recycler = d;
  71. d.prototype.__class__ = "egret.Recycler"
  72. })(egret);
  73. (function(b) {
  74. b.__START_TIME;
  75. b.getTimer = function() {
  76. return Date.now() - b.__START_TIME
  77. }
  78. })(egret);
  79. (function(b) {
  80. b.__callLaterFunctionList = [];
  81. b.__callLaterThisList = [];
  82. b.__callLaterArgsList = [];
  83. b.callLater = function(d, c) {
  84. for (var a = [], e = 0; e < arguments.length - 2; e++) a[e] = arguments[e + 2];
  85. b.__callLaterFunctionList.push(d);
  86. b.__callLaterThisList.push(c);
  87. b.__callLaterArgsList.push(a)
  88. }
  89. })(egret);
  90. __extends = this.__extends || function(b, d) {
  91. function c() {
  92. this.constructor = b
  93. }
  94. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  95. c.prototype = d.prototype;
  96. b.prototype = new c
  97. };
  98. (function(b) {
  99. var d = function(c) {
  100. function a(e, a, m) {
  101. "undefined" === typeof a && (a = !1);
  102. "undefined" === typeof m && (m = !1);
  103. c.call(this);
  104. this._eventPhase = 2;
  105. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  106. this.isNew = !0;
  107. this._type = e;
  108. this._bubbles = a;
  109. this._cancelable = m
  110. }
  111. __extends(a, c);
  112. Object.defineProperty(a.prototype, "type", {
  113. get: function() {
  114. return this._type
  115. },
  116. enumerable: !0,
  117. configurable: !0
  118. });
  119. Object.defineProperty(a.prototype, "bubbles", {
  120. get: function() {
  121. return this._bubbles
  122. },
  123. enumerable: !0,
  124. configurable: !0
  125. });
  126. Object.defineProperty(a.prototype, "cancelable", {
  127. get: function() {
  128. return this._cancelable
  129. },
  130. enumerable: !0,
  131. configurable: !0
  132. });
  133. Object.defineProperty(a.prototype, "eventPhase", {
  134. get: function() {
  135. return this._eventPhase
  136. },
  137. enumerable: !0,
  138. configurable: !0
  139. });
  140. Object.defineProperty(a.prototype, "currentTarget", {
  141. get: function() {
  142. return this._currentTarget
  143. },
  144. enumerable: !0,
  145. configurable: !0
  146. });
  147. a.prototype._setCurrentTarget = function(e) {
  148. this._currentTarget = e
  149. };
  150. Object.defineProperty(a.prototype, "target", {
  151. get: function() {
  152. return this._target
  153. },
  154. enumerable: !0,
  155. configurable: !0
  156. });
  157. a.prototype.isDefaultPrevented = function() {
  158. return this._isDefaultPrevented
  159. };
  160. a.prototype.preventDefault = function() {
  161. this._cancelable && (this._isDefaultPrevented = !0)
  162. };
  163. a.prototype.stopPropagation = function() {
  164. this._bubbles && (this._isPropagationStopped = !0)
  165. };
  166. a.prototype.stopImmediatePropagation = function() {
  167. this._bubbles && (this._isPropagationImmediateStopped = !0)
  168. };
  169. a.prototype._reset = function() {
  170. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
  171. this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  172. };
  173. a._dispatchByTarget = function(e, a, m, c, d, g) {
  174. "undefined" === typeof d && (d = !1);
  175. "undefined" === typeof g && (g = !1);
  176. var k = e.eventRecycler;
  177. k || (k = e.eventRecycler = new b.Recycler);
  178. var n = k.pop();
  179. n ? n._type = m : n = new e(m);
  180. n._bubbles = d;
  181. n._cancelable = g;
  182. if (c)
  183. for (var p in c) n[p] = c[p], null !== n[p] && (c[p] = null);
  184. e = a.dispatchEvent(n);
  185. k.push(n);
  186. return e
  187. };
  188. a._getPropertyData = function(e) {
  189. var a = e._props;
  190. a || (a = e._props = {});
  191. return a
  192. };
  193. a.dispatchEvent = function(e, h, m, b) {
  194. "undefined" === typeof m && (m = !1);
  195. var c = a._getPropertyData(a);
  196. b && (c.data = b);
  197. a._dispatchByTarget(a, e, h, c, m)
  198. };
  199. a.ADDED_TO_STAGE = "addedToStage";
  200. a.REMOVED_FROM_STAGE = "removedFromStage";
  201. a.ADDED = "added";
  202. a.REMOVED = "removed";
  203. a.COMPLETE = "complete";
  204. a.ENTER_FRAME = "enterFrame";
  205. a.RENDER = "render";
  206. a.FINISH_RENDER = "finishRender";
  207. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  208. a.LEAVE_STAGE = "leaveStage";
  209. a.RESIZE = "resize";
  210. a.CHANGE = "change";
  211. return a
  212. }(b.HashObject);
  213. b.Event =
  214. d;
  215. d.prototype.__class__ = "egret.Event"
  216. })(egret);
  217. __extends = this.__extends || function(b, d) {
  218. function c() {
  219. this.constructor = b
  220. }
  221. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  222. c.prototype = d.prototype;
  223. b.prototype = new c
  224. };
  225. (function(b) {
  226. var d = function(c) {
  227. function a(e, a, m) {
  228. "undefined" === typeof a && (a = !1);
  229. "undefined" === typeof m && (m = !1);
  230. c.call(this, e, a, m)
  231. }
  232. __extends(a, c);
  233. a.dispatchIOErrorEvent = function(e) {
  234. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  235. };
  236. a.IO_ERROR = "ioError";
  237. return a
  238. }(b.Event);
  239. b.IOErrorEvent = d;
  240. d.prototype.__class__ = "egret.IOErrorEvent"
  241. })(egret);
  242. __extends = this.__extends || function(b, d) {
  243. function c() {
  244. this.constructor = b
  245. }
  246. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  247. c.prototype = d.prototype;
  248. b.prototype = new c
  249. };
  250. (function(b) {
  251. var d = function(c) {
  252. function a(e, a, m, b, d, g, k, n, p, q) {
  253. "undefined" === typeof a && (a = !0);
  254. "undefined" === typeof m && (m = !0);
  255. "undefined" === typeof b && (b = 0);
  256. "undefined" === typeof d && (d = 0);
  257. "undefined" === typeof g && (g = 0);
  258. "undefined" === typeof k && (k = !1);
  259. "undefined" === typeof n && (n = !1);
  260. "undefined" === typeof q && (q = !1);
  261. c.call(this, e, a, m);
  262. this._localY = this._localX = this._stageY = this._stageX = 0;
  263. this.touchPointID = b;
  264. this._stageX = d;
  265. this._stageY = g;
  266. this.ctrlKey = k;
  267. this.altKey = n;
  268. this.touchDown = q
  269. }
  270. __extends(a, c);
  271. Object.defineProperty(a.prototype,
  272. "stageX", {
  273. get: function() {
  274. return this._stageX
  275. },
  276. enumerable: !0,
  277. configurable: !0
  278. });
  279. Object.defineProperty(a.prototype, "stageY", {
  280. get: function() {
  281. return this._stageY
  282. },
  283. enumerable: !0,
  284. configurable: !0
  285. });
  286. Object.defineProperty(a.prototype, "localX", {
  287. get: function() {
  288. return this._localX
  289. },
  290. enumerable: !0,
  291. configurable: !0
  292. });
  293. Object.defineProperty(a.prototype, "localY", {
  294. get: function() {
  295. return this._localY
  296. },
  297. enumerable: !0,
  298. configurable: !0
  299. });
  300. a.prototype._setCurrentTarget = function(e) {
  301. c.prototype._setCurrentTarget.call(this, e);
  302. e instanceof
  303. b.DisplayObject && (e = e.globalToLocal(this._stageX, this._stageY, b.Point.identity), this._localX = e.x, this._localY = e.y)
  304. };
  305. a.dispatchTouchEvent = function(e, h, m, c, d, g, k, n, p) {
  306. "undefined" === typeof m && (m = 0);
  307. "undefined" === typeof c && (c = 0);
  308. "undefined" === typeof d && (d = 0);
  309. "undefined" === typeof g && (g = !1);
  310. "undefined" === typeof k && (k = !1);
  311. "undefined" === typeof n && (n = !1);
  312. "undefined" === typeof p && (p = !1);
  313. var q = b.Event._getPropertyData(a);
  314. q.touchPointID = m;
  315. q._stageX = c;
  316. q._stageY = d;
  317. q.ctrlKey = g;
  318. q.altKey = k;
  319. q.shiftKey = n;
  320. q.touchDown =
  321. p;
  322. b.Event._dispatchByTarget(a, e, h, q, !0, !0)
  323. };
  324. a.TOUCH_TAP = "touchTap";
  325. a.TOUCH_MOVE = "touchMove";
  326. a.TOUCH_BEGIN = "touchBegin";
  327. a.TOUCH_END = "touchEnd";
  328. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  329. a.TOUCH_ROLL_OUT = "touchRollOut";
  330. a.TOUCH_ROLL_OVER = "touchRollOver";
  331. a.TOUCH_OUT = "touchOut";
  332. a.TOUCH_OVER = "touchOver";
  333. return a
  334. }(b.Event);
  335. b.TouchEvent = d;
  336. d.prototype.__class__ = "egret.TouchEvent"
  337. })(egret);
  338. __extends = this.__extends || function(b, d) {
  339. function c() {
  340. this.constructor = b
  341. }
  342. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  343. c.prototype = d.prototype;
  344. b.prototype = new c
  345. };
  346. (function(b) {
  347. var d = function(c) {
  348. function a(e, a, m) {
  349. "undefined" === typeof a && (a = !1);
  350. "undefined" === typeof m && (m = !1);
  351. c.call(this, e, a, m)
  352. }
  353. __extends(a, c);
  354. a.dispatchTimerEvent = function(e, h) {
  355. b.Event._dispatchByTarget(a, e, h)
  356. };
  357. a.TIMER = "timer";
  358. a.TIMER_COMPLETE = "timerComplete";
  359. return a
  360. }(b.Event);
  361. b.TimerEvent = d;
  362. d.prototype.__class__ = "egret.TimerEvent"
  363. })(egret);
  364. (function(b) {
  365. var d = function() {
  366. function b() {}
  367. b.CAPTURING_PHASE = 1;
  368. b.AT_TARGET = 2;
  369. b.BUBBLING_PHASE = 3;
  370. return b
  371. }();
  372. b.EventPhase = d;
  373. d.prototype.__class__ = "egret.EventPhase"
  374. })(egret);
  375. __extends = this.__extends || function(b, d) {
  376. function c() {
  377. this.constructor = b
  378. }
  379. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  380. c.prototype = d.prototype;
  381. b.prototype = new c
  382. };
  383. (function(b) {
  384. var d = function(c) {
  385. function a(e) {
  386. "undefined" === typeof e && (e = null);
  387. c.call(this);
  388. this._eventTarget = e ? e : this
  389. }
  390. __extends(a, c);
  391. a.prototype.addEventListener = function(e, a, m, c, d) {
  392. "undefined" === typeof c && (c = !1);
  393. "undefined" === typeof d && (d = 0);
  394. "undefined" === typeof c && (c = !1);
  395. "undefined" === typeof d && (d = 0);
  396. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  397. c ? (this._captureEventsMap || (this._captureEventsMap = {}), c = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), c = this._eventsMap);
  398. var g = c[e];
  399. g || (g = c[e] = []);
  400. this._insertEventBin(g, a, m, d)
  401. };
  402. a.prototype._insertEventBin = function(e, a, m, b) {
  403. for (var c = -1, d = e.length, k = 0; k < d; k++) {
  404. var n = e[k];
  405. if (n.listener === a && n.thisObject === m) return !1; - 1 == c && n.priority < b && (c = k)
  406. }
  407. a = {
  408. listener: a,
  409. thisObject: m,
  410. priority: b
  411. }; - 1 != c ? e.splice(c, 0, a) : e.push(a);
  412. return !0
  413. };
  414. a.prototype.removeEventListener = function(e, a, m, b) {
  415. "undefined" === typeof b && (b = !1);
  416. if (b = b ? this._captureEventsMap : this._eventsMap) {
  417. var c = b[e];
  418. c && (this._removeEventBin(c, a, m), 0 ==
  419. c.length && delete b[e])
  420. }
  421. };
  422. a.prototype._removeEventBin = function(e, a, m) {
  423. for (var b = e.length, c = 0; c < b; c++) {
  424. var d = e[c];
  425. if (d.listener === a && d.thisObject === m) return e.splice(c, 1), !0
  426. }
  427. return !1
  428. };
  429. a.prototype.hasEventListener = function(e) {
  430. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  431. };
  432. a.prototype.willTrigger = function(e) {
  433. return this.hasEventListener(e)
  434. };
  435. a.prototype.dispatchEvent = function(e) {
  436. e._reset();
  437. e._target = this._eventTarget;
  438. e._setCurrentTarget(this._eventTarget);
  439. return this._notifyListener(e)
  440. };
  441. a.prototype._notifyListener = function(e) {
  442. var a = 1 == e._eventPhase ? this._captureEventsMap : this._eventsMap;
  443. if (!a) return !0;
  444. a = a[e.type];
  445. if (!a) return !0;
  446. for (var a = a.concat(), m = a.length, b = 0; b < m; b++) {
  447. var c = a[b];
  448. c.listener.call(c.thisObject, e);
  449. if (e._isPropagationImmediateStopped) break
  450. }
  451. return !e.isDefaultPrevented()
  452. };
  453. a.prototype.dispatchEventWith = function(e, a, m) {
  454. "undefined" === typeof a && (a = !1);
  455. b.Event.dispatchEvent(this, e, a, m)
  456. };
  457. return a
  458. }(b.HashObject);
  459. b.EventDispatcher = d;
  460. d.prototype.__class__ =
  461. "egret.EventDispatcher"
  462. })(egret);
  463. __extends = this.__extends || function(b, d) {
  464. function c() {
  465. this.constructor = b
  466. }
  467. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  468. c.prototype = d.prototype;
  469. b.prototype = new c
  470. };
  471. (function(b) {
  472. var d = function(c) {
  473. function a() {
  474. c.call(this);
  475. this.reuseEvent = new b.Event("")
  476. }
  477. __extends(a, c);
  478. a.prototype.run = function() {
  479. b.Ticker.getInstance().run();
  480. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  481. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  482. this.touchContext.run()
  483. };
  484. a.prototype.renderLoop = function(e) {
  485. e = this.rendererContext;
  486. e.clearScreen();
  487. if (0 < b.__callLaterFunctionList.length) {
  488. var a = b.__callLaterFunctionList;
  489. b.__callLaterFunctionList =
  490. [];
  491. var m = b.__callLaterThisList;
  492. b.__callLaterThisList = [];
  493. var c = 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, m, c);
  499. this.stage._updateTransform();
  500. this.dispatchEventWith(b.Event.FINISH_UPDATE_TRANSFORM);
  501. this.stage._draw(e);
  502. this.dispatchEventWith(b.Event.FINISH_RENDER)
  503. };
  504. a.prototype.broadcastEnterFrame = function(e) {
  505. e = this.reuseEvent;
  506. e._type = b.Event.ENTER_FRAME;
  507. this.dispatchEvent(e);
  508. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), m = a.length, c = 0; c < m; c++) {
  509. var d = a[c];
  510. e._target = d.display;
  511. e._setCurrentTarget(d.display);
  512. d.listener.call(d.thisObject, e)
  513. }
  514. a = b.Recycler._callBackList;
  515. for (c = a.length - 1; 0 <= c; c--) a[c]._checkFrame()
  516. };
  517. a.prototype.broadcastRender = function() {
  518. var e = this.reuseEvent;
  519. e._type = b.Event.RENDER;
  520. for (var a = b.DisplayObject._renderCallBackList.concat(), m = a.length, c = 0; c < m; c++) {
  521. var d = a[c];
  522. e._target = d.display;
  523. e._setCurrentTarget(d.display);
  524. d.listener.call(d.thisObject,
  525. e)
  526. }
  527. };
  528. a.prototype.doCallLaterList = function(e, a, b) {
  529. for (var c = e.length, d = 0; d < c; d++) {
  530. var g = e[d];
  531. null != g && g.apply(a[d], b[d])
  532. }
  533. };
  534. a.DEVICE_PC = "web";
  535. a.DEVICE_MOBILE = "native";
  536. return a
  537. }(b.EventDispatcher);
  538. b.MainContext = d;
  539. d.prototype.__class__ = "egret.MainContext"
  540. })(egret);
  541. var testDeviceType = function() {
  542. if (!this.navigator) return !0;
  543. var b = navigator.userAgent.toLowerCase();
  544. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  545. };
  546. egret.MainContext.instance = new egret.MainContext;
  547. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  548. (function(b) {
  549. var d = function() {
  550. function c() {
  551. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  552. this._maxDeltaTime = 500;
  553. this._totalDeltaTime = 0
  554. }
  555. c.getInstance = function() {
  556. null == c.instance && (c.instance = new c);
  557. return c.instance
  558. };
  559. c.prototype.run = function() {
  560. b.Ticker.getInstance().register(this.update, this);
  561. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, b.MainContext.instance.stage.addChild(this._txt));
  562. var a =
  563. b.MainContext.instance;
  564. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  565. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  566. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  567. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  568. };
  569. c.prototype.onEnterFrame = function(a) {
  570. this._lastTime = b.getTimer()
  571. };
  572. c.prototype.onStartRender = function(a) {
  573. a = b.getTimer();
  574. this._logicPerformanceCost = a - this._lastTime;
  575. this._lastTime = a
  576. };
  577. c.prototype.onFinishUpdateTransform =
  578. function(a) {
  579. a = b.getTimer();
  580. this._updateTransformPerformanceCost = a - this._lastTime;
  581. this._lastTime = a
  582. };
  583. c.prototype.onFinishRender = function(a) {
  584. a = b.getTimer();
  585. this._renderPerformanceCost = a - this._lastTime;
  586. this._lastTime = a
  587. };
  588. c.prototype.update = function(a) {
  589. this._tick++;
  590. this._totalDeltaTime += a;
  591. if (this._totalDeltaTime >= this._maxDeltaTime) {
  592. a = (this._preDrawCount - 1).toString();
  593. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  594. "," + 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. c.prototype.onDrawImage = function() {
  601. this._preDrawCount++
  602. };
  603. return c
  604. }();
  605. b.Profiler = d;
  606. d.prototype.__class__ = "egret.Profiler"
  607. })(egret);
  608. __extends = this.__extends || function(b, d) {
  609. function c() {
  610. this.constructor = b
  611. }
  612. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  613. c.prototype = d.prototype;
  614. b.prototype = new c
  615. };
  616. (function(b) {
  617. var d = function(c) {
  618. function a() {
  619. c.apply(this, arguments);
  620. this._timeScale = 1;
  621. this._paused = !1;
  622. this.callBackList = []
  623. }
  624. __extends(a, c);
  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. b = a.length;
  632. e *= this._timeScale;
  633. e *= this._timeScale;
  634. for (var c = 0; c < b; c++) {
  635. var d = a[c];
  636. d.listener.call(d.thisObject, e)
  637. }
  638. };
  639. a.prototype.register = function(e, a, b) {
  640. "undefined" ===
  641. typeof b && (b = 0);
  642. this._insertEventBin(this.callBackList, e, a, b)
  643. };
  644. a.prototype.unregister = function(e, a) {
  645. this._removeEventBin(this.callBackList, e, a)
  646. };
  647. a.prototype.setTimeout = function(e, a, m) {
  648. for (var c = [], d = 0; d < arguments.length - 3; d++) c[d] = arguments[d + 3];
  649. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  650. b.setTimeout.apply(null, [e, a, m].concat(c))
  651. };
  652. a.prototype.setTimeScale = function(e) {
  653. this._timeScale = e
  654. };
  655. a.prototype.getTimeScale = function() {
  656. return this._timeScale
  657. };
  658. a.prototype.pause = function() {
  659. this._paused = !0
  660. };
  661. a.prototype.resume = function() {
  662. this._paused = !1
  663. };
  664. a.getInstance = function() {
  665. null == a.instance && (a.instance = new a);
  666. return a.instance
  667. };
  668. return a
  669. }(b.EventDispatcher);
  670. b.Ticker = d;
  671. d.prototype.__class__ = "egret.Ticker"
  672. })(egret);
  673. (function(b) {
  674. var d = function() {
  675. function b() {}
  676. b.LEFT = "left";
  677. b.RIGHT = "right";
  678. b.CENTER = "center";
  679. b.JUSTIFY = "justify";
  680. b.CONTENT_JUSTIFY = "contentJustify";
  681. return b
  682. }();
  683. b.HorizontalAlign = d;
  684. d.prototype.__class__ = "egret.HorizontalAlign"
  685. })(egret);
  686. (function(b) {
  687. var d = function() {
  688. function b() {}
  689. b.TOP = "top";
  690. b.BOTTOM = "bottom";
  691. b.MIDDLE = "middle";
  692. b.JUSTIFY = "justify";
  693. b.CONTENT_JUSTIFY = "contentJustify";
  694. return b
  695. }();
  696. b.VerticalAlign = d;
  697. d.prototype.__class__ = "egret.VerticalAlign"
  698. })(egret);
  699. __extends = this.__extends || function(b, d) {
  700. function c() {
  701. this.constructor = b
  702. }
  703. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  704. c.prototype = d.prototype;
  705. b.prototype = new c
  706. };
  707. (function(b) {
  708. var d = function(c) {
  709. function a(e, a) {
  710. "undefined" === typeof a && (a = 0);
  711. c.call(this);
  712. this._currentCount = 0;
  713. this.delay = e;
  714. this.repeatCount = a
  715. }
  716. __extends(a, c);
  717. a.prototype.currentCount = function() {
  718. return this._currentCount
  719. };
  720. Object.defineProperty(a.prototype, "running", {
  721. get: function() {
  722. return this._running
  723. },
  724. enumerable: !0,
  725. configurable: !0
  726. });
  727. a.prototype.reset = function() {
  728. this.stop();
  729. this._currentCount = 0
  730. };
  731. a.prototype.start = function() {
  732. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount =
  733. 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  734. };
  735. a.prototype.stop = function() {
  736. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  737. };
  738. a.prototype.onEnterFrame = function(e) {
  739. e = b.getTimer();
  740. 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)))
  741. };
  742. return a
  743. }(b.EventDispatcher);
  744. b.Timer = d;
  745. d.prototype.__class__ = "egret.Timer"
  746. })(egret);
  747. (function(b) {
  748. b.getQualifiedClassName = function(b) {
  749. b = b.prototype ? b.prototype : b.__proto__;
  750. if (b.hasOwnProperty("__class__")) return b.__class__;
  751. var c = b.constructor.toString(),
  752. a = c.indexOf("("),
  753. c = c.substring(9, a);
  754. return b.__class__ = c
  755. }
  756. })(egret);
  757. (function(b) {
  758. var d = {};
  759. b.getDefinitionByName = function(b) {
  760. if (!b) return null;
  761. var a = d[b];
  762. if (a) return a;
  763. for (var e = b.split("."), h = e.length, a = __global, m = 0; m < h; m++)
  764. if (a = a[e[m]], !a) return null;
  765. return d[b] = a
  766. }
  767. })(egret);
  768. var __global = __global || this;
  769. (function(b) {
  770. function d(e) {
  771. for (var a in c) {
  772. var b = c[a];
  773. b.delay -= e;
  774. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete c[a])
  775. }
  776. }
  777. var c = {},
  778. a = 0;
  779. b.setTimeout = function(e, h, m) {
  780. for (var l = [], f = 0; f < arguments.length - 3; f++) l[f] = arguments[f + 3];
  781. l = {
  782. listener: e,
  783. thisObject: h,
  784. delay: m,
  785. params: l
  786. };
  787. 0 == a && b.Ticker.getInstance().register(d, null);
  788. a++;
  789. c[a] = l;
  790. return a
  791. };
  792. b.clearTimeout = function(e) {
  793. delete c[e]
  794. }
  795. })(egret);
  796. (function(b) {
  797. b.hasDefinition = function(d) {
  798. return b.getDefinitionByName(d) ? !0 : !1
  799. }
  800. })(egret);
  801. (function(b) {
  802. b.toColorString = function(b) {
  803. if (isNaN(b) || 0 > b) b = 0;
  804. 16777215 < b && (b = 16777215);
  805. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  806. return "#" + b
  807. }
  808. })(egret);
  809. __extends = this.__extends || function(b, d) {
  810. function c() {
  811. this.constructor = b
  812. }
  813. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  814. c.prototype = d.prototype;
  815. b.prototype = new c
  816. };
  817. (function(b) {
  818. var d = function(c) {
  819. function a(e, a, b, d, f, g) {
  820. "undefined" === typeof e && (e = 1);
  821. "undefined" === typeof a && (a = 0);
  822. "undefined" === typeof b && (b = 0);
  823. "undefined" === typeof d && (d = 1);
  824. "undefined" === typeof f && (f = 0);
  825. "undefined" === typeof g && (g = 0);
  826. c.call(this);
  827. this.a = e;
  828. this.b = a;
  829. this.c = b;
  830. this.d = d;
  831. this.tx = f;
  832. this.ty = g
  833. }
  834. __extends(a, c);
  835. a.prototype.prepend = function(e, a, b, c, d, g) {
  836. var k = this.tx;
  837. if (1 != e || 0 != a || 0 != b || 1 != c) {
  838. var n = this.a,
  839. p = this.c;
  840. this.a = n * e + this.b * b;
  841. this.b = n * a + this.b * c;
  842. this.c = p * e + this.d * b;
  843. this.d = p * a + this.d *
  844. c
  845. }
  846. this.tx = k * e + this.ty * b + d;
  847. this.ty = k * a + this.ty * c + g;
  848. return this
  849. };
  850. a.prototype.append = function(e, a, b, c, d, g) {
  851. var k = this.a,
  852. n = this.b,
  853. p = this.c,
  854. q = this.d;
  855. this.a = e * k + a * p;
  856. this.b = e * n + a * q;
  857. this.c = b * k + c * p;
  858. this.d = b * n + c * q;
  859. this.tx = d * k + g * p + this.tx;
  860. this.ty = d * n + g * q + this.ty;
  861. return this
  862. };
  863. a.prototype.prependMatrix = function(e) {
  864. this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty);
  865. return this
  866. };
  867. a.prototype.appendMatrix = function(e) {
  868. this.append(e.a, e.b, e.c, e.d, e.tx, e.ty);
  869. return this
  870. };
  871. a.prototype.prependTransform = function(e, h, b, c, d, g, k, n, p) {
  872. if (d %
  873. 360) {
  874. var q = d * a.DEG_TO_RAD;
  875. d = Math.cos(q);
  876. q = Math.sin(q)
  877. } else d = 1, q = 0; if (n || p) this.tx -= n, this.ty -= p;
  878. g || k ? (g *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(d * b, q * b, -q * c, d * c, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(g), Math.cos(g), e, h)) : this.prepend(d * b, q * b, -q * c, d * c, e, h);
  879. return this
  880. };
  881. a.prototype.appendTransform = function(e, h, b, c, d, g, k, n, p) {
  882. if (d % 360) {
  883. var q = d * a.DEG_TO_RAD;
  884. d = Math.cos(q);
  885. q = Math.sin(q)
  886. } else d = 1, q = 0;
  887. g || k ? (g *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(g),
  888. Math.cos(g), e, h), this.append(d * b, q * b, -q * c, d * c, 0, 0)) : this.append(d * b, q * b, -q * c, d * c, e, h);
  889. if (n || p) this.tx -= n * this.a + p * this.c, this.ty -= n * this.b + p * this.d;
  890. return this
  891. };
  892. a.prototype.rotate = function(e) {
  893. var a = Math.cos(e);
  894. e = Math.sin(e);
  895. var b = this.a,
  896. c = this.c,
  897. d = this.tx;
  898. this.a = b * a - this.b * e;
  899. this.b = b * e + this.b * a;
  900. this.c = c * a - this.d * e;
  901. this.d = c * e + this.d * a;
  902. this.tx = d * a - this.ty * e;
  903. this.ty = d * e + this.ty * a;
  904. return this
  905. };
  906. a.prototype.skew = function(e, h) {
  907. e *= a.DEG_TO_RAD;
  908. h *= a.DEG_TO_RAD;
  909. this.append(Math.cos(h), Math.sin(h), -Math.sin(e),
  910. Math.cos(e), 0, 0);
  911. return this
  912. };
  913. a.prototype.scale = function(e, a) {
  914. this.a *= e;
  915. this.d *= a;
  916. this.c *= e;
  917. this.b *= a;
  918. this.tx *= e;
  919. this.ty *= a;
  920. return this
  921. };
  922. a.prototype.translate = function(e, a) {
  923. this.tx += e;
  924. this.ty += a;
  925. return this
  926. };
  927. a.prototype.identity = function() {
  928. this.a = this.d = 1;
  929. this.b = this.c = this.tx = this.ty = 0;
  930. return this
  931. };
  932. a.prototype.invert = function() {
  933. var e = this.a,
  934. a = this.b,
  935. b = this.c,
  936. c = this.d,
  937. d = this.tx,
  938. g = e * c - a * b;
  939. this.a = c / g;
  940. this.b = -a / g;
  941. this.c = -b / g;
  942. this.d = e / g;
  943. this.tx = (b * this.ty - c * d) / g;
  944. this.ty = -(e * this.ty - a * d) / g;
  945. return this
  946. };
  947. a.transformCoords = function(e, a, c) {
  948. var d = b.Point.identity;
  949. d.x = e.a * a + e.c * c + e.tx;
  950. d.y = e.d * c + e.b * a + e.ty;
  951. return d
  952. };
  953. a.prototype.toArray = function(e) {
  954. this.array || (this.array = new Float32Array(9));
  955. 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] =
  956. 0);
  957. this.array[8] = 1;
  958. return this.array
  959. };
  960. a.identity = new a;
  961. a.DEG_TO_RAD = Math.PI / 180;
  962. return a
  963. }(b.HashObject);
  964. b.Matrix = d;
  965. d.prototype.__class__ = "egret.Matrix"
  966. })(egret);
  967. __extends = this.__extends || function(b, d) {
  968. function c() {
  969. this.constructor = b
  970. }
  971. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  972. c.prototype = d.prototype;
  973. b.prototype = new c
  974. };
  975. (function(b) {
  976. var d = function(b) {
  977. function a(e, a) {
  978. "undefined" === typeof e && (e = 0);
  979. "undefined" === typeof a && (a = 0);
  980. b.call(this);
  981. this.x = e;
  982. this.y = a
  983. }
  984. __extends(a, b);
  985. a.prototype.clone = function() {
  986. return new a(this.x, this.y)
  987. };
  988. a.prototype.equals = function(e) {
  989. return this.x == e.x && this.y == e.y
  990. };
  991. a.distance = function(e, a) {
  992. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  993. };
  994. a.identity = new a(0, 0);
  995. return a
  996. }(b.HashObject);
  997. b.Point = d;
  998. d.prototype.__class__ = "egret.Point"
  999. })(egret);
  1000. __extends = this.__extends || function(b, d) {
  1001. function c() {
  1002. this.constructor = b
  1003. }
  1004. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1005. c.prototype = d.prototype;
  1006. b.prototype = new c
  1007. };
  1008. (function(b) {
  1009. var d = function(b) {
  1010. function a(e, a, m, d) {
  1011. "undefined" === typeof e && (e = 0);
  1012. "undefined" === typeof a && (a = 0);
  1013. "undefined" === typeof m && (m = 0);
  1014. "undefined" === typeof d && (d = 0);
  1015. b.call(this);
  1016. this.x = e;
  1017. this.y = a;
  1018. this.width = m;
  1019. this.height = d
  1020. }
  1021. __extends(a, b);
  1022. Object.defineProperty(a.prototype, "right", {
  1023. get: function() {
  1024. return this.x + this.width
  1025. },
  1026. set: function(e) {
  1027. this.width = e - this.x
  1028. },
  1029. enumerable: !0,
  1030. configurable: !0
  1031. });
  1032. Object.defineProperty(a.prototype, "bottom", {
  1033. get: function() {
  1034. return this.y + this.height
  1035. },
  1036. set: function(e) {
  1037. this.height =
  1038. e - this.y
  1039. },
  1040. enumerable: !0,
  1041. configurable: !0
  1042. });
  1043. a.prototype.initialize = function(e, a, b, c) {
  1044. this.x = e;
  1045. this.y = a;
  1046. this.width = b;
  1047. this.height = c;
  1048. return this
  1049. };
  1050. a.prototype.contains = function(e, a) {
  1051. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1052. };
  1053. a.prototype.intersects = function(e) {
  1054. 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
  1055. };
  1056. a.prototype.clone = function() {
  1057. return new a(this.x, this.y, this.width, this.height)
  1058. };
  1059. a.prototype.containsPoint =
  1060. function(e) {
  1061. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1062. };
  1063. a.identity = new a(0, 0, 0, 0);
  1064. return a
  1065. }(b.HashObject);
  1066. b.Rectangle = d;
  1067. d.prototype.__class__ = "egret.Rectangle"
  1068. })(egret);
  1069. (function(b) {
  1070. var d = function() {
  1071. function c() {}
  1072. c.fatal = function(a, e) {
  1073. "undefined" === typeof e && (e = null);
  1074. b.Logger.traceToConsole("Fatal", a, e);
  1075. throw Error(b.Logger.getTraceCode("Fatal", a, e));
  1076. };
  1077. c.info = function(a, e) {
  1078. "undefined" === typeof e && (e = null);
  1079. b.Logger.traceToConsole("Info", a, e)
  1080. };
  1081. c.warning = function(a, e) {
  1082. "undefined" === typeof e && (e = null);
  1083. b.Logger.traceToConsole("Warning", a, e)
  1084. };
  1085. c.traceToConsole = function(a, e, h) {
  1086. console.log(b.Logger.getTraceCode(a, e, h))
  1087. };
  1088. c.getTraceCode = function(a, e, h) {
  1089. return "[" + a + "]" + e + ":" +
  1090. (null == h ? "" : h)
  1091. };
  1092. return c
  1093. }();
  1094. b.Logger = d;
  1095. d.prototype.__class__ = "egret.Logger"
  1096. })(egret);
  1097. __extends = this.__extends || function(b, d) {
  1098. function c() {
  1099. this.constructor = b
  1100. }
  1101. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1102. c.prototype = d.prototype;
  1103. b.prototype = new c
  1104. };
  1105. (function(b) {
  1106. var d = function(c) {
  1107. function a() {
  1108. c.call(this);
  1109. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1110. this._xmlDict = {};
  1111. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1112. }
  1113. __extends(a, c);
  1114. a.getInstance = function() {
  1115. a._instance || (a._instance = new a);
  1116. return a._instance
  1117. };
  1118. a.prototype.parserXML = function(e) {
  1119. for (var a = 0;
  1120. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1121. 0 != a && (e = e.substring(a, e.length));
  1122. this._isSupportDOMParser ?
  1123. a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1124. null == a && b.Logger.info("xml not found!");
  1125. return a
  1126. };
  1127. a._instance = null;
  1128. return a
  1129. }(b.HashObject);
  1130. b.SAXParser = d;
  1131. d.prototype.__class__ = "egret.SAXParser"
  1132. })(egret);
  1133. __extends = this.__extends || function(b, d) {
  1134. function c() {
  1135. this.constructor = b
  1136. }
  1137. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1138. c.prototype = d.prototype;
  1139. b.prototype = new c
  1140. };
  1141. (function(b) {
  1142. var d = function(e) {
  1143. function h() {
  1144. e.call(this);
  1145. this._designHeight = this._designWidth = 0;
  1146. this._scaleY = this._scaleX = 1;
  1147. var a = document.getElementById(h.canvas_name),
  1148. b = a.height;
  1149. this._designWidth = a.width;
  1150. this._designHeight = b
  1151. }
  1152. __extends(h, e);
  1153. h.getInstance = function() {
  1154. null == h.instance && (a.initialize(), h.instance = new h);
  1155. return h.instance
  1156. };
  1157. h.prototype.setDesignSize = function(e, a, h) {
  1158. this._designWidth = e;
  1159. this._designHeight = a;
  1160. h && (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"),
  1161. this._setResolutionPolicy(h))
  1162. };
  1163. h.prototype._setResolutionPolicy = function(e) {
  1164. this._resolutionPolicy = e;
  1165. e.init(this);
  1166. e._apply(this, this._designWidth, this._designHeight)
  1167. };
  1168. h.prototype.getScaleX = function() {
  1169. return this._scaleX
  1170. };
  1171. h.prototype.getScaleY = function() {
  1172. return this._scaleY
  1173. };
  1174. h.canvas_name = "gameCanvas";
  1175. h.canvas_div_name = "gameDiv";
  1176. return h
  1177. }(b.HashObject);
  1178. b.StageDelegate = d;
  1179. d.prototype.__class__ = "egret.StageDelegate";
  1180. var c = function() {
  1181. function e(a, h) {
  1182. this.setContainerStrategy(a);
  1183. this.setContentStrategy(h)
  1184. }
  1185. e.prototype.init = function(e) {
  1186. this._containerStrategy.init(e);
  1187. this._contentStrategy.init(e)
  1188. };
  1189. e.prototype._apply = function(e, a, h) {
  1190. this._containerStrategy._apply(e, a, h);
  1191. this._contentStrategy._apply(e, a, h)
  1192. };
  1193. e.prototype.setContainerStrategy = function(e) {
  1194. e instanceof a && (this._containerStrategy = e)
  1195. };
  1196. e.prototype.setContentStrategy = function(e) {
  1197. e instanceof h && (this._contentStrategy = e)
  1198. };
  1199. return e
  1200. }();
  1201. b.ResolutionPolicy = c;
  1202. c.prototype.__class__ = "egret.ResolutionPolicy";
  1203. var a = function() {
  1204. function a() {}
  1205. a.initialize =
  1206. function() {
  1207. a.EQUAL_TO_FRAME = new e
  1208. };
  1209. a.prototype.init = function(e) {};
  1210. a.prototype._apply = function(e, a, h) {};
  1211. a.prototype._setupContainer = function() {
  1212. var e = document.body,
  1213. a;
  1214. 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 =
  1215. a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1216. };
  1217. return a
  1218. }();
  1219. b.ContainerStrategy = a;
  1220. a.prototype.__class__ = "egret.ContainerStrategy";
  1221. var e = function(e) {
  1222. function a() {
  1223. e.apply(this, arguments)
  1224. }
  1225. __extends(a, e);
  1226. a.prototype._apply = function(e) {
  1227. this._setupContainer()
  1228. };
  1229. return a
  1230. }(a);
  1231. b.EqualToFrame = e;
  1232. e.prototype.__class__ = "egret.EqualToFrame";
  1233. var h = function() {
  1234. function e() {}
  1235. e.prototype.init = function(e) {};
  1236. e.prototype._apply = function(e, a, h) {};
  1237. return e
  1238. }();
  1239. b.ContentStrategy =
  1240. h;
  1241. h.prototype.__class__ = "egret.ContentStrategy";
  1242. c = function(e) {
  1243. function a(h) {
  1244. "undefined" === typeof h && (h = 0);
  1245. e.call(this);
  1246. this.minWidth = h
  1247. }
  1248. __extends(a, e);
  1249. a.prototype._apply = function(e, a, h) {
  1250. a = document.getElementById(d.canvas_name);
  1251. var b = document.getElementById(d.canvas_div_name),
  1252. c = document.documentElement.clientWidth,
  1253. m = document.documentElement.clientHeight,
  1254. l = m / h,
  1255. r = c / l,
  1256. s = 1;
  1257. 0 != this.minWidth && (s = Math.min(1, r / this.minWidth));
  1258. a.width = r / s;
  1259. a.height = h;
  1260. a.style.width = c + "px";
  1261. a.style.height = m * s + "px";
  1262. b.style.width =
  1263. c + "px";
  1264. b.style.height = m * s + "px";
  1265. e._scaleX = l * s;
  1266. e._scaleY = l * s
  1267. };
  1268. return a
  1269. }(h);
  1270. b.FixedHeight = c;
  1271. c.prototype.__class__ = "egret.FixedHeight";
  1272. c = function(e) {
  1273. function a(h) {
  1274. "undefined" === typeof h && (h = 0);
  1275. e.call(this);
  1276. this.minHeight = h
  1277. }
  1278. __extends(a, e);
  1279. a.prototype._apply = function(e, a, h) {
  1280. h = document.getElementById(d.canvas_name);
  1281. var b = document.getElementById(d.canvas_div_name),
  1282. c = document.documentElement.clientWidth,
  1283. m = document.documentElement.clientHeight,
  1284. l = c / a,
  1285. r = m / l,
  1286. s = 1;
  1287. 0 != this.minHeight && (s = Math.min(1, r / this.minHeight));
  1288. h.width = a;
  1289. h.height = r / s;
  1290. h.style.width = c * s + "px";
  1291. h.style.height = m + "px";
  1292. b.style.width = c * s + "px";
  1293. b.style.height = m + "px";
  1294. e._scaleX = l * s;
  1295. e._scaleY = l * s
  1296. };
  1297. return a
  1298. }(h);
  1299. b.FixedWidth = c;
  1300. c.prototype.__class__ = "egret.FixedWidth";
  1301. c = function(e) {
  1302. function a(h, b) {
  1303. e.call(this);
  1304. this.width = h;
  1305. this.height = b
  1306. }
  1307. __extends(a, e);
  1308. a.prototype._apply = function(e, a, h) {
  1309. h = document.getElementById(d.canvas_name);
  1310. var b = document.getElementById(d.canvas_div_name),
  1311. c = this.width,
  1312. m = this.height,
  1313. l = c / a;
  1314. h.width = a;
  1315. h.height = m / l;
  1316. h.style.width = c + "px";
  1317. h.style.height =
  1318. m + "px";
  1319. b.style.width = c + "px";
  1320. b.style.height = m + "px";
  1321. e._scaleX = l;
  1322. e._scaleY = l
  1323. };
  1324. return a
  1325. }(h);
  1326. b.FixedSize = c;
  1327. c.prototype.__class__ = "egret.FixedSize";
  1328. c = function(e) {
  1329. function a() {
  1330. e.call(this)
  1331. }
  1332. __extends(a, e);
  1333. a.prototype._apply = function(e, a, h) {
  1334. a = document.getElementById(d.canvas_name);
  1335. a.style.width = a.width + "px";
  1336. a.style.height = a.height + "px";
  1337. e._scaleX = 1;
  1338. e._scaleY = 1
  1339. };
  1340. return a
  1341. }(h);
  1342. b.NoScale = c;
  1343. c.prototype.__class__ = "egret.NoScale"
  1344. })(egret);
  1345. __extends = this.__extends || function(b, d) {
  1346. function c() {
  1347. this.constructor = b
  1348. }
  1349. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1350. c.prototype = d.prototype;
  1351. b.prototype = new c
  1352. };
  1353. (function(b) {
  1354. var d = function(c) {
  1355. function a() {
  1356. c.call(this);
  1357. this._originalData = {};
  1358. this._drawAreaList = []
  1359. }
  1360. __extends(a, c);
  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, c, d, f, g, k, n, p, q) {
  1372. k = k || 0;
  1373. n = n || 0;
  1374. var t = a._texture_to_render;
  1375. if (null != t && 0 != g && 0 != f && 0 != p && 0 != q)
  1376. if (a._worldBounds) {
  1377. var r = this._originalData;
  1378. r.sourceX =
  1379. c;
  1380. r.sourceY = d;
  1381. r.sourceWidth = f;
  1382. r.sourceHeight = g;
  1383. r.destX = k;
  1384. r.destY = n;
  1385. r.destWidth = p;
  1386. r.destHeight = q;
  1387. for (var s = this.getDrawAreaList(), u = 0; u < s.length; u++) {
  1388. var v = s[u];
  1389. if (!this.ignoreRender(a, v, r.destX, r.destY)) {
  1390. if (0 != this._drawAreaList.length)
  1391. if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1392. 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) {
  1393. 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");
  1394. break
  1395. }
  1396. } else {
  1397. var x = a._worldTransform.a,
  1398. y = a._worldTransform.d,
  1399. w;
  1400. a._worldBounds.x + r.destX < v.x && (w = (v.x - a._worldBounds.x) / x - r.destX, c += w / (p / f), f -= w / (p / f), p -= w, k += w);
  1401. a._worldBounds.y + r.destY < v.y && (w = (v.y - a._worldBounds.y) / y - r.destY, d += w / (q / g), g -= w / (q / g), q -= w, n += w);
  1402. 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, f -= w / (p / f), p -= w);
  1403. a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height && (w = (a._worldBounds.y + a._worldBounds.height -
  1404. v.y - v.height) / y + r.destY, g -= w / (q / g), q -= w)
  1405. }
  1406. e.drawImage(t, c, d, f, g, k, n, p, q)
  1407. }
  1408. }
  1409. } else e.drawImage(t, c, d, f, g, k, n, p, q)
  1410. };
  1411. a.prototype.ignoreRender = function(e, a, b, c) {
  1412. var d = e._worldBounds;
  1413. b *= e._worldTransform.a;
  1414. c *= e._worldTransform.d;
  1415. return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + c <= a.y || d.y + c >= a.y + a.height ? !0 : !1
  1416. };
  1417. a.prototype.getDrawAreaList = function() {
  1418. var e;
  1419. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth,
  1420. b.MainContext.instance.stage.stageHeight)]), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1421. return e
  1422. };
  1423. return a
  1424. }(b.HashObject);
  1425. b.RenderFilter = d;
  1426. d.prototype.__class__ = "egret.RenderFilter"
  1427. })(egret);
  1428. (function(b) {
  1429. var d = function() {
  1430. function c() {}
  1431. c.mapClass = function(a, e, h) {
  1432. "undefined" === typeof h && (h = "");
  1433. a = this.getKey(a) + "#" + h;
  1434. this.mapClassDic[a] = e
  1435. };
  1436. c.getKey = function(a) {
  1437. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1438. };
  1439. c.mapValue = function(a, e, h) {
  1440. "undefined" === typeof h && (h = "");
  1441. a = this.getKey(a) + "#" + h;
  1442. this.mapValueDic[a] = e
  1443. };
  1444. c.hasMapRule = function(a, e) {
  1445. "undefined" === typeof e && (e = "");
  1446. var h = this.getKey(a) + "#" + e;
  1447. return this.mapValueDic[h] || this.mapClassDic[h] ? !0 : !1
  1448. };
  1449. c.getInstance = function(a, e) {
  1450. "undefined" ===
  1451. typeof e && (e = "");
  1452. var h = this.getKey(a) + "#" + e;
  1453. if (this.mapValueDic[h]) return this.mapValueDic[h];
  1454. var b = this.mapClassDic[h];
  1455. if (b) return b = new b, this.mapValueDic[h] = b, delete this.mapClassDic[h], b;
  1456. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + h + "\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");
  1457. };
  1458. c.mapClassDic = {};
  1459. c.mapValueDic = {};
  1460. return c
  1461. }();
  1462. b.Injector =
  1463. d;
  1464. d.prototype.__class__ = "egret.Injector"
  1465. })(egret);
  1466. (function(b) {
  1467. var d = function() {
  1468. function b() {}
  1469. b.NORMAL = "normal";
  1470. b.ADD = "add";
  1471. b.LAYER = "layer";
  1472. return b
  1473. }();
  1474. b.BlendMode = d;
  1475. d.prototype.__class__ = "egret.BlendMode"
  1476. })(egret);
  1477. __extends = this.__extends || function(b, d) {
  1478. function c() {
  1479. this.constructor = b
  1480. }
  1481. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1482. c.prototype = d.prototype;
  1483. b.prototype = new c
  1484. };
  1485. (function(b) {
  1486. var d = function(c) {
  1487. function a() {
  1488. c.call(this);
  1489. this._sizeDirty = this._normalDirty = !0;
  1490. this._parent = null;
  1491. this._cacheAsBitmap = !1;
  1492. this._y = this._x = 0;
  1493. this._scaleY = this._scaleX = 1;
  1494. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1495. this._visible = !0;
  1496. this._rotation = 0;
  1497. this._alpha = 1;
  1498. this._skewY = this._skewX = 0;
  1499. this._hasHeightSet = this._hasWidthSet = !1;
  1500. this.worldAlpha = 1;
  1501. this._rectH = this._rectW = 0;
  1502. this._worldTransform = new b.Matrix;
  1503. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1504. }
  1505. __extends(a, c);
  1506. a.prototype._setDirty = function() {
  1507. this._normalDirty = !0
  1508. };
  1509. a.prototype.getDirty = function() {
  1510. return this._normalDirty || this._sizeDirty
  1511. };
  1512. a.prototype._setParentSizeDirty = function() {
  1513. !this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  1514. };
  1515. a.prototype._setSizeDirty = function() {
  1516. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  1517. };
  1518. a.prototype._clearDirty = function() {
  1519. this._normalDirty = !1
  1520. };
  1521. a.prototype._clearSizeDirty = function() {
  1522. this._sizeDirty = !1
  1523. };
  1524. Object.defineProperty(a.prototype, "parent", {
  1525. get: function() {
  1526. return this._parent
  1527. },
  1528. enumerable: !0,
  1529. configurable: !0
  1530. });
  1531. a.prototype._parentChanged = function(e) {
  1532. this._parent = e
  1533. };
  1534. Object.defineProperty(a.prototype, "x", {
  1535. get: function() {
  1536. return this._x
  1537. },
  1538. set: function(e) {
  1539. b.NumberUtils.isNumber(e) && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1540. },
  1541. enumerable: !0,
  1542. configurable: !0
  1543. });
  1544. Object.defineProperty(a.prototype, "y", {
  1545. get: function() {
  1546. return this._y
  1547. },
  1548. set: function(e) {
  1549. b.NumberUtils.isNumber(e) && (this._y = e, this._setDirty(),
  1550. this._setParentSizeDirty())
  1551. },
  1552. enumerable: !0,
  1553. configurable: !0
  1554. });
  1555. Object.defineProperty(a.prototype, "scaleX", {
  1556. get: function() {
  1557. return this._scaleX
  1558. },
  1559. set: function(e) {
  1560. b.NumberUtils.isNumber(e) && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1561. },
  1562. enumerable: !0,
  1563. configurable: !0
  1564. });
  1565. Object.defineProperty(a.prototype, "scaleY", {
  1566. get: function() {
  1567. return this._scaleY
  1568. },
  1569. set: function(e) {
  1570. b.NumberUtils.isNumber(e) && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1571. },
  1572. enumerable: !0,
  1573. configurable: !0
  1574. });
  1575. Object.defineProperty(a.prototype,
  1576. "anchorOffsetX", {
  1577. get: function() {
  1578. return this._anchorOffsetX
  1579. },
  1580. set: function(e) {
  1581. b.NumberUtils.isNumber(e) && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1582. },
  1583. enumerable: !0,
  1584. configurable: !0
  1585. });
  1586. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1587. get: function() {
  1588. return this._anchorOffsetY
  1589. },
  1590. set: function(e) {
  1591. b.NumberUtils.isNumber(e) && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1592. },
  1593. enumerable: !0,
  1594. configurable: !0
  1595. });
  1596. Object.defineProperty(a.prototype, "anchorX", {
  1597. get: function() {
  1598. return this._anchorX
  1599. },
  1600. set: function(e) {
  1601. b.NumberUtils.isNumber(e) && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1602. },
  1603. enumerable: !0,
  1604. configurable: !0
  1605. });
  1606. Object.defineProperty(a.prototype, "anchorY", {
  1607. get: function() {
  1608. return this._anchorY
  1609. },
  1610. set: function(e) {
  1611. b.NumberUtils.isNumber(e) && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1612. },
  1613. enumerable: !0,
  1614. configurable: !0
  1615. });
  1616. Object.defineProperty(a.prototype, "visible", {
  1617. get: function() {
  1618. return this._visible
  1619. },
  1620. set: function(e) {
  1621. this._visible = e;
  1622. this._setSizeDirty()
  1623. },
  1624. enumerable: !0,
  1625. configurable: !0
  1626. });
  1627. Object.defineProperty(a.prototype, "rotation", {
  1628. get: function() {
  1629. return this._rotation
  1630. },
  1631. set: function(e) {
  1632. b.NumberUtils.isNumber(e) && (this._rotation = e, this._setSizeDirty())
  1633. },
  1634. enumerable: !0,
  1635. configurable: !0
  1636. });
  1637. Object.defineProperty(a.prototype, "alpha", {
  1638. get: function() {
  1639. return this._alpha
  1640. },
  1641. set: function(e) {
  1642. b.NumberUtils.isNumber(e) && (this._alpha = e, this._setDirty())
  1643. },
  1644. enumerable: !0,
  1645. configurable: !0
  1646. });
  1647. Object.defineProperty(a.prototype, "skewX", {
  1648. get: function() {
  1649. return this._skewX
  1650. },
  1651. set: function(e) {
  1652. b.NumberUtils.isNumber(e) &&
  1653. (this._skewX = e, this._setSizeDirty())
  1654. },
  1655. enumerable: !0,
  1656. configurable: !0
  1657. });
  1658. Object.defineProperty(a.prototype, "skewY", {
  1659. get: function() {
  1660. return this._skewY
  1661. },
  1662. set: function(e) {
  1663. b.NumberUtils.isNumber(e) && (this._skewY = e, this._setSizeDirty())
  1664. },
  1665. enumerable: !0,
  1666. configurable: !0
  1667. });
  1668. Object.defineProperty(a.prototype, "touchEnabled", {
  1669. get: function() {
  1670. return this._touchEnabled
  1671. },
  1672. set: function(e) {
  1673. this._touchEnabled = e
  1674. },
  1675. enumerable: !0,
  1676. configurable: !0
  1677. });
  1678. Object.defineProperty(a.prototype, "scrollRect", {
  1679. get: function() {
  1680. return this._scrollRect
  1681. },
  1682. set: function(e) {
  1683. this._scrollRect = e;
  1684. this._setSizeDirty()
  1685. },
  1686. enumerable: !0,
  1687. configurable: !0
  1688. });
  1689. Object.defineProperty(a.prototype, "measuredWidth", {
  1690. get: function() {
  1691. return this._measureBounds().width
  1692. },
  1693. enumerable: !0,
  1694. configurable: !0
  1695. });
  1696. Object.defineProperty(a.prototype, "measuredHeight", {
  1697. get: function() {
  1698. return this._measureBounds().height
  1699. },
  1700. enumerable: !0,
  1701. configurable: !0
  1702. });
  1703. Object.defineProperty(a.prototype, "explicitWidth", {
  1704. get: function() {
  1705. return this._explicitWidth
  1706. },
  1707. enumerable: !0,
  1708. configurable: !0
  1709. });
  1710. Object.defineProperty(a.prototype,
  1711. "explicitHeight", {
  1712. get: function() {
  1713. return this._explicitHeight
  1714. },
  1715. enumerable: !0,
  1716. configurable: !0
  1717. });
  1718. Object.defineProperty(a.prototype, "width", {
  1719. get: function() {
  1720. return this._getSize(b.Rectangle.identity).width
  1721. },
  1722. set: function(e) {
  1723. this._setWidth(e)
  1724. },
  1725. enumerable: !0,
  1726. configurable: !0
  1727. });
  1728. Object.defineProperty(a.prototype, "height", {
  1729. get: function() {
  1730. return this._getSize(b.Rectangle.identity).height
  1731. },
  1732. set: function(e) {
  1733. this._setHeight(e)
  1734. },
  1735. enumerable: !0,
  1736. configurable: !0
  1737. });
  1738. a.prototype._setWidth = function(e) {
  1739. this._setSizeDirty();
  1740. this._explicitWidth = e;
  1741. this._hasWidthSet = b.NumberUtils.isNumber(e)
  1742. };
  1743. a.prototype._setHeight = function(e) {
  1744. this._setSizeDirty();
  1745. this._explicitHeight = e;
  1746. this._hasHeightSet = b.NumberUtils.isNumber(e)
  1747. };
  1748. a.prototype._draw = function(e) {
  1749. if (this.visible && !this.drawCacheTexture(e)) {
  1750. e.setAlpha(this.worldAlpha, this.blendMode);
  1751. e.setTransform(this._worldTransform);
  1752. var a = this.mask || this._scrollRect;
  1753. a && e.pushMask(a);
  1754. this._render(e);
  1755. a && e.popMask()
  1756. }
  1757. this.destroyCacheBounds()
  1758. };
  1759. a.prototype.drawCacheTexture = function(e) {
  1760. if (this._cacheAsBitmap) {
  1761. var a =
  1762. this._texture_to_render,
  1763. c = a._offsetX,
  1764. d = a._offsetY,
  1765. f = a._textureWidth,
  1766. a = a._textureHeight;
  1767. this._updateTransform();
  1768. e.setAlpha(this.worldAlpha, this.blendMode);
  1769. e.setTransform(this._worldTransform);
  1770. var g = b.MainContext.instance.rendererContext.texture_scale_factor;
  1771. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, f * g, a * g, c, d, f, a);
  1772. return !0
  1773. }
  1774. return !1
  1775. };
  1776. a.prototype._updateTransform = function() {
  1777. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1778. var e = this._getOffsetPoint();
  1779. this._worldTransform.appendTransform(this._x,
  1780. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, e.x, e.y);
  1781. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1782. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1783. };
  1784. a.prototype._render = function(e) {};
  1785. a.prototype.getBounds = function(e) {
  1786. var a = this._measureBounds(),
  1787. c = this._hasWidthSet ? this._explicitWidth : a.width,
  1788. d = this._hasHeightSet ? this._explicitHeight : a.height,
  1789. f = a.x,
  1790. a = a.y,
  1791. g, k;
  1792. 0 != this._anchorX || 0 != this._anchorY ? (g = c * this._anchorX, k = d * this._anchorY) :
  1793. (g = this._anchorOffsetX, k = this._anchorOffsetY);
  1794. this._cacheBounds.initialize(f - g, a - k, c, d);
  1795. c = this._cacheBounds;
  1796. e || (e = new b.Rectangle);
  1797. return e.initialize(c.x, c.y, c.width, c.height)
  1798. };
  1799. a.prototype.destroyCacheBounds = function() {
  1800. this._cacheBounds.x = 0;
  1801. this._cacheBounds.y = 0;
  1802. this._cacheBounds.width = 0;
  1803. this._cacheBounds.height = 0
  1804. };
  1805. a.prototype._getConcatenatedMatrix = function() {
  1806. for (var e = a.identityMatrixForGetConcatenated.identity(), h = this; null != h;) {
  1807. if (0 != h._anchorX || 0 != h._anchorY) {
  1808. var c = h._getSize(b.Rectangle.identity);
  1809. e.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, c.width * h._anchorX, c.height * h._anchorY)
  1810. } else e.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, h._anchorOffsetX, h._anchorOffsetY);
  1811. h = h._parent
  1812. }
  1813. return e
  1814. };
  1815. a.prototype.localToGlobal = function(e, a, c) {
  1816. "undefined" === typeof e && (e = 0);
  1817. "undefined" === typeof a && (a = 0);
  1818. var d = this._getConcatenatedMatrix();
  1819. d.append(1, 0, 0, 1, e, a);
  1820. c || (c = new b.Point);
  1821. c.x = d.tx;
  1822. c.y = d.ty;
  1823. return c
  1824. };
  1825. a.prototype.globalToLocal = function(e,
  1826. a, c) {
  1827. "undefined" === typeof e && (e = 0);
  1828. "undefined" === typeof a && (a = 0);
  1829. var d = this._getConcatenatedMatrix();
  1830. d.invert();
  1831. d.append(1, 0, 0, 1, e, a);
  1832. c || (c = new b.Point);
  1833. c.x = d.tx;
  1834. c.y = d.ty;
  1835. return c
  1836. };
  1837. a.prototype.hitTest = function(e, a, c) {
  1838. "undefined" === typeof c && (c = !1);
  1839. if (!this.visible || !c && !this._touchEnabled) return null;
  1840. c = this._getSize(b.Rectangle.identity);
  1841. return 0 <= e && e < c.width && 0 <= a && a < c.height ? this.mask || this._scrollRect ? this._scrollRect && e < this._scrollRect.width && a < this._scrollRect.height || this.mask && this.mask.x <=
  1842. e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
  1843. };
  1844. a.prototype.hitTestPoint = function(e, a, c) {
  1845. e = this.globalToLocal(e, a);
  1846. return c ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), c = this._hitTestPointTexture, c.drawToTexture(this), 0 != c.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  1847. };
  1848. a.prototype._getMatrix = function() {
  1849. var e = b.Matrix.identity.identity(),
  1850. a = this._getOffsetPoint();
  1851. e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1852. return e
  1853. };
  1854. a.prototype._getSize = function(e) {
  1855. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(b.Rectangle.identity)
  1856. };
  1857. a.prototype._measureSize = function(e) {
  1858. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  1859. return e
  1860. };
  1861. a.prototype._measureBounds = function() {
  1862. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  1863. };
  1864. a.prototype._getOffsetPoint = function() {
  1865. var e = this._anchorOffsetX,
  1866. a = this._anchorOffsetY;
  1867. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity), e = this._anchorX * a.width, a = this._anchorY * a.height;
  1868. var c = b.Point.identity;
  1869. c.x = e;
  1870. c.y = a;
  1871. return c
  1872. };
  1873. a.prototype._onAddToStage = function() {
  1874. this._stage = b.MainContext.instance.stage;
  1875. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1876. };
  1877. a.prototype._onRemoveFromStage =
  1878. function() {
  1879. this._stage = null;
  1880. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1881. };
  1882. Object.defineProperty(a.prototype, "stage", {
  1883. get: function() {
  1884. return this._stage
  1885. },
  1886. enumerable: !0,
  1887. configurable: !0
  1888. });
  1889. a.prototype.addEventListener = function(e, h, m, d, f) {
  1890. "undefined" === typeof d && (d = !1);
  1891. "undefined" === typeof f && (f = 0);
  1892. c.prototype.addEventListener.call(this, e, h, m, d, f);
  1893. ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(d ? a._enterFrameCallBackList : a._renderCallBackList, h, m, f)
  1894. };
  1895. a.prototype.removeEventListener =
  1896. function(e, h, m, d) {
  1897. "undefined" === typeof d && (d = !1);
  1898. c.prototype.removeEventListener.call(this, e, h, m, d);
  1899. ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(d ? a._enterFrameCallBackList : a._renderCallBackList, h, m)
  1900. };
  1901. a.prototype.dispatchEvent = function(e) {
  1902. if (!e._bubbles) return c.prototype.dispatchEvent.call(this, e);
  1903. for (var a = [], b = this; b;) a.unshift(b), b = b.parent;
  1904. for (var d = a.length, b = d - 1, d = d - 2; 0 <= d; d--) a.push(a[d]);
  1905. e._reset();
  1906. this._dispatchPropagationEvent(e, a, b);
  1907. return !e.isDefaultPrevented()
  1908. };
  1909. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  1910. for (var c = a.length, d = 0; d < c; d++) {
  1911. var g = a[d];
  1912. e._setCurrentTarget(g);
  1913. e._target = this;
  1914. e._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  1915. g._notifyListener(e);
  1916. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  1917. }
  1918. };
  1919. a.prototype.willTrigger = function(e) {
  1920. for (var a = this; a;) {
  1921. if (a.hasEventListener(e)) return !0;
  1922. a = a._parent
  1923. }
  1924. return !1
  1925. };
  1926. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1927. get: function() {
  1928. return this._cacheAsBitmap
  1929. },
  1930. set: function(e) {
  1931. (this._cacheAsBitmap = e) ? (this.renderTexture ||
  1932. (this.renderTexture = new b.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1933. },
  1934. enumerable: !0,
  1935. configurable: !0
  1936. });
  1937. a.getTransformBounds = function(e, a) {
  1938. var b, c, d = e.width,
  1939. g = e.height,
  1940. k = d * a.a,
  1941. d = d * a.b,
  1942. n = g * a.c,
  1943. g = g * a.d,
  1944. p = a.tx,
  1945. q = a.ty,
  1946. t = p,
  1947. r = p,
  1948. s = q,
  1949. u = q;
  1950. (b = k + p) < t ? t = b : b > r && (r = b);
  1951. (b = k + n + p) < t ? t = b : b > r && (r = b);
  1952. (b = n + p) < t ? t = b : b > r && (r = b);
  1953. (c = d + q) < s ? s = c : c > u && (u = c);
  1954. (c = d + g + q) < s ? s = c : c > u && (u = c);
  1955. (c = g + q) < s ? s = c : c > u && (u = c);
  1956. return e.initialize(t, s, r - t, u - s)
  1957. };
  1958. a.identityMatrixForGetConcatenated =
  1959. new b.Matrix;
  1960. a._enterFrameCallBackList = [];
  1961. a._renderCallBackList = [];
  1962. return a
  1963. }(b.EventDispatcher);
  1964. b.DisplayObject = d;
  1965. d.prototype.__class__ = "egret.DisplayObject"
  1966. })(egret);
  1967. __extends = this.__extends || function(b, d) {
  1968. function c() {
  1969. this.constructor = b
  1970. }
  1971. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1972. c.prototype = d.prototype;
  1973. b.prototype = new c
  1974. };
  1975. (function(b) {
  1976. var d = function(c) {
  1977. function a() {
  1978. c.call(this);
  1979. this._touchChildren = !0;
  1980. this._children = []
  1981. }
  1982. __extends(a, c);
  1983. Object.defineProperty(a.prototype, "touchChildren", {
  1984. get: function() {
  1985. return this._touchChildren
  1986. },
  1987. set: function(e) {
  1988. this._touchChildren = e
  1989. },
  1990. enumerable: !0,
  1991. configurable: !0
  1992. });
  1993. Object.defineProperty(a.prototype, "numChildren", {
  1994. get: function() {
  1995. return this._children.length
  1996. },
  1997. enumerable: !0,
  1998. configurable: !0
  1999. });
  2000. a.prototype.setChildIndex = function(e, a) {
  2001. this.doSetChildIndex(e, a)
  2002. };
  2003. a.prototype.doSetChildIndex = function(e,
  2004. a) {
  2005. var c = this._children.indexOf(e);
  2006. 0 > c && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2007. this._children.splice(c, 1);
  2008. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2009. };
  2010. a.prototype.addChild = function(e) {
  2011. var a = this.numChildren;
  2012. e._parent == this && a--;
  2013. return this._doAddChild(e, a)
  2014. };
  2015. a.prototype.addChildAt = function(e, a) {
  2016. return this._doAddChild(e, a)
  2017. };
  2018. a.prototype._doAddChild = function(e, h, c) {
  2019. "undefined" === typeof c && (c = !0);
  2020. if (e == this) return e;
  2021. if (0 > h || h > this._children.length) return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2022. e;
  2023. var d = e.parent;
  2024. if (d == this) return this.doSetChildIndex(e, h), e;
  2025. d && d.removeChild(e);
  2026. this._children.splice(h, 0, e);
  2027. e._parentChanged(this);
  2028. c && e.dispatchEventWith(b.Event.ADDED, !0);
  2029. if (this._stage)
  2030. for (e._onAddToStage(), h = a.__EVENT__ADD_TO_STAGE_LIST; 0 < h.length;) h.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2031. e._setDirty();
  2032. this._setSizeDirty();
  2033. return e
  2034. };
  2035. a.prototype.removeChild = function(e) {
  2036. e = this._children.indexOf(e);
  2037. if (0 <= e) return this._doRemoveChild(e);
  2038. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2039. return null
  2040. };
  2041. a.prototype.removeChildAt = function(e) {
  2042. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2043. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2044. return null
  2045. };
  2046. a.prototype._doRemoveChild = function(e, h) {
  2047. "undefined" === typeof h && (h = !0);
  2048. var c = this._children,
  2049. d = c[e];
  2050. h && d.dispatchEventWith(b.Event.REMOVED, !0);
  2051. if (this._stage) {
  2052. d._onRemoveFromStage();
  2053. for (var f = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) f.shift().dispatchEventWith(b.Event.REMOVED_FROM_STAGE)
  2054. }
  2055. d._parentChanged(null);
  2056. c.splice(e, 1);
  2057. this._setSizeDirty();
  2058. return d
  2059. };
  2060. a.prototype.getChildAt = function(e) {
  2061. if (0 <= e && e < this._children.length) return this._children[e];
  2062. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2063. return null
  2064. };
  2065. a.prototype.contains = function(e) {
  2066. for (; e;) {
  2067. if (e == this) return !0;
  2068. e = e._parent
  2069. }
  2070. return !1
  2071. };
  2072. a.prototype.swapChildrenAt = function(e, a) {
  2073. 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")
  2074. };
  2075. a.prototype.swapChildren = function(a, h) {
  2076. var c = this._children.indexOf(a),
  2077. d = this._children.indexOf(h); - 1 == c || -1 == d ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(c, d)
  2078. };
  2079. a.prototype._swapChildrenAt = function(a, b) {
  2080. if (a != b) {
  2081. var c = this._children,
  2082. d = c[a];
  2083. c[a] = c[b];
  2084. c[b] = d
  2085. }
  2086. };
  2087. a.prototype.getChildIndex = function(a) {
  2088. return this._children.indexOf(a)
  2089. };
  2090. a.prototype.removeChildren = function() {
  2091. for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
  2092. };
  2093. a.prototype._updateTransform =
  2094. function() {
  2095. if (this.visible) {
  2096. c.prototype._updateTransform.call(this);
  2097. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._updateTransform()
  2098. }
  2099. };
  2100. a.prototype._render = function(a) {
  2101. for (var b = 0, c = this._children.length; b < c; b++) this._children[b]._draw(a)
  2102. };
  2103. a.prototype._measureBounds = function() {
  2104. for (var a = 0, h = 0, c = 0, d = 0, f = this._children.length, g = 0; g < f; g++) {
  2105. var k = this._children[g],
  2106. n;
  2107. if (k.visible && (n = b.DisplayObject.getTransformBounds(k._getSize(b.Rectangle.identity), k._getMatrix()))) {
  2108. var k = n.x,
  2109. p = n.y,
  2110. q =
  2111. n.width + n.x,
  2112. t = n.height + n.y;
  2113. if (k < a || 0 == g) a = k;
  2114. if (q > h || 0 == g) h = q;
  2115. if (p < c || 0 == g) c = p;
  2116. if (t > d || 0 == g) d = t
  2117. }
  2118. }
  2119. return b.Rectangle.identity.initialize(a, c, h - a, d - c)
  2120. };
  2121. a.prototype.hitTest = function(a, h, d) {
  2122. "undefined" === typeof d && (d = !1);
  2123. var l;
  2124. if (!this.visible) return null;
  2125. if (this._scrollRect) {
  2126. if (0 > a || 0 > h || a > this._scrollRect.width || h > this._scrollRect.height) return null
  2127. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > h || h > this.mask.y + this.mask.height)) return null;
  2128. for (var f = this._children, g =
  2129. this._touchChildren, k = f.length - 1; 0 <= k; k--) {
  2130. var n = f[k],
  2131. p = n,
  2132. q = p._getOffsetPoint(),
  2133. t = p._x,
  2134. r = p._y;
  2135. this._scrollRect && (t -= this._scrollRect.x, r -= this._scrollRect.y);
  2136. p = b.Matrix.identity.identity().prependTransform(t, r, p._scaleX, p._scaleY, p._rotation, 0, 0, q.x, q.y);
  2137. p.invert();
  2138. p = b.Matrix.transformCoords(p, a, h);
  2139. if (n = n.hitTest(p.x, p.y, !0)) {
  2140. if (n._touchEnabled && g) return n;
  2141. if (this._touchEnabled) return this;
  2142. null == l && (l = n)
  2143. }
  2144. }
  2145. return l ? l : c.prototype.hitTest.call(this, a, h, d)
  2146. };
  2147. a.prototype._onAddToStage = function() {
  2148. c.prototype._onAddToStage.call(this);
  2149. for (var a = this.numChildren, b = 0; b < a; b++) this._children[b]._onAddToStage()
  2150. };
  2151. a.prototype._onRemoveFromStage = function() {
  2152. c.prototype._onRemoveFromStage.call(this);
  2153. for (var a = this.numChildren, b = 0; b < a; b++) this._children[b]._onRemoveFromStage()
  2154. };
  2155. a.prototype.getChildByName = function(a) {
  2156. for (var b = this._children, c = this.numChildren, d, f = 0; f < c; f++)
  2157. if (d = b[f], d.name == a) return d;
  2158. return null
  2159. };
  2160. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2161. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2162. return a
  2163. }(b.DisplayObject);
  2164. b.DisplayObjectContainer = d;
  2165. d.prototype.__class__ =
  2166. "egret.DisplayObjectContainer"
  2167. })(egret);
  2168. __extends = this.__extends || function(b, d) {
  2169. function c() {
  2170. this.constructor = b
  2171. }
  2172. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2173. c.prototype = d.prototype;
  2174. b.prototype = new c
  2175. };
  2176. (function(b) {
  2177. var d = function(c) {
  2178. function a(a, b) {
  2179. "undefined" === typeof a && (a = 480);
  2180. "undefined" === typeof b && (b = 800);
  2181. c.call(this);
  2182. this.touchEnabled = !0;
  2183. this._stage = this;
  2184. this._stageWidth = a;
  2185. this._stageHeight = b
  2186. }
  2187. __extends(a, c);
  2188. a.prototype.invalidate = function() {
  2189. a._invalidateRenderFlag = !0
  2190. };
  2191. Object.defineProperty(a.prototype, "scaleMode", {
  2192. get: function() {
  2193. return this._scaleMode
  2194. },
  2195. set: function(a) {
  2196. if (this._scaleMode != a) {
  2197. this._scaleMode = a;
  2198. var h = {};
  2199. h[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2200. h[b.StageScaleMode.SHOW_ALL] =
  2201. new b.FixedWidth;
  2202. a = h[a];
  2203. if (!a) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2204. h = new b.EqualToFrame;
  2205. a = new b.ResolutionPolicy(h, a);
  2206. b.StageDelegate.getInstance()._setResolutionPolicy(a);
  2207. a = document.getElementById(b.StageDelegate.canvas_name);
  2208. this._stageWidth = a.width;
  2209. this._stageHeight = a.height;
  2210. this.dispatchEventWith(b.Event.RESIZE)
  2211. }
  2212. },
  2213. enumerable: !0,
  2214. configurable: !0
  2215. });
  2216. Object.defineProperty(a.prototype, "stageWidth", {
  2217. get: function() {
  2218. return this._stageWidth
  2219. },
  2220. enumerable: !0,
  2221. configurable: !0
  2222. });
  2223. Object.defineProperty(a.prototype, "stageHeight", {
  2224. get: function() {
  2225. return this._stageHeight
  2226. },
  2227. enumerable: !0,
  2228. configurable: !0
  2229. });
  2230. a.prototype.hitTest = function(a, h) {
  2231. if (!this.touchEnabled) return null;
  2232. var c;
  2233. if (!this.visible) return this;
  2234. for (var d = this._children, f = d.length - 1; 0 <= f; f--) {
  2235. var g = c = d[f],
  2236. k = g._getOffsetPoint(),
  2237. g = b.Matrix.identity.identity().prependTransform(g.x, g.y, g.scaleX, g.scaleY, g.rotation, 0, 0, k.x, k.y);
  2238. g.invert();
  2239. g = b.Matrix.transformCoords(g, a, h);
  2240. if ((c = c.hitTest(g.x, g.y, !0)) && c.touchEnabled) return c
  2241. }
  2242. return this
  2243. };
  2244. a.prototype.getBounds = function(a) {
  2245. a || (a = new b.Rectangle);
  2246. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2247. };
  2248. a.prototype._updateTransform = function() {
  2249. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._updateTransform()
  2250. };
  2251. a._invalidateRenderFlag = !1;
  2252. return a
  2253. }(b.DisplayObjectContainer);
  2254. b.Stage = d;
  2255. d.prototype.__class__ = "egret.Stage"
  2256. })(egret);
  2257. (function(b) {
  2258. var d = function() {
  2259. function b() {}
  2260. b.NO_SCALE = "noScale";
  2261. b.SHOW_ALL = "showAll";
  2262. return b
  2263. }();
  2264. b.StageScaleMode = d;
  2265. d.prototype.__class__ = "egret.StageScaleMode"
  2266. })(egret);
  2267. (function(b) {
  2268. var d = function() {
  2269. function b() {}
  2270. b.REPEAT = "repeat";
  2271. b.SCALE = "scale";
  2272. return b
  2273. }();
  2274. b.BitmapFillMode = d;
  2275. d.prototype.__class__ = "egret.BitmapFillMode"
  2276. })(egret);
  2277. __extends = this.__extends || function(b, d) {
  2278. function c() {
  2279. this.constructor = b
  2280. }
  2281. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2282. c.prototype = d.prototype;
  2283. b.prototype = new c
  2284. };
  2285. (function(b) {
  2286. var d = function(c) {
  2287. function a(a) {
  2288. c.call(this);
  2289. this.debug = !1;
  2290. this.debugColor = 16711680;
  2291. this.fillMode = "scale";
  2292. a && (this._texture = a, this._setSizeDirty())
  2293. }
  2294. __extends(a, c);
  2295. Object.defineProperty(a.prototype, "texture", {
  2296. get: function() {
  2297. return this._texture
  2298. },
  2299. set: function(a) {
  2300. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2301. },
  2302. enumerable: !0,
  2303. configurable: !0
  2304. });
  2305. a.prototype._render = function(e) {
  2306. var b = this._texture;
  2307. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth : b._textureWidth,
  2308. this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2309. };
  2310. a._drawBitmap = function(e, h, c, d) {
  2311. var f = d._texture_to_render;
  2312. if (f) {
  2313. var g = f._textureWidth,
  2314. k = f._textureHeight;
  2315. if ("scale" == d.fillMode) {
  2316. var n = d.scale9Grid || f.scale9Grid;
  2317. if (n && g - n.width < h && k - n.height < c) a.drawScale9GridImage(e, d, n, h, c);
  2318. else {
  2319. var n = f._offsetX,
  2320. p = f._offsetY,
  2321. q = f._bitmapWidth || g,
  2322. t = f._bitmapHeight || k;
  2323. h /= g;
  2324. n = Math.round(n * h);
  2325. h = Math.round(q * h);
  2326. c /= k;
  2327. p = Math.round(p * c);
  2328. c = Math.round(t * c);
  2329. b.RenderFilter.getInstance().drawImage(e,
  2330. d, f._bitmapX, f._bitmapY, q, t, n, p, h, c)
  2331. }
  2332. } else a.drawRepeatImage(e, d, h, c)
  2333. }
  2334. };
  2335. a.drawRepeatImage = function(a, h, c, d) {
  2336. var f = h._texture_to_render;
  2337. if (f)
  2338. for (var g = f._textureWidth, k = f._textureHeight, n = f._bitmapX, p = f._bitmapY, q = f._bitmapWidth || g, t = f._bitmapHeight || k, r = f._offsetX, f = f._offsetY, s = b.RenderFilter.getInstance(); r < c; r += g)
  2339. for (var u = f; u < d; u += k) {
  2340. var v = Math.min(q, c - r),
  2341. x = Math.min(t, d - u);
  2342. s.drawImage(a, h, n, p, q, t, r, u, v, x)
  2343. }
  2344. };
  2345. a.drawScale9GridImage = function(a, h, c, d, f) {
  2346. var g = h._texture_to_render;
  2347. if (g && c) {
  2348. var k = b.RenderFilter.getInstance(),
  2349. n = g._textureWidth,
  2350. p = g._textureHeight,
  2351. q = g._bitmapX,
  2352. t = g._bitmapY,
  2353. r = g._bitmapWidth || n,
  2354. s = g._bitmapHeight || p,
  2355. u = g._offsetX,
  2356. g = g._offsetY;
  2357. c = b.Rectangle.identity.initialize(c.x - Math.round(u), c.y - Math.round(u), c.width, c.height);
  2358. u = Math.round(u);
  2359. g = Math.round(g);
  2360. d -= n - r;
  2361. f -= p - s;
  2362. c.y == c.bottom && (c.bottom < s ? c.bottom++ : c.y--);
  2363. c.x == c.right && (c.right < r ? c.right++ : c.x--);
  2364. var n = q + c.x,
  2365. p = q + c.right,
  2366. v = r - c.right,
  2367. x = t + c.y,
  2368. y = t + c.bottom,
  2369. w = s - c.bottom,
  2370. z = u + c.x,
  2371. A = g + c.y,
  2372. s = f - (s - c.bottom),
  2373. r = d - (r - c.right);
  2374. k.drawImage(a, h, q, t, c.x, c.y, u, g,
  2375. c.x, c.y);
  2376. k.drawImage(a, h, n, t, c.width, c.y, z, g, r - c.x, c.y);
  2377. k.drawImage(a, h, p, t, v, c.y, u + r, g, d - r, c.y);
  2378. k.drawImage(a, h, q, x, c.x, c.height, u, A, c.x, s - c.y);
  2379. k.drawImage(a, h, n, x, c.width, c.height, z, A, r - c.x, s - c.y);
  2380. k.drawImage(a, h, p, x, v, c.height, u + r, A, d - r, s - c.y);
  2381. k.drawImage(a, h, q, y, c.x, w, u, g + s, c.x, f - s);
  2382. k.drawImage(a, h, n, y, c.width, w, z, g + s, r - c.x, f - s);
  2383. k.drawImage(a, h, p, y, v, w, u + r, g + s, d - r, f - s)
  2384. }
  2385. };
  2386. a.prototype._measureBounds = function() {
  2387. var a = this._texture;
  2388. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth,
  2389. a._textureHeight) : c.prototype._measureBounds.call(this)
  2390. };
  2391. a.debug = !1;
  2392. return a
  2393. }(b.DisplayObject);
  2394. b.Bitmap = d;
  2395. d.prototype.__class__ = "egret.Bitmap"
  2396. })(egret);
  2397. __extends = this.__extends || function(b, d) {
  2398. function c() {
  2399. this.constructor = b
  2400. }
  2401. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2402. c.prototype = d.prototype;
  2403. b.prototype = new c
  2404. };
  2405. (function(b) {
  2406. var d = function(c) {
  2407. function a() {
  2408. c.call(this);
  2409. this._text = "";
  2410. this._textChanged = !1;
  2411. this._bitmapPool = []
  2412. }
  2413. __extends(a, c);
  2414. Object.defineProperty(a.prototype, "text", {
  2415. get: function() {
  2416. return this._text
  2417. },
  2418. set: function(a) {
  2419. this._textChanged = !0;
  2420. this._text = a
  2421. },
  2422. enumerable: !0,
  2423. configurable: !0
  2424. });
  2425. a.prototype._updateTransform = function() {
  2426. this.visible && (this._textChanged && this._renderText(), c.prototype._updateTransform.call(this))
  2427. };
  2428. a.prototype._renderText = function(a) {
  2429. var c = a = 0;
  2430. this._textChanged && this.removeChildren();
  2431. for (var d = 0, l = this.text.length; d < l; d++) {
  2432. var f = this.text.charAt(d),
  2433. g = this.spriteSheet.getTexture(f);
  2434. if (null == g) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + f);
  2435. else {
  2436. var f = g._offsetX,
  2437. k = g._offsetY,
  2438. n = g._textureWidth;
  2439. if (this._textChanged) {
  2440. var p = this._bitmapPool[d];
  2441. p || (p = new b.Bitmap, this._bitmapPool.push(p));
  2442. p.texture = g;
  2443. this.addChild(p);
  2444. p.x = a
  2445. }
  2446. a += n + f;
  2447. k + g._textureHeight > c && (c = k + g._textureHeight)
  2448. }
  2449. }
  2450. this._textChanged = !1;
  2451. return b.Rectangle.identity.initialize(0, 0, a, c)
  2452. };
  2453. a.prototype._measureBounds =
  2454. function() {
  2455. return this._renderText(!0)
  2456. };
  2457. return a
  2458. }(b.DisplayObjectContainer);
  2459. b.BitmapText = d;
  2460. d.prototype.__class__ = "egret.BitmapText"
  2461. })(egret);
  2462. (function(b) {
  2463. var d = function() {
  2464. function b() {
  2465. this.commandQueue = [];
  2466. }
  2467. b.prototype.beginFill = function(a, e) {};
  2468. b.prototype._setStyle = function(a) {};
  2469. b.prototype.drawRect = function(a, e, b, c) {};
  2470. b.prototype.drawCircle = function(a, e, b) {};
  2471. b.prototype.lineStyle = function(a, e, b, c, d, f, g, k) {};
  2472. b.prototype.lineTo = function(a, e) {};
  2473. b.prototype.curveTo = function(a, e, b, c) {};
  2474. b.prototype.moveTo = function(a, e) {};
  2475. b.prototype.clear = function() {};
  2476. b.prototype.endFill = function() {};
  2477. b.prototype._draw = function(a) {};
  2478. return b;
  2479. }();
  2480. b.Graphics = d;
  2481. d.prototype.__class__ = "egret.Graphics";
  2482. (function(){
  2483. var mb = function(b, a, e) {
  2484. this.method = b;
  2485. this.thisObject = a;
  2486. this.args = e
  2487. }
  2488. mb.prototype.__class__ = "Command";
  2489. return mb;
  2490. })();
  2491. })(egret);
  2492. __extends = this.__extends || function(b, d) {
  2493. function c() {
  2494. this.constructor = b
  2495. }
  2496. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2497. c.prototype = d.prototype;
  2498. b.prototype = new c;
  2499. };
  2500. (function(b) {
  2501. var d = function(c) {
  2502. function a() {
  2503. c.call(this)
  2504. }
  2505. __extends(a, c);
  2506. Object.defineProperty(a.prototype, "graphics", {
  2507. get: function() {
  2508. this._graphics || (this._graphics = new b.Graphics);
  2509. return this._graphics
  2510. },
  2511. enumerable: !0,
  2512. configurable: !0
  2513. });
  2514. a.prototype._render = function(a) {
  2515. this._graphics && this._graphics._draw(a)
  2516. };
  2517. return a
  2518. }(b.DisplayObject);
  2519. b.Shape = d;
  2520. d.prototype.__class__ = "egret.Shape"
  2521. })(egret);
  2522. __extends = this.__extends || function(b, d) {
  2523. function c() {
  2524. this.constructor = b
  2525. }
  2526. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2527. c.prototype = d.prototype;
  2528. b.prototype = new c
  2529. };
  2530. (function(b) {
  2531. var d = function(c) {
  2532. function a() {
  2533. c.call(this)
  2534. }
  2535. __extends(a, c);
  2536. Object.defineProperty(a.prototype, "graphics", {
  2537. get: function() {
  2538. this._graphics || (this._graphics = new b.Graphics);
  2539. return this._graphics
  2540. },
  2541. enumerable: !0,
  2542. configurable: !0
  2543. });
  2544. a.prototype._render = function(a) {
  2545. this._graphics && this._graphics._draw(a);
  2546. c.prototype._render.call(this, a)
  2547. };
  2548. return a
  2549. }(b.DisplayObjectContainer);
  2550. b.Sprite = d;
  2551. d.prototype.__class__ = "egret.Sprite"
  2552. })(egret);
  2553. __extends = this.__extends || function(b, d) {
  2554. function c() {
  2555. this.constructor = b
  2556. }
  2557. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2558. c.prototype = d.prototype;
  2559. b.prototype = new c
  2560. };
  2561. (function(b) {
  2562. var d = function(c) {
  2563. function a() {
  2564. c.call(this);
  2565. this._fontFamily = "Arial";
  2566. this._size = 30;
  2567. this._textColorString = "#FFFFFF";
  2568. this._textColor = 16777215;
  2569. this._strokeColorString = "#000000";
  2570. this._stroke = this._strokeColor = 0;
  2571. this._textAlign = "left";
  2572. this._verticalAlign = "top";
  2573. this._numLines = this._lineSpacing = 0;
  2574. this.measuredWidths = []
  2575. }
  2576. __extends(a, c);
  2577. Object.defineProperty(a.prototype, "text", {
  2578. get: function() {
  2579. return this._text
  2580. },
  2581. set: function(a) {
  2582. this._text != a && (this._setTextDirty(), this._text = a)
  2583. },
  2584. enumerable: !0,
  2585. configurable: !0
  2586. });
  2587. a.prototype._setTextDirty = function() {
  2588. this._setSizeDirty()
  2589. };
  2590. Object.defineProperty(a.prototype, "fontFamily", {
  2591. get: function() {
  2592. return this._fontFamily
  2593. },
  2594. set: function(a) {
  2595. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  2596. },
  2597. enumerable: !0,
  2598. configurable: !0
  2599. });
  2600. Object.defineProperty(a.prototype, "size", {
  2601. get: function() {
  2602. return this._size
  2603. },
  2604. set: function(a) {
  2605. this._size != a && (this._setTextDirty(), this._size = a)
  2606. },
  2607. enumerable: !0,
  2608. configurable: !0
  2609. });
  2610. Object.defineProperty(a.prototype, "italic", {
  2611. get: function() {
  2612. return this._italic
  2613. },
  2614. set: function(a) {
  2615. this._italic != a && (this._setTextDirty(), this._italic = a)
  2616. },
  2617. enumerable: !0,
  2618. configurable: !0
  2619. });
  2620. Object.defineProperty(a.prototype, "bold", {
  2621. get: function() {
  2622. return this._bold
  2623. },
  2624. set: function(a) {
  2625. this._bold != a && (this._setTextDirty(), this._bold = a)
  2626. },
  2627. enumerable: !0,
  2628. configurable: !0
  2629. });
  2630. Object.defineProperty(a.prototype, "textColor", {
  2631. get: function() {
  2632. return this._textColor
  2633. },
  2634. set: function(a) {
  2635. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = b.toColorString(a))
  2636. },
  2637. enumerable: !0,
  2638. configurable: !0
  2639. });
  2640. Object.defineProperty(a.prototype, "strokeColor", {
  2641. get: function() {
  2642. return this._strokeColor
  2643. },
  2644. set: function(a) {
  2645. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = b.toColorString(a))
  2646. },
  2647. enumerable: !0,
  2648. configurable: !0
  2649. });
  2650. Object.defineProperty(a.prototype, "stroke", {
  2651. get: function() {
  2652. return this._stroke
  2653. },
  2654. set: function(a) {
  2655. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  2656. },
  2657. enumerable: !0,
  2658. configurable: !0
  2659. });
  2660. Object.defineProperty(a.prototype, "textAlign", {
  2661. get: function() {
  2662. return this._textAlign
  2663. },
  2664. set: function(a) {
  2665. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  2666. },
  2667. enumerable: !0,
  2668. configurable: !0
  2669. });
  2670. Object.defineProperty(a.prototype, "verticalAlign", {
  2671. get: function() {
  2672. return this._verticalAlign
  2673. },
  2674. set: function(a) {
  2675. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  2676. },
  2677. enumerable: !0,
  2678. configurable: !0
  2679. });
  2680. Object.defineProperty(a.prototype, "lineSpacing", {
  2681. get: function() {
  2682. return this._lineSpacing
  2683. },
  2684. set: function(a) {
  2685. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  2686. },
  2687. enumerable: !0,
  2688. configurable: !0
  2689. });
  2690. Object.defineProperty(a.prototype, "numLines", {
  2691. get: function() {
  2692. return this._numLines
  2693. },
  2694. enumerable: !0,
  2695. configurable: !0
  2696. });
  2697. a.prototype._render = function(a) {
  2698. this.drawText(a, !1);
  2699. this._clearDirty()
  2700. };
  2701. a.prototype._measureBounds = function() {
  2702. return this.drawText(b.MainContext.instance.rendererContext, !0)
  2703. };
  2704. a.prototype.drawText = function(a, c) {
  2705. var d = this.getTextLines(a);
  2706. if (!d) return b.Rectangle.identity.initialize(0, 0, 0, 0);
  2707. var l = d.length,
  2708. f = 0.5 * this._size,
  2709. g = this._size + this._lineSpacing,
  2710. k = l * g - this._lineSpacing;
  2711. this._textHeight = k;
  2712. var n = this._hasHeightSet ? this._explicitHeight : Number.POSITIVE_INFINITY;
  2713. if (this._hasHeightSet && k < n) {
  2714. var p = 0;
  2715. this._verticalAlign == b.VerticalAlign.MIDDLE ? p = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (p = 1);
  2716. f += p * (n - k)
  2717. }
  2718. var p = f = Math.round(f),
  2719. q = 0;
  2720. this._textAlign == b.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (q = 1);
  2721. var t = this.measuredWidths,
  2722. r;
  2723. r = this._hasWidthSet ? this._explicitWidth : this._textWidth;
  2724. for (var s = Number.POSITIVE_INFINITY, u = 0; u < l; u++) {
  2725. var v = d[u],
  2726. x = Math.round((r - t[u]) * q);
  2727. x < s && (s = x);
  2728. !c && f < n && a.drawText(this, v, x, f, r);
  2729. f += g
  2730. }
  2731. return b.Rectangle.identity.initialize(s, p, r, k)
  2732. };
  2733. a.prototype.getTextLines = function(a) {
  2734. var b = this.text ? this.text.toString() : "";
  2735. if (!b) return null;
  2736. var c = this.measuredWidths;
  2737. c.length = 0;
  2738. a.setupFont(this);
  2739. var b = b.split(/(?:\r\n|\r|\n)/),
  2740. d = b.length,
  2741. f = 0;
  2742. if (this._hasWidthSet)
  2743. for (var g = this._explicitWidth, k = 0; k < d; k++) {
  2744. var n = b[k],
  2745. p = a.measureText(n);
  2746. if (p > g) {
  2747. for (var q = "", t = 0, r = n.length, s = 0; s < r; s++) {
  2748. var u = n.charAt(s),
  2749. p = a.measureText(u);
  2750. t + p > g && (0 == t ? (b.splice(k, 0, u), c[k] = p, f < p && (f = p), p = 0, u = "") : (b.splice(k, 0, q), c[k] = t, f < t && (f = t), q = "", t = 0), k++, d++);
  2751. t += p;
  2752. q += u
  2753. }
  2754. b[k] = q;
  2755. c[k] = t
  2756. } else c[k] = p, f < p && (f = p)
  2757. } else
  2758. for (k = 0; k < d; k++) n = b[k], p = a.measureText(n), c[k] = p, f < p && (f = p);
  2759. this._textWidth = f;
  2760. return b
  2761. };
  2762. return a
  2763. }(b.DisplayObject);
  2764. b.TextField = d;
  2765. d.prototype.__class__ = "egret.TextField"
  2766. })(egret);
  2767. (function(b) {
  2768. var d = function() {
  2769. function b() {}
  2770. b.DYNAMIC = "dynamic";
  2771. b.INPUT = "input";
  2772. return b
  2773. }();
  2774. b.TextFieldType = d;
  2775. d.prototype.__class__ = "egret.TextFieldType"
  2776. })(egret);
  2777. __extends = this.__extends || function(b, d) {
  2778. function c() {
  2779. this.constructor = b
  2780. }
  2781. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2782. c.prototype = d.prototype;
  2783. b.prototype = new c
  2784. };
  2785. (function(b) {
  2786. var d = function(c) {
  2787. function a(a) {
  2788. c.call(this);
  2789. var b = a.bitmapData;
  2790. this.bitmapData = b;
  2791. this._textureMap = {};
  2792. this._sourceWidth = b.width;
  2793. this._sourceHeight = b.height;
  2794. this._bitmapX = a._bitmapX - a._offsetX;
  2795. this._bitmapY = a._bitmapY - a._offsetY
  2796. }
  2797. __extends(a, c);
  2798. a.prototype.getTexture = function(a) {
  2799. return this._textureMap[a]
  2800. };
  2801. a.prototype.createTexture = function(a, c, d, l, f, g, k, n, p) {
  2802. "undefined" === typeof g && (g = 0);
  2803. "undefined" === typeof k && (k = 0);
  2804. "undefined" === typeof n && (n = g + l);
  2805. "undefined" === typeof p && (p = k + f);
  2806. var q =
  2807. new b.Texture;
  2808. q._bitmapData = this.bitmapData;
  2809. q._bitmapX = this._bitmapX + c;
  2810. q._bitmapY = this._bitmapY + d;
  2811. q._bitmapWidth = l;
  2812. q._bitmapHeight = f;
  2813. q._offsetX = g;
  2814. q._offsetY = k;
  2815. q._textureWidth = n;
  2816. q._textureHeight = p;
  2817. q._sourceWidth = this._sourceWidth;
  2818. q._sourceHeight = this._sourceHeight;
  2819. return this._textureMap[a] = q
  2820. };
  2821. return a
  2822. }(b.HashObject);
  2823. b.SpriteSheet = d;
  2824. d.prototype.__class__ = "egret.SpriteSheet"
  2825. })(egret);
  2826. __extends = this.__extends || function(b, d) {
  2827. function c() {
  2828. this.constructor = b
  2829. }
  2830. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2831. c.prototype = d.prototype;
  2832. b.prototype = new c
  2833. };
  2834. (function(b) {
  2835. var d = function(c) {
  2836. function a() {
  2837. c.apply(this, arguments);
  2838. this._placeholderText = "";
  2839. this._edFontSize = 14;
  2840. this._textColor = 16711680;
  2841. this._placeholderFontSize = 14;
  2842. this._placeholderColor = 16776960;
  2843. this._preY = this._preX = 0
  2844. }
  2845. __extends(a, c);
  2846. a.prototype._onAddToStage = function() {
  2847. c.prototype._onAddToStage.call(this);
  2848. var a = this.localToGlobal(),
  2849. h = new b.StageText;
  2850. h._open(a.x, a.y, this._explicitWidth, this._explicitHeight);
  2851. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2852. this.stageText =
  2853. h
  2854. };
  2855. a.prototype.setText = function(a) {
  2856. this.stageText._setText(a)
  2857. };
  2858. a.prototype.getText = function() {
  2859. return this.stageText._getText()
  2860. };
  2861. a.prototype.setTextType = function(a) {
  2862. this.stageText._setTextType(a)
  2863. };
  2864. a.prototype.getTextType = function() {
  2865. return this.stageText._getTextType()
  2866. };
  2867. a.prototype.onMouseDownHandler = function(a) {};
  2868. a.prototype._onRemoveFromStage = function() {
  2869. this.stageText._remove()
  2870. };
  2871. a.prototype._measureBounds = function() {
  2872. return b.Rectangle.identity
  2873. };
  2874. a.prototype.hitTest = function(a, b, c) {
  2875. return null
  2876. };
  2877. return a
  2878. }(b.DisplayObject);
  2879. b.TextInput = d;
  2880. d.prototype.__class__ = "egret.TextInput";
  2881. d = function() {
  2882. function b() {}
  2883. b.prototype.editBoxEditingDidBegin = function(a) {};
  2884. b.prototype.editBoxEditingDidEnd = function(a) {};
  2885. b.prototype.editBoxTextChanged = function(a, e) {};
  2886. b.prototype.editBoxReturn = function(a) {};
  2887. return b
  2888. }();
  2889. b.TextInputDegelete = d;
  2890. d.prototype.__class__ = "egret.TextInputDegelete"
  2891. })(egret);
  2892. __extends = this.__extends || function(b, d) {
  2893. function c() {
  2894. this.constructor = b
  2895. }
  2896. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2897. c.prototype = d.prototype;
  2898. b.prototype = new c
  2899. };
  2900. (function(b) {
  2901. var d = function(b) {
  2902. function a(a, h) {
  2903. b.call(this, a);
  2904. this.charList = this.parseConfig(h)
  2905. }
  2906. __extends(a, b);
  2907. a.prototype.getTexture = function(a) {
  2908. var b = this._textureMap[a];
  2909. if (!b) {
  2910. b = this.charList[a];
  2911. if (!b) return null;
  2912. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  2913. this._textureMap[a] = b
  2914. }
  2915. return b
  2916. };
  2917. a.prototype.parseConfig = function(a) {
  2918. a = a.split("\r\n").join("\n");
  2919. a = a.split("\n");
  2920. for (var b = this.getConfigByKey(a[3], "count"), c = {}, d = 4; d < 4 + b; d++) {
  2921. var f = a[d],
  2922. g = String.fromCharCode(this.getConfigByKey(f,
  2923. "id")),
  2924. k = {};
  2925. c[g] = k;
  2926. k.x = this.getConfigByKey(f, "x");
  2927. k.y = this.getConfigByKey(f, "y");
  2928. k.width = this.getConfigByKey(f, "width");
  2929. k.height = this.getConfigByKey(f, "height");
  2930. k.offsetX = this.getConfigByKey(f, "xoffset");
  2931. k.offsetY = this.getConfigByKey(f, "yoffset")
  2932. }
  2933. return c
  2934. };
  2935. a.prototype.getConfigByKey = function(a, b) {
  2936. for (var c = a.split(" "), d = 0, f = c.length; d < f; d++) {
  2937. var g = c[d];
  2938. if (b == g.substring(0, b.length)) return c = g.substring(b.length + 1), parseInt(c)
  2939. }
  2940. return 0
  2941. };
  2942. return a
  2943. }(b.SpriteSheet);
  2944. b.BitmapTextSpriteSheet = d;
  2945. d.prototype.__class__ =
  2946. "egret.BitmapTextSpriteSheet"
  2947. })(egret);
  2948. __extends = this.__extends || function(b, d) {
  2949. function c() {
  2950. this.constructor = b
  2951. }
  2952. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2953. c.prototype = d.prototype;
  2954. b.prototype = new c
  2955. };
  2956. (function(b) {
  2957. var d = function(a) {
  2958. function e(e, d) {
  2959. a.call(this);
  2960. this.frameRate = 60;
  2961. e instanceof c ? (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 c(e, d);
  2962. this.delegate.setMovieClip(this)
  2963. }
  2964. __extends(e, a);
  2965. e.prototype.gotoAndPlay = function(a) {
  2966. this.delegate.gotoAndPlay(a)
  2967. };
  2968. e.prototype.gotoAndStop = function(a) {
  2969. this.delegate.gotoAndStop(a)
  2970. };
  2971. e.prototype.stop =
  2972. function() {
  2973. this.delegate.stop()
  2974. };
  2975. e.prototype.dispose = function() {
  2976. this.delegate.dispose()
  2977. };
  2978. e.prototype.release = function() {
  2979. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2980. this.dispose()
  2981. };
  2982. e.prototype.getCurrentFrameIndex = function() {
  2983. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2984. return this.delegate._currentFrameIndex
  2985. };
  2986. e.prototype.getTotalFrame = function() {
  2987. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2988. return this.delegate._totalFrame
  2989. };
  2990. e.prototype.setInterval = function(a) {
  2991. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2992. this.frameRate = 60 / a
  2993. };
  2994. e.prototype.getIsPlaying = function() {
  2995. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2996. return this.delegate.isPlaying
  2997. };
  2998. return e
  2999. }(b.DisplayObjectContainer);
  3000. b.MovieClip = d;
  3001. d.prototype.__class__ = "egret.MovieClip";
  3002. var c = function() {
  3003. function a(a, c) {
  3004. this.data = a;
  3005. this._currentFrameIndex = this._passTime =
  3006. this._totalFrame = 0;
  3007. this._isPlaying = !1;
  3008. this._frameData = a;
  3009. this._spriteSheet = new b.SpriteSheet(c)
  3010. }
  3011. a.prototype.setMovieClip = function(a) {
  3012. this.movieClip = a;
  3013. this.bitmap = new b.Bitmap;
  3014. this.movieClip.addChild(this.bitmap)
  3015. };
  3016. a.prototype.gotoAndPlay = function(a) {
  3017. this.checkHasFrame(a);
  3018. this._isPlaying = !0;
  3019. this._currentFrameIndex = 0;
  3020. this._currentFrameName = a;
  3021. this._totalFrame = this._frameData.frames[a].totalFrame;
  3022. this.playNextFrame();
  3023. this._passTime = 0;
  3024. b.Ticker.getInstance().register(this.update, this)
  3025. };
  3026. a.prototype.gotoAndStop =
  3027. function(a) {
  3028. this.checkHasFrame(a);
  3029. this.stop();
  3030. this._currentFrameIndex = this._passTime = 0;
  3031. this._currentFrameName = a;
  3032. this._totalFrame = this._frameData.frames[a].totalFrame;
  3033. this.playNextFrame()
  3034. };
  3035. a.prototype.stop = function() {
  3036. this._isPlaying = !1;
  3037. b.Ticker.getInstance().unregister(this.update, this)
  3038. };
  3039. a.prototype.dispose = function() {};
  3040. a.prototype.checkHasFrame = function(a) {
  3041. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  3042. };
  3043. a.prototype.update = function(a) {
  3044. for (var b =
  3045. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  3046. this._passTime += a
  3047. };
  3048. a.prototype.playNextFrame = function(a) {
  3049. "undefined" === typeof a && (a = !0);
  3050. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  3051. if (a) {
  3052. a = this.getTexture(b.res);
  3053. var c = this.bitmap;
  3054. c.x = b.x;
  3055. c.y = b.y;
  3056. c.texture = a
  3057. }
  3058. null != b.action && this.movieClip.dispatchEventWith(b.action);
  3059. this._currentFrameIndex++;
  3060. this._currentFrameIndex == this._totalFrame &&
  3061. (this._currentFrameIndex = 0)
  3062. };
  3063. a.prototype.getTexture = function(a) {
  3064. var b = this._frameData.res[a],
  3065. c = this._spriteSheet.getTexture(a);
  3066. c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  3067. return c
  3068. };
  3069. return a
  3070. }();
  3071. b.DefaultMovieClipDelegate = c;
  3072. c.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  3073. })(egret);
  3074. __extends = this.__extends || function(b, d) {
  3075. function c() {
  3076. this.constructor = b
  3077. }
  3078. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3079. c.prototype = d.prototype;
  3080. b.prototype = new c
  3081. };
  3082. (function(b) {
  3083. var d = function(c) {
  3084. function a() {
  3085. c.call(this)
  3086. }
  3087. __extends(a, c);
  3088. a.prototype._getText = function() {
  3089. return this.inputElement.value
  3090. };
  3091. a.prototype._setText = function(a) {
  3092. this.inputElement.value = a
  3093. };
  3094. a.prototype._setTextType = function(a) {
  3095. this.inputElement.type = a
  3096. };
  3097. a.prototype._getTextType = function() {
  3098. return this.inputElement.type
  3099. };
  3100. a.prototype._open = function(a, c, d, l) {
  3101. "undefined" === typeof d && (d = 160);
  3102. "undefined" === typeof l && (l = 21);
  3103. var f = b.StageDelegate.getInstance().getScaleX(),
  3104. g = b.StageDelegate.getInstance().getScaleY(),
  3105. k = document.createElement("input");
  3106. k.type = "text";
  3107. k.style.fontSize = "20px";
  3108. k.style.color = "#FFFFFF";
  3109. k.style.borderStyle = "none";
  3110. k.style.background = "none";
  3111. k.style.width = d * f + "px";
  3112. k.style.height = l * g + "px";
  3113. k.style.outline = "medium";
  3114. var n = b.Browser.getInstance().$new("div");
  3115. n.style.position = "absolute";
  3116. n.position.x = a * f;
  3117. n.style.width = d * f + "px";
  3118. n.style.height = l * g + "px";
  3119. n.position.y = c * g;
  3120. n.transforms();
  3121. n.appendChild(k);
  3122. a = b.Browser.getInstance().$("#StageDelegateDiv");
  3123. a || (d = document.getElementById(b.StageDelegate.canvas_div_name),
  3124. l = d.clientHeight, d = d.clientWidth, a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", a.style.position = "absolute", a.style.width = d + "px", a.style.maxHeight = l + "px", a.style.margin = "0px", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.position.y = -l, a.transforms());
  3125. a.appendChild(n);
  3126. this.div = n;
  3127. this.inputElement = k
  3128. };
  3129. a.prototype._remove = function() {
  3130. var a = this.div;
  3131. a && a.parentNode && a.parentNode.removeChild(a)
  3132. };
  3133. return a
  3134. }(b.HashObject);
  3135. b.StageText = d;
  3136. d.prototype.__class__ = "egret.StageText"
  3137. })(egret ||
  3138. (egret = {}));
  3139. (function(b) {
  3140. var d = function() {
  3141. function b() {}
  3142. b.GET = "GET";
  3143. b.POST = "POST";
  3144. return b
  3145. }();
  3146. b.URLRequestMethod = d;
  3147. d.prototype.__class__ = "egret.URLRequestMethod"
  3148. })(egret);
  3149. (function(b) {
  3150. var d = function() {
  3151. function b() {}
  3152. b.BINARY = "binary";
  3153. b.TEXT = "text";
  3154. b.VARIABLES = "variables";
  3155. b.TEXTURE = "texture";
  3156. b.SOUND = "sound";
  3157. return b
  3158. }();
  3159. b.URLLoaderDataFormat = d;
  3160. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  3161. })(egret);
  3162. __extends = this.__extends || function(b, d) {
  3163. function c() {
  3164. this.constructor = b
  3165. }
  3166. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3167. c.prototype = d.prototype;
  3168. b.prototype = new c
  3169. };
  3170. (function(b) {
  3171. var d = function(b) {
  3172. function a(a) {
  3173. "undefined" === typeof a && (a = null);
  3174. b.call(this);
  3175. null !== a && this.decode(a)
  3176. }
  3177. __extends(a, b);
  3178. a.prototype.decode = function(a) {
  3179. this.variables || (this.variables = {});
  3180. a = a.split("+").join(" ");
  3181. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  3182. };
  3183. a.prototype.toString = function() {
  3184. if (!this.variables) return "";
  3185. var a = this.variables,
  3186. b = "",
  3187. c = !0,
  3188. d;
  3189. for (d in a) c ? c = !1 : b += "&", b += d + "=" + a[d];
  3190. return b
  3191. };
  3192. return a
  3193. }(b.HashObject);
  3194. b.URLVariables = d;
  3195. d.prototype.__class__ = "egret.URLVariables"
  3196. })(egret);
  3197. __extends = this.__extends || function(b, d) {
  3198. function c() {
  3199. this.constructor = b
  3200. }
  3201. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3202. c.prototype = d.prototype;
  3203. b.prototype = new c
  3204. };
  3205. (function(b) {
  3206. var d = function(c) {
  3207. function a(a) {
  3208. "undefined" === typeof a && (a = null);
  3209. c.call(this);
  3210. this.method = b.URLRequestMethod.GET;
  3211. this.url = a
  3212. }
  3213. __extends(a, c);
  3214. return a
  3215. }(b.HashObject);
  3216. b.URLRequest = d;
  3217. d.prototype.__class__ = "egret.URLRequest"
  3218. })(egret);
  3219. __extends = this.__extends || function(b, d) {
  3220. function c() {
  3221. this.constructor = b
  3222. }
  3223. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3224. c.prototype = d.prototype;
  3225. b.prototype = new c
  3226. };
  3227. (function(b) {
  3228. var d = function(c) {
  3229. function a(a) {
  3230. "undefined" === typeof a && (a = null);
  3231. c.call(this);
  3232. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  3233. a && this.load(a)
  3234. }
  3235. __extends(a, c);
  3236. a.prototype.load = function(a) {
  3237. this._request = a;
  3238. this.data = null;
  3239. b.MainContext.instance.netContext.proceed(this)
  3240. };
  3241. return a
  3242. }(b.EventDispatcher);
  3243. b.URLLoader = d;
  3244. d.prototype.__class__ = "egret.URLLoader"
  3245. })(egret);
  3246. __extends = this.__extends || function(b, d) {
  3247. function c() {
  3248. this.constructor = b
  3249. }
  3250. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3251. c.prototype = d.prototype;
  3252. b.prototype = new c
  3253. };
  3254. (function(b) {
  3255. var d = function(c) {
  3256. function a() {
  3257. c.call(this);
  3258. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3259. }
  3260. __extends(a, c);
  3261. Object.defineProperty(a.prototype, "textureWidth", {
  3262. get: function() {
  3263. return this._textureWidth
  3264. },
  3265. enumerable: !0,
  3266. configurable: !0
  3267. });
  3268. Object.defineProperty(a.prototype, "textureHeight", {
  3269. get: function() {
  3270. return this._textureHeight
  3271. },
  3272. enumerable: !0,
  3273. configurable: !0
  3274. });
  3275. Object.defineProperty(a.prototype, "bitmapData", {
  3276. get: function() {
  3277. return this._bitmapData
  3278. },
  3279. enumerable: !0,
  3280. configurable: !0
  3281. });
  3282. a.prototype._setBitmapData = function(a) {
  3283. var c = b.MainContext.instance.rendererContext.texture_scale_factor;
  3284. this._bitmapData = a;
  3285. this._sourceWidth = a.width;
  3286. this._sourceHeight = a.height;
  3287. this._textureWidth = this._sourceWidth * c;
  3288. this._textureHeight = this._sourceHeight * c;
  3289. this._bitmapWidth = this._textureWidth;
  3290. this._bitmapHeight = this._textureHeight;
  3291. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3292. };
  3293. a.prototype.getPixel32 = function(a, b) {
  3294. return this._bitmapData.getContext("2d").getImageData(a,
  3295. b, 1, 1).data
  3296. };
  3297. return a
  3298. }(b.HashObject);
  3299. b.Texture = d;
  3300. d.prototype.__class__ = "egret.Texture"
  3301. })(egret);
  3302. __extends = this.__extends || function(b, d) {
  3303. function c() {
  3304. this.constructor = b
  3305. }
  3306. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3307. c.prototype = d.prototype;
  3308. b.prototype = new c
  3309. };
  3310. (function(b) {
  3311. var d = function(c) {
  3312. function a() {
  3313. c.call(this);
  3314. this._bitmapData = document.createElement("canvas");
  3315. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  3316. }
  3317. __extends(a, c);
  3318. a.prototype.drawToTexture = function(a) {
  3319. var c = this._bitmapData,
  3320. d = a.getBounds(b.Rectangle.identity);
  3321. c.width = d.width;
  3322. c.height = d.height;
  3323. a._worldTransform.identity();
  3324. a.worldAlpha = 1;
  3325. if (a instanceof b.DisplayObjectContainer) {
  3326. this._offsetX = d.x;
  3327. this._offsetY = d.y;
  3328. a._worldTransform.append(1, 0, 0, 1, -d.x, -d.y);
  3329. for (var c =
  3330. a._children, d = 0, l = c.length; d < l; d++) c[d]._updateTransform()
  3331. }
  3332. c = b.RenderFilter.getInstance();
  3333. d = c._drawAreaList.concat();
  3334. c._drawAreaList.length = 0;
  3335. this.renderContext.clearScreen();
  3336. this.webGLTexture = null;
  3337. (l = a.mask || a._scrollRect) && this.renderContext.pushMask(l);
  3338. a._render(this.renderContext);
  3339. l && this.renderContext.popMask();
  3340. c._drawAreaList = d;
  3341. this._textureWidth = this._bitmapData.width;
  3342. this._textureHeight = this._bitmapData.height;
  3343. this._sourceWidth = this._textureWidth;
  3344. this._sourceHeight = this._textureHeight
  3345. };
  3346. return a
  3347. }(b.Texture);
  3348. b.RenderTexture = d;
  3349. d.prototype.__class__ = "egret.RenderTexture"
  3350. })(egret);
  3351. __extends = this.__extends || function(b, d) {
  3352. function c() {
  3353. this.constructor = b
  3354. }
  3355. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3356. c.prototype = d.prototype;
  3357. b.prototype = new c
  3358. };
  3359. (function(b) {
  3360. var d = function(c) {
  3361. function a() {
  3362. c.call(this);
  3363. this.renderCost = 0;
  3364. this.texture_scale_factor = 1
  3365. }
  3366. __extends(a, c);
  3367. a.prototype.clearScreen = function() {};
  3368. a.prototype.clearRect = function(a, b, c, d) {};
  3369. a.prototype.drawImage = function(a, c, d, l, f, g, k, n, p) {
  3370. b.Profiler.getInstance().onDrawImage()
  3371. };
  3372. a.prototype.setTransform = function(a) {};
  3373. a.prototype.setAlpha = function(a, b) {};
  3374. a.prototype.setupFont = function(a) {};
  3375. a.prototype.measureText = function(a) {
  3376. return 0
  3377. };
  3378. a.prototype.drawText = function(a, c, d, l, f) {
  3379. b.Profiler.getInstance().onDrawImage()
  3380. };
  3381. a.prototype.strokeRect = function(a, b, c, d, f) {};
  3382. a.prototype.pushMask = function(a) {};
  3383. a.prototype.popMask = function() {};
  3384. a.createRendererContext = function(a) {
  3385. return null
  3386. };
  3387. return a
  3388. }(b.HashObject);
  3389. b.RendererContext = d;
  3390. d.prototype.__class__ = "egret.RendererContext"
  3391. })(egret);
  3392. (function(b) {
  3393. var d = function() {
  3394. function b() {}
  3395. b.MOUSE = "mouse";
  3396. b.TOUCH = "touch";
  3397. b.mode = "touch";
  3398. return b
  3399. }();
  3400. b.InteractionMode = d;
  3401. d.prototype.__class__ = "egret.InteractionMode"
  3402. })(egret);
  3403. __extends = this.__extends || function(b, d) {
  3404. function c() {
  3405. this.constructor = b
  3406. }
  3407. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3408. c.prototype = d.prototype;
  3409. b.prototype = new c
  3410. };
  3411. (function(b) {
  3412. var d = function(c) {
  3413. function a() {
  3414. c.call(this);
  3415. this._currentTouchTarget = {};
  3416. this.maxTouches = 2;
  3417. this.touchDownTarget = {};
  3418. this.lastTouchY = this.lastTouchX = -1
  3419. }
  3420. __extends(a, c);
  3421. a.prototype.run = function() {};
  3422. a.prototype.getTouchData = function(a, b, c) {
  3423. var d = this._currentTouchTarget[a];
  3424. null == d && (d = {}, this._currentTouchTarget[a] = d);
  3425. d.stageX = b;
  3426. d.stageY = c;
  3427. d.identifier = a;
  3428. return d
  3429. };
  3430. a.prototype.dispatchEvent = function(a, c) {
  3431. b.TouchEvent.dispatchTouchEvent(c.target, a, c.identifier, c.stageX, c.stageY, !1, !1, !1, !0 ==
  3432. this.touchDownTarget[c.identifier])
  3433. };
  3434. a.prototype.onTouchBegan = function(a, c, d) {
  3435. var l = b.MainContext.instance.stage.hitTest(a, c);
  3436. l && (a = this.getTouchData(d, a, c), this.touchDownTarget[d] = !0, a.target = l, a.beginTarget = l, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a))
  3437. };
  3438. a.prototype.onTouchMove = function(a, c, d) {
  3439. if (a != this.lastTouchX || c != this.lastTouchY) {
  3440. this.lastTouchX = a;
  3441. this.lastTouchY = c;
  3442. var l = b.MainContext.instance.stage.hitTest(a, c);
  3443. l && (a = this.getTouchData(d, a, c), a.target = l, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE,
  3444. a))
  3445. }
  3446. };
  3447. a.prototype.onTouchEnd = function(a, c, d) {
  3448. var l = b.MainContext.instance.stage.hitTest(a, c);
  3449. l && (a = this.getTouchData(d, a, c), delete this.touchDownTarget[d], d = a.beginTarget, a.target = l, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == l ? 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])
  3450. };
  3451. return a
  3452. }(b.HashObject);
  3453. b.TouchContext = d;
  3454. d.prototype.__class__ = "egret.TouchContext"
  3455. })(egret ||
  3456. (egret = {}));
  3457. __extends = this.__extends || function(b, d) {
  3458. function c() {
  3459. this.constructor = b
  3460. }
  3461. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3462. c.prototype = d.prototype;
  3463. b.prototype = new c
  3464. };
  3465. (function(b) {
  3466. var d = function(b) {
  3467. function a() {
  3468. b.call(this)
  3469. }
  3470. __extends(a, b);
  3471. a.prototype.proceed = function(a) {};
  3472. return a
  3473. }(b.HashObject);
  3474. b.NetContext = d;
  3475. d.prototype.__class__ = "egret.NetContext"
  3476. })(egret);
  3477. __extends = this.__extends || function(b, d) {
  3478. function c() {
  3479. this.constructor = b
  3480. }
  3481. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3482. c.prototype = d.prototype;
  3483. b.prototype = new c
  3484. };
  3485. (function(b) {
  3486. var d = function(b) {
  3487. function a() {
  3488. b.call(this);
  3489. this.frameRate = 60
  3490. }
  3491. __extends(a, b);
  3492. a.prototype.executeMainLoop = function(a, b) {};
  3493. return a
  3494. }(b.HashObject);
  3495. b.DeviceContext = d;
  3496. d.prototype.__class__ = "egret.DeviceContext"
  3497. })(egret);
  3498. __extends = this.__extends || function(b, d) {
  3499. function c() {
  3500. this.constructor = b
  3501. }
  3502. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3503. c.prototype = d.prototype;
  3504. b.prototype = new c
  3505. };
  3506. (function(b) {
  3507. var d = function(c) {
  3508. function a() {
  3509. c.call(this);
  3510. this.translate = this.isHD ? function(a) {
  3511. return "translate3d(" + a.x + "px, " + (a.y - b.MainContext.instance.stage.stageHeight) + "px, 0) "
  3512. } : function(a) {
  3513. return "translate(" + a.x + "px, " + a.y + "px) "
  3514. };
  3515. this.rotate = this.isHD ? function(a) {
  3516. return "rotateZ(" + a + "deg) "
  3517. } : function(a) {
  3518. return "rotate(" + a + "deg) "
  3519. };
  3520. this.ua = navigator.userAgent.toLowerCase();
  3521. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3522. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  3523. this.type = "unknow";
  3524. switch (this.type) {
  3525. case "firefox":
  3526. this.pfx = "Moz";
  3527. this.isHD = !0;
  3528. break;
  3529. case "chrome":
  3530. case "safari":
  3531. this.pfx = "webkit";
  3532. this.isHD = !0;
  3533. break;
  3534. case "opera":
  3535. this.pfx = "O";
  3536. this.isHD = !1;
  3537. break;
  3538. case "ie":
  3539. this.pfx = "ms";
  3540. this.isHD = !1;
  3541. break;
  3542. default:
  3543. this.pfx = "webkit", this.isHD = !0
  3544. }
  3545. this.trans = this.pfx + "Transform"
  3546. }
  3547. __extends(a, c);
  3548. a.getInstance = function() {
  3549. null == a.instance && (a.instance = new a);
  3550. return a.instance
  3551. };
  3552. Object.defineProperty(a.prototype,
  3553. "isMobile", {
  3554. get: function() {
  3555. 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 ");
  3556. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  3557. },
  3558. enumerable: !0,
  3559. configurable: !0
  3560. });
  3561. a.prototype.$new = function(a) {
  3562. return this.$(document.createElement(a))
  3563. };
  3564. a.prototype.$ = function(e) {
  3565. var c = document;
  3566. if (e = e instanceof HTMLElement ? e : c.querySelector(e)) e.find = e.find ||
  3567. this.$, e.hasClass = e.hasClass || function(a) {
  3568. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  3569. }, e.addClass = e.addClass || function(a) {
  3570. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  3571. return this
  3572. }, e.removeClass = e.removeClass || function(a) {
  3573. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  3574. return this
  3575. }, e.remove = e.remove || function() {}, e.appendTo = e.appendTo || function(a) {
  3576. a.appendChild(this);
  3577. return this
  3578. }, e.prependTo = e.prependTo || function(a) {
  3579. a.childNodes[0] ?
  3580. a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  3581. return this
  3582. }, e.transforms = e.transforms || function() {
  3583. 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);
  3584. return this
  3585. }, e.position = e.position || {
  3586. x: 0,
  3587. y: 0
  3588. }, e.rotation = e.rotation || 0, e.scale = e.scale || {
  3589. x: 1,
  3590. y: 1
  3591. }, e.skew = e.skew || {
  3592. x: 0,
  3593. y: 0
  3594. }, e.translates = function(a, e) {
  3595. this.position.x = a;
  3596. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  3597. this.transforms();
  3598. return this
  3599. }, e.rotate = function(a) {
  3600. this.rotation = a;
  3601. this.transforms();
  3602. return this
  3603. }, e.resize = function(a, e) {
  3604. this.scale.x = a;
  3605. this.scale.y = e;
  3606. this.transforms();
  3607. return this
  3608. }, e.setSkew = function(a, e) {
  3609. this.skew.x = a;
  3610. this.skew.y = e;
  3611. this.transforms();
  3612. return this
  3613. };
  3614. return e
  3615. };
  3616. a.prototype.scale = function(a) {
  3617. return "scale(" + a.x + ", " + a.y + ") "
  3618. };
  3619. a.prototype.skew = function(a) {
  3620. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  3621. };
  3622. return a
  3623. }(b.HashObject);
  3624. b.Browser = d;
  3625. d.prototype.__class__ = "egret.Browser"
  3626. })(egret);
  3627. (function(b) {
  3628. var d = function() {
  3629. function c() {}
  3630. c.parse = function(a) {
  3631. a = b.SAXParser.getInstance().parserXML(a);
  3632. if (!a || !a.childNodes) return null;
  3633. for (var e = a.childNodes.length, d = !1, m = 0; m < e; m++) {
  3634. var l = a.childNodes[m];
  3635. if (1 == l.nodeType) {
  3636. d = !0;
  3637. break
  3638. }
  3639. }
  3640. return d ? c.parseNode(l) : null
  3641. };
  3642. c.parseNode = function(a) {
  3643. if (!a || 1 != a.nodeType) return null;
  3644. var e = {};
  3645. e.localName = a.localName;
  3646. e.name = a.nodeName;
  3647. a.namespaceURI && (e.namespace = a.namespaceURI);
  3648. a.prefix && (e.prefix = a.prefix);
  3649. for (var b = a.attributes, d = b.length, l = 0; l < d; l++) {
  3650. var f = b[l],
  3651. g = f.name;
  3652. 0 != g.indexOf("xmlns:") && (e["$" + g] = f.value)
  3653. }
  3654. b = a.childNodes;
  3655. d = b.length;
  3656. for (l = 0; l < d; l++)
  3657. if (f = c.parseNode(b[l])) e.children || (e.children = []), f.parent = e, e.children.push(f);!e.children && (a = a.textContent.trim()) && (e.text = a);
  3658. return e
  3659. };
  3660. c.findChildren = function(a, e, b) {
  3661. b ? b.length = 0 : b = [];
  3662. c.findByPath(a, e, b);
  3663. return b
  3664. };
  3665. c.findByPath = function(a, e, b) {
  3666. var d = e.indexOf("."),
  3667. l; - 1 == d ? (l = e, d = !0) : (l = e.substring(0, d), e = e.substring(d + 1), d = !1);
  3668. if (a = a.children)
  3669. for (var f = a.length, g = 0; g < f; g++) {
  3670. var k = a[g];
  3671. k.localName == l &&
  3672. (d ? b.push(k) : c.findByPath(k, e, b))
  3673. }
  3674. };
  3675. c.getAttributes = function(a, e) {
  3676. e ? e.length = 0 : e = [];
  3677. for (var b in a) "$" == b.charAt(0) && e.push(b.substring(1));
  3678. return e
  3679. };
  3680. return c
  3681. }();
  3682. b.XML = d;
  3683. d.prototype.__class__ = "egret.XML"
  3684. })(egret);
  3685. (function(b) {
  3686. var d = function() {
  3687. function a() {}
  3688. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  3689. a.BIG_ENDIAN = "BIG_ENDIAN";
  3690. return a
  3691. }();
  3692. b.Endian = d;
  3693. d.prototype.__class__ = "egret.Endian";
  3694. var c = function() {
  3695. function a() {
  3696. this.length = this.position = 0;
  3697. this._mode = "";
  3698. this.maxlength = 0;
  3699. this._endian = d.LITTLE_ENDIAN;
  3700. this.isLittleEndian = !1;
  3701. this._mode = "Typed array";
  3702. this.maxlength = 4;
  3703. this.arraybytes = new ArrayBuffer(this.maxlength);
  3704. this.unalignedarraybytestemp = new ArrayBuffer(16);
  3705. this.endian = a.DEFAULT_ENDIAN
  3706. }
  3707. Object.defineProperty(a.prototype,
  3708. "endian", {
  3709. get: function() {
  3710. return this._endian
  3711. },
  3712. set: function(a) {
  3713. this._endian = a;
  3714. this.isLittleEndian = a == d.LITTLE_ENDIAN
  3715. },
  3716. enumerable: !0,
  3717. configurable: !0
  3718. });
  3719. a.prototype.ensureWriteableSpace = function(a) {
  3720. this.ensureSpace(a + this.position)
  3721. };
  3722. a.prototype.setArrayBuffer = function(a) {
  3723. this.ensureSpace(a.byteLength);
  3724. this.length = a.byteLength;
  3725. a = new Int8Array(a);
  3726. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  3727. this.position = 0
  3728. };
  3729. Object.defineProperty(a.prototype, "bytesAvailable", {
  3730. get: function() {
  3731. return this.length - this.position
  3732. },
  3733. enumerable: !0,
  3734. configurable: !0
  3735. });
  3736. a.prototype.ensureSpace = function(a) {
  3737. if (a > this.maxlength) {
  3738. a = a + 255 & -256;
  3739. var b = new ArrayBuffer(a),
  3740. c = new Uint8Array(this.arraybytes, 0, this.length);
  3741. (new Uint8Array(b, 0, this.length)).set(c);
  3742. this.arraybytes = b;
  3743. this.maxlength = a
  3744. }
  3745. };
  3746. a.prototype.writeByte = function(a) {
  3747. this.ensureWriteableSpace(1);
  3748. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  3749. this.position > this.length && (this.length = this.position)
  3750. };
  3751. a.prototype.readByte = function() {
  3752. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  3753. this.position + ", Length=" + this.length;
  3754. return (new Int8Array(this.arraybytes))[this.position++]
  3755. };
  3756. a.prototype.readBytes = function(a, b, c) {
  3757. "undefined" === typeof b && (b = 0);
  3758. "undefined" === typeof c && (c = 0);
  3759. null == c && (c = a.length);
  3760. a.ensureWriteableSpace(b + c);
  3761. var d = new Int8Array(a.arraybytes),
  3762. f = new Int8Array(this.arraybytes);
  3763. d.set(f.subarray(this.position, this.position + c), b);
  3764. this.position += c;
  3765. c + b > a.length && (a.length += c + b - a.length)
  3766. };
  3767. a.prototype.writeUnsignedByte = function(a) {
  3768. this.ensureWriteableSpace(1);
  3769. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  3770. this.position > this.length && (this.length = this.position)
  3771. };
  3772. a.prototype.readUnsignedByte = function() {
  3773. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3774. return (new Uint8Array(this.arraybytes))[this.position++]
  3775. };
  3776. a.prototype.writeUnsignedShort = function(a) {
  3777. this.ensureWriteableSpace(2);
  3778. if (0 == (this.position & 1)) {
  3779. var b = new Uint16Array(this.arraybytes);
  3780. b[this.position >> 1] = ~~a & 65535
  3781. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  3782. this.position += 2;
  3783. this.position > this.length && (this.length = this.position)
  3784. };
  3785. a.prototype.readUTFBytes = function(a) {
  3786. var b = "";
  3787. a = this.position + a;
  3788. for (var c = new DataView(this.arraybytes); this.position < a;) {
  3789. var d = c.getUint8(this.position++);
  3790. if (128 > d) {
  3791. if (0 == d) break;
  3792. b += String.fromCharCode(d)
  3793. } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | c.getUint8(this.position++) & 127);
  3794. else if (240 > d) var f = c.getUint8(this.position++),
  3795. b = b + String.fromCharCode((d & 31) << 12 | (f & 127) << 6 | c.getUint8(this.position++) & 127);
  3796. else var f = c.getUint8(this.position++),
  3797. g = c.getUint8(this.position++),
  3798. b = b + String.fromCharCode((d & 15) << 18 | (f & 127) << 12 | g << 6 & 127 | c.getUint8(this.position++) & 127)
  3799. }
  3800. return b
  3801. };
  3802. a.prototype.readInt = function() {
  3803. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  3804. this.position += 4;
  3805. return a
  3806. };
  3807. a.prototype.readShort = function() {
  3808. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  3809. this.position += 2;
  3810. return a
  3811. };
  3812. a.prototype.readDouble = function() {
  3813. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  3814. this.position += 8;
  3815. return a
  3816. };
  3817. a.prototype.readUnsignedShort = function() {
  3818. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3819. if (0 == (this.position & 1)) {
  3820. var a = new Uint16Array(this.arraybytes),
  3821. b = this.position >> 1;
  3822. this.position += 2;
  3823. return a[b]
  3824. }
  3825. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  3826. b = new Uint8Array(this.arraybytes,
  3827. this.position, 2);
  3828. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  3829. this.position += 2;
  3830. return a[0]
  3831. };
  3832. a.prototype.writeUnsignedInt = function(a) {
  3833. this.ensureWriteableSpace(4);
  3834. if (0 == (this.position & 3)) {
  3835. var b = new Uint32Array(this.arraybytes);
  3836. b[this.position >> 2] = ~~a & 4294967295
  3837. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  3838. this.position += 4;
  3839. this.position > this.length &&
  3840. (this.length = this.position)
  3841. };
  3842. a.prototype.readUnsignedInt = function() {
  3843. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3844. if (0 == (this.position & 3)) {
  3845. var a = new Uint32Array(this.arraybytes),
  3846. b = this.position >> 2;
  3847. this.position += 4;
  3848. return a[b]
  3849. }
  3850. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  3851. b = new Uint8Array(this.arraybytes, this.position, 4);
  3852. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3853. this.position += 4;
  3854. return a[0]
  3855. };
  3856. a.prototype.writeFloat =
  3857. function(a) {
  3858. this.ensureWriteableSpace(4);
  3859. if (0 == (this.position & 3)) {
  3860. var b = new Float32Array(this.arraybytes);
  3861. b[this.position >> 2] = a
  3862. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  3863. this.position += 4;
  3864. this.position > this.length && (this.length = this.position)
  3865. };
  3866. a.prototype.readFloat = function() {
  3867. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  3868. this.length;
  3869. if (0 == (this.position & 3)) {
  3870. var a = new Float32Array(this.arraybytes),
  3871. b = this.position >> 2;
  3872. this.position += 4;
  3873. return a[b]
  3874. }
  3875. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  3876. b = new Uint8Array(this.arraybytes, this.position, 4);
  3877. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3878. this.position += 4;
  3879. return a[0]
  3880. };
  3881. a.DEFAULT_ENDIAN = d.BIG_ENDIAN;
  3882. return a
  3883. }();
  3884. b.ByteArray = c;
  3885. c.prototype.__class__ = "egret.ByteArray"
  3886. })(egret);
  3887. __extends = this.__extends || function(b, d) {
  3888. function c() {
  3889. this.constructor = b
  3890. }
  3891. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3892. c.prototype = d.prototype;
  3893. b.prototype = new c
  3894. };
  3895. (function(b) {
  3896. var d = function(c) {
  3897. function a(a, b, d) {
  3898. c.call(this);
  3899. this._target = null;
  3900. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  3901. this._actions = this._steps = this.pluginData = null;
  3902. this.paused = !1;
  3903. this.duration = 0;
  3904. this._prevPos = -1;
  3905. this.position = null;
  3906. this._stepPosition = this._prevPosition = 0;
  3907. this.passive = !1;
  3908. this.initialize(a, b, d)
  3909. }
  3910. __extends(a, c);
  3911. a.get = function(e, b, c, d) {
  3912. "undefined" === typeof b && (b = null);
  3913. "undefined" === typeof c && (c = null);
  3914. "undefined" === typeof d && (d = !1);
  3915. d && a.removeTweens(e);
  3916. return new a(e, b, c)
  3917. };
  3918. a.removeTweens = function(e) {
  3919. if (e.tween_count) {
  3920. for (var b = a._tweens, c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
  3921. e.tween_count = 0
  3922. }
  3923. };
  3924. a.tick = function(e, b) {
  3925. "undefined" === typeof b && (b = !1);
  3926. for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  3927. var f = c[d];
  3928. b && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : e)
  3929. }
  3930. };
  3931. a._register = function(e, c) {
  3932. var d = e._target,
  3933. l = a._tweens;
  3934. if (c) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), l.push(e), a._inited || (b.Ticker.getInstance().register(a.tick, null),
  3935. a._inited = !0);
  3936. else
  3937. for (d && d.tween_count--, d = l.length; d--;)
  3938. if (l[d] == e) {
  3939. l.splice(d, 1);
  3940. break
  3941. }
  3942. };
  3943. a.removeAllTweens = function() {
  3944. for (var e = a._tweens, b = 0, c = e.length; b < c; b++) {
  3945. var d = e[b];
  3946. d.paused = !0;
  3947. d._target.tweenjs_count = 0
  3948. }
  3949. e.length = 0
  3950. };
  3951. a.prototype.initialize = function(e, b, c) {
  3952. this._target = e;
  3953. 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));
  3954. this.pluginData = c || {};
  3955. this._curQueueProps = {};
  3956. this._initQueueProps = {};
  3957. this._steps = [];
  3958. this._actions = [];
  3959. b && b.paused ? this.paused = !0 : a._register(this, !0);
  3960. b && null != b.position && this.setPosition(b.position, a.NONE)
  3961. };
  3962. a.prototype.setPosition = function(a, b) {
  3963. "undefined" === typeof b && (b = 1);
  3964. 0 > a && (a = 0);
  3965. var c = a,
  3966. d = !1;
  3967. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  3968. if (c == this._prevPos) return d;
  3969. var f = this._prevPos;
  3970. this.position = this._prevPos = c;
  3971. this._prevPosition = a;
  3972. if (this._target)
  3973. if (d) this._updateTargetProps(null, 1);
  3974. else if (0 < this._steps.length) {
  3975. for (var g =
  3976. 0, k = this._steps.length; g < k && !(this._steps[g].t > c); g++);
  3977. g = this._steps[g - 1];
  3978. this._updateTargetProps(g, (this._stepPosition = c - g.t) / g.d)
  3979. }
  3980. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < f ? (f != this.duration && this._runActions(f, this.duration), this._runActions(0, c, !0)) : this._runActions(f, c));
  3981. d && this.setPaused(!0);
  3982. this.dispatchEventWith("change");
  3983. return d
  3984. };
  3985. a.prototype._runActions = function(a, b, c) {
  3986. "undefined" === typeof c && (c = !1);
  3987. var d = a,
  3988. f = b,
  3989. g = -1,
  3990. k = this._actions.length,
  3991. n = 1;
  3992. a > b && (d = b,
  3993. f = a, g = k, k = n = -1);
  3994. for (;
  3995. (g += n) != k;) {
  3996. b = this._actions[g];
  3997. var p = b.t;
  3998. (p == f || p > d && p < f || c && p == a) && b.f.apply(b.o, b.p)
  3999. }
  4000. };
  4001. a.prototype._updateTargetProps = function(e, b) {
  4002. var c, d, f, g;
  4003. if (e || 1 != b) {
  4004. if (this.passive = !!e.v) return;
  4005. e.e && (b = e.e(b, 0, 1, 1));
  4006. c = e.p0;
  4007. d = e.p1
  4008. } else this.passive = !1, c = d = this._curQueueProps;
  4009. for (var k in this._initQueueProps) {
  4010. null == (f = c[k]) && (c[k] = f = this._initQueueProps[k]);
  4011. null == (g = d[k]) && (d[k] = g = f);
  4012. f = f == g || 0 == b || 1 == b || "number" != typeof f ? 1 == b ? g : f : f + (g - f) * b;
  4013. var n = !1;
  4014. if (g = a._plugins[k])
  4015. for (var p = 0, q = g.length; p <
  4016. q; p++) {
  4017. var t = g[p].tween(this, k, f, c, d, b, !!e && c == d, !e);
  4018. t == a.IGNORE ? n = !0 : f = t
  4019. }
  4020. n || (this._target[k] = f)
  4021. }
  4022. };
  4023. a.prototype.setPaused = function(e) {
  4024. this.paused = e;
  4025. a._register(this, !e);
  4026. return this
  4027. };
  4028. a.prototype._cloneProps = function(a) {
  4029. var b = {},
  4030. c;
  4031. for (c in a) b[c] = a[c];
  4032. return b
  4033. };
  4034. a.prototype._addStep = function(a) {
  4035. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  4036. return this
  4037. };
  4038. a.prototype._appendQueueProps = function(b) {
  4039. var c, d, l, f, g, k;
  4040. for (k in b)
  4041. if (void 0 === this._initQueueProps[k]) {
  4042. d = this._target[k];
  4043. if (c = a._plugins[k])
  4044. for (l =
  4045. 0, f = c.length; l < f; l++) d = c[l].init(this, k, d);
  4046. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  4047. }
  4048. for (k in b) {
  4049. d = this._curQueueProps[k];
  4050. if (c = a._plugins[k])
  4051. for (g = g || {}, l = 0, f = c.length; l < f; l++) c[l].step && c[l].step(this, k, d, b[k], g);
  4052. this._curQueueProps[k] = b[k]
  4053. }
  4054. g && this._appendQueueProps(g);
  4055. return this._curQueueProps
  4056. };
  4057. a.prototype._addAction = function(a) {
  4058. a.t = this.duration;
  4059. this._actions.push(a);
  4060. return this
  4061. };
  4062. a.prototype._set = function(a, b) {
  4063. for (var c in a) b[c] = a[c]
  4064. };
  4065. a.prototype.wait = function(a, b) {
  4066. if (null ==
  4067. a || 0 >= a) return this;
  4068. var c = this._cloneProps(this._curQueueProps);
  4069. return this._addStep({
  4070. d: a,
  4071. p0: c,
  4072. p1: c,
  4073. v: b
  4074. })
  4075. };
  4076. a.prototype.to = function(a, b, c) {
  4077. "undefined" === typeof c && (c = void 0);
  4078. if (isNaN(b) || 0 > b) b = 0;
  4079. return this._addStep({
  4080. d: b || 0,
  4081. p0: this._cloneProps(this._curQueueProps),
  4082. e: c,
  4083. p1: this._cloneProps(this._appendQueueProps(a))
  4084. })
  4085. };
  4086. a.prototype.call = function(a, b, c) {
  4087. "undefined" === typeof b && (b = void 0);
  4088. "undefined" === typeof c && (c = void 0);
  4089. return this._addAction({
  4090. f: a,
  4091. p: c ? c : [],
  4092. o: b ? b : this._target
  4093. })
  4094. };
  4095. a.prototype.set = function(a,
  4096. b) {
  4097. "undefined" === typeof b && (b = null);
  4098. return this._addAction({
  4099. f: this._set,
  4100. o: this,
  4101. p: [a, b ? b : this._target]
  4102. })
  4103. };
  4104. a.prototype.play = function(a) {
  4105. a || (a = this);
  4106. return this.call(a.setPaused, a, [!1])
  4107. };
  4108. a.prototype.pause = function(a) {
  4109. a || (a = this);
  4110. return this.call(a.setPaused, a, [!0])
  4111. };
  4112. a.prototype.tick = function(a) {
  4113. this.paused || this.setPosition(this._prevPosition + a)
  4114. };
  4115. a.NONE = 0;
  4116. a.LOOP = 1;
  4117. a.REVERSE = 2;
  4118. a._tweens = [];
  4119. a.IGNORE = {};
  4120. a._plugins = {};
  4121. a._inited = !1;
  4122. return a
  4123. }(b.EventDispatcher);
  4124. b.Tween = d;
  4125. d.prototype.__class__ = "egret.Tween"
  4126. })(egret ||
  4127. (egret = {}));
  4128. (function(b) {
  4129. var d = function() {
  4130. function c() {
  4131. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  4132. }
  4133. c.get = function(a) {
  4134. -1 > a && (a = -1);
  4135. 1 < a && (a = 1);
  4136. return function(b) {
  4137. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  4138. }
  4139. };
  4140. c.getPowIn = function(a) {
  4141. return function(b) {
  4142. return Math.pow(b, a)
  4143. }
  4144. };
  4145. c.getPowOut = function(a) {
  4146. return function(b) {
  4147. return 1 - Math.pow(1 - b, a)
  4148. }
  4149. };
  4150. c.getPowInOut = function(a) {
  4151. return function(b) {
  4152. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  4153. }
  4154. };
  4155. c.sineIn = function(a) {
  4156. return 1 - Math.cos(a *
  4157. Math.PI / 2)
  4158. };
  4159. c.sineOut = function(a) {
  4160. return Math.sin(a * Math.PI / 2)
  4161. };
  4162. c.sineInOut = function(a) {
  4163. return -0.5 * (Math.cos(Math.PI * a) - 1)
  4164. };
  4165. c.getBackIn = function(a) {
  4166. return function(b) {
  4167. return b * b * ((a + 1) * b - a)
  4168. }
  4169. };
  4170. c.getBackOut = function(a) {
  4171. return function(b) {
  4172. b -= 1;
  4173. return b * b * ((a + 1) * b + a) + 1
  4174. }
  4175. };
  4176. c.getBackInOut = function(a) {
  4177. a *= 1.525;
  4178. return function(b) {
  4179. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  4180. }
  4181. };
  4182. c.circIn = function(a) {
  4183. return -(Math.sqrt(1 - a * a) - 1)
  4184. };
  4185. c.circOut = function(a) {
  4186. return Math.sqrt(1 - a * a)
  4187. };
  4188. c.circInOut = function(a) {
  4189. return 1 >
  4190. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  4191. };
  4192. c.bounceIn = function(a) {
  4193. return 1 - c.bounceOut(1 - a)
  4194. };
  4195. c.bounceOut = function(a) {
  4196. 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
  4197. };
  4198. c.bounceInOut = function(a) {
  4199. return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
  4200. };
  4201. c.getElasticIn = function(a, b) {
  4202. var c = 2 * Math.PI;
  4203. return function(d) {
  4204. if (0 == d || 1 == d) return d;
  4205. var l = b / c * Math.asin(1 / a);
  4206. return -(a * Math.pow(2, 10 *
  4207. (d -= 1)) * Math.sin((d - l) * c / b))
  4208. }
  4209. };
  4210. c.getElasticOut = function(a, b) {
  4211. var c = 2 * Math.PI;
  4212. return function(d) {
  4213. if (0 == d || 1 == d) return d;
  4214. var l = b / c * Math.asin(1 / a);
  4215. return a * Math.pow(2, -10 * d) * Math.sin((d - l) * c / b) + 1
  4216. }
  4217. };
  4218. c.getElasticInOut = function(a, b) {
  4219. var c = 2 * Math.PI;
  4220. return function(d) {
  4221. var l = b / c * Math.asin(1 / a);
  4222. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - l) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - l) * c / b) * 0.5 + 1
  4223. }
  4224. };
  4225. c.quadIn = c.getPowIn(2);
  4226. c.quadOut = c.getPowOut(2);
  4227. c.quadInOut = c.getPowInOut(2);
  4228. c.cubicIn = c.getPowIn(3);
  4229. c.cubicOut = c.getPowOut(3);
  4230. c.cubicInOut = c.getPowInOut(3);
  4231. c.quartIn = c.getPowIn(4);
  4232. c.quartOut = c.getPowOut(4);
  4233. c.quartInOut = c.getPowInOut(4);
  4234. c.quintIn = c.getPowIn(5);
  4235. c.quintOut = c.getPowOut(5);
  4236. c.quintInOut = c.getPowInOut(5);
  4237. c.backIn = c.getBackIn(1.7);
  4238. c.backOut = c.getBackOut(1.7);
  4239. c.backInOut = c.getBackInOut(1.7);
  4240. c.elasticIn = c.getElasticIn(1, 0.3);
  4241. c.elasticOut = c.getElasticOut(1, 0.3);
  4242. c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
  4243. return c
  4244. }();
  4245. b.Ease = d;
  4246. d.prototype.__class__ = "egret.Ease"
  4247. })(egret);
  4248. (function(b) {
  4249. var d = function() {
  4250. function b() {}
  4251. b.prototype.play = function(a) {
  4252. "undefined" === typeof a && (a = !1);
  4253. var b = this.audio;
  4254. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  4255. };
  4256. b.prototype.pause = function() {
  4257. var a = this.audio;
  4258. a && a.pause()
  4259. };
  4260. b.prototype.load = function() {
  4261. var a = this.audio;
  4262. a && a.load()
  4263. };
  4264. b.prototype.addEventListener = function(a, b) {
  4265. this.audio && this.audio.addEventListener(a, b, !1)
  4266. };
  4267. b.prototype.removeEventListener = function(a, b) {
  4268. this.audio && this.audio.removeEventListener(a, b, !1)
  4269. };
  4270. b.prototype.setVolume =
  4271. function(a) {
  4272. var b = this.audio;
  4273. b && (b.volume = a)
  4274. };
  4275. b.prototype.getVolume = function() {
  4276. return this.audio ? this.audio.volume : 0
  4277. };
  4278. return b
  4279. }();
  4280. b.Sound = d;
  4281. d.prototype.__class__ = "egret.Sound"
  4282. })(egret);
  4283. (function(b) {
  4284. var d = function() {
  4285. function b() {}
  4286. b.isNumber = function(a) {
  4287. return "number" === typeof a && !isNaN(a)
  4288. };
  4289. return b
  4290. }();
  4291. b.NumberUtils = d;
  4292. d.prototype.__class__ = "egret.NumberUtils"
  4293. })(egret);
  4294. var __extends = this.__extends || function(b, d) {
  4295. function c() {
  4296. this.constructor = b
  4297. }
  4298. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4299. c.prototype = d.prototype;
  4300. b.prototype = new c
  4301. },
  4302. RES;
  4303. (function(b) {
  4304. var d = function(b) {
  4305. function a(a, d, m) {
  4306. "undefined" === typeof d && (d = !1);
  4307. "undefined" === typeof m && (m = !1);
  4308. b.call(this, a, d, m);
  4309. this.itemsTotal = this.itemsLoaded = 0
  4310. }
  4311. __extends(a, b);
  4312. a.dispatchResourceEvent = function(b, c, d, l, f, g) {
  4313. "undefined" === typeof d && (d = "");
  4314. "undefined" === typeof l && (l = null);
  4315. "undefined" === typeof f && (f = 0);
  4316. "undefined" === typeof g && (g = 0);
  4317. var k = egret.Event._getPropertyData(a);
  4318. k.groupName = d;
  4319. k.resItem = l;
  4320. k.itemsLoaded = f;
  4321. k.itemsTotal = g;
  4322. egret.Event._dispatchByTarget(a, b, c, k)
  4323. };
  4324. a.ITEM_LOAD_ERROR =
  4325. "itemLoadError";
  4326. a.CONFIG_COMPLETE = "configComplete";
  4327. a.GROUP_PROGRESS = "groupProgress";
  4328. a.GROUP_COMPLETE = "groupComplete";
  4329. return a
  4330. }(egret.Event);
  4331. b.ResourceEvent = d;
  4332. d.prototype.__class__ = "RES.ResourceEvent"
  4333. })(RES || (RES = {}));
  4334. (function(b) {
  4335. var d = function() {
  4336. function b(a, e, c) {
  4337. this._loaded = !1;
  4338. this.name = a;
  4339. this.url = e;
  4340. this.type = c
  4341. }
  4342. Object.defineProperty(b.prototype, "loaded", {
  4343. get: function() {
  4344. return this.data ? this.data.loaded : this._loaded
  4345. },
  4346. set: function(a) {
  4347. this.data && (this.data.loaded = a);
  4348. this._loaded = a
  4349. },
  4350. enumerable: !0,
  4351. configurable: !0
  4352. });
  4353. b.prototype.toString = function() {
  4354. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  4355. };
  4356. b.TYPE_XML = "xml";
  4357. b.TYPE_IMAGE = "image";
  4358. b.TYPE_BIN = "bin";
  4359. b.TYPE_TEXT = "text";
  4360. b.TYPE_JSON =
  4361. "json";
  4362. b.TYPE_SHEET = "sheet";
  4363. b.TYPE_FONT = "font";
  4364. b.TYPE_SOUND = "sound";
  4365. return b
  4366. }();
  4367. b.ResourceItem = d;
  4368. d.prototype.__class__ = "RES.ResourceItem"
  4369. })(RES || (RES = {}));
  4370. (function(b) {
  4371. var d = function() {
  4372. function c() {
  4373. this.keyMap = {};
  4374. this.groupDic = {}
  4375. }
  4376. c.prototype.getGroupByName = function(a) {
  4377. var b = [];
  4378. if (!this.groupDic[a]) return b;
  4379. a = this.groupDic[a];
  4380. for (var c = a.length, d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  4381. return b
  4382. };
  4383. c.prototype.getRawGroupByName = function(a) {
  4384. return this.groupDic[a] ? this.groupDic[a] : []
  4385. };
  4386. c.prototype.createGroup = function(a, b, c) {
  4387. "undefined" === typeof c && (c = !1);
  4388. if (!c && this.groupDic[a] || !b || 0 == b.length) return !1;
  4389. c = this.groupDic;
  4390. for (var d = [], l = b.length, f = 0; f <
  4391. l; f++) {
  4392. var g = b[f],
  4393. k = c[g];
  4394. if (k)
  4395. for (var g = k.length, n = 0; n < g; n++) {
  4396. var p = k[n]; - 1 == d.indexOf(p) && d.push(p)
  4397. } else(p = this.keyMap[g]) && -1 == d.indexOf(p) && d.push(p)
  4398. }
  4399. if (0 == d.length) return !1;
  4400. this.groupDic[a] = d;
  4401. return !0
  4402. };
  4403. c.prototype.parseConfig = function(a, b) {
  4404. if (a) {
  4405. var c = a.resources;
  4406. if (c)
  4407. for (var d = c.length, l = 0; l < d; l++) {
  4408. var f = c[l],
  4409. g = f.url;
  4410. g && -1 == g.indexOf("://") && (f.url = b + g);
  4411. this.addItemToKeyMap(f)
  4412. }
  4413. if (c = a.groups)
  4414. for (d = c.length, l = 0; l < d; l++) {
  4415. for (var g = c[l], k = [], n = g.keys.split(","), p = n.length, q = 0; q < p; q++) f = n[q].trim(), (f = this.keyMap[f]) && -1 == k.indexOf(f) && k.push(f);
  4416. this.groupDic[g.name] = k
  4417. }
  4418. }
  4419. };
  4420. c.prototype.addItemToKeyMap = function(a) {
  4421. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  4422. if (a.hasOwnProperty("subkeys")) {
  4423. var b = a.subkeys.split(",");
  4424. a.subkeys = b;
  4425. for (var c = b.length, d = 0; d < c; d++) {
  4426. var l = b[d];
  4427. null == this.keyMap[l] && (this.keyMap[l] = a)
  4428. }
  4429. }
  4430. };
  4431. c.prototype.getName = function(a) {
  4432. return (a = this.keyMap[a]) ? a.name : ""
  4433. };
  4434. c.prototype.getType = function(a) {
  4435. return (a = this.keyMap[a]) ? a.type : ""
  4436. };
  4437. c.prototype.getRawResourceItem = function(a) {
  4438. return this.keyMap[a]
  4439. };
  4440. c.prototype.getResourceItem = function(a) {
  4441. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  4442. };
  4443. c.prototype.parseResourceItem = function(a) {
  4444. var e = new b.ResourceItem(a.name, a.url, a.type);
  4445. e.data = a;
  4446. return e
  4447. };
  4448. return c
  4449. }();
  4450. b.ResourceConfig = d;
  4451. d.prototype.__class__ = "RES.ResourceConfig"
  4452. })(RES || (RES = {}));
  4453. __extends = this.__extends || function(b, d) {
  4454. function c() {
  4455. this.constructor = b
  4456. }
  4457. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4458. c.prototype = d.prototype;
  4459. b.prototype = new c
  4460. };
  4461. (function(b) {
  4462. var d = function(c) {
  4463. function a() {
  4464. c.call(this);
  4465. this.thread = 2;
  4466. this.loadingCount = 0;
  4467. this.groupTotalDic = {};
  4468. this.numLoadedDic = {};
  4469. this.itemListDic = {};
  4470. this.priorityQueue = {};
  4471. this.lazyLoadList = [];
  4472. this.analyzerDic = {};
  4473. this.queueIndex = 0
  4474. }
  4475. __extends(a, c);
  4476. a.prototype.isGroupInLoading = function(a) {
  4477. return void 0 !== this.itemListDic[a]
  4478. };
  4479. a.prototype.loadGroup = function(a, c, d) {
  4480. "undefined" === typeof d && (d = 0);
  4481. if (!this.itemListDic[c] && c)
  4482. if (a && 0 != a.length) {
  4483. this.priorityQueue[d] ? this.priorityQueue[d].push(c) : this.priorityQueue[d] =
  4484. [c];
  4485. this.itemListDic[c] = a;
  4486. d = a.length;
  4487. for (var l = 0; l < d; l++) a[l].groupName = c;
  4488. this.groupTotalDic[c] = a.length;
  4489. this.numLoadedDic[c] = 0;
  4490. this.next()
  4491. } else a = new b.ResourceEvent(b.ResourceEvent.GROUP_COMPLETE), a.groupName = c, this.dispatchEvent(a)
  4492. };
  4493. a.prototype.loadItem = function(a) {
  4494. this.lazyLoadList.push(a);
  4495. a.groupName = "";
  4496. this.next()
  4497. };
  4498. a.prototype.next = function() {
  4499. for (; this.loadingCount < this.thread;) {
  4500. var a = this.getOneResourceItem();
  4501. if (!a) break;
  4502. this.loadingCount++;
  4503. if (a.loaded) this.onItemComplete(a);
  4504. else {
  4505. var c = this.analyzerDic[a.type];
  4506. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  4507. c.loadFile(a, this.onItemComplete, this)
  4508. }
  4509. }
  4510. };
  4511. a.prototype.getOneResourceItem = function() {
  4512. var a = Number.NEGATIVE_INFINITY,
  4513. b;
  4514. for (b in this.priorityQueue) a = Math.max(a, b);
  4515. a = this.priorityQueue[a];
  4516. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  4517. b = a.length;
  4518. for (var c, d = 0; d < b; d++) {
  4519. this.queueIndex >= b && (this.queueIndex = 0);
  4520. c = this.itemListDic[a[this.queueIndex]];
  4521. if (0 < c.length) break;
  4522. this.queueIndex++
  4523. }
  4524. return 0 ==
  4525. c.length ? null : c.shift()
  4526. };
  4527. a.prototype.onItemComplete = function(a) {
  4528. this.loadingCount--;
  4529. var c = a.groupName;
  4530. a.loaded || b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  4531. if (c) {
  4532. this.numLoadedDic[c]++;
  4533. var d = this.numLoadedDic[c],
  4534. l = this.groupTotalDic[c];
  4535. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, d, l);
  4536. d == l && (this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], b.ResourceEvent.dispatchResourceEvent(this,
  4537. b.ResourceEvent.GROUP_COMPLETE, c))
  4538. } else this.callBack.call(this.resInstance, a);
  4539. this.next()
  4540. };
  4541. a.prototype.removeGroupName = function(a) {
  4542. for (var b in this.priorityQueue) {
  4543. for (var c = this.priorityQueue[b], d = c.length, f = 0, g = !1, d = c.length, k = 0; k < d; k++) {
  4544. if (c[k] == a) {
  4545. c.splice(f, 1);
  4546. g = !0;
  4547. break
  4548. }
  4549. f++
  4550. }
  4551. if (g) {
  4552. 0 == c.length && delete this.priorityQueue[b];
  4553. break
  4554. }
  4555. }
  4556. };
  4557. return a
  4558. }(egret.EventDispatcher);
  4559. b.ResourceLoader = d;
  4560. d.prototype.__class__ = "RES.ResourceLoader"
  4561. })(RES || (RES = {}));
  4562. __extends = this.__extends || function(b, d) {
  4563. function c() {
  4564. this.constructor = b
  4565. }
  4566. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4567. c.prototype = d.prototype;
  4568. b.prototype = new c
  4569. };
  4570. (function(b) {
  4571. var d = function(b) {
  4572. function a() {
  4573. b.call(this)
  4574. }
  4575. __extends(a, b);
  4576. a.prototype.loadFile = function(a, b, c) {};
  4577. a.prototype.getRes = function(a) {};
  4578. a.prototype.destroyRes = function(a) {
  4579. return !1
  4580. };
  4581. a.getStringPrefix = function(a) {
  4582. if (!a) return "";
  4583. var b = a.indexOf(".");
  4584. return -1 != b ? a.substring(0, b) : ""
  4585. };
  4586. a.getStringTail = function(a) {
  4587. if (!a) return "";
  4588. var b = a.indexOf(".");
  4589. return -1 != b ? a.substring(b + 1) : ""
  4590. };
  4591. return a
  4592. }(egret.HashObject);
  4593. b.AnalyzerBase = d;
  4594. d.prototype.__class__ = "RES.AnalyzerBase"
  4595. })(RES || (RES = {}));
  4596. __extends = this.__extends || function(b, d) {
  4597. function c() {
  4598. this.constructor = b
  4599. }
  4600. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4601. c.prototype = d.prototype;
  4602. b.prototype = new c
  4603. };
  4604. (function(b) {
  4605. var d = function(b) {
  4606. function a() {
  4607. b.call(this);
  4608. this.fileDic = {};
  4609. this.resItemDic = [];
  4610. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  4611. this.recycler = new egret.Recycler
  4612. }
  4613. __extends(a, b);
  4614. a.prototype.loadFile = function(a, b, c) {
  4615. if (this.fileDic[a.name]) b.call(c, a);
  4616. else {
  4617. var d = this.getLoader();
  4618. this.resItemDic[d.hashCode] = {
  4619. item: a,
  4620. func: b,
  4621. thisObject: c
  4622. };
  4623. d.load(new egret.URLRequest(a.url))
  4624. }
  4625. };
  4626. a.prototype.getLoader = function() {
  4627. var a = this.recycler.pop();
  4628. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  4629. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  4630. a.dataFormat = this._dataFormat;
  4631. return a
  4632. };
  4633. a.prototype.onLoadFinish = function(a) {
  4634. var b = a.target,
  4635. c = this.resItemDic[b.hashCode];
  4636. delete this.resItemDic[b.hashCode];
  4637. this.recycler.push(b);
  4638. var d = c.item,
  4639. f = c.func;
  4640. d.loaded = a.type == egret.Event.COMPLETE;
  4641. d.loaded && this.analyzeData(d, b.data);
  4642. f.call(c.thisObject, d)
  4643. };
  4644. a.prototype.analyzeData = function(a, b) {
  4645. var c = a.name;
  4646. !this.fileDic[c] && b && (this.fileDic[c] = b)
  4647. };
  4648. a.prototype.getRes =
  4649. function(a) {
  4650. return this.fileDic[a]
  4651. };
  4652. a.prototype.hasRes = function(a) {
  4653. return null != this.getRes(a)
  4654. };
  4655. a.prototype.destroyRes = function(a) {
  4656. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  4657. };
  4658. return a
  4659. }(b.AnalyzerBase);
  4660. b.BinAnalyzer = d;
  4661. d.prototype.__class__ = "RES.BinAnalyzer"
  4662. })(RES || (RES = {}));
  4663. __extends = this.__extends || function(b, d) {
  4664. function c() {
  4665. this.constructor = b
  4666. }
  4667. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4668. c.prototype = d.prototype;
  4669. b.prototype = new c
  4670. };
  4671. (function(b) {
  4672. var d = function(b) {
  4673. function a() {
  4674. b.call(this);
  4675. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  4676. }
  4677. __extends(a, b);
  4678. a.prototype.analyzeData = function(a, b) {
  4679. var c = a.name;
  4680. !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]))))
  4681. };
  4682. return a
  4683. }(b.BinAnalyzer);
  4684. b.ImageAnalyzer = d;
  4685. d.prototype.__class__ = "RES.ImageAnalyzer"
  4686. })(RES || (RES = {}));
  4687. __extends = this.__extends || function(b, d) {
  4688. function c() {
  4689. this.constructor = b
  4690. }
  4691. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4692. c.prototype = d.prototype;
  4693. b.prototype = new c
  4694. };
  4695. (function(b) {
  4696. var d = function(b) {
  4697. function a() {
  4698. b.call(this);
  4699. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4700. }
  4701. __extends(a, b);
  4702. a.prototype.analyzeData = function(a, b) {
  4703. var c = a.name;
  4704. if (!this.fileDic[c] && b) try {
  4705. this.fileDic[c] = JSON.parse(b)
  4706. } catch (d) {
  4707. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4708. }
  4709. };
  4710. return a
  4711. }(b.BinAnalyzer);
  4712. b.JsonAnalyzer = d;
  4713. d.prototype.__class__ = "RES.JsonAnalyzer"
  4714. })(RES || (RES = {}));
  4715. __extends = this.__extends || function(b, d) {
  4716. function c() {
  4717. this.constructor = b
  4718. }
  4719. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4720. c.prototype = d.prototype;
  4721. b.prototype = new c
  4722. };
  4723. (function(b) {
  4724. var d = function(b) {
  4725. function a() {
  4726. b.call(this);
  4727. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4728. }
  4729. __extends(a, b);
  4730. return a
  4731. }(b.BinAnalyzer);
  4732. b.TextAnalyzer = d;
  4733. d.prototype.__class__ = "RES.TextAnalyzer"
  4734. })(RES || (RES = {}));
  4735. __extends = this.__extends || function(b, d) {
  4736. function c() {
  4737. this.constructor = b
  4738. }
  4739. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4740. c.prototype = d.prototype;
  4741. b.prototype = new c
  4742. };
  4743. (function(b) {
  4744. var d = function(c) {
  4745. function a() {
  4746. c.call(this);
  4747. this.sheetMap = {};
  4748. this.textureMap = {};
  4749. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4750. }
  4751. __extends(a, c);
  4752. a.prototype.getRes = function(a) {
  4753. var c = this.fileDic[a];
  4754. c || (c = this.textureMap[a]);
  4755. !c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  4756. return c
  4757. };
  4758. a.prototype.onLoadFinish = function(a) {
  4759. var b = a.target,
  4760. c = this.resItemDic[b.hashCode];
  4761. delete this.resItemDic[b.hashCode];
  4762. this.recycler.push(b);
  4763. var d =
  4764. c.item,
  4765. f = c.func;
  4766. d.loaded = a.type == egret.Event.COMPLETE;
  4767. d.loaded && this.analyzeData(d, b.data);
  4768. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, f, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : f.call(c.thisObject, d)
  4769. };
  4770. a.prototype.analyzeData = function(a, b) {
  4771. var c = a.name;
  4772. if (!this.fileDic[c] && b) {
  4773. var d;
  4774. if ("string" == typeof b) {
  4775. try {
  4776. d = JSON.parse(b)
  4777. } catch (f) {
  4778. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4779. }
  4780. d && (this.sheetMap[c] =
  4781. d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  4782. } else d = this.sheetMap[c], delete this.sheetMap[c], b && (d = this.parseSpriteSheet(b, d), this.fileDic[c] = d)
  4783. }
  4784. };
  4785. a.prototype.getRelativePath = function(a, b) {
  4786. a = a.split("\\").join("/");
  4787. var c = a.lastIndexOf("/");
  4788. return a = -1 != c ? a.substring(0, c + 1) + b : b
  4789. };
  4790. a.prototype.parseSpriteSheet = function(a, b) {
  4791. var c = b.frames;
  4792. if (!c) return null;
  4793. var d = new egret.SpriteSheet(a),
  4794. f = this.textureMap,
  4795. g;
  4796. for (g in c) {
  4797. var k = c[g];
  4798. a = d.createTexture(g, k.x, k.y, k.w, k.h, k.offX, k.offY, k.sourceW, k.sourceH);
  4799. null == f[g] && (f[g] = a)
  4800. }
  4801. return d
  4802. };
  4803. return a
  4804. }(b.BinAnalyzer);
  4805. b.SheetAnalyzer = d;
  4806. d.prototype.__class__ = "RES.SheetAnalyzer"
  4807. })(RES || (RES = {}));
  4808. __extends = this.__extends || function(b, d) {
  4809. function c() {
  4810. this.constructor = b
  4811. }
  4812. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4813. c.prototype = d.prototype;
  4814. b.prototype = new c
  4815. };
  4816. (function(b) {
  4817. var d = function(b) {
  4818. function a() {
  4819. b.call(this)
  4820. }
  4821. __extends(a, b);
  4822. a.prototype.analyzeData = function(a, b) {
  4823. var c = a.name;
  4824. if (!this.fileDic[c] && b) {
  4825. var d;
  4826. "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))
  4827. }
  4828. };
  4829. a.prototype.getTexturePath = function(a, b) {
  4830. var c = "",
  4831. d = b.split("\n")[2],
  4832. f = d.indexOf('file="'); - 1 != f && (d = d.substring(f + 6), f = d.indexOf('"'), c = d.substring(0,
  4833. f));
  4834. a = a.split("\\").join("/");
  4835. f = a.lastIndexOf("/");
  4836. return a = -1 != f ? a.substring(0, f + 1) + c : c
  4837. };
  4838. return a
  4839. }(b.SheetAnalyzer);
  4840. b.FontAnalyzer = d;
  4841. d.prototype.__class__ = "RES.FontAnalyzer"
  4842. })(RES || (RES = {}));
  4843. __extends = this.__extends || function(b, d) {
  4844. function c() {
  4845. this.constructor = b
  4846. }
  4847. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4848. c.prototype = d.prototype;
  4849. b.prototype = new c
  4850. };
  4851. (function(b) {
  4852. var d = function(b) {
  4853. function a() {
  4854. b.call(this);
  4855. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  4856. }
  4857. __extends(a, b);
  4858. return a
  4859. }(b.BinAnalyzer);
  4860. b.SoundAnalyzer = d;
  4861. d.prototype.__class__ = "RES.SoundAnalyzer"
  4862. })(RES || (RES = {}));
  4863. __extends = this.__extends || function(b, d) {
  4864. function c() {
  4865. this.constructor = b
  4866. }
  4867. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4868. c.prototype = d.prototype;
  4869. b.prototype = new c
  4870. };
  4871. (function(b) {
  4872. var d = function(b) {
  4873. function a() {
  4874. b.call(this);
  4875. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4876. }
  4877. __extends(a, b);
  4878. a.prototype.analyzeData = function(a, b) {
  4879. var c = a.name;
  4880. if (!this.fileDic[c] && b) try {
  4881. var d = egret.XML.parse(b);
  4882. this.fileDic[c] = d
  4883. } catch (f) {}
  4884. };
  4885. return a
  4886. }(b.BinAnalyzer);
  4887. b.XMLAnalyzer = d;
  4888. d.prototype.__class__ = "RES.XMLAnalyzer"
  4889. })(RES || (RES = {}));
  4890. __extends = this.__extends || function(b, d) {
  4891. function c() {
  4892. this.constructor = b
  4893. }
  4894. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4895. c.prototype = d.prototype;
  4896. b.prototype = new c
  4897. };
  4898. (function(b) {
  4899. b.loadConfig = function(a, b, d) {
  4900. "undefined" === typeof b && (b = "");
  4901. "undefined" === typeof d && (d = "json");
  4902. c.loadConfig(a, b, d)
  4903. };
  4904. b.loadGroup = function(a, b) {
  4905. "undefined" === typeof b && (b = 0);
  4906. c.loadGroup(a, b)
  4907. };
  4908. b.isGroupLoaded = function(a) {
  4909. return c.isGroupLoaded(a)
  4910. };
  4911. b.getGroupByName = function(a) {
  4912. return c.getGroupByName(a)
  4913. };
  4914. b.createGroup = function(a, b, d) {
  4915. "undefined" === typeof d && (d = !1);
  4916. return c.createGroup(a, b, d)
  4917. };
  4918. b.hasRes = function(a) {
  4919. return c.hasRes(a)
  4920. };
  4921. b.getRes = function(a) {
  4922. return c.getRes(a)
  4923. };
  4924. b.getResAsync =
  4925. function(a, b, d) {
  4926. c.getResAsync(a, b, d)
  4927. };
  4928. b.getResByUrl = function(a, b, d, m) {
  4929. "undefined" === typeof m && (m = "");
  4930. c.getResByUrl(a, b, d, m)
  4931. };
  4932. b.destroyRes = function(a) {
  4933. return c.destroyRes(a)
  4934. };
  4935. b.setMaxLoadingThread = function(a) {
  4936. c.setMaxLoadingThread(a)
  4937. };
  4938. b.addEventListener = function(a, b, d, m, l) {
  4939. "undefined" === typeof m && (m = !1);
  4940. "undefined" === typeof l && (l = 0);
  4941. c.addEventListener(a, b, d, m, l)
  4942. };
  4943. b.removeEventListener = function(a, b, d, m) {
  4944. "undefined" === typeof m && (m = !1);
  4945. c.removeEventListener(a, b, d, m)
  4946. };
  4947. var d = function(a) {
  4948. function c() {
  4949. a.call(this);
  4950. this.analyzerDic = {};
  4951. this.configItemList = [];
  4952. this.configComplete = this.callLaterFlag = !1;
  4953. this.loadedGroups = [];
  4954. this.groupNameList = [];
  4955. this.asyncDic = {};
  4956. this.init()
  4957. }
  4958. __extends(c, a);
  4959. c.prototype.getAnalyzerByType = function(a) {
  4960. var c = this.analyzerDic[a];
  4961. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  4962. return c
  4963. };
  4964. c.prototype.init = function() {
  4965. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  4966. egret.Injector.hasMapRule(b.AnalyzerBase,
  4967. b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  4968. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  4969. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  4970. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase,
  4971. b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  4972. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  4973. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  4974. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  4975. this.resConfig =
  4976. new b.ResourceConfig;
  4977. this.resLoader = new b.ResourceLoader;
  4978. this.resLoader.callBack = this.onResourceItemComp;
  4979. this.resLoader.resInstance = this;
  4980. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  4981. };
  4982. c.prototype.loadConfig = function(a, b, c) {
  4983. "undefined" === typeof c && (c = "json");
  4984. this.configItemList.push({
  4985. url: a,
  4986. resourceRoot: b,
  4987. type: c
  4988. });
  4989. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  4990. };
  4991. c.prototype.startLoadConfig = function() {
  4992. this.callLaterFlag = !1;
  4993. var a = this.configItemList;
  4994. this.configItemList = [];
  4995. this.loadingConfigList = a;
  4996. for (var d = a.length, l = [], f = 0; f < d; f++) {
  4997. var g = a[f],
  4998. g = new b.ResourceItem(g.url, g.url, g.type);
  4999. l.push(g)
  5000. }
  5001. this.resLoader.loadGroup(l, c.GROUP_CONFIG, Number.MAX_VALUE)
  5002. };
  5003. c.prototype.isGroupLoaded = function(a) {
  5004. return -1 != this.loadedGroups.indexOf(a)
  5005. };
  5006. c.prototype.getGroupByName = function(a) {
  5007. return this.resConfig.getGroupByName(a)
  5008. };
  5009. c.prototype.loadGroup = function(a, b) {
  5010. "undefined" === typeof b && (b = 0);
  5011. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  5012. if (this.configComplete) {
  5013. var c =
  5014. this.resConfig.getGroupByName(a);
  5015. this.resLoader.loadGroup(c, a, b)
  5016. } else this.groupNameList.push({
  5017. name: a,
  5018. priority: b
  5019. })
  5020. };
  5021. c.prototype.createGroup = function(a, b, c) {
  5022. "undefined" === typeof c && (c = !1);
  5023. if (c) {
  5024. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  5025. }
  5026. return this.resConfig.createGroup(a, b, c)
  5027. };
  5028. c.prototype.onGroupComp = function(a) {
  5029. if (a.groupName == c.GROUP_CONFIG) {
  5030. a = this.loadingConfigList.length;
  5031. for (var d = 0; d < a; d++) {
  5032. var l = this.loadingConfigList[d],
  5033. f = this.getAnalyzerByType(l.type),
  5034. g = f.getRes(l.url);
  5035. f.destroyRes(l.url);
  5036. this.resConfig.parseConfig(g, l.resourceRoot)
  5037. }
  5038. this.configComplete = !0;
  5039. this.loadingConfigList = null;
  5040. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  5041. l = this.groupNameList;
  5042. a = l.length;
  5043. for (d = 0; d < a; d++) f = l[d], this.loadGroup(f.name, f.priority);
  5044. this.groupNameList = []
  5045. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  5046. };
  5047. c.prototype.hasRes = function(a) {
  5048. var c = this.resConfig.getType(a);
  5049. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a),
  5050. "" == c) ? !1 : !0
  5051. };
  5052. c.prototype.getRes = function(a) {
  5053. var c = this.resConfig.getType(a);
  5054. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(c), "" == c) ? null : this.getAnalyzerByType(c).getRes(a)
  5055. };
  5056. c.prototype.getResAsync = function(a, c, d) {
  5057. var e = this.resConfig.getType(a),
  5058. g = this.resConfig.getName(a);
  5059. if ("" == e && (g = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(g), "" == e)) {
  5060. c.call(d, null);
  5061. return
  5062. }(e = this.getAnalyzerByType(e).getRes(a)) ? c.call(d, e) : (a = {
  5063. key: a,
  5064. compFunc: c,
  5065. thisObject: d
  5066. }, this.asyncDic[g] ?
  5067. this.asyncDic[g].push(a) : (this.asyncDic[g] = [a], g = this.resConfig.getResourceItem(g), this.resLoader.loadItem(g)))
  5068. };
  5069. c.prototype.getResByUrl = function(a, c, d, e) {
  5070. "undefined" === typeof e && (e = "");
  5071. if (a) {
  5072. e || (e = this.getTypeByUrl(a));
  5073. var g = this.getAnalyzerByType(e).getRes(a);
  5074. g ? c.call(d, g) : (c = {
  5075. key: a,
  5076. compFunc: c,
  5077. thisObject: d
  5078. }, this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  5079. } else c.call(d, null)
  5080. };
  5081. c.prototype.getTypeByUrl = function(a) {
  5082. (a = a.substr(a.lastIndexOf(".") +
  5083. 1)) && (a = a.toLowerCase());
  5084. switch (a) {
  5085. case b.ResourceItem.TYPE_XML:
  5086. case b.ResourceItem.TYPE_JSON:
  5087. case b.ResourceItem.TYPE_SHEET:
  5088. break;
  5089. case "png":
  5090. case "jpg":
  5091. case "gif":
  5092. a = b.ResourceItem.TYPE_IMAGE;
  5093. break;
  5094. case "fnt":
  5095. a = b.ResourceItem.TYPE_FONT;
  5096. break;
  5097. case "txt":
  5098. a = b.ResourceItem.TYPE_TEXT;
  5099. break;
  5100. case "mp3":
  5101. case "ogg":
  5102. case "mpeg":
  5103. case "wav":
  5104. case "m4a":
  5105. case "mp4":
  5106. case "aiff":
  5107. case "wma":
  5108. case "mid":
  5109. a = b.ResourceItem.TYPE_SOUND;
  5110. break;
  5111. default:
  5112. a = b.ResourceItem.TYPE_BIN
  5113. }
  5114. return a
  5115. };
  5116. c.prototype.onResourceItemComp = function(a) {
  5117. var b =
  5118. this.asyncDic[a.name];
  5119. delete this.asyncDic[a.name];
  5120. a = this.getAnalyzerByType(a.type);
  5121. for (var c = b.length, d = 0; d < c; d++) {
  5122. var e = b[d],
  5123. k = a.getRes(e.key);
  5124. e.compFunc.call(e.thisObject, k)
  5125. }
  5126. };
  5127. c.prototype.destroyRes = function(a) {
  5128. var b = this.resConfig.getRawGroupByName(a);
  5129. if (b) {
  5130. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  5131. a = b.length;
  5132. for (var d = 0; d < a; d++) {
  5133. c = b[d];
  5134. c.loaded = !1;
  5135. var e = this.getAnalyzerByType(c.type);
  5136. e.destroyRes(c.name)
  5137. }
  5138. return !0
  5139. }
  5140. b = this.resConfig.getType(a);
  5141. if ("" == b) return !1;
  5142. c = this.resConfig.getRawResourceItem(a);
  5143. c.loaded = !1;
  5144. e = this.getAnalyzerByType(b);
  5145. return e.destroyRes(a)
  5146. };
  5147. c.prototype.setMaxLoadingThread = function(a) {
  5148. 1 > a && (a = 1);
  5149. this.resLoader.thread = a
  5150. };
  5151. c.GROUP_CONFIG = "RES__CONFIG";
  5152. return c
  5153. }(egret.EventDispatcher);
  5154. d.prototype.__class__ = "Resource";
  5155. var c = new d
  5156. })(RES || (RES = {}));
  5157. __extends = this.__extends || function(b, d) {
  5158. function c() {
  5159. this.constructor = b
  5160. }
  5161. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5162. c.prototype = d.prototype;
  5163. b.prototype = new c
  5164. };
  5165. (function(b) {
  5166. var d = function(c) {
  5167. function a(b) {
  5168. "undefined" === typeof b && (b = 60);
  5169. c.call(this);
  5170. this.frameRate = b;
  5171. this._time = 0;
  5172. 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 ||
  5173. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  5174. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  5175. return window.setTimeout(a, 1E3 / b)
  5176. });
  5177. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  5178. return window.clearTimeout(a)
  5179. });
  5180. a.instance = this;
  5181. this.registerListener()
  5182. }
  5183. __extends(a, c);
  5184. a.prototype.enterFrame = function() {
  5185. var c = a.instance,
  5186. d = a._thisObject,
  5187. m = a._callback,
  5188. l = b.getTimer();
  5189. m.call(d,
  5190. l - c._time);
  5191. c._time = l;
  5192. c._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  5193. };
  5194. a.prototype.executeMainLoop = function(b, c) {
  5195. a._callback = b;
  5196. a._thisObject = c;
  5197. this.enterFrame()
  5198. };
  5199. a.prototype.reset = function() {
  5200. var c = a.instance;
  5201. c._requestAnimationId && (c._time = b.getTimer(), a.cancelAnimationFrame.call(window, c._requestAnimationId), c.enterFrame())
  5202. };
  5203. a.prototype.registerListener = function() {
  5204. var b = function() {
  5205. a.instance.reset()
  5206. },
  5207. c = function() {
  5208. document[d] || b()
  5209. };
  5210. window.onfocus = b;
  5211. window.onblur = function() {};
  5212. var d, l;
  5213. "undefined" !== typeof document.hidden ? (d = "hidden", l = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", l = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", l = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", l = "webkitvisibilitychange");
  5214. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  5215. d && l && document.addEventListener(l, c, !1)
  5216. };
  5217. return a
  5218. }(b.DeviceContext);
  5219. b.HTML5DeviceContext =
  5220. d;
  5221. d.prototype.__class__ = "egret.HTML5DeviceContext"
  5222. })(egret);
  5223. __extends = this.__extends || function(b, d) {
  5224. function c() {
  5225. this.constructor = b
  5226. }
  5227. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5228. c.prototype = d.prototype;
  5229. b.prototype = new c
  5230. };
  5231. (function(b) {
  5232. var d = function(c) {
  5233. function a(a) {
  5234. this.canvas = a;
  5235. this.canvasContext = a.getContext("2d");
  5236. var b = this.canvasContext.setTransform,
  5237. d = this;
  5238. this.canvasContext.setTransform = function(a, c, e, k, n, p) {
  5239. d._matrixA = a;
  5240. d._matrixB = c;
  5241. d._matrixC = e;
  5242. d._matrixD = k;
  5243. d._matrixTx = n;
  5244. d._matrixTy = p;
  5245. b.call(d.canvasContext, a, c, e, k, n, p)
  5246. };
  5247. this._matrixA = 1;
  5248. this._matrixC = this._matrixB = 0;
  5249. this._matrixD = 1;
  5250. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  5251. c.call(this)
  5252. }
  5253. __extends(a, c);
  5254. a.prototype.clearScreen = function() {
  5255. this.setTransform(b.Matrix.identity.identity());
  5256. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, d = a.length; c < d; c++) {
  5257. var l = a[c];
  5258. this.clearRect(l.x + this._transformTx, l.y + this._transformTy, l.width, l.height)
  5259. }
  5260. this.renderCost = 0
  5261. };
  5262. a.prototype.clearRect = function(a, b, c, d) {
  5263. this.canvasContext.clearRect(a, b, c, d)
  5264. };
  5265. a.prototype.drawImage = function(a, d, m, l, f, g, k, n, p) {
  5266. d /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5267. m /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5268. l /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5269. f /= b.MainContext.instance.rendererContext.texture_scale_factor;
  5270. a = a._bitmapData;
  5271. g += this._transformTx;
  5272. k += this._transformTy;
  5273. var q = b.getTimer();
  5274. this.canvasContext.drawImage(a, d, m, l, f, g, k, n, p);
  5275. c.prototype.drawImage.call(this, a, d, m, l, f, g, k, n, p);
  5276. this.renderCost += b.getTimer() - q
  5277. };
  5278. a.prototype.setTransform = function(a) {
  5279. 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 =
  5280. 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))
  5281. };
  5282. a.prototype.setAlpha = function(a, c) {
  5283. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  5284. c ? (this.blendValue = c, this.canvasContext.globalCompositeOperation = c) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = b.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = b.BlendMode.NORMAL)
  5285. };
  5286. a.prototype.setupFont = function(a) {
  5287. var b = this.canvasContext,
  5288. c = a.italic ? "italic " : "normal ",
  5289. c = c + (a.bold ? "bold " : "normal "),
  5290. c = c + (a.size + "px " + a.fontFamily);
  5291. b.font = c;
  5292. b.textAlign = "left";
  5293. b.textBaseline = "middle"
  5294. };
  5295. a.prototype.measureText = function(a) {
  5296. return this.canvasContext.measureText(a).width
  5297. };
  5298. a.prototype.drawText = function(a, b, d, l, f) {
  5299. var g = a._strokeColorString,
  5300. k = a.stroke,
  5301. n = this.canvasContext;
  5302. n.fillStyle = a._textColorString;
  5303. n.strokeStyle = g;
  5304. k && (n.lineWidth = 2 * k, n.strokeText(b, d + this._transformTx, l + this._transformTy,
  5305. f || 65535));
  5306. n.fillText(b, d + this._transformTx, l + this._transformTy, f || 65535);
  5307. c.prototype.drawText.call(this, a, b, d, l, f)
  5308. };
  5309. a.prototype.strokeRect = function(a, b, c, d, f) {
  5310. this.canvasContext.strokeStyle = f;
  5311. this.canvasContext.strokeRect(a, b, c, d)
  5312. };
  5313. a.prototype.pushMask = function(a) {
  5314. this.canvasContext.save();
  5315. this.canvasContext.beginPath();
  5316. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  5317. this.canvasContext.clip();
  5318. this.canvasContext.closePath()
  5319. };
  5320. a.prototype.popMask = function() {
  5321. this.canvasContext.restore();
  5322. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  5323. };
  5324. return a
  5325. }(b.RendererContext);
  5326. b.HTML5CanvasRenderer = d;
  5327. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  5328. })(egret);
  5329. var egret_h5_graphics;
  5330. (function(b) {
  5331. b.beginFill = function(b, a) {
  5332. "undefined" === typeof a && (a = 1);
  5333. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  5334. this.fillStyleColor = e;
  5335. this.commandQueue.push(new d(this._setStyle, this, [e]))
  5336. };
  5337. b.drawRect = function(b, a, e, h) {
  5338. this.commandQueue.push(new d(function(a, b, c, d) {
  5339. var e = this.renderContext;
  5340. this.canvasContext.beginPath();
  5341. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  5342. this.canvasContext.closePath()
  5343. }, this, [b, a, e, h]));
  5344. this._fill()
  5345. };
  5346. b.drawCircle = function(b, a, e) {
  5347. this.commandQueue.push(new d(function(a,
  5348. b, c) {
  5349. var d = this.renderContext;
  5350. this.canvasContext.beginPath();
  5351. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  5352. this.canvasContext.closePath()
  5353. }, this, [b, a, e]));
  5354. this._fill()
  5355. };
  5356. b.lineStyle = function(b, a, e, h, m, l, f, g) {
  5357. "undefined" === typeof b && (b = NaN);
  5358. "undefined" === typeof a && (a = 0);
  5359. "undefined" === typeof e && (e = 1);
  5360. "undefined" === typeof h && (h = !1);
  5361. "undefined" === typeof m && (m = "normal");
  5362. "undefined" === typeof l && (l = null);
  5363. "undefined" === typeof f && (f = null);
  5364. "undefined" === typeof g && (g = 3);
  5365. this.strokeStyleColor &&
  5366. (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  5367. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  5368. this.commandQueue.push(new d(function(a, b) {
  5369. this.canvasContext.lineWidth = a;
  5370. this.canvasContext.strokeStyle = b;
  5371. this.canvasContext.beginPath()
  5372. }, this, [b, a]));
  5373. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  5374. this.moveTo(this.lineX, this.lineY)
  5375. };
  5376. b.lineTo = function(b, a) {
  5377. this.commandQueue.push(new d(function(a, b) {
  5378. var c = this.renderContext;
  5379. this.canvasContext.lineTo(c._transformTx +
  5380. a, c._transformTy + b)
  5381. }, this, [b, a]));
  5382. this.lineX = b;
  5383. this.lineY = a
  5384. };
  5385. b.curveTo = function(b, a, e, h) {
  5386. this.commandQueue.push(new d(function(a, b, c, d) {
  5387. var e = this.renderContext;
  5388. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  5389. }, this, [b, a, e, h]));
  5390. this.lineX = e;
  5391. this.lineY = h
  5392. };
  5393. b.moveTo = function(b, a) {
  5394. this.commandQueue.push(new d(function(a, b) {
  5395. var c = this.renderContext;
  5396. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  5397. }, this, [b, a]))
  5398. };
  5399. b.clear = function() {
  5400. this.lineY = this.lineX = this.commandQueue.length =
  5401. 0;
  5402. this.fillStyleColor = this.strokeStyleColor = null
  5403. };
  5404. b.createEndFillCommand = function() {
  5405. this.endFillCommand || (this.endFillCommand = new d(function() {
  5406. this.canvasContext.fill();
  5407. this.canvasContext.closePath()
  5408. }, this, null))
  5409. };
  5410. b.endFill = function() {
  5411. null != this.fillStyleColor && this._fill();
  5412. this.fillStyleColor = null
  5413. };
  5414. b._fill = function() {
  5415. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  5416. };
  5417. b.createEndLineCommand = function() {
  5418. this.endLineCommand || (this.endLineCommand = new d(function() {
  5419. this.canvasContext.stroke();
  5420. this.canvasContext.closePath()
  5421. }, this, null))
  5422. };
  5423. b._draw = function(b) {
  5424. this.renderContext = b;
  5425. b = this.canvasContext = this.renderContext.canvasContext;
  5426. b.save();
  5427. var a = this.commandQueue.length;
  5428. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  5429. for (var d = 0; d < a; d++) {
  5430. var h = this.commandQueue[d];
  5431. h.method.apply(h.thisObject, h.args)
  5432. }
  5433. b.restore()
  5434. };
  5435. var d = function() {
  5436. return function(b, a, d) {
  5437. this.method =
  5438. b;
  5439. this.thisObject = a;
  5440. this.args = d
  5441. }
  5442. }();
  5443. d.prototype.__class__ = "Command";
  5444. b._setStyle = function(b) {
  5445. this.canvasContext.fillStyle = b;
  5446. this.canvasContext.beginPath()
  5447. };
  5448. b.init = function() {
  5449. for (var c in b) egret.Graphics.prototype[c] = b[c];
  5450. egret.RendererContext.createRendererContext = function(a) {
  5451. return new egret.HTML5CanvasRenderer(a)
  5452. }
  5453. }
  5454. })(egret_h5_graphics || (egret_h5_graphics = {}));
  5455. egret_h5_graphics.init();
  5456. __extends = this.__extends || function(b, d) {
  5457. function c() {
  5458. this.constructor = b
  5459. }
  5460. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5461. c.prototype = d.prototype;
  5462. b.prototype = new c
  5463. };
  5464. (function(b) {
  5465. var d = function(c) {
  5466. function a(a) {
  5467. c.call(this);
  5468. this.size = 2E3;
  5469. this.vertSize = 6;
  5470. this.contextLost = !1;
  5471. this.glContextId = 0;
  5472. this.currentBlendMode = "";
  5473. this.currentBaseTexture = null;
  5474. this.currentBatchSize = 0;
  5475. this.maskList = [];
  5476. this.maskDataFreeList = [];
  5477. this.canvasContext = document.createElement("canvas").getContext("2d");
  5478. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  5479. this.canvas = a;
  5480. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  5481. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  5482. this.projectionX = a.width / 2;
  5483. this.projectionY = -a.height / 2;
  5484. a = 6 * this.size;
  5485. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  5486. this.indices = new Uint16Array(a);
  5487. for (var d = 0, m = 0; d < a; d += 6, m += 4) this.indices[d + 0] = m + 0, this.indices[d + 1] = m + 1, this.indices[d + 2] = m + 2, this.indices[d + 3] = m + 0, this.indices[d + 4] = m + 2, this.indices[d + 5] = m + 3;
  5488. this.initWebGL();
  5489. this.shaderManager = new b.WebGLShaderManager(this.gl);
  5490. this.worldTransform = new b.Matrix;
  5491. this.initBlendMode();
  5492. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER,
  5493. this._draw, this);
  5494. b.TextField.prototype._draw = function(a) {
  5495. this.getDirty() && (this.cacheAsBitmap = !0);
  5496. b.DisplayObject.prototype._draw.call(this, a)
  5497. }
  5498. }
  5499. __extends(a, c);
  5500. a.prototype.handleContextLost = function() {
  5501. this.contextLost = !0
  5502. };
  5503. a.prototype.handleContextRestored = function() {
  5504. this.initWebGL();
  5505. this.shaderManager.setContext(this.gl);
  5506. this.contextLost = !1
  5507. };
  5508. a.prototype.initWebGL = function() {
  5509. for (var a = {
  5510. stencil: !0
  5511. }, b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  5512. try {
  5513. b = this.canvas.getContext(c[d], a)
  5514. } catch (f) {}
  5515. if (b) break
  5516. }
  5517. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  5518. this.setContext(b)
  5519. };
  5520. a.prototype.setContext = function(a) {
  5521. this.gl = a;
  5522. a.id = this.glContextId++;
  5523. this.vertexBuffer = a.createBuffer();
  5524. this.indexBuffer = a.createBuffer();
  5525. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5526. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  5527. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5528. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  5529. a.disable(a.DEPTH_TEST);
  5530. a.disable(a.CULL_FACE);
  5531. a.enable(a.BLEND);
  5532. a.colorMask(!0, !0, !0, !0)
  5533. };
  5534. a.prototype.initBlendMode = function() {
  5535. a.blendModesWebGL[b.BlendMode.NORMAL] =
  5536. [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  5537. a.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  5538. };
  5539. a.prototype.start = function() {
  5540. if (!this.contextLost) {
  5541. var a = this.gl;
  5542. a.activeTexture(a.TEXTURE0);
  5543. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5544. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5545. var b = this.shaderManager.defaultShader;
  5546. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  5547. var c = 4 * this.vertSize;
  5548. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  5549. a.vertexAttribPointer(b.aTextureCoord,
  5550. 2, a.FLOAT, !1, c, 8);
  5551. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  5552. }
  5553. };
  5554. a.prototype.clearScreen = function() {
  5555. var a = this.gl;
  5556. a.colorMask(!0, !0, !0, !0);
  5557. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, l = c.length; d < l; d++) {
  5558. var f = c[d];
  5559. a.viewport(f.x, f.y, f.width, f.height);
  5560. a.bindFramebuffer(a.FRAMEBUFFER, null);
  5561. a.clearColor(0, 0, 0, 0);
  5562. a.clear(a.COLOR_BUFFER_BIT)
  5563. }
  5564. this.renderCost = 0
  5565. };
  5566. a.prototype.setBlendMode = function(c) {
  5567. c || (c = b.BlendMode.NORMAL);
  5568. if (this.currentBlendMode != c) {
  5569. var d = a.blendModesWebGL[c];
  5570. d && (this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = c)
  5571. }
  5572. };
  5573. a.prototype.drawImage = function(a, c, d, l, f, g, k, n, p) {
  5574. if (!this.contextLost) {
  5575. var q = b.MainContext.instance.rendererContext.texture_scale_factor;
  5576. c /= q;
  5577. d /= q;
  5578. l /= q;
  5579. f /= q;
  5580. this.createWebGLTexture(a);
  5581. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(), this.currentBaseTexture = a.webGLTexture;
  5582. var t = this.worldTransform,
  5583. r = t.a,
  5584. s = t.b,
  5585. u = t.c,
  5586. v = t.d,
  5587. x = t.tx,
  5588. y = t.ty;
  5589. 0 == g && 0 == k || t.append(1, 0, 0, 1, g, k);
  5590. 1 == l / n && 1 == f / p || t.append(n / l,
  5591. 0, 0, p / f, 0, 0);
  5592. g = t.a;
  5593. k = t.b;
  5594. n = t.c;
  5595. p = t.d;
  5596. var q = t.tx,
  5597. w = t.ty;
  5598. t.a = r;
  5599. t.b = s;
  5600. t.c = u;
  5601. t.d = v;
  5602. t.tx = x;
  5603. t.ty = y;
  5604. r = a._sourceWidth;
  5605. s = a._sourceHeight;
  5606. a = l;
  5607. t = f;
  5608. c /= r;
  5609. d /= s;
  5610. l /= r;
  5611. f /= s;
  5612. r = this.vertices;
  5613. s = 4 * this.currentBatchSize * this.vertSize;
  5614. u = this.worldAlpha;
  5615. r[s++] = q;
  5616. r[s++] = w;
  5617. r[s++] = c;
  5618. r[s++] = d;
  5619. r[s++] = u;
  5620. r[s++] = 16777215;
  5621. r[s++] = g * a + q;
  5622. r[s++] = k * a + w;
  5623. r[s++] = l + c;
  5624. r[s++] = d;
  5625. r[s++] = u;
  5626. r[s++] = 16777215;
  5627. r[s++] = g * a + n * t + q;
  5628. r[s++] = p * t + k * a + w;
  5629. r[s++] = l + c;
  5630. r[s++] = f + d;
  5631. r[s++] = u;
  5632. r[s++] = 16777215;
  5633. r[s++] = n * t + q;
  5634. r[s++] = p * t + w;
  5635. r[s++] = c;
  5636. r[s++] = f + d;
  5637. r[s++] = u;
  5638. r[s++] =
  5639. 16777215;
  5640. this.currentBatchSize++
  5641. }
  5642. };
  5643. a.prototype._draw = function() {
  5644. if (0 != this.currentBatchSize && !this.contextLost) {
  5645. var a = b.getTimer();
  5646. this.start();
  5647. var c = this.gl;
  5648. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  5649. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  5650. c.bufferSubData(c.ARRAY_BUFFER, 0, d);
  5651. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  5652. this.currentBatchSize = 0;
  5653. this.renderCost += b.getTimer() - a;
  5654. b.Profiler.getInstance().onDrawImage()
  5655. }
  5656. };
  5657. a.prototype.setTransform =
  5658. function(a) {
  5659. var b = this.worldTransform;
  5660. b.a = a.a;
  5661. b.b = a.b;
  5662. b.c = a.c;
  5663. b.d = a.d;
  5664. b.tx = a.tx;
  5665. b.ty = a.ty
  5666. };
  5667. a.prototype.setAlpha = function(a, b) {
  5668. this.worldAlpha = a;
  5669. b && this.setBlendMode(b)
  5670. };
  5671. a.prototype.createWebGLTexture = function(a) {
  5672. if (!a.webGLTexture) {
  5673. var b = this.gl;
  5674. a.webGLTexture = b.createTexture();
  5675. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  5676. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  5677. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  5678. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  5679. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  5680. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  5681. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  5682. b.bindTexture(b.TEXTURE_2D, null)
  5683. }
  5684. };
  5685. a.prototype.pushMask = function(a) {
  5686. this._draw();
  5687. var b = this.gl;
  5688. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  5689. var c = this.maskDataFreeList.pop();
  5690. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  5691. x: a.x,
  5692. y: a.y,
  5693. w: a.width,
  5694. h: a.height
  5695. };
  5696. this.maskList.push(c);
  5697. b.colorMask(!1, !1, !1, !1);
  5698. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  5699. this.renderGraphics(c);
  5700. b.colorMask(!0, !0, !0, !0);
  5701. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  5702. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  5703. };
  5704. a.prototype.popMask = function() {
  5705. this._draw();
  5706. var a = this.gl,
  5707. b = this.maskList.pop();
  5708. 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));
  5709. 0 == this.maskList.length &&
  5710. a.disable(a.STENCIL_TEST)
  5711. };
  5712. a.prototype.setupFont = function(a) {
  5713. var b = this.canvasContext,
  5714. c = a.italic ? "italic " : "normal ",
  5715. c = c + (a.bold ? "bold " : "normal "),
  5716. c = c + (a.size + "px " + a.fontFamily);
  5717. b.font = c;
  5718. b.textAlign = "left";
  5719. b.textBaseline = "middle"
  5720. };
  5721. a.prototype.measureText = function(a) {
  5722. return this.canvasContext.measureText(a).width
  5723. };
  5724. a.prototype.renderGraphics = function(a) {
  5725. var b = this.gl,
  5726. c = this.shaderManager.primitiveShader;
  5727. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints =
  5728. [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  5729. this.updateGraphics(a);
  5730. this.shaderManager.activateShader(c);
  5731. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  5732. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  5733. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  5734. b.uniform2f(c.offsetVector, 0, 0);
  5735. b.uniform3fv(c.tintColor, [1, 1, 1]);
  5736. b.uniform1f(c.alpha, this.worldAlpha);
  5737. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5738. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  5739. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  5740. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5741. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  5742. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  5743. };
  5744. a.prototype.updateGraphics = function(a) {
  5745. var b = this.gl;
  5746. this.buildRectangle(a);
  5747. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5748. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints),
  5749. b.STATIC_DRAW);
  5750. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5751. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  5752. };
  5753. a.prototype.buildRectangle = function(a) {
  5754. var b = a.x,
  5755. c = a.y,
  5756. d = a.w;
  5757. a = a.h;
  5758. var f = this.graphicsPoints,
  5759. g = this.graphicsIndices,
  5760. k = f.length / 6;
  5761. f.push(b, c);
  5762. f.push(0, 0, 0, 1);
  5763. f.push(b + d, c);
  5764. f.push(0, 0, 0, 1);
  5765. f.push(b, c + a);
  5766. f.push(0, 0, 0, 1);
  5767. f.push(b + d, c + a);
  5768. f.push(0, 0, 0, 1);
  5769. g.push(k, k, k + 1, k + 2, k + 3, k + 3)
  5770. };
  5771. a.blendModesWebGL = {};
  5772. return a
  5773. }(b.RendererContext);
  5774. b.WebGLRenderer =
  5775. d;
  5776. d.prototype.__class__ = "egret.WebGLRenderer"
  5777. })(egret);
  5778. (function(b) {
  5779. var d = function() {
  5780. function b() {}
  5781. b.compileProgram = function(a, d, h) {
  5782. h = b.compileFragmentShader(a, h);
  5783. d = b.compileVertexShader(a, d);
  5784. var m = a.createProgram();
  5785. a.attachShader(m, d);
  5786. a.attachShader(m, h);
  5787. a.linkProgram(m);
  5788. a.getProgramParameter(m, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  5789. return m
  5790. };
  5791. b.compileFragmentShader = function(a, d) {
  5792. return b._compileShader(a, d, a.FRAGMENT_SHADER)
  5793. };
  5794. b.compileVertexShader = function(a, d) {
  5795. return b._compileShader(a, d, a.VERTEX_SHADER)
  5796. };
  5797. b._compileShader =
  5798. function(a, b, c) {
  5799. c = a.createShader(c);
  5800. a.shaderSource(c, b);
  5801. a.compileShader(c);
  5802. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c : (console.log(a.getShaderInfoLog(c)), null)
  5803. };
  5804. b.checkCanUseWebGL = function() {
  5805. if (void 0 == b.canUseWebGL) try {
  5806. var a = document.createElement("canvas");
  5807. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  5808. } catch (d) {
  5809. b.canUseWebGL = !1
  5810. }
  5811. return b.canUseWebGL
  5812. };
  5813. return b
  5814. }();
  5815. b.WebGLUtils = d;
  5816. d.prototype.__class__ = "egret.WebGLUtils"
  5817. })(egret);
  5818. (function(b) {
  5819. var d = function() {
  5820. function b(a) {
  5821. this.maxAttibs = 10;
  5822. this.attribState = [];
  5823. this.tempAttribState = [];
  5824. for (var c = 0; c < this.maxAttibs; c++) this.attribState[c] = !1;
  5825. this.setContext(a)
  5826. }
  5827. b.prototype.setContext = function(b) {
  5828. this.gl = b;
  5829. this.primitiveShader = new a(b);
  5830. this.defaultShader = new c(b);
  5831. this.activateShader(this.defaultShader)
  5832. };
  5833. b.prototype.activateShader = function(a) {
  5834. this.gl.useProgram(a.program);
  5835. this.setAttribs(a.attributes)
  5836. };
  5837. b.prototype.setAttribs = function(a) {
  5838. var b, c;
  5839. c = this.tempAttribState.length;
  5840. for (b =
  5841. 0; b < c; b++) this.tempAttribState[b] = !1;
  5842. c = a.length;
  5843. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  5844. a = this.gl;
  5845. c = this.attribState.length;
  5846. 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))
  5847. };
  5848. return b
  5849. }();
  5850. b.WebGLShaderManager = d;
  5851. d.prototype.__class__ = "egret.WebGLShaderManager";
  5852. var c = function() {
  5853. function a(b) {
  5854. 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}";
  5855. this.program = null;
  5856. 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}";
  5857. this.gl = b;
  5858. this.init()
  5859. }
  5860. a.prototype.init = function() {
  5861. var a = this.gl,
  5862. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  5863. a.useProgram(c);
  5864. this.uSampler = a.getUniformLocation(c, "uSampler");
  5865. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  5866. this.offsetVector =
  5867. a.getUniformLocation(c, "offsetVector");
  5868. this.dimensions = a.getUniformLocation(c, "dimensions");
  5869. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  5870. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  5871. this.colorAttribute = a.getAttribLocation(c, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  5872. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  5873. this.program = c
  5874. };
  5875. return a
  5876. }();
  5877. b.EgretShader = c;
  5878. c.prototype.__class__ = "egret.EgretShader";
  5879. var a = function() {
  5880. function a(b) {
  5881. this.alpha =
  5882. this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  5883. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  5884. 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}";
  5885. this.gl = b;
  5886. this.init()
  5887. }
  5888. a.prototype.init = function() {
  5889. var a = this.gl,
  5890. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  5891. a.useProgram(c);
  5892. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  5893. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  5894. this.tintColor = a.getUniformLocation(c, "tint");
  5895. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  5896. this.colorAttribute = a.getAttribLocation(c, "aColor");
  5897. this.attributes = [this.aVertexPosition, this.colorAttribute];
  5898. this.translationMatrix =
  5899. a.getUniformLocation(c, "translationMatrix");
  5900. this.alpha = a.getUniformLocation(c, "alpha");
  5901. this.program = c
  5902. };
  5903. return a
  5904. }();
  5905. b.PrimitiveShader = a;
  5906. a.prototype.__class__ = "egret.PrimitiveShader"
  5907. })(egret);
  5908. __extends = this.__extends || function(b, d) {
  5909. function c() {
  5910. this.constructor = b
  5911. }
  5912. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5913. c.prototype = d.prototype;
  5914. b.prototype = new c
  5915. };
  5916. (function(b) {
  5917. var d = function(c) {
  5918. function a() {
  5919. c.call(this)
  5920. }
  5921. __extends(a, c);
  5922. a.prototype.proceed = function(a) {
  5923. function c(d) {
  5924. b.IOErrorEvent.dispatchIOErrorEvent(a)
  5925. }
  5926. function d(c) {
  5927. switch (a.dataFormat) {
  5928. case b.URLLoaderDataFormat.TEXT:
  5929. a.data = f.responseText;
  5930. break;
  5931. case b.URLLoaderDataFormat.VARIABLES:
  5932. a.data = new b.URLVariables(f.responseText);
  5933. break;
  5934. case b.URLLoaderDataFormat.BINARY:
  5935. a.data = f.response;
  5936. break;
  5937. default:
  5938. a.data = f.responseText
  5939. }
  5940. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  5941. }
  5942. if (a.dataFormat ==
  5943. b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  5944. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  5945. else {
  5946. var l = a._request,
  5947. f = this.getXHR();
  5948. f.onerror = c;
  5949. f.onload = d;
  5950. f.open(l.method, l.url, !0);
  5951. this.setResponseType(f, a.dataFormat);
  5952. l.method != b.URLRequestMethod.GET && l.data ? l.data instanceof b.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(l.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(l.data)) : f.send()
  5953. }
  5954. };
  5955. a.prototype.loadSound =
  5956. function(a) {
  5957. function c(f) {
  5958. window.clearTimeout(l.__timeoutId);
  5959. l.removeEventListener("canplaythrough", c, !1);
  5960. l.removeEventListener("error", d, !1);
  5961. f = new b.Sound;
  5962. f.audio = l;
  5963. a.data = f;
  5964. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  5965. }
  5966. function d(f) {
  5967. window.clearTimeout(l.__timeoutId);
  5968. l.removeEventListener("canplaythrough", c, !1);
  5969. l.removeEventListener("error", d, !1);
  5970. b.IOErrorEvent.dispatchIOErrorEvent(a)
  5971. }
  5972. var l = new Audio(a._request.url);
  5973. l.__timeoutId = window.setTimeout(c, 100);
  5974. l.addEventListener("canplaythrough",
  5975. c, !1);
  5976. l.addEventListener("error", d, !1);
  5977. l.load()
  5978. };
  5979. a.prototype.getXHR = function() {
  5980. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  5981. };
  5982. a.prototype.setResponseType = function(a, c) {
  5983. switch (c) {
  5984. case b.URLLoaderDataFormat.TEXT:
  5985. case b.URLLoaderDataFormat.VARIABLES:
  5986. a.responseType = b.URLLoaderDataFormat.TEXT;
  5987. break;
  5988. case b.URLLoaderDataFormat.BINARY:
  5989. a.responseType = "arraybuffer";
  5990. break;
  5991. default:
  5992. a.responseType = c
  5993. }
  5994. };
  5995. a.prototype.loadTexture = function(a) {
  5996. var c = a._request,
  5997. d = new Image;
  5998. d.crossOrigin = "Anonymous";
  5999. d.onload = function(c) {
  6000. d.onerror = null;
  6001. d.onload = null;
  6002. c = new b.Texture;
  6003. c._setBitmapData(d);
  6004. a.data = c;
  6005. b.callLater(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  6006. };
  6007. d.onerror = function(c) {
  6008. d.onerror = null;
  6009. d.onload = null;
  6010. b.IOErrorEvent.dispatchIOErrorEvent(a)
  6011. };
  6012. d.src = c.url
  6013. };
  6014. return a
  6015. }(b.NetContext);
  6016. b.HTML5NetContext = d;
  6017. d.prototype.__class__ = "egret.HTML5NetContext"
  6018. })(egret);
  6019. __extends = this.__extends || function(b, d) {
  6020. function c() {
  6021. this.constructor = b
  6022. }
  6023. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6024. c.prototype = d.prototype;
  6025. b.prototype = new c
  6026. };
  6027. (function(b) {
  6028. var d = function(c) {
  6029. function a(a) {
  6030. c.call(this);
  6031. this.canvas = a;
  6032. this._isTouchDown = !1
  6033. }
  6034. __extends(a, c);
  6035. a.prototype.run = function() {
  6036. var a = this;
  6037. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown", function(b) {
  6038. a._onTouchBegin(b);
  6039. b.stopPropagation();
  6040. b.preventDefault()
  6041. }, !1), this.canvas.addEventListener("MSPointerMove", function(b) {
  6042. a._onTouchMove(b);
  6043. b.stopPropagation();
  6044. b.preventDefault()
  6045. }, !1), this.canvas.addEventListener("MSPointerUp", function(b) {
  6046. a._onTouchEnd(b);
  6047. b.stopPropagation();
  6048. b.preventDefault()
  6049. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  6050. window.addEventListener("mousedown", function(b) {
  6051. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  6052. });
  6053. window.addEventListener("mouseup", function(b) {
  6054. a._isTouchDown && a.inOutOfCanvas(b) && a.dispatchLeaveStageEvent();
  6055. a._isTouchDown = !1
  6056. })
  6057. };
  6058. a.prototype.addMouseListener = function() {
  6059. var a = this;
  6060. this.canvas.addEventListener("mousedown", function(b) {
  6061. a._onTouchBegin(b)
  6062. });
  6063. this.canvas.addEventListener("mousemove", function(b) {
  6064. a._onTouchMove(b)
  6065. });
  6066. this.canvas.addEventListener("mouseup", function(b) {
  6067. a._onTouchEnd(b)
  6068. })
  6069. };
  6070. a.prototype.addTouchListener = function() {
  6071. var a = this;
  6072. this.canvas.addEventListener("touchstart", function(b) {
  6073. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchBegin(b.changedTouches[d]);
  6074. b.stopPropagation();
  6075. b.preventDefault()
  6076. }, !1);
  6077. this.canvas.addEventListener("touchmove",
  6078. function(b) {
  6079. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchMove(b.changedTouches[d]);
  6080. b.stopPropagation();
  6081. b.preventDefault()
  6082. }, !1);
  6083. this.canvas.addEventListener("touchend", function(b) {
  6084. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchEnd(b.changedTouches[d]);
  6085. b.stopPropagation();
  6086. b.preventDefault()
  6087. }, !1);
  6088. this.canvas.addEventListener("touchcancel", function(b) {
  6089. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchEnd(b.changedTouches[d]);
  6090. b.stopPropagation();
  6091. b.preventDefault()
  6092. }, !1)
  6093. };
  6094. a.prototype.inOutOfCanvas = function(a) {
  6095. a = this.getLocation(this.canvas, a);
  6096. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  6097. };
  6098. a.prototype.dispatchLeaveStageEvent = function() {
  6099. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  6100. };
  6101. a.prototype._onTouchBegin = function(a) {
  6102. var b = this.getLocation(this.canvas, a),
  6103. c = -1;
  6104. a.hasOwnProperty("identifier") && (c = a.identifier);
  6105. this.onTouchBegan(b.x, b.y, c)
  6106. };
  6107. a.prototype._onTouchMove = function(a) {
  6108. var b = this.getLocation(this.canvas,
  6109. a),
  6110. c = -1;
  6111. a.hasOwnProperty("identifier") && (c = a.identifier);
  6112. this.onTouchMove(b.x, b.y, c)
  6113. };
  6114. a.prototype._onTouchEnd = function(a) {
  6115. var b = this.getLocation(this.canvas, a),
  6116. c = -1;
  6117. a.hasOwnProperty("identifier") && (c = a.identifier);
  6118. this.onTouchEnd(b.x, b.y, c)
  6119. };
  6120. a.prototype.getLocation = function(a, c) {
  6121. var d = document.documentElement,
  6122. l = window,
  6123. f, g;
  6124. "function" === typeof a.getBoundingClientRect ? (g = a.getBoundingClientRect(), f = g.left, g = g.top) : g = f = 0;
  6125. f += l.pageXOffset - d.clientLeft;
  6126. g += l.pageYOffset - d.clientTop;
  6127. null != c.pageX ? (d = c.pageX,
  6128. l = c.pageY) : (f -= document.body.scrollLeft, g -= document.body.scrollTop, d = c.clientX, l = c.clientY);
  6129. var k = b.Point.identity;
  6130. k.x = (d - f) / b.StageDelegate.getInstance().getScaleX();
  6131. k.y = (l - g) / b.StageDelegate.getInstance().getScaleY();
  6132. return k
  6133. };
  6134. return a
  6135. }(b.TouchContext);
  6136. b.HTML5TouchContext = d;
  6137. d.prototype.__class__ = "egret.HTML5TouchContext"
  6138. })(egret);
  6139. var utils;
  6140. (function(b) {
  6141. var d = function() {
  6142. function b() {}
  6143. b.hitTest = function(a, b) {
  6144. var c = a.getBounds(),
  6145. d = b.getBounds();
  6146. c.x = a.x;
  6147. c.y = a.y;
  6148. d.x = b.x;
  6149. d.y = b.y;
  6150. return c.intersects(d)
  6151. };
  6152. return b
  6153. }();
  6154. b.GameUtil = d;
  6155. d.prototype.__class__ = "utils.GameUtil";
  6156. b.createBitmapByName = function(b) {
  6157. var a = new egret.Bitmap;
  6158. b = RES.getRes(b);
  6159. a.texture = b;
  6160. return a
  6161. };
  6162. b.createRectangular = function(b, a, d, h, m, l) {
  6163. "undefined" === typeof b && (b = 0);
  6164. "undefined" === typeof a && (a = 0);
  6165. "undefined" === typeof d && (d = 480);
  6166. "undefined" === typeof h && (h = 640);
  6167. "undefined" === typeof m &&
  6168. (m = 1);
  6169. "undefined" === typeof l && (l = 0);
  6170. var f = new egret.Sprite;
  6171. f.graphics.beginFill(l, m);
  6172. f.graphics.drawRect(b, a, d, h);
  6173. f.graphics.endFill();
  6174. f.width = d;
  6175. f.height = h;
  6176. return f
  6177. };
  6178. b.createCircle = function(b, a, d, h, m) {
  6179. "undefined" === typeof b && (b = 0);
  6180. "undefined" === typeof a && (a = 0);
  6181. "undefined" === typeof d && (d = 10);
  6182. "undefined" === typeof h && (h = 1);
  6183. "undefined" === typeof m && (m = 16777215);
  6184. var l = new egret.Sprite;
  6185. l.graphics.beginFill(m, h);
  6186. l.graphics.drawCircle(b, a, d);
  6187. l.graphics.endFill();
  6188. return l
  6189. };
  6190. b.createTextLabel = function(b, a, d,
  6191. h, m, l, f, g, k, n, p, q) {
  6192. "undefined" === typeof a && (a = 0);
  6193. "undefined" === typeof d && (d = "left");
  6194. "undefined" === typeof h && (h = "none");
  6195. "undefined" === typeof m && (m = 14);
  6196. "undefined" === typeof l && (l = 0);
  6197. "undefined" === typeof f && (f = 0);
  6198. "undefined" === typeof g && (g = 0);
  6199. "undefined" === typeof k && (k = 0);
  6200. "undefined" === typeof n && (n = 0);
  6201. "undefined" === typeof p && (p = 0);
  6202. "undefined" === typeof q && (q = 0);
  6203. b = new egret.TextField;
  6204. b.textColor = a;
  6205. b.textAlign = d;
  6206. b.text = h;
  6207. b.size = m;
  6208. 0 != l && (b.width = l);
  6209. 0 != f && 0 != g && (b.strokeColor = f, b.stroke = g);
  6210. b.rotation = p;
  6211. 0 !=
  6212. q && (b.skewX = q);
  6213. b.x = k;
  6214. b.y = n;
  6215. return b
  6216. };
  6217. b.randomInt = function(b, a) {
  6218. if (0 >= a - b) return 0;
  6219. var d = a - b;
  6220. return Math.floor(Math.random() * d) + b
  6221. };
  6222. b.createBitmap = function(b, a, d, h) {
  6223. "undefined" === typeof d && (d = 0);
  6224. "undefined" === typeof h && (h = 0);
  6225. var m = new egret.Bitmap;
  6226. m.texture = b.getTexture(a);
  6227. m.x = d;
  6228. m.y = h;
  6229. return m
  6230. }
  6231. })(utils || (utils = {}));
  6232. var __extends = this.__extends || function(b, d) {
  6233. function c() {
  6234. this.constructor = b
  6235. }
  6236. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6237. c.prototype = d.prototype;
  6238. b.prototype = new c
  6239. },
  6240. StartBtn = function(b) {
  6241. function d() {
  6242. b.call(this);
  6243. this.sprite = new egret.Sprite;
  6244. this.downBool = !1;
  6245. this.sprite = utils.createCircle(5, 5, Settings.stageWidth / 4, 1, 10427238);
  6246. this.addChild(this.sprite);
  6247. this.sprite = utils.createCircle(0, 0, Settings.stageWidth / 4, 1, 16777215);
  6248. this.addChild(this.sprite);
  6249. var c = new egret.TextField,
  6250. c = utils.createTextLabel(c,
  6251. 7342404, "center", "开始", 60, 0, 7342404, 3, 0, 0);
  6252. this.addChild(c);
  6253. c.x = (this.sprite.width - c.width) / 2 + this.sprite.x;
  6254. c.y = (this.sprite.height - c.height) / 2 + this.sprite.y
  6255. }
  6256. __extends(d, b);
  6257. d.prototype.down = function() {
  6258. this.downBool || (this.sprite.x += 5, this.sprite.y += 5, this.downBool = !0)
  6259. };
  6260. d.prototype.up = function() {
  6261. this.downBool && (this.sprite.x -= 5, this.sprite.y -= 5, this.downBool = !1)
  6262. };
  6263. return d
  6264. }(egret.Sprite);
  6265. StartBtn.prototype.__class__ = "StartBtn";
  6266. var __extends = this.__extends || function(b, d) {
  6267. function c() {
  6268. this.constructor = b
  6269. }
  6270. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6271. c.prototype = d.prototype;
  6272. b.prototype = new c
  6273. },
  6274. DottedLine = function(b) {
  6275. function d(c, a, d, h, m) {
  6276. "undefined" === typeof c && (c = 400);
  6277. "undefined" === typeof a && (a = 2);
  6278. "undefined" === typeof d && (d = 20);
  6279. "undefined" === typeof h && (h = 16777215);
  6280. "undefined" === typeof m && (m = 0);
  6281. b.call(this);
  6282. c /= d;
  6283. for (var l = new egret.Sprite, f = 1; f <= d; f++) l = 1 == f || 0 == f % 2 || f == d ? utils.createRectangular(0, 0, c, a, 1, h) : utils.createRectangular(0,
  6284. 0, c, a, 1, m), this.addChild(l), l.x = (f - 1) * c, l.y = 0
  6285. }
  6286. __extends(d, b);
  6287. return d
  6288. }(egret.Sprite);
  6289. DottedLine.prototype.__class__ = "DottedLine";
  6290. var Settings = function() {
  6291. function b() {}
  6292. b.initVar = function(d, c) {
  6293. b.stageWidth = d;
  6294. b.stageHeight = c
  6295. };
  6296. b.setScoreText = function(d) {
  6297. b.score += d;
  6298. d = b.score.toString();
  6299. var c = d.length;
  6300. console.log(d.length);
  6301. for (var a = ""; 4 > c;) a += "0", c += 1;
  6302. GameUI.scoreText.text = (a + d).toString()
  6303. };
  6304. b.stageWidth = 480;
  6305. b.stageHeight = 640;
  6306. b.score = 0;
  6307. return b
  6308. }();
  6309. Settings.prototype.__class__ = "Settings";
  6310. var __extends = this.__extends || function(b, d) {
  6311. function c() {
  6312. this.constructor = b
  6313. }
  6314. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6315. c.prototype = d.prototype;
  6316. b.prototype = new c
  6317. },
  6318. GameUI = function(b) {
  6319. function d() {
  6320. b.call(this);
  6321. this.GameBg = new egret.Sprite;
  6322. this.runway = new egret.Sprite;
  6323. this.nameText = new egret.TextField;
  6324. this.nameText = utils.createTextLabel(this.nameText, 16341428, "left", "疯狂的方块", 70, 0, 16341428, 2);
  6325. this.ui_line = new DottedLine(230, 5, 20, 14952082, 12587381);
  6326. this.GameBg = utils.createRectangular(0, 0, Settings.stageWidth,
  6327. Settings.stageHeight, 1, 14952082);
  6328. this.runway = utils.createRectangular(0, 0, 230, Settings.stageHeight, 1, 12587381);
  6329. this.GameBg.width = Settings.stageWidth;
  6330. this.GameBg.height = Settings.stageHeight;
  6331. d.scoreText = new egret.TextField;
  6332. d.scoreText = utils.createTextLabel(d.scoreText, 16341428, "left", "0000", 130, 0, 16341428, 0, 0, 0, 90);
  6333. this.addChild(this.GameBg);
  6334. this.GameBg.touchEnabled = !0;
  6335. this.GameBg.addEventListener(egret.TouchEvent.TOUCH_END, this.onStageTouchEnd, this);
  6336. this.btn_start = new StartBtn;
  6337. this.plan_start(!0)
  6338. }
  6339. __extends(d,
  6340. b);
  6341. d.prototype.plan_start = function(b) {
  6342. b ? (this.addChild(this.btn_start), this.addChild(this.nameText), this.nameText.x = (Settings.stageWidth - this.nameText.width) / 2, this.nameText.y = 100, this.btn_start.width = Settings.stageWidth / 2, this.btn_start.height = Settings.stageWidth / 2, this.btn_start.touchChildren = !1, this.btn_start.x = Settings.stageWidth / 2, this.btn_start.y = this.nameText.y + this.nameText.height + 150, this.btn_start.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.start_btn_tap, this), this.btn_start.addEventListener(egret.TouchEvent.TOUCH_END,
  6343. this.start_btn_end, this), this.btn_start.touchEnabled = !0) : (this.btn_start.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.start_btn_tap, this), this.btn_start.removeEventListener(egret.TouchEvent.TOUCH_END, this.start_btn_end, this), this.removeChild(this.btn_start), this.removeChild(this.nameText))
  6344. };
  6345. d.prototype.plan_play = function(b) {
  6346. b ? (this.addChild(this.runway), this.runway.x = 70, this.addChild(this.ui_line), this.ui_line.x = 70, this.ui_line.y = 50, this.addChild(d.scoreText), d.scoreText.x = 450, d.scoreText.y =
  6347. 50) : (this.removeChild(this.runway), this.removeChild(this.ui_line))
  6348. };
  6349. d.prototype.start_btn_tap = function(b) {
  6350. this.btn_start.down();
  6351. this.current_btn_name = "btn_start"
  6352. };
  6353. d.prototype.start_btn_end = function(b) {
  6354. this.plan_start(!1);
  6355. this.btn_start.up();
  6356. this.dispatchEvent(new egret.Event("GamePlay", !1, !1));
  6357. this.plan_play(!0)
  6358. };
  6359. d.prototype.onStageTouchEnd = function(b) {
  6360. if ("" != this.current_btn_name) switch (this.current_btn_name) {
  6361. case "btn_start":
  6362. this.btn_start.up()
  6363. }
  6364. };
  6365. return d
  6366. }(egret.Sprite);
  6367. GameUI.prototype.__class__ = "GameUI";
  6368. var __extends = this.__extends || function(b, d) {
  6369. function c() {
  6370. this.constructor = b
  6371. }
  6372. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6373. c.prototype = d.prototype;
  6374. b.prototype = new c
  6375. },
  6376. DrawRectBtn = function(b) {
  6377. function d(c, a, d, h, m, l, f) {
  6378. "undefined" === typeof c && (c = 100);
  6379. "undefined" === typeof a && (a = 30);
  6380. "undefined" === typeof d && (d = 1122867);
  6381. "undefined" === typeof h && (h = 2241348);
  6382. "undefined" === typeof m && (m = "btn");
  6383. "undefined" === typeof l && (l = 12);
  6384. "undefined" === typeof f && (f = 16777215);
  6385. b.call(this);
  6386. this.btn = new egret.Sprite;
  6387. this.btn =
  6388. utils.createRectangular(5, 5, c, a, 1, h);
  6389. this.addChild(this.btn);
  6390. this.btn = utils.createRectangular(0, 0, c, a, 1, d);
  6391. this.addChild(this.btn);
  6392. this.text = new egret.TextField;
  6393. this.text = utils.createTextLabel(this.text, f, "left", m, l);
  6394. this.addChild(this.text);
  6395. this.text.x = (this.btn.width - this.text.width) / 2;
  6396. this.text.y = (this.btn.height - this.text.height) / 2
  6397. }
  6398. __extends(d, b);
  6399. d.prototype.down = function() {
  6400. this.btn.x += 5;
  6401. this.btn.y += 5;
  6402. this.text.x += 5;
  6403. this.text.y += 5
  6404. };
  6405. d.prototype.up = function() {
  6406. this.btn.x -= 5;
  6407. this.btn.y -= 5;
  6408. this.text.x -=
  6409. 5;
  6410. this.text.y -= 5
  6411. };
  6412. return d
  6413. }(egret.Sprite);
  6414. DrawRectBtn.prototype.__class__ = "DrawRectBtn";
  6415. var __extends = this.__extends || function(b, d) {
  6416. function c() {
  6417. this.constructor = b
  6418. }
  6419. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6420. c.prototype = d.prototype;
  6421. b.prototype = new c
  6422. },
  6423. Box = function(b) {
  6424. function d(c, a, d) {
  6425. b.call(this);
  6426. this.colorArray = [16341428, 3064569, 16777215, 7342404];
  6427. this.boxScale = 57.5;
  6428. this.boxBGcolor = 0;
  6429. this.id = c;
  6430. this.listId = a;
  6431. this._index = d;
  6432. this.boxSprite = new egret.Sprite;
  6433. this.boxSprite = utils.createRectangular(5, 5, this.boxScale, this.boxScale, 1, this.boxBGcolor);
  6434. this.boxSprite.alpha = 0.2;
  6435. this.addChild(this.boxSprite);
  6436. this.boxSprite = utils.createRectangular(0, 0, this.boxScale, this.boxScale, 1, this.colorArray[c]);
  6437. this.addChild(this.boxSprite)
  6438. }
  6439. __extends(d, b);
  6440. return d
  6441. }(egret.Sprite);
  6442. Box.prototype.__class__ = "Box";
  6443. var __extends = this.__extends || function(b, d) {
  6444. function c() {
  6445. this.constructor = b
  6446. }
  6447. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6448. c.prototype = d.prototype;
  6449. b.prototype = new c
  6450. },
  6451. OverPlan = function(b) {
  6452. function d() {
  6453. b.call(this);
  6454. this.sprite = new egret.Sprite;
  6455. this.btnIsbool = 0;
  6456. this.sprite = utils.createRectangular(0, 0, Settings.stageWidth, Settings.stageHeight, 0.3, 0);
  6457. this.addChild(this.sprite);
  6458. this.sprite = utils.createRectangular(5, 5, 340, 240, 0.4, 0);
  6459. this.sprite.x = (Settings.stageWidth - this.sprite.width) / 2;
  6460. this.sprite.y = (Settings.stageHeight -
  6461. this.sprite.height) / 2;
  6462. this.addChild(this.sprite);
  6463. this.sprite = utils.createRectangular(0, 0, 340, 240, 1, 14952082);
  6464. this.addChild(this.sprite);
  6465. this.sprite.x = (Settings.stageWidth - this.sprite.width) / 2;
  6466. this.sprite.y = (Settings.stageHeight - this.sprite.height) / 2;
  6467. var c = new egret.TextField,
  6468. c = utils.createTextLabel(c, 16407734, "center", "游戏结束", 40);
  6469. this.addChild(c);
  6470. c.y = this.sprite.y + 20;
  6471. c.x = this.sprite.x + 20;
  6472. var a = new DottedLine(340, 4, 15, 16407734, 14952082);
  6473. this.addChild(a);
  6474. a.y = c.y + c.height;
  6475. a.x = this.sprite.x;
  6476. c = utils.createTextLabel(c,
  6477. 16777215, "center", ("得分:" + Settings.score).toString(), 24);
  6478. c.x = this.sprite.x + 10;
  6479. c.y = a.y + a.height + 30;
  6480. this.addChild(c);
  6481. this.rStartBtn = new DrawRectBtn(120, 50, 16777215, 10361701, "重来", 20, 7342404);
  6482. this.addChild(this.rStartBtn);
  6483. this.rStartBtn.x = this.sprite.x + 30;
  6484. this.rStartBtn.y = this.sprite.y + this.sprite.height - this.rStartBtn.height - 20;
  6485. this.shareBtn = new DrawRectBtn(120, 50, 16777215, 10361701, "更多游戏", 20, 7342404);
  6486. this.addChild(this.shareBtn);
  6487. this.shareBtn.x = this.sprite.x + this.sprite.width - this.rStartBtn.width -
  6488. 30;
  6489. this.shareBtn.y = this.rStartBtn.y;
  6490. this.touchEnabled = !0;
  6491. this.addEventListener(egret.TouchEvent.TOUCH_END, this.onPlanEnd, this);
  6492. this.rStartBtn.touchEnabled = !0;
  6493. this.shareBtn.touchEnabled = !0;
  6494. this.rStartBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rStart_being, this);
  6495. this.rStartBtn.addEventListener(egret.TouchEvent.TOUCH_END, this.rStartBtn_end, this);
  6496. this.shareBtn.touchEnabled = !0;
  6497. this.shareBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.shareBtn_begin, this);
  6498. this.shareBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  6499. this.shareBtn_end, this);
  6500. this.sharPlan = new egret.Sprite;
  6501. this.sharPlan = utils.createRectangular(0, 0, Settings.stageWidth, Settings.stageHeight, 0.3, 0);
  6502. //c = utils.createTextLabel(c, 16777215, "left", "\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u6309\u94ae\n\u9009\u62e9\u5206\u4eab\u5230\u670b\u53cb\u5708", 26);
  6503. //c.x = (480 - c.width) / 2;
  6504. //c.y = (640 - c.height) / 2;
  6505. //this.sharPlan.addChild(c)
  6506. }
  6507. __extends(d, b);
  6508. d.prototype.rStartBtn_end = function(b) {
  6509. this.dispatchEvent(new egret.Event("click_rStart", !1, !1))
  6510. };
  6511. d.prototype.shareBtn_end = function(b) {
  6512. /*
  6513. this.addChild(this.sharPlan);
  6514. this.sharPlan.touchEnabled = !0;
  6515. this.sharPlan.addEventListener(egret.TouchEvent.TOUCH_TAP, this.sharBtnClick, this)*/
  6516. };
  6517. d.prototype.sharBtnClick = function(b) {
  6518. this.removeChild(this.sharPlan)
  6519. };
  6520. d.prototype.rStart_being = function(b) {
  6521. this.rStartBtn.down();
  6522. this.btnIsbool = -1
  6523. };
  6524. d.prototype.shareBtn_begin = function(b) {
  6525. //_hmt.push(["_trackEvent", "按钮点击事件", "分享按钮点击"]);
  6526. b.preventDefault();
  6527. // window.location.href=Play68.goHome();
  6528. //LBShare.callShare();
  6529. //this.shareBtn.down();
  6530. //this.btnIsbool = 1
  6531. };
  6532. d.prototype.onPlanEnd = function(b) {
  6533. 1 == this.btnIsbool ? this.shareBtn.up() : -1 == this.btnIsbool && this.rStartBtn.up();
  6534. this.btnIsbool = 0
  6535. };
  6536. return d
  6537. }(egret.Sprite);
  6538. OverPlan.prototype.__class__ = "OverPlan";
  6539. var __extends = this.__extends || function(b, d) {
  6540. function c() {
  6541. this.constructor = b
  6542. }
  6543. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6544. c.prototype = d.prototype;
  6545. b.prototype = new c
  6546. },
  6547. ReduceThreeBtn = function(b) {
  6548. function d() {
  6549. b.call(this);
  6550. this.btnMask = new egret.Sprite;
  6551. var c = new egret.Sprite,
  6552. c = utils.createCircle(0, 0, 40, 1, 12587381);
  6553. this.addChild(c);
  6554. c = new egret.TextField;
  6555. c = utils.createTextLabel(c, 16341428, "left", "- 3", 40, 0, 16341428, 1);
  6556. this.addChild(c);
  6557. c.x = -c.width / 2;
  6558. c.y = -c.height / 2;
  6559. this.btnMask = utils.createCircle(0, 0,
  6560. 40, 1, 0);
  6561. this.addChild(this.btnMask);
  6562. this.btnMask.alpha = 0
  6563. }
  6564. __extends(d, b);
  6565. return d
  6566. }(egret.Sprite);
  6567. ReduceThreeBtn.prototype.__class__ = "ReduceThreeBtn";
  6568. var __extends = this.__extends || function(b, d) {
  6569. function c() {
  6570. this.constructor = b
  6571. }
  6572. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6573. c.prototype = d.prototype;
  6574. b.prototype = new c
  6575. },
  6576. SelectAllBtn = function(b) {
  6577. function d() {
  6578. b.call(this);
  6579. this.btnMask = new egret.Sprite;
  6580. var c = new egret.Sprite,
  6581. c = utils.createCircle(0, 0, 40, 1, 12587381);
  6582. this.addChild(c);
  6583. c = utils.createCircle(0, 0, 30, 1, 16341428);
  6584. this.addChild(c);
  6585. c = utils.createCircle(0, 0, 25, 1, 12587381);
  6586. this.addChild(c);
  6587. c = utils.createRectangular(0, 0, 15, 5, 1, 16341428);
  6588. this.addChild(c);
  6589. c.x = 10;
  6590. c.y = -2.5;
  6591. c = utils.createRectangular(0, 0, 15, 5, 1, 16341428);
  6592. this.addChild(c);
  6593. c.x = -c.width - 10;
  6594. c.y = -2.5;
  6595. c = utils.createRectangular(0, 0, 15, 5, 1, 16341428);
  6596. c.rotation = 90;
  6597. this.addChild(c);
  6598. c.x = 2.5;
  6599. c.y = 10;
  6600. c = utils.createRectangular(0, 0, 15, 5, 1, 16341428);
  6601. c.rotation = 90;
  6602. c.y = -c.height - 20;
  6603. c.x = 2.5;
  6604. this.addChild(c);
  6605. c = utils.createRectangular(0, 0, 10, 10, 1, 16341428);
  6606. this.addChild(c);
  6607. c.y = -5;
  6608. c.x = -5;
  6609. this.btnMask = utils.createCircle(0, 0, 40, 1, 0);
  6610. this.addChild(this.btnMask);
  6611. this.btnMask.alpha = 0
  6612. }
  6613. __extends(d, b);
  6614. return d
  6615. }(egret.Sprite);
  6616. SelectAllBtn.prototype.__class__ = "SelectAllBtn";
  6617. var __extends = this.__extends || function(b, d) {
  6618. function c() {
  6619. this.constructor = b
  6620. }
  6621. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6622. c.prototype = d.prototype;
  6623. b.prototype = new c
  6624. },
  6625. StopBtn = function(b) {
  6626. function d() {
  6627. b.call(this);
  6628. this.btnMask = new egret.Sprite;
  6629. var c = new egret.Sprite,
  6630. c = utils.createCircle(0, 0, 40, 1, 12587381);
  6631. this.addChild(c);
  6632. c = new egret.TextField;
  6633. c = utils.createTextLabel(c, 16341428, "left", "STOP", 24, 0, 16341428, 1);
  6634. this.addChild(c);
  6635. c.x = -c.width / 2;
  6636. c.y = -c.height / 2;
  6637. this.btnMask = utils.createCircle(0, 0, 40, 1, 0);
  6638. this.addChild(this.btnMask);
  6639. this.btnMask.alpha = 0
  6640. }
  6641. __extends(d, b);
  6642. return d
  6643. }(egret.Sprite);
  6644. StopBtn.prototype.__class__ = "StopBtn";
  6645. var __extends = this.__extends || function(b, d) {
  6646. function c() {
  6647. this.constructor = b
  6648. }
  6649. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6650. c.prototype = d.prototype;
  6651. b.prototype = new c
  6652. },
  6653. Game = function(b) {
  6654. function d() {
  6655. b.call(this);
  6656. this.boxList1 = [];
  6657. this.boxList2 = [];
  6658. this.boxList3 = [];
  6659. this.boxList4 = [];
  6660. this.recycle = [];
  6661. this.recycleSpeed = 2;
  6662. this.isTap = !1;
  6663. this.bj = this.sortRun = 0
  6664. }
  6665. __extends(d, b);
  6666. d.prototype.onBoxTap = function(b) {
  6667. if (this.isTap)
  6668. if (this.SelectAllBool) {
  6669. for (var a = 1; 5 > a; a++)
  6670. for (var d = this["boxList" + a].length - 1; 0 <= d; d--) this["boxList" +
  6671. a][d].id == b.target.id && (this["container_" + a].removeChild(this["boxList" + a][d]), this.recycle.push(this["boxList" + a][d]), this["boxList" + a][d].anchorX = this["boxList" + a][d].anchorY = 0.5, this.addChild(this["boxList" + a][d]), this["boxList" + a][d].touchEnabled = !1, this["boxList" + a].splice(d, 1));
  6672. this.SelectAllBool = !1
  6673. } else this.isTap = !1, this.sortRun += 1, this.boxDetection(b.target.id, b.target.listId, b.target._index)
  6674. };
  6675. d.prototype.sortBox = function() {
  6676. for (var b = 0, a = 1; 5 > a; a++) {
  6677. for (var d = this["boxList" + a].length - 1; 0 <=
  6678. d; d--) this["boxList" + a][d]._delete && (this["container_" + a].removeChild(this["boxList" + a][d]), this.recycle.push(this["boxList" + a][d]), this["boxList" + a][d].anchorX = this["boxList" + a][d].anchorY = 0.5, this.addChild(this["boxList" + a][d]), this["boxList" + a].splice(d, 1), b += 1);
  6679. this.StopBool || (d = new Box(utils.randomInt(0, 4), a, 0), this["boxList" + a].unshift(d), this["container_" + a].addChild(d), d.x = 70 + 57.5 * (a - 1), d.y = Settings.stageHeight, d.touchEnabled = !0, d.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBoxTap,
  6680. this))
  6681. }
  6682. this.StopBool = !1;
  6683. Settings.setScoreText(b);
  6684. this.isTap = !0
  6685. };
  6686. d.prototype.GameOver = function() {
  6687. this.removeEventListener(egret.Event.ENTER_FRAME, this.onBoxMove, this);
  6688. this.isTap = !1;
  6689. this.plan_over(!0);
  6690. this.SelectAllBool = this.StopBool = !1;
  6691. this.rtBtn.btnMask.alpha = this.sAllBtn.btnMask.alpha = this.stopBtn.btnMask.alpha = 0;
  6692. console.log("游戏结束");
  6693. // updateShare(Settings.score);
  6694. // Play68.setRankingScoreDesc(Settings.score);
  6695. };
  6696. d.prototype.plan_over = function(b) {
  6697. "undefined" === typeof b && (b = !0);
  6698. b ? (this.overPlan = new OverPlan, this.addChild(this.overPlan), this.overPlan.addEventListener("click_rStart", this.GameRstart, this)) : (this.removeChild(this.overPlan), this.overPlan.removeEventListener("click_rStart", this.GameRstart,
  6699. this), this.overPlan = null)
  6700. };
  6701. d.prototype.GameRstart = function(b) {
  6702. this.plan_over(!1);
  6703. this.dispatchEvent(new egret.Event("GameRstart", !1, !1));
  6704. this.boxDistory();
  6705. this.boxInit();
  6706. GameUI.scoreText.text = "0000".toString();
  6707. Settings.score = 0;
  6708. console.log("游戏重玩点击");
  6709. //_hmt.push(["_trackEvent", "按钮点击事件", "游戏重玩点击"]);
  6710. // LBShare.showAd({pos: 'banner', hide: true });
  6711. // LBShare.showAd({pos: 'top', hide: true });
  6712. // LBShare.showAd({pos: 'footer', hide: true });
  6713. };
  6714. d.prototype.boxDistory = function() {
  6715. for (var b = 1; 5 > b; b++)
  6716. for (var a = this["boxList" + b].length - 1; 0 <= a; a--) this["container_" + b].removeChild(this["boxList" + b][a]), this.recycle.push(this["boxList" + b][a]), this["boxList" + b][a].anchorX = this["boxList" + b][a].anchorY = 0.5, this.addChild(this["boxList" +
  6717. b][a]), this["boxList" + b].splice(a, 1)
  6718. };
  6719. d.prototype.onBoxMove = function(b) {
  6720. if (1 <= this.recycle.length) {
  6721. for (b = 0; b < this.recycle.length; b++) this.recycle[b].rotation += this.recycleSpeed, this.recycle[b].y += this.recycleSpeed, this.recycle[b].y >= Settings.stageHeight && (this.removeChild(this.recycle[b]), this.recycle.splice(b, 1));
  6722. this.recycleSpeed += 6
  6723. } else this.recycleSpeed = 2;
  6724. for (b = 4; 1 <= b; b--)
  6725. for (var a = 0; a <= this["boxList" + b].length - 1; a++) {
  6726. if (30 >= this["boxList" + b][a].y) {
  6727. this.GameOver();
  6728. return
  6729. }
  6730. this["boxList" + b][a]._index =
  6731. a;
  6732. this["boxList" + b][a].y += (Settings.stageHeight - 57.5 * (a + 1) - this["boxList" + b][a].y) / 2
  6733. }
  6734. };
  6735. d.prototype.onrtBtnTap = function() {
  6736. console.log("\u6267\u884c\uff01");
  6737. console.log(this.rtBtn.btnMask.alpha);
  6738. if (0 == this.rtBtn.btnMask.alpha) {
  6739. this.rtBtn.btnMask.alpha = 0.2;
  6740. for (var b = 1; 5 > b; b++) {
  6741. var a;
  6742. 3 <= this["boxList" + b].length ? a = 3 : a = this["boxList" + b].length;
  6743. for (var d = a - 1; 0 <= d; d--) this["container_" + b].removeChild(this["boxList" + b][d]), this.recycle.push(this["boxList" + b][d]), this["boxList" + b][d].anchorX = this["boxList" +
  6744. b][d].anchorY = 0.5, this.addChild(this["boxList" + b][d]), this["boxList" + b].splice(d, 1)
  6745. }
  6746. }
  6747. };
  6748. d.prototype.onsAllBtnTap = function() {
  6749. 0 == this.sAllBtn.btnMask.alpha && (this.sAllBtn.btnMask.alpha = 0.2, this.SelectAllBool = !0)
  6750. };
  6751. d.prototype.onstopBtnTap = function() {
  6752. 0 == this.stopBtn.btnMask.alpha && (this.stopBtn.btnMask.alpha = 0.2, this.StopBool = !0)
  6753. };
  6754. d.prototype.GameInit = function() {
  6755. this.container_1 = new egret.Sprite;
  6756. this.addChild(this.container_1);
  6757. this.container_2 = new egret.Sprite;
  6758. this.addChild(this.container_2);
  6759. this.container_3 =
  6760. new egret.Sprite;
  6761. this.addChild(this.container_3);
  6762. this.container_4 = new egret.Sprite;
  6763. this.addChild(this.container_4);
  6764. this.rtBtn = new ReduceThreeBtn;
  6765. this.sAllBtn = new SelectAllBtn;
  6766. this.stopBtn = new StopBtn;
  6767. this.rtBtn.x = this.sAllBtn.x = this.stopBtn.x = 390;
  6768. this.sAllBtn.y = GameUI.scoreText.y + GameUI.scoreText.width + 2 * this.sAllBtn.height;
  6769. this.rtBtn.y = this.sAllBtn.y + 1.8 * this.sAllBtn.height;
  6770. this.stopBtn.y = this.rtBtn.y + 2.2 * this.rtBtn.height;
  6771. this.rtBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onrtBtnTap, this);
  6772. this.sAllBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onsAllBtnTap, this);
  6773. this.stopBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onstopBtnTap, this);
  6774. this.addChild(this.rtBtn);
  6775. this.addChild(this.sAllBtn);
  6776. this.addChild(this.stopBtn);
  6777. this.rtBtn.touchEnabled = !0;
  6778. this.sAllBtn.touchEnabled = !0;
  6779. this.stopBtn.touchEnabled = !0;
  6780. this.boxInit()
  6781. // updateShare(0)
  6782. };
  6783. d.prototype.boxInit = function() {
  6784. for (var b = 0; 3 >= b; b++)
  6785. for (var a = 3; 0 <= a; a--) {
  6786. var d = new Box(utils.randomInt(0, 4), b + 1, a);
  6787. this["boxList" + (b + 1)].unshift(d);
  6788. this["container_" +
  6789. (b + 1)].addChild(d);
  6790. d.x = 70 + 57.5 * b;
  6791. d.y = Settings.stageHeight - (a + 1) * d.height;
  6792. d.touchEnabled = !0;
  6793. d.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBoxTap, this)
  6794. }
  6795. this.isTap = !0;
  6796. this.addEventListener(egret.Event.ENTER_FRAME, this.onBoxMove, this)
  6797. };
  6798. d.prototype.boxDetection = function(b, a, d) {
  6799. this["boxList" + a][d]._delete = !0;
  6800. this.bj += 1;
  6801. d < this["boxList" + a].length - 1 && void 0 != this["boxList" + a][d + 1] && this["boxList" + a][d].id == this["boxList" + a][d + 1].id && !this["boxList" + a][d + 1]._delete && (this["boxList" + a][d + 1]._delete = !0, this.sortRun += 1, this.boxDetection(this["boxList" + a][d + 1].id, a, d + 1));
  6802. 1 <= d && null != this["boxList" + a][d - 1] && this["boxList" + a][d].id == this["boxList" + a][d - 1].id && !this["boxList" + a][d - 1]._delete && (this["boxList" + a][d - 1]._delete = !0, this.sortRun += 1, this.boxDetection(this["boxList" + a][d - 1].id, a, d - 1));
  6803. 2 <= a && null != this["boxList" + (a - 1)][d] && this["boxList" + a][d].id == this["boxList" + (a - 1)][d].id && !this["boxList" + (a - 1)][d]._delete && (this["boxList" + (a - 1)][d]._delete = !0, this.sortRun += 1, this.boxDetection(this["boxList" +
  6804. (a - 1)][d].id, a - 1, d));
  6805. 3 >= a && null != this["boxList" + (a + 1)][d] && this["boxList" + a][d].id == this["boxList" + (a + 1)][d].id && !this["boxList" + (a + 1)][d]._delete && (this.sortRun += 1, this["boxList" + (a + 1)][d]._delete = !0, this.boxDetection(this["boxList" + (a + 1)][d].id, a + 1, d));
  6806. this.sortRun -= 1;
  6807. 0 == this.sortRun && this.sortBox()
  6808. };
  6809. return d
  6810. }(egret.Sprite);
  6811. Game.prototype.__class__ = "Game";
  6812. var __extends = this.__extends || function(b, d) {
  6813. function c() {
  6814. this.constructor = b
  6815. }
  6816. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6817. c.prototype = d.prototype;
  6818. b.prototype = new c
  6819. },
  6820. GameApp = function(b) {
  6821. function d() {
  6822. b.call(this);
  6823. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  6824. }
  6825. __extends(d, b);
  6826. d.prototype.onAddToStage = function(b) {
  6827. this.GameStart()
  6828. };
  6829. d.prototype.GameStart = function() {
  6830. Settings.initVar(this.stage.stageWidth, this.stage.stageHeight);
  6831. this.ui = new GameUI;
  6832. this.addChild(this.ui);
  6833. this.game =
  6834. new Game;
  6835. this.addChild(this.game);
  6836. this.ui.addEventListener("GamePlay", this.GamePlay, this);
  6837. // _hmt.push(["_trackEvent", "游戏开始事件", "游戏开始"]);
  6838. };
  6839. d.prototype.GamePlay = function() {
  6840. this.game.GameInit()
  6841. };
  6842. return d
  6843. }(egret.DisplayObjectContainer);
  6844. window['GameApp'] = GameApp;
  6845. GameApp.prototype.__class__ = "GameApp";
  6846. }()