game-min.js 265 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892
  1. var egret;
  2. (function (b) {
  3. var e = function () {
  4. function b() {
  5. this._hashCode = b.hashCount++
  6. }
  7. Object.defineProperty(b.prototype, "hashCode", {
  8. get : function () {
  9. return this._hashCode
  10. },
  11. enumerable : !0,
  12. configurable : !0
  13. });
  14. b.hashCount = 1;
  15. return b
  16. }
  17. ();
  18. b.HashObject = e;
  19. e.prototype.__class__ = "egret.HashObject"
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends || function (b, e) {
  22. function d() {
  23. this.constructor = b
  24. }
  25. for (var a in e)
  26. e.hasOwnProperty(a) && (b[a] = e[a]);
  27. d.prototype = e.prototype;
  28. b.prototype = new d
  29. };
  30. (function (b) {
  31. var e = function (b) {
  32. function a(c) {
  33. void 0 === c && (c = 300);
  34. b.call(this);
  35. this.objectPool = [];
  36. this._length = 0;
  37. 1 > c && (c = 1);
  38. this.autoDisposeTime = c;
  39. this.frameCount = 0
  40. }
  41. __extends(a, b);
  42. a.prototype._checkFrame = function () {
  43. this.frameCount--;
  44. 0 >= this.frameCount && this.dispose()
  45. };
  46. Object.defineProperty(a.prototype, "length", {
  47. get : function () {
  48. return this._length
  49. },
  50. enumerable : !0,
  51. configurable : !0
  52. });
  53. a.prototype.push = function (c) {
  54. var l = this.objectPool;
  55. -1 == l.indexOf(c) && (l.push(c), this._length++, 0 == this.frameCount && (this.frameCount =
  56. this.autoDisposeTime, a._callBackList.push(this)))
  57. };
  58. a.prototype.pop = function () {
  59. if (0 == this._length)
  60. return null;
  61. this._length--;
  62. return this.objectPool.pop()
  63. };
  64. a.prototype.dispose = function () {
  65. 0 < this._length && (this.objectPool = [], this._length = 0);
  66. this.frameCount = 0;
  67. var c = a._callBackList,
  68. l = c.indexOf(this);
  69. -1 != l && c.splice(l, 1)
  70. };
  71. a._callBackList = [];
  72. return a
  73. }
  74. (b.HashObject);
  75. b.Recycler = e;
  76. e.prototype.__class__ = "egret.Recycler"
  77. })(egret || (egret = {}));
  78. (function (b) {
  79. b.__START_TIME;
  80. b.getTimer = function () {
  81. return Date.now() - b.__START_TIME
  82. }
  83. })(egret || (egret = {}));
  84. (function (b) {
  85. b.__callLaterFunctionList = [];
  86. b.__callLaterThisList = [];
  87. b.__callLaterArgsList = [];
  88. b.callLater = function (e, d) {
  89. for (var a = [], c = 2; c < arguments.length; c++)
  90. a[c - 2] = arguments[c];
  91. b.__callLaterFunctionList.push(e);
  92. b.__callLaterThisList.push(d);
  93. b.__callLaterArgsList.push(a)
  94. };
  95. b.__callAsyncFunctionList = [];
  96. b.__callAsyncThisList = [];
  97. b.__callAsyncArgsList = [];
  98. b.__callAsync = function (e, d) {
  99. for (var a = [], c = 2; c < arguments.length; c++)
  100. a[c - 2] = arguments[c];
  101. b.__callAsyncFunctionList.push(e);
  102. b.__callAsyncThisList.push(d);
  103. b.__callAsyncArgsList.push(a)
  104. }
  105. })(egret || (egret = {}));
  106. var egret_dom;
  107. (function (b) {
  108. function e() {
  109. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], c = 0; c < a.length; c++)
  110. if (a[c] + "ransform" in b)
  111. return a[c];
  112. return a[0]
  113. }
  114. b.header = "";
  115. b.getHeader = e;
  116. b.getTrans = function (d) {
  117. "" == b.header && (b.header = e());
  118. return b.header + d.substring(1, d.length)
  119. }
  120. })(egret_dom || (egret_dom = {}));
  121. __extends = this.__extends || function (b, e) {
  122. function d() {
  123. this.constructor = b
  124. }
  125. for (var a in e)
  126. e.hasOwnProperty(a) && (b[a] = e[a]);
  127. d.prototype = e.prototype;
  128. b.prototype = new d
  129. };
  130. (function (b) {
  131. var e = function (d) {
  132. function a(c, a, h) {
  133. void 0 === a && (a = !1);
  134. void 0 === h && (h = !1);
  135. d.call(this);
  136. this._eventPhase = 2;
  137. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  138. this.isNew = !0;
  139. this._type = c;
  140. this._bubbles = a;
  141. this._cancelable = h
  142. }
  143. __extends(a, d);
  144. Object.defineProperty(a.prototype, "type", {
  145. get : function () {
  146. return this._type
  147. },
  148. enumerable : !0,
  149. configurable : !0
  150. });
  151. Object.defineProperty(a.prototype, "bubbles", {
  152. get : function () {
  153. return this._bubbles
  154. },
  155. enumerable : !0,
  156. configurable : !0
  157. });
  158. Object.defineProperty(a.prototype, "cancelable", {
  159. get : function () {
  160. return this._cancelable
  161. },
  162. enumerable : !0,
  163. configurable : !0
  164. });
  165. Object.defineProperty(a.prototype, "eventPhase", {
  166. get : function () {
  167. return this._eventPhase
  168. },
  169. enumerable : !0,
  170. configurable : !0
  171. });
  172. Object.defineProperty(a.prototype, "currentTarget", {
  173. get : function () {
  174. return this._currentTarget
  175. },
  176. enumerable : !0,
  177. configurable : !0
  178. });
  179. Object.defineProperty(a.prototype, "target", {
  180. get : function () {
  181. return this._target
  182. },
  183. enumerable : !0,
  184. configurable : !0
  185. });
  186. a.prototype.isDefaultPrevented =
  187. function () {
  188. return this._isDefaultPrevented
  189. };
  190. a.prototype.preventDefault = function () {
  191. this._cancelable && (this._isDefaultPrevented = !0)
  192. };
  193. a.prototype.stopPropagation = function () {
  194. this._bubbles && (this._isPropagationStopped = !0)
  195. };
  196. a.prototype.stopImmediatePropagation = function () {
  197. this._bubbles && (this._isPropagationImmediateStopped = !0)
  198. };
  199. a.prototype._reset = function () {
  200. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  201. null, this._eventPhase = 2)
  202. };
  203. a._dispatchByTarget = function (c, a, h, d, e, f) {
  204. void 0 === e && (e = !1);
  205. void 0 === f && (f = !1);
  206. var k = c.eventRecycler;
  207. k || (k = c.eventRecycler = new b.Recycler);
  208. var m = k.pop();
  209. m ? m._type = h : m = new c(h);
  210. m._bubbles = e;
  211. m._cancelable = f;
  212. if (d)
  213. for (var p in d)
  214. m[p] = d[p], null !== m[p] && (d[p] = null);
  215. c = a.dispatchEvent(m);
  216. k.push(m);
  217. return c
  218. };
  219. a._getPropertyData = function (c) {
  220. var a = c._props;
  221. a || (a = c._props = {});
  222. return a
  223. };
  224. a.dispatchEvent = function (c, l, h, b) {
  225. void 0 === h && (h = !1);
  226. var d = a._getPropertyData(a);
  227. b && (d.data = b);
  228. a._dispatchByTarget(a,
  229. c, l, d, h)
  230. };
  231. a.ADDED_TO_STAGE = "addedToStage";
  232. a.REMOVED_FROM_STAGE = "removedFromStage";
  233. a.ADDED = "added";
  234. a.REMOVED = "removed";
  235. a.COMPLETE = "complete";
  236. a.ENTER_FRAME = "enterFrame";
  237. a.RENDER = "render";
  238. a.FINISH_RENDER = "finishRender";
  239. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  240. a.LEAVE_STAGE = "leaveStage";
  241. a.RESIZE = "resize";
  242. a.CHANGE = "change";
  243. a.ACTIVATE = "activate";
  244. a.DEACTIVATE = "deactivate";
  245. a.CLOSE = "close";
  246. a.CONNECT = "connect";
  247. return a
  248. }
  249. (b.HashObject);
  250. b.Event = e;
  251. e.prototype.__class__ = "egret.Event"
  252. })(egret || (egret = {}));
  253. __extends = this.__extends || function (b, e) {
  254. function d() {
  255. this.constructor = b
  256. }
  257. for (var a in e)
  258. e.hasOwnProperty(a) && (b[a] = e[a]);
  259. d.prototype = e.prototype;
  260. b.prototype = new d
  261. };
  262. (function (b) {
  263. var e = function (b) {
  264. function a(c, a, h) {
  265. void 0 === a && (a = !1);
  266. void 0 === h && (h = !1);
  267. b.call(this, c, a, h);
  268. this._status = 0
  269. }
  270. __extends(a, b);
  271. Object.defineProperty(a.prototype, "status", {
  272. get : function () {
  273. return this._status
  274. },
  275. enumerable : !0,
  276. configurable : !0
  277. });
  278. a.dispatchHTTPStatusEvent = function (c, l) {
  279. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  280. a.httpStatusEvent._status = l;
  281. c.dispatchEvent(a.httpStatusEvent)
  282. };
  283. a.HTTP_STATUS = "httpStatus";
  284. a.httpStatusEvent = null;
  285. return a
  286. }
  287. (b.Event);
  288. b.HTTPStatusEvent =
  289. e;
  290. e.prototype.__class__ = "egret.HTTPStatusEvent"
  291. })(egret || (egret = {}));
  292. __extends = this.__extends || function (b, e) {
  293. function d() {
  294. this.constructor = b
  295. }
  296. for (var a in e)
  297. e.hasOwnProperty(a) && (b[a] = e[a]);
  298. d.prototype = e.prototype;
  299. b.prototype = new d
  300. };
  301. (function (b) {
  302. var e = function (d) {
  303. function a(c, a, h) {
  304. void 0 === a && (a = !1);
  305. void 0 === h && (h = !1);
  306. d.call(this, c, a, h)
  307. }
  308. __extends(a, d);
  309. a.dispatchIOErrorEvent = function (c) {
  310. b.Event._dispatchByTarget(a, c, a.IO_ERROR)
  311. };
  312. a.IO_ERROR = "ioError";
  313. return a
  314. }
  315. (b.Event);
  316. b.IOErrorEvent = e;
  317. e.prototype.__class__ = "egret.IOErrorEvent"
  318. })(egret || (egret = {}));
  319. __extends = this.__extends || function (b, e) {
  320. function d() {
  321. this.constructor = b
  322. }
  323. for (var a in e)
  324. e.hasOwnProperty(a) && (b[a] = e[a]);
  325. d.prototype = e.prototype;
  326. b.prototype = new d
  327. };
  328. (function (b) {
  329. var e = function (d) {
  330. function a(c, a, h, b, e, f, k, m, p, q) {
  331. void 0 === a && (a = !0);
  332. void 0 === h && (h = !0);
  333. void 0 === b && (b = 0);
  334. void 0 === e && (e = 0);
  335. void 0 === f && (f = 0);
  336. void 0 === k && (k = !1);
  337. void 0 === m && (m = !1);
  338. void 0 === q && (q = !1);
  339. d.call(this, c, a, h);
  340. this._stageY = this._stageX = 0;
  341. this.touchPointID = b;
  342. this._stageX = e;
  343. this._stageY = f;
  344. this.ctrlKey = k;
  345. this.altKey = m;
  346. this.touchDown = q
  347. }
  348. __extends(a, d);
  349. Object.defineProperty(a.prototype, "stageX", {
  350. get : function () {
  351. return this._stageX
  352. },
  353. enumerable : !0,
  354. configurable : !0
  355. });
  356. Object.defineProperty(a.prototype,
  357. "stageY", {
  358. get : function () {
  359. return this._stageY
  360. },
  361. enumerable : !0,
  362. configurable : !0
  363. });
  364. Object.defineProperty(a.prototype, "localX", {
  365. get : function () {
  366. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  367. },
  368. enumerable : !0,
  369. configurable : !0
  370. });
  371. Object.defineProperty(a.prototype, "localY", {
  372. get : function () {
  373. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  374. },
  375. enumerable : !0,
  376. configurable : !0
  377. });
  378. a.dispatchTouchEvent = function (c, l, h, d, e, f, k, m, p) {
  379. void 0 === h && (h = 0);
  380. void 0 === d && (d = 0);
  381. void 0 === e && (e = 0);
  382. void 0 === f && (f = !1);
  383. void 0 === k && (k = !1);
  384. void 0 === m && (m = !1);
  385. void 0 === p && (p = !1);
  386. var q = b.Event._getPropertyData(a);
  387. q.touchPointID = h;
  388. q._stageX = d;
  389. q._stageY = e;
  390. q.ctrlKey = f;
  391. q.altKey = k;
  392. q.shiftKey = m;
  393. q.touchDown = p;
  394. b.Event._dispatchByTarget(a, c, l, q, !0, !0)
  395. };
  396. a.TOUCH_TAP = "touchTap";
  397. a.TOUCH_MOVE = "touchMove";
  398. a.TOUCH_BEGIN = "touchBegin";
  399. a.TOUCH_END = "touchEnd";
  400. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  401. a.TOUCH_ROLL_OUT = "touchRollOut";
  402. a.TOUCH_ROLL_OVER = "touchRollOver";
  403. a.TOUCH_OUT =
  404. "touchOut";
  405. a.TOUCH_OVER = "touchOver";
  406. return a
  407. }
  408. (b.Event);
  409. b.TouchEvent = e;
  410. e.prototype.__class__ = "egret.TouchEvent"
  411. })(egret || (egret = {}));
  412. __extends = this.__extends || function (b, e) {
  413. function d() {
  414. this.constructor = b
  415. }
  416. for (var a in e)
  417. e.hasOwnProperty(a) && (b[a] = e[a]);
  418. d.prototype = e.prototype;
  419. b.prototype = new d
  420. };
  421. (function (b) {
  422. var e = function (d) {
  423. function a(c, a, h) {
  424. void 0 === a && (a = !1);
  425. void 0 === h && (h = !1);
  426. d.call(this, c, a, h)
  427. }
  428. __extends(a, d);
  429. a.dispatchTimerEvent = function (c, l) {
  430. b.Event._dispatchByTarget(a, c, l)
  431. };
  432. a.TIMER = "timer";
  433. a.TIMER_COMPLETE = "timerComplete";
  434. return a
  435. }
  436. (b.Event);
  437. b.TimerEvent = e;
  438. e.prototype.__class__ = "egret.TimerEvent"
  439. })(egret || (egret = {}));
  440. __extends = this.__extends || function (b, e) {
  441. function d() {
  442. this.constructor = b
  443. }
  444. for (var a in e)
  445. e.hasOwnProperty(a) && (b[a] = e[a]);
  446. d.prototype = e.prototype;
  447. b.prototype = new d
  448. };
  449. (function (b) {
  450. var e = function (d) {
  451. function a(c, a, h, b, e) {
  452. void 0 === a && (a = !1);
  453. void 0 === h && (h = !1);
  454. void 0 === b && (b = 0);
  455. void 0 === e && (e = 0);
  456. d.call(this, c, a, h);
  457. this.bytesLoaded = b;
  458. this.bytesTotal = e
  459. }
  460. __extends(a, d);
  461. a.dispatchProgressEvent = function (c, l, h, d) {
  462. void 0 === h && (h = 0);
  463. void 0 === d && (d = 0);
  464. b.Event._dispatchByTarget(a, c, l, {
  465. bytesLoaded : h,
  466. bytesTotal : d
  467. })
  468. };
  469. a.PROGRESS = "progress";
  470. a.SOCKET_DATA = "socketData";
  471. return a
  472. }
  473. (b.Event);
  474. b.ProgressEvent = e;
  475. e.prototype.__class__ = "egret.ProgressEvent"
  476. })(egret || (egret = {}));
  477. (function (b) {
  478. var e = function () {
  479. function b() {}
  480. b.CAPTURING_PHASE = 1;
  481. b.AT_TARGET = 2;
  482. b.BUBBLING_PHASE = 3;
  483. return b
  484. }
  485. ();
  486. b.EventPhase = e;
  487. e.prototype.__class__ = "egret.EventPhase"
  488. })(egret || (egret = {}));
  489. __extends = this.__extends || function (b, e) {
  490. function d() {
  491. this.constructor = b
  492. }
  493. for (var a in e)
  494. e.hasOwnProperty(a) && (b[a] = e[a]);
  495. d.prototype = e.prototype;
  496. b.prototype = new d
  497. };
  498. (function (b) {
  499. var e = function (d) {
  500. function a(c) {
  501. void 0 === c && (c = null);
  502. d.call(this);
  503. this._eventTarget = c ? c : this
  504. }
  505. __extends(a, d);
  506. a.prototype.addEventListener = function (c, a, h, d, e) {
  507. void 0 === d && (d = !1);
  508. void 0 === e && (e = 0);
  509. "undefined" === typeof d && (d = !1);
  510. "undefined" === typeof e && (e = 0);
  511. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  512. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  513. var f = d[c];
  514. f || (f = d[c] = []);
  515. this._insertEventBin(f, a, h, e)
  516. };
  517. a.prototype._insertEventBin = function (c, a, h, b, d) {
  518. void 0 === d && (d = void 0);
  519. for (var e = -1, k = c.length, m = 0; m < k; m++) {
  520. var p = c[m];
  521. if (p.listener === a && p.thisObject === h && p.display === d)
  522. return !1;
  523. -1 == e && p.priority < b && (e = m)
  524. }
  525. a = {
  526. listener : a,
  527. thisObject : h,
  528. priority : b
  529. };
  530. d && (a.display = d);
  531. -1 != e ? c.splice(e, 0, a) : c.push(a);
  532. return !0
  533. };
  534. a.prototype.removeEventListener = function (c, a, h, b) {
  535. void 0 === b && (b = !1);
  536. if (b = b ? this._captureEventsMap : this._eventsMap) {
  537. var d = b[c];
  538. d && (this._removeEventBin(d,
  539. a, h), 0 == d.length && delete b[c])
  540. }
  541. };
  542. a.prototype._removeEventBin = function (c, a, h, b) {
  543. void 0 === b && (b = void 0);
  544. for (var d = c.length, e = 0; e < d; e++) {
  545. var k = c[e];
  546. if (k.listener === a && k.thisObject === h && k.display === b)
  547. return c.splice(e, 1), !0
  548. }
  549. return !1
  550. };
  551. a.prototype.hasEventListener = function (c) {
  552. return this._eventsMap && this._eventsMap[c] || this._captureEventsMap && this._captureEventsMap[c]
  553. };
  554. a.prototype.willTrigger = function (c) {
  555. return this.hasEventListener(c)
  556. };
  557. a.prototype.dispatchEvent = function (c) {
  558. c._reset();
  559. c._target = this._eventTarget;
  560. c._currentTarget = this._eventTarget;
  561. return this._notifyListener(c)
  562. };
  563. a.prototype._notifyListener = function (c) {
  564. var a = 1 == c._eventPhase ? this._captureEventsMap : this._eventsMap;
  565. if (!a)
  566. return !0;
  567. a = a[c._type];
  568. if (!a)
  569. return !0;
  570. var b = a.length;
  571. if (0 == b)
  572. return !0;
  573. for (var a = a.concat(), d = 0; d < b; d++) {
  574. var e = a[d];
  575. e.listener.call(e.thisObject, c);
  576. if (c._isPropagationImmediateStopped)
  577. break
  578. }
  579. return !c._isDefaultPrevented
  580. };
  581. a.prototype.dispatchEventWith = function (c, a, h) {
  582. void 0 === a && (a = !1);
  583. b.Event.dispatchEvent(this, c, a, h)
  584. };
  585. return a
  586. }
  587. (b.HashObject);
  588. b.EventDispatcher = e;
  589. e.prototype.__class__ = "egret.EventDispatcher"
  590. })(egret || (egret = {}));
  591. __extends = this.__extends || function (b, e) {
  592. function d() {
  593. this.constructor = b
  594. }
  595. for (var a in e)
  596. e.hasOwnProperty(a) && (b[a] = e[a]);
  597. d.prototype = e.prototype;
  598. b.prototype = new d
  599. };
  600. (function (b) {
  601. var e = function (d) {
  602. function a() {
  603. d.call(this);
  604. this.reuseEvent = new b.Event("")
  605. }
  606. __extends(a, d);
  607. a.prototype.run = function () {
  608. b.Ticker.getInstance().run();
  609. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  610. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  611. this.touchContext.run()
  612. };
  613. a.prototype.renderLoop = function (c) {
  614. if (0 < b.__callLaterFunctionList.length) {
  615. var l = b.__callLaterFunctionList;
  616. b.__callLaterFunctionList = [];
  617. var h = b.__callLaterThisList;
  618. b.__callLaterThisList = [];
  619. var d = b.__callLaterArgsList;
  620. b.__callLaterArgsList = []
  621. }
  622. c = this.stage;
  623. var e = a.cachedEvent;
  624. e._type = b.Event.RENDER;
  625. this.dispatchEvent(e);
  626. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  627. l && this.doCallLaterList(l, h, d);
  628. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  629. l = this.rendererContext;
  630. l.onRenderStart();
  631. l.clearScreen();
  632. c._updateTransform();
  633. e._type = b.Event.FINISH_UPDATE_TRANSFORM;
  634. this.dispatchEvent(e);
  635. c._draw(l);
  636. e._type = b.Event.FINISH_RENDER;
  637. this.dispatchEvent(e);
  638. l.onRenderFinish()
  639. };
  640. a.prototype.broadcastEnterFrame = function (c) {
  641. c = this.reuseEvent;
  642. c._type = b.Event.ENTER_FRAME;
  643. this.dispatchEvent(c);
  644. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), h = a.length, d = 0; d < h; d++) {
  645. var e = a[d];
  646. c._target = e.display;
  647. c._currentTarget = e.display;
  648. e.listener.call(e.thisObject, c)
  649. }
  650. a = b.Recycler._callBackList;
  651. for (d = a.length - 1; 0 <= d; d--)
  652. a[d]._checkFrame()
  653. };
  654. a.prototype.broadcastRender = function () {
  655. var c = this.reuseEvent;
  656. c._type = b.Event.RENDER;
  657. for (var a = b.DisplayObject._renderCallBackList.concat(),
  658. h = a.length, d = 0; d < h; d++) {
  659. var e = a[d],
  660. f = e.display;
  661. c._target = f;
  662. c._currentTarget = f;
  663. e.listener.call(e.thisObject, c)
  664. }
  665. };
  666. a.prototype.doCallLaterList = function (c, a, b) {
  667. for (var d = c.length, e = 0; e < d; e++) {
  668. var f = c[e];
  669. null != f && f.apply(a[e], b[e])
  670. }
  671. };
  672. a.prototype.doCallAsyncList = function () {
  673. var c = b.__callAsyncFunctionList.concat(),
  674. a = b.__callAsyncThisList.concat(),
  675. h = b.__callAsyncArgsList.concat();
  676. b.__callAsyncFunctionList.length = 0;
  677. b.__callAsyncThisList.length = 0;
  678. for (var d = b.__callAsyncArgsList.length = 0; d < c.length; d++) {
  679. var e =
  680. c[d];
  681. null != e && e.apply(a[d], h[d])
  682. }
  683. };
  684. a.DEVICE_PC = "web";
  685. a.DEVICE_MOBILE = "native";
  686. a.RUNTIME_HTML5 = "runtime_html5";
  687. a.RUNTIME_NATIVE = "runtime_native";
  688. a.cachedEvent = new b.Event("");
  689. return a
  690. }
  691. (b.EventDispatcher);
  692. b.MainContext = e;
  693. e.prototype.__class__ = "egret.MainContext"
  694. })(egret || (egret = {}));
  695. var testDeviceType = function () {
  696. if (!this.navigator)
  697. return !0;
  698. var b = navigator.userAgent.toLowerCase();
  699. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  700. }, testRuntimeType = function () {
  701. return this.navigator ? !0 : !1
  702. };
  703. egret.MainContext.instance = new egret.MainContext;
  704. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  705. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  706. delete testDeviceType;
  707. delete testRuntimeType;
  708. (function (b) {
  709. var e = function () {
  710. function d() {
  711. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  712. this._maxDeltaTime = 500;
  713. this._totalDeltaTime = 0
  714. }
  715. d.getInstance = function () {
  716. null == d.instance && (d.instance = new d);
  717. return d.instance
  718. };
  719. d.prototype.run = function () {
  720. b.Ticker.getInstance().register(this.update, this);
  721. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, b.MainContext.instance.stage.addChild(this._txt));
  722. var a = b.MainContext.instance;
  723. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  724. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  725. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  726. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  727. };
  728. d.prototype.onEnterFrame = function (a) {
  729. this._lastTime = b.getTimer()
  730. };
  731. d.prototype.onStartRender = function (a) {
  732. a = b.getTimer();
  733. this._logicPerformanceCost = a - this._lastTime;
  734. this._lastTime = a
  735. };
  736. d.prototype.onFinishUpdateTransform =
  737. function (a) {
  738. a = b.getTimer();
  739. this._updateTransformPerformanceCost = a - this._lastTime;
  740. this._lastTime = a
  741. };
  742. d.prototype.onFinishRender = function (a) {
  743. a = b.getTimer();
  744. this._renderPerformanceCost = a - this._lastTime;
  745. this._lastTime = a
  746. };
  747. d.prototype.update = function (a) {
  748. this._tick++;
  749. this._totalDeltaTime += a;
  750. if (this._totalDeltaTime >= this._maxDeltaTime) {
  751. a = (this._preDrawCount - 1).toString();
  752. var c = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  753. "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  754. this._txt.text = "draw:" + a + "\ncost:" + c + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  755. this._tick = this._totalDeltaTime = 0
  756. }
  757. this._preDrawCount = 0
  758. };
  759. d.prototype.onDrawImage = function () {
  760. this._preDrawCount++
  761. };
  762. return d
  763. }
  764. ();
  765. b.Profiler = e;
  766. e.prototype.__class__ = "egret.Profiler"
  767. })(egret || (egret = {}));
  768. __extends = this.__extends || function (b, e) {
  769. function d() {
  770. this.constructor = b
  771. }
  772. for (var a in e)
  773. e.hasOwnProperty(a) && (b[a] = e[a]);
  774. d.prototype = e.prototype;
  775. b.prototype = new d
  776. };
  777. (function (b) {
  778. var e = function (d) {
  779. function a() {
  780. d.apply(this, arguments);
  781. this._timeScale = 1;
  782. this._paused = !1;
  783. this.callBackList = []
  784. }
  785. __extends(a, d);
  786. a.prototype.run = function () {
  787. b.__START_TIME = (new Date).getTime();
  788. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  789. };
  790. a.prototype.update = function (c) {
  791. var a = this.callBackList.concat(),
  792. b = a.length;
  793. c *= this._timeScale;
  794. c *= this._timeScale;
  795. for (var d = 0; d < b; d++) {
  796. var e = a[d];
  797. e.listener.call(e.thisObject, c)
  798. }
  799. };
  800. a.prototype.register = function (c, a, b) {
  801. void 0 === b &&
  802. (b = 0);
  803. this._insertEventBin(this.callBackList, c, a, b)
  804. };
  805. a.prototype.unregister = function (c, a) {
  806. this._removeEventBin(this.callBackList, c, a)
  807. };
  808. a.prototype.setTimeout = function (c, a, h) {
  809. for (var d = [], e = 3; e < arguments.length; e++)
  810. d[e - 3] = arguments[e];
  811. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  812. b.setTimeout.apply(null, [c, a, h].concat(d))
  813. };
  814. a.prototype.setTimeScale = function (c) {
  815. this._timeScale = c
  816. };
  817. a.prototype.getTimeScale = function () {
  818. return this._timeScale
  819. };
  820. a.prototype.pause = function () {
  821. this._paused = !0
  822. };
  823. a.prototype.resume = function () {
  824. this._paused = !1
  825. };
  826. a.getInstance = function () {
  827. null == a.instance && (a.instance = new a);
  828. return a.instance
  829. };
  830. return a
  831. }
  832. (b.EventDispatcher);
  833. b.Ticker = e;
  834. e.prototype.__class__ = "egret.Ticker"
  835. })(egret || (egret = {}));
  836. (function (b) {
  837. var e = function () {
  838. function b() {}
  839. b.LEFT = "left";
  840. b.RIGHT = "right";
  841. b.CENTER = "center";
  842. b.JUSTIFY = "justify";
  843. b.CONTENT_JUSTIFY = "contentJustify";
  844. return b
  845. }
  846. ();
  847. b.HorizontalAlign = e;
  848. e.prototype.__class__ = "egret.HorizontalAlign"
  849. })(egret || (egret = {}));
  850. (function (b) {
  851. var e = function () {
  852. function b() {}
  853. b.TOP = "top";
  854. b.BOTTOM = "bottom";
  855. b.MIDDLE = "middle";
  856. b.JUSTIFY = "justify";
  857. b.CONTENT_JUSTIFY = "contentJustify";
  858. return b
  859. }
  860. ();
  861. b.VerticalAlign = e;
  862. e.prototype.__class__ = "egret.VerticalAlign"
  863. })(egret || (egret = {}));
  864. __extends = this.__extends || function (b, e) {
  865. function d() {
  866. this.constructor = b
  867. }
  868. for (var a in e)
  869. e.hasOwnProperty(a) && (b[a] = e[a]);
  870. d.prototype = e.prototype;
  871. b.prototype = new d
  872. };
  873. (function (b) {
  874. var e = function (d) {
  875. function a(c, a) {
  876. void 0 === a && (a = 0);
  877. d.call(this);
  878. this._currentCount = 0;
  879. this.delay = c;
  880. this.repeatCount = a
  881. }
  882. __extends(a, d);
  883. a.prototype.currentCount = function () {
  884. return this._currentCount
  885. };
  886. Object.defineProperty(a.prototype, "running", {
  887. get : function () {
  888. return this._running
  889. },
  890. enumerable : !0,
  891. configurable : !0
  892. });
  893. a.prototype.reset = function () {
  894. this.stop();
  895. this._currentCount = 0
  896. };
  897. a.prototype.start = function () {
  898. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount =
  899. 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  900. };
  901. a.prototype.stop = function () {
  902. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  903. };
  904. a.prototype.onEnterFrame = function (c) {
  905. c = b.getTimer();
  906. c - this.lastTime > this.delay && (this.lastTime = c, 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)))
  907. };
  908. return a
  909. }
  910. (b.EventDispatcher);
  911. b.Timer = e;
  912. e.prototype.__class__ = "egret.Timer"
  913. })(egret || (egret = {}));
  914. (function (b) {
  915. function e(b) {
  916. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  917. if (b.hasOwnProperty("__class__"))
  918. return b.__class__;
  919. var a = b.constructor.toString(),
  920. c = a.indexOf("("),
  921. a = a.substring(9, c);
  922. Object.defineProperty(b, "__class__", {
  923. value : a,
  924. enumerable : !1,
  925. writable : !0
  926. });
  927. return a
  928. }
  929. b.getQualifiedClassName = e;
  930. b.getQualifiedSuperclassName = function (b) {
  931. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  932. if (b.hasOwnProperty("__superclass__"))
  933. return b.__superclass__;
  934. var a = Object.getPrototypeOf(b);
  935. if (null == a)
  936. return null;
  937. a = e(a.constructor);
  938. if (!a)
  939. return null;
  940. Object.defineProperty(b, "__superclass__", {
  941. value : a,
  942. enumerable : !1,
  943. writable : !0
  944. });
  945. return a
  946. }
  947. })(egret || (egret = {}));
  948. (function (b) {
  949. var e = {};
  950. b.getDefinitionByName = function (b) {
  951. if (!b)
  952. return null;
  953. var a = e[b];
  954. if (a)
  955. return a;
  956. for (var c = b.split("."), l = c.length, a = __global, h = 0; h < l; h++)
  957. if (a = a[c[h]], !a)
  958. return null;
  959. return e[b] = a
  960. }
  961. })(egret || (egret = {}));
  962. var __global = __global || this;
  963. (function (b) {
  964. function e(c) {
  965. for (var a in d) {
  966. var b = d[a];
  967. b.delay -= c;
  968. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete d[a])
  969. }
  970. }
  971. var d = {},
  972. a = 0;
  973. b.setTimeout = function (c, l, h) {
  974. for (var n = [], g = 3; g < arguments.length; g++)
  975. n[g - 3] = arguments[g];
  976. n = {
  977. listener : c,
  978. thisObject : l,
  979. delay : h,
  980. params : n
  981. };
  982. 0 == a && b.Ticker.getInstance().register(e, null);
  983. a++;
  984. d[a] = n;
  985. return a
  986. };
  987. b.clearTimeout = function (c) {
  988. delete d[c]
  989. }
  990. })(egret || (egret = {}));
  991. (function (b) {
  992. b.hasDefinition = function (e) {
  993. return b.getDefinitionByName(e) ? !0 : !1
  994. }
  995. })(egret || (egret = {}));
  996. (function (b) {
  997. b.toColorString = function (b) {
  998. if (isNaN(b) || 0 > b)
  999. b = 0;
  1000. 16777215 < b && (b = 16777215);
  1001. for (b = b.toString(16).toUpperCase(); 6 > b.length; )
  1002. b = "0" + b;
  1003. return "#" + b
  1004. }
  1005. })(egret || (egret = {}));
  1006. __extends = this.__extends || function (b, e) {
  1007. function d() {
  1008. this.constructor = b
  1009. }
  1010. for (var a in e)
  1011. e.hasOwnProperty(a) && (b[a] = e[a]);
  1012. d.prototype = e.prototype;
  1013. b.prototype = new d
  1014. };
  1015. (function (b) {
  1016. var e = function (d) {
  1017. function a(c, a, b, e, g, f) {
  1018. void 0 === c && (c = 1);
  1019. void 0 === a && (a = 0);
  1020. void 0 === b && (b = 0);
  1021. void 0 === e && (e = 1);
  1022. void 0 === g && (g = 0);
  1023. void 0 === f && (f = 0);
  1024. d.call(this);
  1025. this.a = c;
  1026. this.b = a;
  1027. this.c = b;
  1028. this.d = e;
  1029. this.tx = g;
  1030. this.ty = f
  1031. }
  1032. __extends(a, d);
  1033. a.prototype.prepend = function (c, a, b, d, e, f) {
  1034. var k = this.tx;
  1035. if (1 != c || 0 != a || 0 != b || 1 != d) {
  1036. var m = this.a,
  1037. p = this.c;
  1038. this.a = m * c + this.b * b;
  1039. this.b = m * a + this.b * d;
  1040. this.c = p * c + this.d * b;
  1041. this.d = p * a + this.d * d
  1042. }
  1043. this.tx = k * c + this.ty * b + e;
  1044. this.ty = k * a + this.ty * d + f;
  1045. return this
  1046. };
  1047. a.prototype.append =
  1048. function (c, a, b, d, e, f) {
  1049. var k = this.a,
  1050. m = this.b,
  1051. p = this.c,
  1052. q = this.d;
  1053. if (1 != c || 0 != a || 0 != b || 1 != d)
  1054. this.a = c * k + a * p, this.b = c * m + a * q, this.c = b * k + d * p, this.d = b * m + d * q;
  1055. this.tx = e * k + f * p + this.tx;
  1056. this.ty = e * m + f * q + this.ty;
  1057. return this
  1058. };
  1059. a.prototype.prependTransform = function (c, a, h, d, e, f, k, m, p) {
  1060. if (e % 360) {
  1061. var q = b.NumberUtils.cos(e);
  1062. e = b.NumberUtils.sin(e)
  1063. } else
  1064. q = 1, e = 0;
  1065. if (m || p)
  1066. this.tx -= m, this.ty -= p;
  1067. f || k ? (this.prepend(q * h, e * h, -e * d, q * d, 0, 0), this.prepend(b.NumberUtils.cos(k), b.NumberUtils.sin(k), -b.NumberUtils.sin(f), b.NumberUtils.cos(f),
  1068. c, a)) : this.prepend(q * h, e * h, -e * d, q * d, c, a);
  1069. return this
  1070. };
  1071. a.prototype.appendTransform = function (c, a, h, d, e, f, k, m, p) {
  1072. if (e % 360) {
  1073. var q = b.NumberUtils.cos(e);
  1074. e = b.NumberUtils.sin(e)
  1075. } else
  1076. q = 1, e = 0;
  1077. f || k ? (this.append(b.NumberUtils.cos(k), b.NumberUtils.sin(k), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), c, a), this.append(q * h, e * h, -e * d, q * d, 0, 0)) : this.append(q * h, e * h, -e * d, q * d, c, a);
  1078. if (m || p)
  1079. this.tx -= m * this.a + p * this.c, this.ty -= m * this.b + p * this.d;
  1080. return this
  1081. };
  1082. a.prototype.rotate = function (c) {
  1083. var a = Math.cos(c);
  1084. c = Math.sin(c);
  1085. var b =
  1086. this.a,
  1087. d = this.c,
  1088. e = this.tx;
  1089. this.a = b * a - this.b * c;
  1090. this.b = b * c + this.b * a;
  1091. this.c = d * a - this.d * c;
  1092. this.d = d * c + this.d * a;
  1093. this.tx = e * a - this.ty * c;
  1094. this.ty = e * c + this.ty * a;
  1095. return this
  1096. };
  1097. a.prototype.skew = function (c, a) {
  1098. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(c), b.NumberUtils.cos(c), 0, 0);
  1099. return this
  1100. };
  1101. a.prototype.scale = function (c, a) {
  1102. this.a *= c;
  1103. this.d *= a;
  1104. this.c *= c;
  1105. this.b *= a;
  1106. this.tx *= c;
  1107. this.ty *= a;
  1108. return this
  1109. };
  1110. a.prototype.translate = function (c, a) {
  1111. this.tx += c;
  1112. this.ty += a;
  1113. return this
  1114. };
  1115. a.prototype.identity =
  1116. function () {
  1117. this.a = this.d = 1;
  1118. this.b = this.c = this.tx = this.ty = 0;
  1119. return this
  1120. };
  1121. a.prototype.identityMatrix = function (c) {
  1122. this.a = c.a;
  1123. this.b = c.b;
  1124. this.c = c.c;
  1125. this.d = c.d;
  1126. this.tx = c.tx;
  1127. this.ty = c.ty;
  1128. return this
  1129. };
  1130. a.prototype.invert = function () {
  1131. var c = this.a,
  1132. a = this.b,
  1133. b = this.c,
  1134. d = this.d,
  1135. e = this.tx,
  1136. f = c * d - a * b;
  1137. this.a = d / f;
  1138. this.b = -a / f;
  1139. this.c = -b / f;
  1140. this.d = c / f;
  1141. this.tx = (b * this.ty - d * e) / f;
  1142. this.ty = - (c * this.ty - a * e) / f;
  1143. return this
  1144. };
  1145. a.transformCoords = function (c, a, h) {
  1146. var d = b.Point.identity;
  1147. d.x = c.a * a + c.c * h + c.tx;
  1148. d.y = c.d * h + c.b * a + c.ty;
  1149. return d
  1150. };
  1151. a.prototype.toArray = function (c) {
  1152. this.array || (this.array = new Float32Array(9));
  1153. c ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1154. this.array[8] = 1;
  1155. return this.array
  1156. };
  1157. a.identity = new a;
  1158. a.DEG_TO_RAD = Math.PI / 180;
  1159. return a
  1160. }
  1161. (b.HashObject);
  1162. b.Matrix = e;
  1163. e.prototype.__class__ = "egret.Matrix"
  1164. })(egret || (egret = {}));
  1165. __extends = this.__extends || function (b, e) {
  1166. function d() {
  1167. this.constructor = b
  1168. }
  1169. for (var a in e)
  1170. e.hasOwnProperty(a) && (b[a] = e[a]);
  1171. d.prototype = e.prototype;
  1172. b.prototype = new d
  1173. };
  1174. (function (b) {
  1175. var e = function (b) {
  1176. function a(c, a) {
  1177. void 0 === c && (c = 0);
  1178. void 0 === a && (a = 0);
  1179. b.call(this);
  1180. this.x = c;
  1181. this.y = a
  1182. }
  1183. __extends(a, b);
  1184. a.prototype.clone = function () {
  1185. return new a(this.x, this.y)
  1186. };
  1187. a.prototype.equals = function (c) {
  1188. return this.x == c.x && this.y == c.y
  1189. };
  1190. a.distance = function (c, a) {
  1191. return Math.sqrt((c.x - a.x) * (c.x - a.x) + (c.y - a.y) * (c.y - a.y))
  1192. };
  1193. a.identity = new a(0, 0);
  1194. return a
  1195. }
  1196. (b.HashObject);
  1197. b.Point = e;
  1198. e.prototype.__class__ = "egret.Point"
  1199. })(egret || (egret = {}));
  1200. __extends = this.__extends || function (b, e) {
  1201. function d() {
  1202. this.constructor = b
  1203. }
  1204. for (var a in e)
  1205. e.hasOwnProperty(a) && (b[a] = e[a]);
  1206. d.prototype = e.prototype;
  1207. b.prototype = new d
  1208. };
  1209. (function (b) {
  1210. var e = function (b) {
  1211. function a(c, a, h, e) {
  1212. void 0 === c && (c = 0);
  1213. void 0 === a && (a = 0);
  1214. void 0 === h && (h = 0);
  1215. void 0 === e && (e = 0);
  1216. b.call(this);
  1217. this.x = c;
  1218. this.y = a;
  1219. this.width = h;
  1220. this.height = e
  1221. }
  1222. __extends(a, b);
  1223. Object.defineProperty(a.prototype, "right", {
  1224. get : function () {
  1225. return this.x + this.width
  1226. },
  1227. set : function (c) {
  1228. this.width = c - this.x
  1229. },
  1230. enumerable : !0,
  1231. configurable : !0
  1232. });
  1233. Object.defineProperty(a.prototype, "bottom", {
  1234. get : function () {
  1235. return this.y + this.height
  1236. },
  1237. set : function (c) {
  1238. this.height = c - this.y
  1239. },
  1240. enumerable : !0,
  1241. configurable : !0
  1242. });
  1243. a.prototype.initialize = function (c, a, b, d) {
  1244. this.x = c;
  1245. this.y = a;
  1246. this.width = b;
  1247. this.height = d;
  1248. return this
  1249. };
  1250. a.prototype.contains = function (c, a) {
  1251. return this.x <= c && this.x + this.width >= c && this.y <= a && this.y + this.height >= a
  1252. };
  1253. a.prototype.intersects = function (c) {
  1254. var a = c.right,
  1255. b = c.bottom,
  1256. d = this.right,
  1257. e = this.bottom;
  1258. return this.contains(c.x, c.y) || this.contains(c.x, b) || this.contains(a, c.y) || this.contains(a, b) || c.contains(this.x, this.y) || c.contains(this.x, e) || c.contains(d, this.y) || c.contains(d, e) ? !0 : !1
  1259. };
  1260. a.prototype.clone =
  1261. function () {
  1262. return new a(this.x, this.y, this.width, this.height)
  1263. };
  1264. a.prototype.containsPoint = function (c) {
  1265. return this.x < c.x && this.x + this.width > c.x && this.y < c.y && this.y + this.height > c.y ? !0 : !1
  1266. };
  1267. a.identity = new a(0, 0, 0, 0);
  1268. return a
  1269. }
  1270. (b.HashObject);
  1271. b.Rectangle = e;
  1272. e.prototype.__class__ = "egret.Rectangle"
  1273. })(egret || (egret = {}));
  1274. (function (b) {
  1275. var e = function () {
  1276. function d() {}
  1277. d.fatal = function (a, c) {
  1278. void 0 === c && (c = null);
  1279. b.Logger.traceToConsole("Fatal", a, c);
  1280. throw Error(b.Logger.getTraceCode("Fatal", a, c));
  1281. };
  1282. d.info = function (a, c) {
  1283. void 0 === c && (c = null);
  1284. b.Logger.traceToConsole("Info", a, c)
  1285. };
  1286. d.warning = function (a, c) {
  1287. void 0 === c && (c = null);
  1288. b.Logger.traceToConsole("Warning", a, c)
  1289. };
  1290. d.traceToConsole = function (a, c, l) {
  1291. console.log(b.Logger.getTraceCode(a, c, l))
  1292. };
  1293. d.getTraceCode = function (a, c, l) {
  1294. return "[" + a + "]" + c + ":" + (null == l ? "" : l)
  1295. };
  1296. return d
  1297. }
  1298. ();
  1299. b.Logger =
  1300. e;
  1301. e.prototype.__class__ = "egret.Logger"
  1302. })(egret || (egret = {}));
  1303. __extends = this.__extends || function (b, e) {
  1304. function d() {
  1305. this.constructor = b
  1306. }
  1307. for (var a in e)
  1308. e.hasOwnProperty(a) && (b[a] = e[a]);
  1309. d.prototype = e.prototype;
  1310. b.prototype = new d
  1311. };
  1312. (function (b) {
  1313. var e = function (d) {
  1314. function a() {
  1315. d.call(this);
  1316. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1317. this._xmlDict = {};
  1318. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1319. }
  1320. __extends(a, d);
  1321. a.getInstance = function () {
  1322. a._instance || (a._instance = new a);
  1323. return a._instance
  1324. };
  1325. a.prototype.parserXML = function (c) {
  1326. for (var a = 0; "\n" == c.charAt(a) || "\t" == c.charAt(a) || "\r" == c.charAt(a) || " " == c.charAt(a); )
  1327. a++;
  1328. 0 != a && (c = c.substring(a, c.length));
  1329. this._isSupportDOMParser ?
  1330. a = this._parser.parseFromString(c, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(c));
  1331. null == a && b.Logger.info("xml not found!");
  1332. return a
  1333. };
  1334. a._instance = null;
  1335. return a
  1336. }
  1337. (b.HashObject);
  1338. b.SAXParser = e;
  1339. e.prototype.__class__ = "egret.SAXParser"
  1340. })(egret || (egret = {}));
  1341. __extends = this.__extends || function (b, e) {
  1342. function d() {
  1343. this.constructor = b
  1344. }
  1345. for (var a in e)
  1346. e.hasOwnProperty(a) && (b[a] = e[a]);
  1347. d.prototype = e.prototype;
  1348. b.prototype = new d
  1349. };
  1350. (function (b) {
  1351. var e = function (c) {
  1352. function l() {
  1353. c.call(this);
  1354. this._designHeight = this._designWidth = 0;
  1355. this._scaleY = this._scaleX = 1;
  1356. this._stageHeight = this._stageWidth = this._offSetY = 0
  1357. }
  1358. __extends(l, c);
  1359. l.getInstance = function () {
  1360. null == l.instance && (a.initialize(), l.instance = new l);
  1361. return l.instance
  1362. };
  1363. l.prototype.setDesignSize = function (c, a, l) {
  1364. this._designWidth = c;
  1365. this._designHeight = a;
  1366. l && (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"),
  1367. this._setResolutionPolicy(l))
  1368. };
  1369. l.prototype._setResolutionPolicy = function (c) {
  1370. this._resolutionPolicy = c;
  1371. c.init(this);
  1372. c._apply(this, this._designWidth, this._designHeight)
  1373. };
  1374. l.prototype.getScaleX = function () {
  1375. return this._scaleX
  1376. };
  1377. l.prototype.getScaleY = function () {
  1378. return this._scaleY
  1379. };
  1380. l.prototype.getOffSetY = function () {
  1381. return this._offSetY
  1382. };
  1383. l.canvas_name = "egretCanvas";
  1384. l.canvas_div_name = "gameDiv";
  1385. return l
  1386. }
  1387. (b.HashObject);
  1388. b.StageDelegate = e;
  1389. e.prototype.__class__ = "egret.StageDelegate";
  1390. var d = function () {
  1391. function c(a,
  1392. l) {
  1393. this._containerStrategy = a;
  1394. this._contentStrategy = l
  1395. }
  1396. c.prototype.init = function (c) {
  1397. this._containerStrategy.init(c);
  1398. this._contentStrategy.init(c)
  1399. };
  1400. c.prototype._apply = function (c, a, l) {
  1401. this._containerStrategy._apply(c, a, l);
  1402. this._contentStrategy._apply(c, a, l)
  1403. };
  1404. return c
  1405. }
  1406. ();
  1407. b.ResolutionPolicy = d;
  1408. d.prototype.__class__ = "egret.ResolutionPolicy";
  1409. var a = function () {
  1410. function a() {}
  1411. a.initialize = function () {
  1412. a.EQUAL_TO_FRAME = new c
  1413. };
  1414. a.prototype.init = function (c) {};
  1415. a.prototype._apply = function (c, a, l) {};
  1416. a.prototype._setupContainer =
  1417. function () {
  1418. var c = document.body,
  1419. a;
  1420. c && (a = c.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1421. };
  1422. return a
  1423. }
  1424. ();
  1425. b.ContainerStrategy = a;
  1426. a.prototype.__class__ = "egret.ContainerStrategy";
  1427. var c = function (c) {
  1428. function a() {
  1429. c.apply(this, arguments)
  1430. }
  1431. __extends(a, c);
  1432. a.prototype._apply = function (c) {
  1433. this._setupContainer()
  1434. };
  1435. return a
  1436. }
  1437. (a);
  1438. b.EqualToFrame = c;
  1439. c.prototype.__class__ = "egret.EqualToFrame";
  1440. d = function () {
  1441. function c() {}
  1442. c.prototype.init = function (c) {};
  1443. c.prototype._apply = function (c, a, l) {};
  1444. c.prototype.setEgretSize = function (c, a, l, h, d, p) {
  1445. void 0 === p && (p = 0);
  1446. b.StageDelegate.getInstance()._stageWidth = Math.round(c);
  1447. b.StageDelegate.getInstance()._stageHeight =
  1448. Math.round(a);
  1449. c = document.getElementById(e.canvas_div_name);
  1450. c.style.width = l + "px";
  1451. c.style.height = h + "px";
  1452. c.style.top = p + "px"
  1453. };
  1454. c.prototype._getClientWidth = function () {
  1455. return document.documentElement.clientWidth
  1456. };
  1457. c.prototype._getClientHeight = function () {
  1458. return document.documentElement.clientHeight
  1459. };
  1460. return c
  1461. }
  1462. ();
  1463. b.ContentStrategy = d;
  1464. d.prototype.__class__ = "egret.ContentStrategy";
  1465. var l = function (c) {
  1466. function a(l) {
  1467. void 0 === l && (l = 0);
  1468. c.call(this);
  1469. this.minWidth = l
  1470. }
  1471. __extends(a, c);
  1472. a.prototype._apply = function (c, a, l) {
  1473. a =
  1474. this._getClientWidth();
  1475. var b = this._getClientHeight(),
  1476. h = b / l,
  1477. d = a / h,
  1478. e = 1;
  1479. 0 != this.minWidth && (e = Math.min(1, d / this.minWidth));
  1480. this.setEgretSize(d / e, l, a, b * e);
  1481. c._scaleX = h * e;
  1482. c._scaleY = h * e
  1483. };
  1484. return a
  1485. }
  1486. (d);
  1487. b.FixedHeight = l;
  1488. l.prototype.__class__ = "egret.FixedHeight";
  1489. l = function (c) {
  1490. function a(l) {
  1491. void 0 === l && (l = 0);
  1492. c.call(this);
  1493. this.minHeight = l
  1494. }
  1495. __extends(a, c);
  1496. a.prototype._apply = function (c, a, l) {
  1497. l = this._getClientWidth();
  1498. var b = this._getClientHeight(),
  1499. h = l / a,
  1500. d = b / h,
  1501. e = 1;
  1502. 0 != this.minHeight && (e = Math.min(1, d / this.minHeight));
  1503. this.setEgretSize(a,
  1504. d / e, l * e, b, l * (1 - e) / 2);
  1505. c._scaleX = h * e;
  1506. c._scaleY = h * e
  1507. };
  1508. return a
  1509. }
  1510. (d);
  1511. b.FixedWidth = l;
  1512. l.prototype.__class__ = "egret.FixedWidth";
  1513. l = function (c) {
  1514. function a(l, b) {
  1515. c.call(this);
  1516. this.width = l;
  1517. this.height = b
  1518. }
  1519. __extends(a, c);
  1520. a.prototype._apply = function (c, a, l) {
  1521. l = this.width;
  1522. var b = this.height,
  1523. h = l / a;
  1524. this.setEgretSize(a, b / h, l, b);
  1525. c._scaleX = h;
  1526. c._scaleY = h
  1527. };
  1528. return a
  1529. }
  1530. (d);
  1531. b.FixedSize = l;
  1532. l.prototype.__class__ = "egret.FixedSize";
  1533. l = function (c) {
  1534. function a() {
  1535. c.call(this)
  1536. }
  1537. __extends(a, c);
  1538. a.prototype._apply = function (c, a, l) {
  1539. this.setEgretSize(a,
  1540. l, a, l, Math.floor((a - a) / 2));
  1541. c._scaleX = 1;
  1542. c._scaleY = 1
  1543. };
  1544. return a
  1545. }
  1546. (d);
  1547. b.NoScale = l;
  1548. l.prototype.__class__ = "egret.NoScale";
  1549. l = function (c) {
  1550. function a() {
  1551. c.call(this)
  1552. }
  1553. __extends(a, c);
  1554. a.prototype._apply = function (c, a, l) {
  1555. var b = this._getClientWidth(),
  1556. h = this._getClientHeight(),
  1557. d = b,
  1558. e = h,
  1559. n = d / a < e / l ? d / a : e / l,
  1560. d = a * n,
  1561. e = l * n,
  1562. b = Math.floor((b - d) / 2);
  1563. c._offSetY = Math.floor((h - e) / 2);
  1564. this.setEgretSize(a, l / 1, 1 * d, e, b, c._offSetY);
  1565. c._scaleX = 1 * n;
  1566. c._scaleY = 1 * n
  1567. };
  1568. return a
  1569. }
  1570. (d);
  1571. b.ShowAll = l;
  1572. l.prototype.__class__ = "egret.ShowAll";
  1573. d = function (c) {
  1574. function a() {
  1575. c.call(this)
  1576. }
  1577. __extends(a, c);
  1578. a.prototype._apply = function (c, a, l) {
  1579. var b = this._getClientWidth(),
  1580. h = this._getClientHeight(),
  1581. b = b / a,
  1582. h = h / l;
  1583. this.setEgretSize(a, l, a * b, l * h);
  1584. c._scaleX = b;
  1585. c._scaleY = h
  1586. };
  1587. return a
  1588. }
  1589. (d);
  1590. b.FullScreen = d;
  1591. d.prototype.__class__ = "egret.FullScreen"
  1592. })(egret || (egret = {}));
  1593. __extends = this.__extends || function (b, e) {
  1594. function d() {
  1595. this.constructor = b
  1596. }
  1597. for (var a in e)
  1598. e.hasOwnProperty(a) && (b[a] = e[a]);
  1599. d.prototype = e.prototype;
  1600. b.prototype = new d
  1601. };
  1602. (function (b) {
  1603. var e = function (d) {
  1604. function a() {
  1605. d.call(this);
  1606. this._originalData = {};
  1607. this._drawAreaList = []
  1608. }
  1609. __extends(a, d);
  1610. a.getInstance = function () {
  1611. null == a.instance && (a.instance = new a);
  1612. return a.instance
  1613. };
  1614. a.prototype.addDrawArea = function (c) {
  1615. this._drawAreaList.push(c)
  1616. };
  1617. a.prototype.clearDrawArea = function () {
  1618. this._drawAreaList = []
  1619. };
  1620. a.prototype.drawImage = function (c, a, h, d, e, f, k, m, p, q, r) {
  1621. void 0 === r && (r = void 0);
  1622. k = k || 0;
  1623. m = m || 0;
  1624. var t = a._texture_to_render;
  1625. if (null != t && 0 != f && 0 != e && 0 != p && 0 != q) {
  1626. var s = b.MainContext.instance.rendererContext.texture_scale_factor;
  1627. e /= s;
  1628. f /= s;
  1629. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1630. s = b.DisplayObject.getTransformBounds(a._getSize(b.Rectangle.identity), a._worldTransform);
  1631. a._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1632. s = this._originalData;
  1633. s.sourceX = h;
  1634. s.sourceY = d;
  1635. s.sourceWidth = e;
  1636. s.sourceHeight = f;
  1637. s.destX = k;
  1638. s.destY = m;
  1639. s.destWidth = p;
  1640. s.destHeight = q;
  1641. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1642. if (!this.ignoreRender(a, u[v], s.destX, s.destY)) {
  1643. c.drawImage(t, h, d, e, f, k, m, p, q, r);
  1644. break
  1645. }
  1646. } else
  1647. c.drawImage(t, h, d, e, f, k, m, p, q, r)
  1648. }
  1649. };
  1650. a.prototype.ignoreRender = function (c, a, b, d) {
  1651. var e = c._worldBounds;
  1652. b *= c._worldTransform.a;
  1653. d *= c._worldTransform.d;
  1654. return e.x + e.width + b <= a.x || e.x + b >= a.x + a.width || e.y + e.height + d <= a.y || e.y + d >= a.y + a.height ? !0 : !1
  1655. };
  1656. a.prototype.getDrawAreaList = function () {
  1657. var c;
  1658. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  1659. this.onResize, this)), c = this._defaultDrawAreaList) : c = this._drawAreaList;
  1660. return c
  1661. };
  1662. a.prototype.onResize = function () {
  1663. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1664. this._defaultDrawAreaList = null
  1665. };
  1666. return a
  1667. }
  1668. (b.HashObject);
  1669. b.RenderFilter = e;
  1670. e.prototype.__class__ = "egret.RenderFilter"
  1671. })(egret || (egret = {}));
  1672. (function (b) {
  1673. var e = function () {
  1674. function d() {}
  1675. d.mapClass = function (a, c, l) {
  1676. void 0 === l && (l = "");
  1677. a = this.getKey(a) + "#" + l;
  1678. this.mapClassDic[a] = c
  1679. };
  1680. d.getKey = function (a) {
  1681. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1682. };
  1683. d.mapValue = function (a, c, l) {
  1684. void 0 === l && (l = "");
  1685. a = this.getKey(a) + "#" + l;
  1686. this.mapValueDic[a] = c
  1687. };
  1688. d.hasMapRule = function (a, c) {
  1689. void 0 === c && (c = "");
  1690. var l = this.getKey(a) + "#" + c;
  1691. return this.mapValueDic[l] || this.mapClassDic[l] ? !0 : !1
  1692. };
  1693. d.getInstance = function (a, c) {
  1694. void 0 === c && (c = "");
  1695. var l = this.getKey(a) + "#" +
  1696. c;
  1697. if (this.mapValueDic[l])
  1698. return this.mapValueDic[l];
  1699. var b = this.mapClassDic[l];
  1700. if (b)
  1701. return b = new b, this.mapValueDic[l] = b, delete this.mapClassDic[l], b;
  1702. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + l + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1703. };
  1704. d.mapClassDic = {};
  1705. d.mapValueDic = {};
  1706. return d
  1707. }
  1708. ();
  1709. b.Injector = e;
  1710. e.prototype.__class__ = "egret.Injector"
  1711. })(egret ||
  1712. (egret = {}));
  1713. (function (b) {
  1714. var e = function () {
  1715. function b() {}
  1716. b.NORMAL = "normal";
  1717. b.ADD = "add";
  1718. return b
  1719. }
  1720. ();
  1721. b.BlendMode = e;
  1722. e.prototype.__class__ = "egret.BlendMode"
  1723. })(egret || (egret = {}));
  1724. __extends = this.__extends || function (b, e) {
  1725. function d() {
  1726. this.constructor = b
  1727. }
  1728. for (var a in e)
  1729. e.hasOwnProperty(a) && (b[a] = e[a]);
  1730. d.prototype = e.prototype;
  1731. b.prototype = new d
  1732. };
  1733. (function (b) {
  1734. var e = function (d) {
  1735. function a() {
  1736. d.call(this);
  1737. this.__hack_local_matrix = null;
  1738. this._sizeDirty = this._normalDirty = !0;
  1739. this._parent = this._texture_to_render = null;
  1740. this._y = this._x = 0;
  1741. this._scaleY = this._scaleX = 1;
  1742. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1743. this._visible = !0;
  1744. this._rotation = 0;
  1745. this._alpha = 1;
  1746. this._skewY = this._skewX = 0;
  1747. this._touchEnabled = !1;
  1748. this._scrollRect = this.blendMode = null;
  1749. this._hasHeightSet = this._hasWidthSet = !1;
  1750. this._worldBounds = this.mask = null;
  1751. this.worldAlpha =
  1752. 1;
  1753. this._rectH = this._rectW = 0;
  1754. this._stage = null;
  1755. this._cacheDirty = this._cacheAsBitmap = !1;
  1756. this._colorTransform = null;
  1757. this._worldTransform = new b.Matrix;
  1758. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1759. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1760. }
  1761. __extends(a, d);
  1762. a.prototype._setDirty = function () {
  1763. this._normalDirty = !0
  1764. };
  1765. a.prototype.getDirty = function () {
  1766. return this._normalDirty || this._sizeDirty
  1767. };
  1768. a.prototype._setParentSizeDirty = function () {
  1769. var c = this._parent;
  1770. !c || c._hasWidthSet || c._hasHeightSet || c._setSizeDirty()
  1771. };
  1772. a.prototype._setSizeDirty =
  1773. function () {
  1774. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1775. };
  1776. a.prototype._clearDirty = function () {
  1777. this._normalDirty = !1
  1778. };
  1779. a.prototype._clearSizeDirty = function () {
  1780. this._sizeDirty = !1
  1781. };
  1782. Object.defineProperty(a.prototype, "parent", {
  1783. get : function () {
  1784. return this._parent
  1785. },
  1786. enumerable : !0,
  1787. configurable : !0
  1788. });
  1789. a.prototype._parentChanged = function (c) {
  1790. this._parent = c
  1791. };
  1792. Object.defineProperty(a.prototype, "x", {
  1793. get : function () {
  1794. return this._x
  1795. },
  1796. set : function (c) {
  1797. this._setX(c)
  1798. },
  1799. enumerable : !0,
  1800. configurable : !0
  1801. });
  1802. a.prototype._setX = function (c) {
  1803. b.NumberUtils.isNumber(c) && this._x != c && (this._x = c, this._setDirty(), this._setParentSizeDirty())
  1804. };
  1805. Object.defineProperty(a.prototype, "y", {
  1806. get : function () {
  1807. return this._y
  1808. },
  1809. set : function (c) {
  1810. this._setY(c)
  1811. },
  1812. enumerable : !0,
  1813. configurable : !0
  1814. });
  1815. a.prototype._setY = function (c) {
  1816. b.NumberUtils.isNumber(c) && this._y != c && (this._y = c, this._setDirty(), this._setParentSizeDirty())
  1817. };
  1818. Object.defineProperty(a.prototype, "scaleX", {
  1819. get : function () {
  1820. return this._scaleX
  1821. },
  1822. set : function (c) {
  1823. b.NumberUtils.isNumber(c) &&
  1824. this._scaleX != c && (this._scaleX = c, this._setDirty(), this._setParentSizeDirty())
  1825. },
  1826. enumerable : !0,
  1827. configurable : !0
  1828. });
  1829. Object.defineProperty(a.prototype, "scaleY", {
  1830. get : function () {
  1831. return this._scaleY
  1832. },
  1833. set : function (c) {
  1834. b.NumberUtils.isNumber(c) && this._scaleY != c && (this._scaleY = c, this._setDirty(), this._setParentSizeDirty())
  1835. },
  1836. enumerable : !0,
  1837. configurable : !0
  1838. });
  1839. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1840. get : function () {
  1841. return this._anchorOffsetX
  1842. },
  1843. set : function (c) {
  1844. b.NumberUtils.isNumber(c) && this._anchorOffsetX !=
  1845. c && (this._anchorOffsetX = c, this._setDirty(), this._setParentSizeDirty())
  1846. },
  1847. enumerable : !0,
  1848. configurable : !0
  1849. });
  1850. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1851. get : function () {
  1852. return this._anchorOffsetY
  1853. },
  1854. set : function (c) {
  1855. b.NumberUtils.isNumber(c) && this._anchorOffsetY != c && (this._anchorOffsetY = c, this._setDirty(), this._setParentSizeDirty())
  1856. },
  1857. enumerable : !0,
  1858. configurable : !0
  1859. });
  1860. Object.defineProperty(a.prototype, "anchorX", {
  1861. get : function () {
  1862. return this._anchorX
  1863. },
  1864. set : function (c) {
  1865. this._setAnchorX(c)
  1866. },
  1867. enumerable : !0,
  1868. configurable : !0
  1869. });
  1870. a.prototype._setAnchorX = function (c) {
  1871. b.NumberUtils.isNumber(c) && this._anchorX != c && (this._anchorX = c, this._setDirty(), this._setParentSizeDirty())
  1872. };
  1873. Object.defineProperty(a.prototype, "anchorY", {
  1874. get : function () {
  1875. return this._anchorY
  1876. },
  1877. set : function (c) {
  1878. this._setAnchorY(c)
  1879. },
  1880. enumerable : !0,
  1881. configurable : !0
  1882. });
  1883. a.prototype._setAnchorY = function (c) {
  1884. b.NumberUtils.isNumber(c) && this._anchorY != c && (this._anchorY = c, this._setDirty(), this._setParentSizeDirty())
  1885. };
  1886. Object.defineProperty(a.prototype, "visible", {
  1887. get : function () {
  1888. return this._visible
  1889. },
  1890. set : function (c) {
  1891. this._setVisible(c)
  1892. },
  1893. enumerable : !0,
  1894. configurable : !0
  1895. });
  1896. a.prototype._setVisible = function (c) {
  1897. this._visible != c && (this._visible = c, this._setSizeDirty())
  1898. };
  1899. Object.defineProperty(a.prototype, "rotation", {
  1900. get : function () {
  1901. return this._rotation
  1902. },
  1903. set : function (c) {
  1904. b.NumberUtils.isNumber(c) && this._rotation != c && (this._rotation = c, this._setSizeDirty())
  1905. },
  1906. enumerable : !0,
  1907. configurable : !0
  1908. });
  1909. Object.defineProperty(a.prototype, "alpha", {
  1910. get : function () {
  1911. return this._alpha
  1912. },
  1913. set : function (c) {
  1914. b.NumberUtils.isNumber(c) &&
  1915. this._alpha != c && (this._alpha = c, this._setDirty(), this._setCacheDirty())
  1916. },
  1917. enumerable : !0,
  1918. configurable : !0
  1919. });
  1920. Object.defineProperty(a.prototype, "skewX", {
  1921. get : function () {
  1922. return this._skewX
  1923. },
  1924. set : function (c) {
  1925. b.NumberUtils.isNumber(c) && this._skewX != c && (this._skewX = c, this._setSizeDirty())
  1926. },
  1927. enumerable : !0,
  1928. configurable : !0
  1929. });
  1930. Object.defineProperty(a.prototype, "skewY", {
  1931. get : function () {
  1932. return this._skewY
  1933. },
  1934. set : function (c) {
  1935. b.NumberUtils.isNumber(c) && this._skewY != c && (this._skewY = c, this._setSizeDirty())
  1936. },
  1937. enumerable : !0,
  1938. configurable : !0
  1939. });
  1940. Object.defineProperty(a.prototype, "touchEnabled", {
  1941. get : function () {
  1942. return this._touchEnabled
  1943. },
  1944. set : function (c) {
  1945. this._setTouchEnabled(c)
  1946. },
  1947. enumerable : !0,
  1948. configurable : !0
  1949. });
  1950. a.prototype._setTouchEnabled = function (c) {
  1951. this._touchEnabled = c
  1952. };
  1953. Object.defineProperty(a.prototype, "scrollRect", {
  1954. get : function () {
  1955. return this._scrollRect
  1956. },
  1957. set : function (c) {
  1958. this._setScrollRect(c)
  1959. },
  1960. enumerable : !0,
  1961. configurable : !0
  1962. });
  1963. a.prototype._setScrollRect = function (c) {
  1964. this._scrollRect = c;
  1965. this._setSizeDirty()
  1966. };
  1967. Object.defineProperty(a.prototype,
  1968. "measuredWidth", {
  1969. get : function () {
  1970. return this._measureBounds().width
  1971. },
  1972. enumerable : !0,
  1973. configurable : !0
  1974. });
  1975. Object.defineProperty(a.prototype, "measuredHeight", {
  1976. get : function () {
  1977. return this._measureBounds().height
  1978. },
  1979. enumerable : !0,
  1980. configurable : !0
  1981. });
  1982. Object.defineProperty(a.prototype, "explicitWidth", {
  1983. get : function () {
  1984. return this._explicitWidth
  1985. },
  1986. enumerable : !0,
  1987. configurable : !0
  1988. });
  1989. Object.defineProperty(a.prototype, "explicitHeight", {
  1990. get : function () {
  1991. return this._explicitHeight
  1992. },
  1993. enumerable : !0,
  1994. configurable : !0
  1995. });
  1996. Object.defineProperty(a.prototype,
  1997. "width", {
  1998. get : function () {
  1999. return this._getSize(b.Rectangle.identity).width
  2000. },
  2001. set : function (c) {
  2002. this._setWidth(c)
  2003. },
  2004. enumerable : !0,
  2005. configurable : !0
  2006. });
  2007. Object.defineProperty(a.prototype, "height", {
  2008. get : function () {
  2009. return this._getSize(b.Rectangle.identity).height
  2010. },
  2011. set : function (c) {
  2012. this._setHeight(c)
  2013. },
  2014. enumerable : !0,
  2015. configurable : !0
  2016. });
  2017. a.prototype._setWidth = function (c) {
  2018. this._setSizeDirty();
  2019. this._setCacheDirty();
  2020. this._explicitWidth = c;
  2021. this._hasWidthSet = b.NumberUtils.isNumber(c)
  2022. };
  2023. a.prototype._setHeight = function (c) {
  2024. this._setSizeDirty();
  2025. this._setCacheDirty();
  2026. this._explicitHeight = c;
  2027. this._hasHeightSet = b.NumberUtils.isNumber(c)
  2028. };
  2029. a.prototype._draw = function (c) {
  2030. if (this._visible && !this.drawCacheTexture(c)) {
  2031. this._colorTransform && c.setGlobalColorTransform(this._colorTransform.matrix);
  2032. c.setAlpha(this.worldAlpha, this.blendMode);
  2033. c.setTransform(this._worldTransform);
  2034. var a = this.mask || this._scrollRect;
  2035. a && c.pushMask(a);
  2036. this._render(c);
  2037. a && c.popMask();
  2038. this._colorTransform && c.setGlobalColorTransform(null)
  2039. }
  2040. this.destroyCacheBounds()
  2041. };
  2042. a.prototype.drawCacheTexture =
  2043. function (c) {
  2044. if (!1 == this._cacheAsBitmap)
  2045. return !1;
  2046. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight))
  2047. this._cacheDirty = !this._makeBitmapCache();
  2048. if (null == this._texture_to_render)
  2049. return !1;
  2050. var a = this._texture_to_render,
  2051. h = a._offsetX,
  2052. d = a._offsetY,
  2053. e = a._textureWidth,
  2054. a = a._textureHeight;
  2055. this._updateTransform();
  2056. c.setAlpha(this.worldAlpha, this.blendMode);
  2057. c.setTransform(this._worldTransform);
  2058. var f = b.MainContext.instance.rendererContext.texture_scale_factor;
  2059. b.RenderFilter.getInstance().drawImage(c, this, 0, 0, e * f, a * f, h, d, e, a);
  2060. return !0
  2061. };
  2062. a.prototype._updateTransform = function () {
  2063. this._calculateWorldTransform()
  2064. };
  2065. a.prototype._calculateWorldTransform = function () {
  2066. var c = this._worldTransform,
  2067. a = this._parent;
  2068. c.identityMatrix(a._worldTransform);
  2069. this._getMatrix(c);
  2070. var b = this._scrollRect;
  2071. b && c.append(1, 0, 0, 1, -b.x, -b.y);
  2072. this.worldAlpha = a.worldAlpha * this._alpha
  2073. };
  2074. a.prototype._render = function (c) {};
  2075. a.prototype.getBounds =
  2076. function (c, a) {
  2077. void 0 === a && (a = !0);
  2078. var h = this._measureBounds(),
  2079. d = this._hasWidthSet ? this._explicitWidth : h.width,
  2080. e = this._hasHeightSet ? this._explicitHeight : h.height;
  2081. this._rectW = h.width;
  2082. this._rectH = h.height;
  2083. this._clearSizeDirty();
  2084. var f = h.x,
  2085. h = h.y,
  2086. k = 0,
  2087. m = 0;
  2088. a && (0 != this._anchorX || 0 != this._anchorY ? (k = d * this._anchorX, m = e * this._anchorY) : (k = this._anchorOffsetX, m = this._anchorOffsetY));
  2089. this._cacheBounds.initialize(f - k, h - m, d, e);
  2090. d = this._cacheBounds;
  2091. c || (c = new b.Rectangle);
  2092. return c.initialize(d.x, d.y, d.width, d.height)
  2093. };
  2094. a.prototype.destroyCacheBounds = function () {
  2095. this._cacheBounds.x = 0;
  2096. this._cacheBounds.y = 0;
  2097. this._cacheBounds.width = 0;
  2098. this._cacheBounds.height = 0
  2099. };
  2100. a.prototype._getConcatenatedMatrix = function () {
  2101. for (var c = a.identityMatrixForGetConcatenated.identity(), l = this; null != l; ) {
  2102. if (0 != l._anchorX || 0 != l._anchorY) {
  2103. var h = l._getSize(b.Rectangle.identity);
  2104. c.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, h.width * l._anchorX, h.height * l._anchorY)
  2105. } else
  2106. c.prependTransform(l._x, l._y, l._scaleX, l._scaleY,
  2107. l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
  2108. l._scrollRect && c.prepend(1, 0, 0, 1, -l._scrollRect.x, -l._scrollRect.y);
  2109. l = l._parent
  2110. }
  2111. return c
  2112. };
  2113. a.prototype.localToGlobal = function (c, a, h) {
  2114. void 0 === c && (c = 0);
  2115. void 0 === a && (a = 0);
  2116. var d = this._getConcatenatedMatrix();
  2117. d.append(1, 0, 0, 1, c, a);
  2118. h || (h = new b.Point);
  2119. h.x = d.tx;
  2120. h.y = d.ty;
  2121. return h
  2122. };
  2123. a.prototype.globalToLocal = function (c, a, h) {
  2124. void 0 === c && (c = 0);
  2125. void 0 === a && (a = 0);
  2126. var d = this._getConcatenatedMatrix();
  2127. d.invert();
  2128. d.append(1, 0, 0, 1, c, a);
  2129. h || (h = new b.Point);
  2130. h.x = d.tx;
  2131. h.y = d.ty;
  2132. return h
  2133. };
  2134. a.prototype.hitTest = function (c, a, h) {
  2135. void 0 === h && (h = !1);
  2136. if (!this._visible || !h && !this._touchEnabled)
  2137. return null;
  2138. h = this._getSize(b.Rectangle.identity);
  2139. return 0 <= c && c < h.width && 0 <= a && a < h.height ? this.mask || this._scrollRect ? this._scrollRect && c > this._scrollRect.x && a > this._scrollRect.y && c < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= c && c < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ?
  2140. this : null : this : null
  2141. };
  2142. a.prototype.hitTestPoint = function (c, a, h) {
  2143. c = this.globalToLocal(c, a);
  2144. return h ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), h = this._hitTestPointTexture, h.drawToTexture(this), 0 != h.getPixel32(c.x - this._hitTestPointTexture._offsetX, c.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(c.x, c.y, !0)
  2145. };
  2146. a.prototype._getMatrix = function (c) {
  2147. c || (c = b.Matrix.identity.identity());
  2148. var a,
  2149. h;
  2150. h = this._getOffsetPoint();
  2151. a = h.x;
  2152. h = h.y;
  2153. var d = this.__hack_local_matrix;
  2154. d ? (c.append(d.a, d.b, d.c, d.d, d.tx, d.ty), c.append(1, 0, 0, 1, -a, -h)) : c.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, h);
  2155. return c
  2156. };
  2157. a.prototype._getSize = function (c) {
  2158. return this._hasHeightSet && this._hasWidthSet ? c.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(c)
  2159. };
  2160. a.prototype._measureSize = function (c) {
  2161. this._sizeDirty ? (c = this._measureBounds(), this._rectW = c.width, this._rectH = c.height, this._clearSizeDirty()) : (c.width = this._rectW,
  2162. c.height = this._rectH);
  2163. c.x = 0;
  2164. c.y = 0;
  2165. return c
  2166. };
  2167. a.prototype._measureBounds = function () {
  2168. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2169. };
  2170. a.prototype._getOffsetPoint = function () {
  2171. var c = this._anchorOffsetX,
  2172. a = this._anchorOffsetY;
  2173. if (0 != this._anchorX || 0 != this._anchorY)
  2174. a = this._getSize(b.Rectangle.identity), c = this._anchorX * a.width, a = this._anchorY * a.height;
  2175. var h = b.Point.identity;
  2176. h.x = c;
  2177. h.y = a;
  2178. return h
  2179. };
  2180. a.prototype._onAddToStage = function () {
  2181. this._stage = b.MainContext.instance.stage;
  2182. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2183. };
  2184. a.prototype._onRemoveFromStage = function () {
  2185. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2186. };
  2187. Object.defineProperty(a.prototype, "stage", {
  2188. get : function () {
  2189. return this._stage
  2190. },
  2191. enumerable : !0,
  2192. configurable : !0
  2193. });
  2194. a.prototype.addEventListener = function (c, l, h, e, g) {
  2195. void 0 === e && (e = !1);
  2196. void 0 === g && (g = 0);
  2197. d.prototype.addEventListener.call(this, c, l, h, e, g);
  2198. ((e = c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, l, h, g, this)
  2199. };
  2200. a.prototype.removeEventListener =
  2201. function (c, l, h, e) {
  2202. void 0 === e && (e = !1);
  2203. d.prototype.removeEventListener.call(this, c, l, h, e);
  2204. ((e = c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, l, h, this)
  2205. };
  2206. a.prototype.dispatchEvent = function (c) {
  2207. if (!c._bubbles)
  2208. return d.prototype.dispatchEvent.call(this, c);
  2209. for (var a = [], b = this; b; )
  2210. a.push(b), b = b._parent;
  2211. c._reset();
  2212. this._dispatchPropagationEvent(c, a);
  2213. return !c._isDefaultPrevented
  2214. };
  2215. a.prototype._dispatchPropagationEvent = function (c, a, b) {
  2216. b = a.length;
  2217. for (var d = 1, e = b - 1; 0 <= e; e--) {
  2218. var f = a[e];
  2219. c._currentTarget = f;
  2220. c._target = this;
  2221. c._eventPhase = d;
  2222. f._notifyListener(c);
  2223. if (c._isPropagationStopped || c._isPropagationImmediateStopped)
  2224. return
  2225. }
  2226. f = a[0];
  2227. c._currentTarget = f;
  2228. c._target = this;
  2229. c._eventPhase = 2;
  2230. f._notifyListener(c);
  2231. if (!c._isPropagationStopped && !c._isPropagationImmediateStopped)
  2232. for (d = 3, e = 1; e < b && (f = a[e], c._currentTarget = f, c._target = this, c._eventPhase = d, f._notifyListener(c), !c._isPropagationStopped && !c._isPropagationImmediateStopped); e++);
  2233. };
  2234. a.prototype.willTrigger =
  2235. function (c) {
  2236. for (var a = this; a; ) {
  2237. if (a.hasEventListener(c))
  2238. return !0;
  2239. a = a._parent
  2240. }
  2241. return !1
  2242. };
  2243. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2244. get : function () {
  2245. return this._cacheAsBitmap
  2246. },
  2247. set : function (c) {
  2248. (this._cacheAsBitmap = c) ? b.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2249. },
  2250. enumerable : !0,
  2251. configurable : !0
  2252. });
  2253. a.prototype._makeBitmapCache = function () {
  2254. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2255. var c = this.renderTexture.drawToTexture(this);
  2256. this._texture_to_render = c ? this.renderTexture :
  2257. null;
  2258. return c
  2259. };
  2260. a.prototype._setCacheDirty = function (c) {
  2261. void 0 === c && (c = !0);
  2262. this._cacheDirty = c
  2263. };
  2264. a.getTransformBounds = function (c, a) {
  2265. var b = c.x,
  2266. d = c.y,
  2267. e = c.width,
  2268. f = c.height;
  2269. (b || d) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -d);
  2270. var k = e * a.a,
  2271. e = e * a.b,
  2272. m = f * a.c,
  2273. f = f * a.d,
  2274. p = a.tx,
  2275. q = a.ty,
  2276. r = p,
  2277. t = p,
  2278. s = q,
  2279. u = q;
  2280. (b = k + p) < r ? r = b : b > t && (t = b);
  2281. (b = k + m + p) < r ? r = b : b > t && (t = b);
  2282. (b = m + p) < r ? r = b : b > t && (t = b);
  2283. (d = e + q) < s ? s = d : d > u && (u = d);
  2284. (d = e + f + q) < s ? s = d : d > u && (u = d);
  2285. (d = f + q) < s ? s = d : d > u && (u = d);
  2286. return c.initialize(r, s, t - r, u - s)
  2287. };
  2288. Object.defineProperty(a.prototype, "colorTransform", {
  2289. get : function () {
  2290. return this._colorTransform
  2291. },
  2292. set : function (c) {
  2293. this._colorTransform = c
  2294. },
  2295. enumerable : !0,
  2296. configurable : !0
  2297. });
  2298. a.identityMatrixForGetConcatenated = new b.Matrix;
  2299. a._enterFrameCallBackList = [];
  2300. a._renderCallBackList = [];
  2301. return a
  2302. }
  2303. (b.EventDispatcher);
  2304. b.DisplayObject = e;
  2305. e.prototype.__class__ = "egret.DisplayObject";
  2306. e = function () {
  2307. function b() {
  2308. this.matrix = null
  2309. }
  2310. b.prototype.updateColor = function (a, c, b, h, d, e, f, k) {};
  2311. return b
  2312. }
  2313. ();
  2314. b.ColorTransform = e;
  2315. e.prototype.__class__ = "egret.ColorTransform"
  2316. })(egret || (egret = {}));
  2317. __extends = this.__extends || function (b, e) {
  2318. function d() {
  2319. this.constructor = b
  2320. }
  2321. for (var a in e)
  2322. e.hasOwnProperty(a) && (b[a] = e[a]);
  2323. d.prototype = e.prototype;
  2324. b.prototype = new d
  2325. };
  2326. (function (b) {
  2327. var e = function (d) {
  2328. function a() {
  2329. d.call(this);
  2330. this._touchChildren = !0;
  2331. this._children = []
  2332. }
  2333. __extends(a, d);
  2334. Object.defineProperty(a.prototype, "touchChildren", {
  2335. get : function () {
  2336. return this._touchChildren
  2337. },
  2338. set : function (c) {
  2339. this._touchChildren = c
  2340. },
  2341. enumerable : !0,
  2342. configurable : !0
  2343. });
  2344. Object.defineProperty(a.prototype, "numChildren", {
  2345. get : function () {
  2346. return this._children.length
  2347. },
  2348. enumerable : !0,
  2349. configurable : !0
  2350. });
  2351. a.prototype.setChildIndex = function (c, a) {
  2352. this.doSetChildIndex(c, a)
  2353. };
  2354. a.prototype.doSetChildIndex = function (c,
  2355. a) {
  2356. var h = this._children.indexOf(c);
  2357. 0 > h && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2358. this._children.splice(h, 1);
  2359. 0 > a || this._children.length <= a ? this._children.push(c) : this._children.splice(a, 0, c)
  2360. };
  2361. a.prototype.addChild = function (c) {
  2362. var a = this._children.length;
  2363. c._parent == this && a--;
  2364. return this._doAddChild(c, a)
  2365. };
  2366. a.prototype.addChildAt = function (c, a) {
  2367. return this._doAddChild(c, a)
  2368. };
  2369. a.prototype._doAddChild = function (c, l, h) {
  2370. void 0 === h && (h = !0);
  2371. if (c == this)
  2372. return c;
  2373. if (0 > l || l > this._children.length)
  2374. return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2375. c;
  2376. var d = c._parent;
  2377. if (d == this)
  2378. return this.doSetChildIndex(c, l), c;
  2379. d && (l = d._children.indexOf(c), 0 <= l && d._doRemoveChild(l));
  2380. this._children.splice(l, 0, c);
  2381. c._parentChanged(this);
  2382. h && c.dispatchEventWith(b.Event.ADDED, !0);
  2383. if (this._stage)
  2384. for (c._onAddToStage(), l = a.__EVENT__ADD_TO_STAGE_LIST; 0 < l.length; )
  2385. l.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2386. c._setDirty();
  2387. this._setSizeDirty();
  2388. return c
  2389. };
  2390. a.prototype.removeChild = function (c) {
  2391. c = this._children.indexOf(c);
  2392. if (0 <= c)
  2393. return this._doRemoveChild(c);
  2394. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2395. return null
  2396. };
  2397. a.prototype.removeChildAt = function (c) {
  2398. if (0 <= c && c < this._children.length)
  2399. return this._doRemoveChild(c);
  2400. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2401. return null
  2402. };
  2403. a.prototype._doRemoveChild = function (c, l) {
  2404. void 0 === l && (l = !0);
  2405. var h = this._children,
  2406. d = h[c];
  2407. l && d.dispatchEventWith(b.Event.REMOVED, !0);
  2408. if (this._stage) {
  2409. d._onRemoveFromStage();
  2410. for (var e = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < e.length; ) {
  2411. var f = e.shift();
  2412. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2413. f._stage = null
  2414. }
  2415. }
  2416. d._parentChanged(null);
  2417. h.splice(c, 1);
  2418. this._setSizeDirty();
  2419. return d
  2420. };
  2421. a.prototype.getChildAt = function (c) {
  2422. if (0 <= c && c < this._children.length)
  2423. return this._children[c];
  2424. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2425. return null
  2426. };
  2427. a.prototype.contains = function (c) {
  2428. for (; c; ) {
  2429. if (c == this)
  2430. return !0;
  2431. c = c._parent
  2432. }
  2433. return !1
  2434. };
  2435. a.prototype.swapChildrenAt = function (c, a) {
  2436. 0 <= c && c < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(c, a) : b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2437. };
  2438. a.prototype.swapChildren = function (c, a) {
  2439. var h = this._children.indexOf(c),
  2440. d = this._children.indexOf(a);
  2441. -1 == h || -1 == d ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(h, d)
  2442. };
  2443. a.prototype._swapChildrenAt = function (c, a) {
  2444. if (c != a) {
  2445. var b = this._children,
  2446. d = b[c];
  2447. b[c] = b[a];
  2448. b[a] = d
  2449. }
  2450. };
  2451. a.prototype.getChildIndex = function (c) {
  2452. return this._children.indexOf(c)
  2453. };
  2454. a.prototype.removeChildren = function () {
  2455. for (var c = this._children.length - 1; 0 <= c; c--)
  2456. this._doRemoveChild(c)
  2457. };
  2458. a.prototype._updateTransform =
  2459. function () {
  2460. if (this._visible) {
  2461. d.prototype._updateTransform.call(this);
  2462. for (var c = 0, a = this._children.length; c < a; c++)
  2463. this._children[c]._updateTransform()
  2464. }
  2465. };
  2466. a.prototype._render = function (c) {
  2467. for (var a = 0, b = this._children.length; a < b; a++)
  2468. this._children[a]._draw(c)
  2469. };
  2470. a.prototype._measureBounds = function () {
  2471. for (var c = 0, a = 0, h = 0, d = 0, e = this._children.length, f = 0; f < e; f++) {
  2472. var k = this._children[f];
  2473. if (k._visible) {
  2474. var m = k.getBounds(b.Rectangle.identity, !1),
  2475. p = m.x,
  2476. q = m.y,
  2477. r = m.width,
  2478. m = m.height,
  2479. k = k._getMatrix(),
  2480. k = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p,
  2481. q, r, m), k),
  2482. p = k.x,
  2483. q = k.y,
  2484. r = k.width + k.x,
  2485. k = k.height + k.y;
  2486. if (p < c || 0 == f)
  2487. c = p;
  2488. if (r > a || 0 == f)
  2489. a = r;
  2490. if (q < h || 0 == f)
  2491. h = q;
  2492. if (k > d || 0 == f)
  2493. d = k
  2494. }
  2495. }
  2496. return b.Rectangle.identity.initialize(c, h, a - c, d - h)
  2497. };
  2498. a.prototype.hitTest = function (c, a, h) {
  2499. void 0 === h && (h = !1);
  2500. var e;
  2501. if (!this._visible)
  2502. return null;
  2503. if (this._scrollRect) {
  2504. if (c < this._scrollRect.x || a < this._scrollRect.y || c > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height)
  2505. return null
  2506. } else if (this.mask && (this.mask.x > c || c > this.mask.x + this.mask.width || this.mask.y >
  2507. a || a > this.mask.y + this.mask.height))
  2508. return null;
  2509. for (var g = this._children, f = this._touchChildren, k = g.length - 1; 0 <= k; k--) {
  2510. var m = g[k],
  2511. p = m._getMatrix(),
  2512. q = m._scrollRect;
  2513. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2514. p.invert();
  2515. p = b.Matrix.transformCoords(p, c, a);
  2516. if (m = m.hitTest(p.x, p.y, !0)) {
  2517. if (!f)
  2518. return this;
  2519. if (m._touchEnabled && f)
  2520. return m;
  2521. e = this
  2522. }
  2523. }
  2524. return e ? e : this._texture_to_render || this.graphics ? d.prototype.hitTest.call(this, c, a, h) : null
  2525. };
  2526. a.prototype._onAddToStage = function () {
  2527. d.prototype._onAddToStage.call(this);
  2528. for (var c = this._children.length,
  2529. a = 0; a < c; a++)
  2530. this._children[a]._onAddToStage()
  2531. };
  2532. a.prototype._onRemoveFromStage = function () {
  2533. d.prototype._onRemoveFromStage.call(this);
  2534. for (var c = this._children.length, a = 0; a < c; a++)
  2535. this._children[a]._onRemoveFromStage()
  2536. };
  2537. a.prototype.getChildByName = function (c) {
  2538. for (var a = this._children, b = a.length, d, e = 0; e < b; e++)
  2539. if (d = a[e], d.name == c)
  2540. return d;
  2541. return null
  2542. };
  2543. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2544. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2545. return a
  2546. }
  2547. (b.DisplayObject);
  2548. b.DisplayObjectContainer = e;
  2549. e.prototype.__class__ = "egret.DisplayObjectContainer"
  2550. })(egret ||
  2551. (egret = {}));
  2552. __extends = this.__extends || function (b, e) {
  2553. function d() {
  2554. this.constructor = b
  2555. }
  2556. for (var a in e)
  2557. e.hasOwnProperty(a) && (b[a] = e[a]);
  2558. d.prototype = e.prototype;
  2559. b.prototype = new d
  2560. };
  2561. (function (b) {
  2562. var e = function (d) {
  2563. function a(c, a) {
  2564. void 0 === c && (c = 480);
  2565. void 0 === a && (a = 800);
  2566. d.call(this);
  2567. this.touchEnabled = !0;
  2568. this._stage = this;
  2569. this._stageWidth = c;
  2570. this._stageHeight = a
  2571. }
  2572. __extends(a, d);
  2573. a.prototype.invalidate = function () {
  2574. a._invalidateRenderFlag = !0
  2575. };
  2576. Object.defineProperty(a.prototype, "scaleMode", {
  2577. get : function () {
  2578. return this._scaleMode
  2579. },
  2580. set : function (c) {
  2581. this._scaleMode != c && (this._scaleMode = c, this.setResolutionPolicy())
  2582. },
  2583. enumerable : !0,
  2584. configurable : !0
  2585. });
  2586. a.prototype.changeSize = function () {
  2587. this.setResolutionPolicy();
  2588. this.dispatchEventWith(b.Event.RESIZE)
  2589. };
  2590. a.prototype.setResolutionPolicy = function () {
  2591. var c = {};
  2592. c[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2593. c[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2594. c[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2595. c[b.StageScaleMode.EXACT_FIT] = new b.FullScreen;
  2596. c = c[this._scaleMode];
  2597. if (!c)
  2598. throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2599. var a = new b.EqualToFrame,
  2600. c = new b.ResolutionPolicy(a, c);
  2601. b.StageDelegate.getInstance()._setResolutionPolicy(c);
  2602. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2603. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2604. };
  2605. Object.defineProperty(a.prototype, "stageWidth", {
  2606. get : function () {
  2607. return this._stageWidth
  2608. },
  2609. enumerable : !0,
  2610. configurable : !0
  2611. });
  2612. Object.defineProperty(a.prototype, "stageHeight", {
  2613. get : function () {
  2614. return this._stageHeight
  2615. },
  2616. enumerable : !0,
  2617. configurable : !0
  2618. });
  2619. a.prototype.hitTest = function (c, a, d) {
  2620. if (!this._touchEnabled)
  2621. return null;
  2622. var e;
  2623. if (!this._touchChildren)
  2624. return this;
  2625. d = this._children;
  2626. for (var g = d.length - 1; 0 <= g; g--) {
  2627. e = d[g];
  2628. var f = e._getMatrix(),
  2629. k = e._scrollRect;
  2630. k && f.append(1, 0, 0, 1, -k.x, -k.y);
  2631. f.invert();
  2632. f = b.Matrix.transformCoords(f, c, a);
  2633. if ((e = e.hitTest(f.x, f.y, !0)) && e._touchEnabled)
  2634. return e
  2635. }
  2636. return this
  2637. };
  2638. a.prototype.getBounds = function (c) {
  2639. c || (c = new b.Rectangle);
  2640. return c.initialize(0, 0, this._stageWidth, this._stageHeight)
  2641. };
  2642. a.prototype._updateTransform = function () {
  2643. for (var c = 0, a = this._children.length; c < a; c++)
  2644. this._children[c]._updateTransform()
  2645. };
  2646. Object.defineProperty(a.prototype, "focus", {
  2647. get : function () {
  2648. return null
  2649. },
  2650. enumerable : !0,
  2651. configurable : !0
  2652. });
  2653. a._invalidateRenderFlag =
  2654. !1;
  2655. return a
  2656. }
  2657. (b.DisplayObjectContainer);
  2658. b.Stage = e;
  2659. e.prototype.__class__ = "egret.Stage"
  2660. })(egret || (egret = {}));
  2661. (function (b) {
  2662. var e = function () {
  2663. function b() {}
  2664. b.NO_BORDER = "noBorder";
  2665. b.NO_SCALE = "noScale";
  2666. b.SHOW_ALL = "showAll";
  2667. b.EXACT_FIT = "exactFit";
  2668. return b
  2669. }
  2670. ();
  2671. b.StageScaleMode = e;
  2672. e.prototype.__class__ = "egret.StageScaleMode"
  2673. })(egret || (egret = {}));
  2674. __extends = this.__extends || function (b, e) {
  2675. function d() {
  2676. this.constructor = b
  2677. }
  2678. for (var a in e)
  2679. e.hasOwnProperty(a) && (b[a] = e[a]);
  2680. d.prototype = e.prototype;
  2681. b.prototype = new d
  2682. };
  2683. (function (b) {
  2684. var e = function (d) {
  2685. function a(c) {
  2686. void 0 === c && (c = null);
  2687. d.call(this);
  2688. this._lastTouchPosition = new b.Point(0, 0);
  2689. this._lastTouchTime = 0;
  2690. this._lastTouchEvent = null;
  2691. this._velocitys = [];
  2692. this._content = null;
  2693. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2694. this._scrollTop = this._scrollLeft = 0;
  2695. this._vCanScroll = this._hCanScroll = !1;
  2696. this.touchEnabled = !0;
  2697. c && this.setContent(c)
  2698. }
  2699. __extends(a, d);
  2700. a.prototype.setContent = function (c) {
  2701. this._content !== c && (this.removeContent(), c && (this._content = c, d.prototype.addChild.call(this,
  2702. c), this._addEvents()))
  2703. };
  2704. a.prototype.removeContent = function () {
  2705. this._content && (this._removeEvents(), d.prototype.removeChildAt.call(this, 0));
  2706. this._content = null
  2707. };
  2708. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2709. get : function () {
  2710. return this._verticalScrollPolicy
  2711. },
  2712. set : function (c) {
  2713. c != this._verticalScrollPolicy && (this._verticalScrollPolicy = c)
  2714. },
  2715. enumerable : !0,
  2716. configurable : !0
  2717. });
  2718. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2719. get : function () {
  2720. return this._horizontalScrollPolicy
  2721. },
  2722. set : function (c) {
  2723. c !=
  2724. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = c)
  2725. },
  2726. enumerable : !0,
  2727. configurable : !0
  2728. });
  2729. Object.defineProperty(a.prototype, "scrollLeft", {
  2730. get : function () {
  2731. return this._scrollLeft
  2732. },
  2733. set : function (c) {
  2734. c != this._scrollLeft && (this._scrollLeft = c, this._validatePosition(!1, !0), this._updateContentPosition())
  2735. },
  2736. enumerable : !0,
  2737. configurable : !0
  2738. });
  2739. Object.defineProperty(a.prototype, "scrollTop", {
  2740. get : function () {
  2741. return this._scrollTop
  2742. },
  2743. set : function (c) {
  2744. c != this._scrollTop && (this._scrollTop = c, this._validatePosition(!0,
  2745. !1), this._updateContentPosition())
  2746. },
  2747. enumerable : !0,
  2748. configurable : !0
  2749. });
  2750. a.prototype.setScrollPosition = function (c, a, b) {
  2751. void 0 === b && (b = !1);
  2752. if (!b || 0 != c || 0 != a)
  2753. if (b || this._scrollTop != c || this._scrollLeft != a) {
  2754. if (b) {
  2755. b = this._isOnTheEdge(!0);
  2756. var d = this._isOnTheEdge(!1);
  2757. this._scrollTop += b ? c / 2 : c;
  2758. this._scrollLeft += d ? a / 2 : a
  2759. } else
  2760. this._scrollTop = c, this._scrollLeft = a;
  2761. this._validatePosition(!0, !0);
  2762. this._updateContentPosition()
  2763. }
  2764. };
  2765. a.prototype._isOnTheEdge = function (c) {
  2766. void 0 === c && (c = !0);
  2767. var a = this._scrollTop,
  2768. b = this._scrollLeft;
  2769. return c ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2770. };
  2771. a.prototype._validatePosition = function (c, a) {
  2772. void 0 === c && (c = !1);
  2773. void 0 === a && (a = !1);
  2774. if (c) {
  2775. var b = this.height,
  2776. d = this._getContentHeight();
  2777. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2778. this._scrollTop = Math.min(this._scrollTop, d > b ? d - b / 2 : d / 2)
  2779. }
  2780. a && (b = this.width, d = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, d > b ? d - b / 2 : d / 2))
  2781. };
  2782. a.prototype._setWidth = function (c) {
  2783. this._explicitWidth !=
  2784. c && (d.prototype._setWidth.call(this, c), this._updateContentPosition())
  2785. };
  2786. a.prototype._setHeight = function (c) {
  2787. this._explicitHeight != c && (d.prototype._setHeight.call(this, c), this._updateContentPosition())
  2788. };
  2789. a.prototype._updateContentPosition = function () {
  2790. var c = this.getBounds(b.Rectangle.identity);
  2791. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, c.width, c.height);
  2792. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2793. };
  2794. a.prototype._checkScrollPolicy = function () {
  2795. var c = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2796. this._getContentWidth(), this.width);
  2797. this._hCanScroll = c;
  2798. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2799. this._vCanScroll = a;
  2800. return c || a
  2801. };
  2802. a.prototype.__checkScrollPolicy = function (c, a, b) {
  2803. return "on" == c ? !0 : "off" == c ? !1 : a > b
  2804. };
  2805. a.prototype._addEvents = function () {
  2806. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2807. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2808. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2809. this, !0)
  2810. };
  2811. a.prototype._removeEvents = function () {
  2812. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2813. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2814. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2815. };
  2816. a.prototype._onTouchBegin = function (c) {
  2817. !c._isDefaultPrevented && this._checkScrollPolicy() && (b.Tween.removeTweens(this), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END,
  2818. this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(c), c.preventDefault())
  2819. };
  2820. a.prototype._onTouchBeginCapture = function (c) {
  2821. var l = this._checkScrollPolicy();
  2822. if (l) {
  2823. for (var d = c.target; d != this; ) {
  2824. if (d instanceof a && (l = d._checkScrollPolicy()))
  2825. return;
  2826. d = d.parent
  2827. }
  2828. c.stopPropagation();
  2829. this.delayTouchBeginEvent = this.cloneTouchEvent(c);
  2830. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100,
  2831. 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2832. this.touchBeginTimer.start();
  2833. this._onTouchBegin(c)
  2834. }
  2835. };
  2836. a.prototype._onTouchEndCapture = function (c) {
  2837. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2838. };
  2839. a.prototype._onTouchBeginTimer = function () {
  2840. this.touchBeginTimer.stop();
  2841. var c = this.delayTouchBeginEvent;
  2842. this.delayTouchBeginEvent = null;
  2843. this.dispatchPropagationEvent(c)
  2844. };
  2845. a.prototype.dispatchPropagationEvent = function (c) {
  2846. for (var a = [], b = c._target; b; )
  2847. a.push(b),
  2848. b = b.parent;
  2849. for (var d = this._content, e = 1; ; e += 2) {
  2850. b = a[e];
  2851. if (!b || b === d)
  2852. break;
  2853. a.unshift(b)
  2854. }
  2855. this._dispatchPropagationEvent(c, a)
  2856. };
  2857. a.prototype._dispatchPropagationEvent = function (c, a, b) {
  2858. for (var d = a.length, e = 0; e < d; e++) {
  2859. var f = a[e];
  2860. c._currentTarget = f;
  2861. c._target = this;
  2862. c._eventPhase = e < b ? 1 : e == b ? 2 : 3;
  2863. f._notifyListener(c);
  2864. if (c._isPropagationStopped || c._isPropagationImmediateStopped)
  2865. break
  2866. }
  2867. };
  2868. a.prototype._onTouchMove = function (c) {
  2869. if (this._lastTouchPosition.x != c.stageX || this._lastTouchPosition.y != c.stageY) {
  2870. this.delayTouchBeginEvent &&
  2871. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2872. this.touchChildren = !1;
  2873. var a = this._getPointChange(c);
  2874. this.setScrollPosition(a.y, a.x, !0);
  2875. this._calcVelocitys(c);
  2876. this._logTouchEvent(c)
  2877. }
  2878. };
  2879. a.prototype._onTouchEnd = function (c) {
  2880. this.touchChildren = !0;
  2881. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2882. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2883. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE,
  2884. this._onTouchEnd, this);
  2885. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2886. this._moveAfterTouchEnd()
  2887. };
  2888. a.prototype._onEnterFrame = function (c) {
  2889. c = b.getTimer();
  2890. 100 < c - this._lastTouchTime && 300 > c - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2891. };
  2892. a.prototype._logTouchEvent = function (c) {
  2893. this._lastTouchPosition.x = c.stageX;
  2894. this._lastTouchPosition.y = c.stageY;
  2895. this._lastTouchEvent = this.cloneTouchEvent(c);
  2896. this._lastTouchTime = b.getTimer()
  2897. };
  2898. a.prototype._getPointChange = function (c) {
  2899. return {
  2900. x : !1 ===
  2901. this._hCanScroll ? 0 : this._lastTouchPosition.x - c.stageX,
  2902. y : !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - c.stageY
  2903. }
  2904. };
  2905. a.prototype._calcVelocitys = function (c) {
  2906. var a = b.getTimer();
  2907. if (0 == this._lastTouchTime)
  2908. this._lastTouchTime = a;
  2909. else {
  2910. var d = this._getPointChange(c),
  2911. a = a - this._lastTouchTime;
  2912. d.x /= a;
  2913. d.y /= a;
  2914. this._velocitys.push(d);
  2915. 5 < this._velocitys.length && this._velocitys.shift();
  2916. this._lastTouchPosition.x = c.stageX;
  2917. this._lastTouchPosition.y = c.stageY
  2918. }
  2919. };
  2920. a.prototype._getContentWidth = function () {
  2921. return this._content.explicitWidth ||
  2922. this._content.width
  2923. };
  2924. a.prototype._getContentHeight = function () {
  2925. return this._content.explicitHeight || this._content.height
  2926. };
  2927. a.prototype.getMaxScrollLeft = function () {
  2928. var c = this._getContentWidth() - this.width;
  2929. return Math.max(0, c)
  2930. };
  2931. a.prototype.getMaxScrollTop = function () {
  2932. var c = this._getContentHeight() - this.height;
  2933. return Math.max(0, c)
  2934. };
  2935. a.prototype._moveAfterTouchEnd = function () {
  2936. if (0 != this._velocitys.length) {
  2937. for (var c = 0, b = 0, d = 0, e = 0; e < this._velocitys.length; e++)
  2938. var g = this._velocitys[e], f = a.weight[e], c = c + g.x * f,
  2939. b = b + g.y * f, d = d + f;
  2940. this._velocitys.length = 0;
  2941. c /= d;
  2942. b /= d;
  2943. g = Math.abs(c);
  2944. d = Math.abs(b);
  2945. f = this.getMaxScrollLeft();
  2946. e = this.getMaxScrollTop();
  2947. c = 0.02 < g ? this.getAnimationDatas(c, this._scrollLeft, f) : {
  2948. position : this._scrollLeft,
  2949. duration : 1
  2950. };
  2951. b = 0.02 < d ? this.getAnimationDatas(b, this._scrollTop, e) : {
  2952. position : this._scrollTop,
  2953. duration : 1
  2954. };
  2955. this.setScrollLeft(c.position, c.duration);
  2956. this.setScrollTop(b.position, b.duration)
  2957. }
  2958. };
  2959. a.prototype.setScrollTop = function (c, a) {
  2960. void 0 === a && (a = 0);
  2961. var d = Math.min(this.getMaxScrollTop(), Math.max(c,
  2962. 0));
  2963. if (0 == a)
  2964. return this.scrollTop = d, null;
  2965. var e = b.Tween.get(this).to({
  2966. scrollTop : c
  2967. }, a, b.Ease.quartOut);
  2968. d != c && e.to({
  2969. scrollTop : d
  2970. }, 300, b.Ease.quintOut)
  2971. };
  2972. a.prototype.setScrollLeft = function (c, a) {
  2973. void 0 === a && (a = 0);
  2974. var d = Math.min(this.getMaxScrollLeft(), Math.max(c, 0));
  2975. if (0 == a)
  2976. return this.scrollLeft = d, null;
  2977. var e = b.Tween.get(this).to({
  2978. scrollLeft : c
  2979. }, a, b.Ease.quartOut);
  2980. d != c && e.to({
  2981. scrollLeft : d
  2982. }, 300, b.Ease.quintOut)
  2983. };
  2984. a.prototype.getAnimationDatas = function (c, a, b) {
  2985. var d = Math.abs(c),
  2986. e = 0,
  2987. f = a + 500 * c;
  2988. if (0 > f || f > b)
  2989. for (f =
  2990. a; Infinity != Math.abs(c) && 0.02 < Math.abs(c); )
  2991. f += c, c = 0 > f || f > b ? 0.998 * c * 0.95 : 0.998 * c, e++;
  2992. else
  2993. e = 500 * -Math.log(0.02 / d);
  2994. return {
  2995. position : Math.min(b + 50, Math.max(f, -50)),
  2996. duration : e
  2997. }
  2998. };
  2999. a.prototype.cloneTouchEvent = function (c) {
  3000. var a = new b.TouchEvent(c._type, c._bubbles, c.cancelable);
  3001. a.touchPointID = c.touchPointID;
  3002. a._stageX = c._stageX;
  3003. a._stageY = c._stageY;
  3004. a.ctrlKey = c.ctrlKey;
  3005. a.altKey = c.altKey;
  3006. a.shiftKey = c.shiftKey;
  3007. a.touchDown = c.touchDown;
  3008. a._isDefaultPrevented = !1;
  3009. a._target = c._target;
  3010. return a
  3011. };
  3012. a.prototype.throwNotSupportedError =
  3013. function () {
  3014. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  3015. };
  3016. a.prototype.addChild = function (c) {
  3017. this.throwNotSupportedError();
  3018. return null
  3019. };
  3020. a.prototype.addChildAt = function (c, a) {
  3021. this.throwNotSupportedError();
  3022. return null
  3023. };
  3024. a.prototype.removeChild = function (c) {
  3025. this.throwNotSupportedError();
  3026. return null
  3027. };
  3028. a.prototype.removeChildAt = function (c) {
  3029. this.throwNotSupportedError();
  3030. return null
  3031. };
  3032. a.prototype.setChildIndex = function (c, a) {
  3033. this.throwNotSupportedError()
  3034. };
  3035. a.prototype.swapChildren = function (c,
  3036. a) {
  3037. this.throwNotSupportedError()
  3038. };
  3039. a.prototype.swapChildrenAt = function (c, a) {
  3040. this.throwNotSupportedError()
  3041. };
  3042. a.prototype.hitTest = function (c, a, h) {
  3043. void 0 === h && (h = !1);
  3044. var e = d.prototype.hitTest.call(this, c, a, h);
  3045. return e ? e : b.DisplayObject.prototype.hitTest.call(this, c, a, h)
  3046. };
  3047. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3048. return a
  3049. }
  3050. (b.DisplayObjectContainer);
  3051. b.ScrollView = e;
  3052. e.prototype.__class__ = "egret.ScrollView"
  3053. })(egret || (egret = {}));
  3054. (function (b) {
  3055. var e = function () {
  3056. function b() {}
  3057. b.REPEAT = "repeat";
  3058. b.SCALE = "scale";
  3059. return b
  3060. }
  3061. ();
  3062. b.BitmapFillMode = e;
  3063. e.prototype.__class__ = "egret.BitmapFillMode"
  3064. })(egret || (egret = {}));
  3065. __extends = this.__extends || function (b, e) {
  3066. function d() {
  3067. this.constructor = b
  3068. }
  3069. for (var a in e)
  3070. e.hasOwnProperty(a) && (b[a] = e[a]);
  3071. d.prototype = e.prototype;
  3072. b.prototype = new d
  3073. };
  3074. (function (b) {
  3075. var e = function (d) {
  3076. function a(c) {
  3077. d.call(this);
  3078. this.debug = !1;
  3079. this.debugColor = 16711680;
  3080. this.scale9Grid = null;
  3081. this.fillMode = "scale";
  3082. c && (this._texture = c, this._setSizeDirty())
  3083. }
  3084. __extends(a, d);
  3085. Object.defineProperty(a.prototype, "texture", {
  3086. get : function () {
  3087. return this._texture
  3088. },
  3089. set : function (c) {
  3090. c != this._texture && (this._setSizeDirty(), this._texture = c)
  3091. },
  3092. enumerable : !0,
  3093. configurable : !0
  3094. });
  3095. a.prototype._render = function (c) {
  3096. var b = this._texture;
  3097. b ? (this._texture_to_render = b, a._drawBitmap(c, this._hasWidthSet ? this._explicitWidth :
  3098. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  3099. };
  3100. a._drawBitmap = function (c, b, d, e) {
  3101. var g = e._texture_to_render;
  3102. if (g) {
  3103. var f = g._textureWidth,
  3104. k = g._textureHeight;
  3105. if ("scale" == e.fillMode) {
  3106. var m = e.scale9Grid || g.scale9Grid;
  3107. if (m && f - m.width < b && k - m.height < d)
  3108. a.drawScale9GridImage(c, e, m, b, d);
  3109. else {
  3110. var m = g._offsetX,
  3111. p = g._offsetY,
  3112. q = g._bitmapWidth || f,
  3113. r = g._bitmapHeight || k;
  3114. b /= f;
  3115. m = Math.round(m * b);
  3116. b = Math.round(q * b);
  3117. d /= k;
  3118. p = Math.round(p * d);
  3119. d = Math.round(r * d);
  3120. a.renderFilter.drawImage(c,
  3121. e, g._bitmapX, g._bitmapY, q, r, m, p, b, d)
  3122. }
  3123. } else
  3124. a.drawRepeatImage(c, e, b, d, e.fillMode)
  3125. }
  3126. };
  3127. a.drawRepeatImage = function (c, a, d, e, g) {
  3128. var f = a._texture_to_render;
  3129. if (f) {
  3130. var k = f._textureWidth,
  3131. m = f._textureHeight,
  3132. p = f._bitmapX,
  3133. q = f._bitmapY,
  3134. k = f._bitmapWidth || k,
  3135. m = f._bitmapHeight || m,
  3136. r = f._offsetX,
  3137. f = f._offsetY;
  3138. b.RenderFilter.getInstance().drawImage(c, a, p, q, k, m, r, f, d, e, g)
  3139. }
  3140. };
  3141. a.drawScale9GridImage = function (c, a, d, e, g) {
  3142. var f = a._texture_to_render;
  3143. if (f && d) {
  3144. var k = b.RenderFilter.getInstance(),
  3145. m = f._textureWidth,
  3146. p = f._textureHeight,
  3147. q = f._bitmapX,
  3148. r = f._bitmapY,
  3149. t = f._bitmapWidth || m,
  3150. s = f._bitmapHeight || p,
  3151. u = f._offsetX,
  3152. v = f._offsetY,
  3153. f = b.MainContext.instance.rendererContext.texture_scale_factor;
  3154. d = b.Rectangle.identity.initialize(d.x - Math.round(u), d.y - Math.round(u), d.width, d.height);
  3155. u = Math.round(u);
  3156. v = Math.round(v);
  3157. e -= m - t;
  3158. g -= p - s;
  3159. d.y == d.bottom && (d.bottom < s ? d.bottom++ : d.y--);
  3160. d.x == d.right && (d.right < t ? d.right++ : d.x--);
  3161. var m = q + d.x,
  3162. p = q + d.right,
  3163. x = t - d.right,
  3164. y = r + d.y,
  3165. w = r + d.bottom,
  3166. z = s - d.bottom,
  3167. A = u + d.x,
  3168. B = v + d.y,
  3169. s = g - (s - d.bottom),
  3170. t = e - (t - d.right);
  3171. k.drawImage(c,
  3172. a, q / f, r / f, d.x, d.y, u, v, d.x, d.y);
  3173. k.drawImage(c, a, m / f, r / f, d.width, d.y, A, v, t - d.x, d.y);
  3174. k.drawImage(c, a, p / f, r / f, x, d.y, u + t, v, e - t, d.y);
  3175. k.drawImage(c, a, q / f, y / f, d.x, d.height, u, B, d.x, s - d.y);
  3176. k.drawImage(c, a, m / f, y / f, d.width, d.height, A, B, t - d.x, s - d.y);
  3177. k.drawImage(c, a, p / f, y / f, x, d.height, u + t, B, e - t, s - d.y);
  3178. k.drawImage(c, a, q / f, w / f, d.x, z, u, v + s, d.x, g - s);
  3179. k.drawImage(c, a, m / f, w / f, d.width, z, A, v + s, t - d.x, g - s);
  3180. k.drawImage(c, a, p / f, w / f, x, z, u + t, v + s, e - t, g - s)
  3181. }
  3182. };
  3183. a.prototype._measureBounds = function () {
  3184. var c = this._texture;
  3185. return c ? b.Rectangle.identity.initialize(c._offsetX,
  3186. c._offsetY, c._textureWidth, c._textureHeight) : d.prototype._measureBounds.call(this)
  3187. };
  3188. a.debug = !1;
  3189. a.renderFilter = b.RenderFilter.getInstance();
  3190. return a
  3191. }
  3192. (b.DisplayObject);
  3193. b.Bitmap = e;
  3194. e.prototype.__class__ = "egret.Bitmap"
  3195. })(egret || (egret = {}));
  3196. __extends = this.__extends || function (b, e) {
  3197. function d() {
  3198. this.constructor = b
  3199. }
  3200. for (var a in e)
  3201. e.hasOwnProperty(a) && (b[a] = e[a]);
  3202. d.prototype = e.prototype;
  3203. b.prototype = new d
  3204. };
  3205. (function (b) {
  3206. var e = function (d) {
  3207. function a() {
  3208. d.call(this);
  3209. this._text = "";
  3210. this._textChanged = !1;
  3211. this._spriteSheet = null;
  3212. this._spriteSheetChanged = !1;
  3213. this._bitmapPool = []
  3214. }
  3215. __extends(a, d);
  3216. Object.defineProperty(a.prototype, "text", {
  3217. get : function () {
  3218. return this._text
  3219. },
  3220. set : function (c) {
  3221. this._textChanged = !0;
  3222. this._text = c;
  3223. this._setSizeDirty()
  3224. },
  3225. enumerable : !0,
  3226. configurable : !0
  3227. });
  3228. Object.defineProperty(a.prototype, "spriteSheet", {
  3229. get : function () {
  3230. return this._spriteSheet
  3231. },
  3232. set : function (c) {
  3233. this._spriteSheet != c && (this._spriteSheet =
  3234. c, this._spriteSheetChanged = !0, this._setSizeDirty())
  3235. },
  3236. enumerable : !0,
  3237. configurable : !0
  3238. });
  3239. a.prototype._updateTransform = function () {
  3240. this.visible && ((this._textChanged || this._spriteSheetChanged) && this._renderText(), d.prototype._updateTransform.call(this))
  3241. };
  3242. a.prototype._renderText = function (c) {
  3243. var a = c = 0;
  3244. (this._textChanged || this._spriteSheetChanged) && this.removeChildren();
  3245. for (var d = 0, e = this.text.length; d < e; d++) {
  3246. var g = this.text.charAt(d),
  3247. f = this.spriteSheet.getTexture(g);
  3248. if (null == f)
  3249. console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" +
  3250. g);
  3251. else {
  3252. var g = f._offsetX,
  3253. k = f._offsetY,
  3254. m = f._textureWidth;
  3255. if (this._textChanged || this._spriteSheetChanged) {
  3256. var p = this._bitmapPool[d];
  3257. p || (p = new b.Bitmap, this._bitmapPool.push(p));
  3258. p.texture = f;
  3259. this.addChild(p);
  3260. p.x = c
  3261. }
  3262. c += m + g;
  3263. k + f._textureHeight > a && (a = k + f._textureHeight)
  3264. }
  3265. }
  3266. this._spriteSheetChanged = this._textChanged = !1;
  3267. return b.Rectangle.identity.initialize(0, 0, c, a)
  3268. };
  3269. a.prototype._measureBounds = function () {
  3270. return this._renderText(!0)
  3271. };
  3272. return a
  3273. }
  3274. (b.DisplayObjectContainer);
  3275. b.BitmapText = e;
  3276. e.prototype.__class__ = "egret.BitmapText"
  3277. })(egret ||
  3278. (egret = {}));
  3279. (function (b) {
  3280. var e = function () {
  3281. function b() {
  3282. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3283. this.commandQueue = []
  3284. }
  3285. b.prototype.beginFill = function (a, c) {};
  3286. b.prototype._setStyle = function (a) {};
  3287. b.prototype.drawRect = function (a, c, b, d) {
  3288. this.checkRect(a, c, b, d)
  3289. };
  3290. b.prototype.drawCircle = function (a, c, b) {
  3291. this.checkRect(a - b, c - b, 2 * b, 2 * b)
  3292. };
  3293. b.prototype.drawRoundRect = function (a, c, b, d, e, g) {
  3294. this.checkRect(a, c, b, d)
  3295. };
  3296. b.prototype.drawEllipse = function (a, c, b, d) {
  3297. this.checkRect(a - b, c - d, 2 * b, 2 * d)
  3298. };
  3299. b.prototype.lineStyle =
  3300. function (a, c, b, d, e, g, f, k) {};
  3301. b.prototype.lineTo = function (a, c) {
  3302. this.checkPoint(a, c)
  3303. };
  3304. b.prototype.curveTo = function (a, c, b, d) {
  3305. this.checkPoint(a, c);
  3306. this.checkPoint(b, d)
  3307. };
  3308. b.prototype.moveTo = function (a, c) {
  3309. this.checkPoint(a, c)
  3310. };
  3311. b.prototype.clear = function () {
  3312. this._maxY = this._maxX = this._minY = this._minX = 0
  3313. };
  3314. b.prototype.endFill = function () {};
  3315. b.prototype._draw = function (a) {};
  3316. b.prototype.checkRect = function (a, c, b, d) {
  3317. this._minX = Math.min(this._minX, a);
  3318. this._minY = Math.min(this._minY, c);
  3319. this._maxX = Math.max(this._maxX, a +
  3320. b);
  3321. this._maxY = Math.max(this._maxY, c + d)
  3322. };
  3323. b.prototype.checkPoint = function (a, c) {
  3324. this._minX = Math.min(this._minX, a);
  3325. this._minY = Math.min(this._minY, c);
  3326. this._maxX = Math.max(this._maxX, a);
  3327. this._maxY = Math.max(this._maxY, c);
  3328. this._lastX = a;
  3329. this._lastY = c
  3330. };
  3331. return b
  3332. }
  3333. ();
  3334. b.Graphics = e;
  3335. e.prototype.__class__ = "egret.Graphics";
  3336. (function () {
  3337. return function (b, a, c) {
  3338. this.method = b;
  3339. this.thisObject = a;
  3340. this.args = c
  3341. }
  3342. })().prototype.__class__ = "egret.Command"
  3343. })(egret || (egret = {}));
  3344. __extends = this.__extends || function (b, e) {
  3345. function d() {
  3346. this.constructor = b
  3347. }
  3348. for (var a in e)
  3349. e.hasOwnProperty(a) && (b[a] = e[a]);
  3350. d.prototype = e.prototype;
  3351. b.prototype = new d
  3352. };
  3353. (function (b) {
  3354. var e = function (d) {
  3355. function a() {
  3356. d.call(this)
  3357. }
  3358. __extends(a, d);
  3359. Object.defineProperty(a.prototype, "graphics", {
  3360. get : function () {
  3361. this._graphics || (this._graphics = new b.Graphics);
  3362. return this._graphics
  3363. },
  3364. enumerable : !0,
  3365. configurable : !0
  3366. });
  3367. a.prototype._render = function (c) {
  3368. this._graphics && this._graphics._draw(c)
  3369. };
  3370. return a
  3371. }
  3372. (b.DisplayObject);
  3373. b.Shape = e;
  3374. e.prototype.__class__ = "egret.Shape"
  3375. })(egret || (egret = {}));
  3376. __extends = this.__extends || function (b, e) {
  3377. function d() {
  3378. this.constructor = b
  3379. }
  3380. for (var a in e)
  3381. e.hasOwnProperty(a) && (b[a] = e[a]);
  3382. d.prototype = e.prototype;
  3383. b.prototype = new d
  3384. };
  3385. (function (b) {
  3386. var e = function (d) {
  3387. function a() {
  3388. d.call(this)
  3389. }
  3390. __extends(a, d);
  3391. Object.defineProperty(a.prototype, "graphics", {
  3392. get : function () {
  3393. this._graphics || (this._graphics = new b.Graphics);
  3394. return this._graphics
  3395. },
  3396. enumerable : !0,
  3397. configurable : !0
  3398. });
  3399. a.prototype._render = function (c) {
  3400. this._graphics && this._graphics._draw(c);
  3401. d.prototype._render.call(this, c)
  3402. };
  3403. return a
  3404. }
  3405. (b.DisplayObjectContainer);
  3406. b.Sprite = e;
  3407. e.prototype.__class__ = "egret.Sprite"
  3408. })(egret || (egret = {}));
  3409. __extends = this.__extends || function (b, e) {
  3410. function d() {
  3411. this.constructor = b
  3412. }
  3413. for (var a in e)
  3414. e.hasOwnProperty(a) && (b[a] = e[a]);
  3415. d.prototype = e.prototype;
  3416. b.prototype = new d
  3417. };
  3418. (function (b) {
  3419. var e = function (d) {
  3420. function a() {
  3421. d.call(this);
  3422. this._inputEnabled = !1;
  3423. this._text = this._type = "";
  3424. this._displayAsPassword = !1;
  3425. this._fontFamily = a.default_fontFamily;
  3426. this._size = 30;
  3427. this._textColorString = "#FFFFFF";
  3428. this._textColor = 16777215;
  3429. this._strokeColorString = "#000000";
  3430. this._stroke = this._strokeColor = 0;
  3431. this._textAlign = "left";
  3432. this._verticalAlign = "top";
  3433. this._maxChars = 0;
  3434. this._scrollV = -1;
  3435. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3436. this._isFlow = this._multiline = !1;
  3437. this._textArr = [];
  3438. this._isArrayChanged =
  3439. !1;
  3440. this._textMaxHeight = this._textMaxWidth = 0;
  3441. this._linesArr = []
  3442. }
  3443. __extends(a, d);
  3444. a.prototype.isInput = function () {
  3445. return this._type == b.TextFieldType.INPUT
  3446. };
  3447. a.prototype._setTouchEnabled = function (c) {
  3448. d.prototype._setTouchEnabled.call(this, c);
  3449. this.isInput() && (this._inputEnabled = !0)
  3450. };
  3451. Object.defineProperty(a.prototype, "type", {
  3452. get : function () {
  3453. return this._type
  3454. },
  3455. set : function (c) {
  3456. this._setType(c)
  3457. },
  3458. enumerable : !0,
  3459. configurable : !0
  3460. });
  3461. a.prototype._setType = function (c) {
  3462. this._type != c && (this._type = c, this._type == b.TextFieldType.INPUT ?
  3463. (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3464. };
  3465. Object.defineProperty(a.prototype, "text", {
  3466. get : function () {
  3467. return this._getText()
  3468. },
  3469. set : function (c) {
  3470. this._setText(c)
  3471. },
  3472. enumerable : !0,
  3473. configurable : !0
  3474. });
  3475. a.prototype._getText = function () {
  3476. return this._type ==
  3477. b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3478. };
  3479. a.prototype._setSizeDirty = function () {
  3480. d.prototype._setSizeDirty.call(this);
  3481. this._isArrayChanged = !0
  3482. };
  3483. a.prototype._setTextDirty = function () {
  3484. this._setSizeDirty()
  3485. };
  3486. a.prototype._setBaseText = function (c) {
  3487. null == c && (c = "");
  3488. this._isFlow = !1;
  3489. if (this._text != c || this._displayAsPassword)
  3490. this._setTextDirty(), this._text = c, c = "", c = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3491. text : c
  3492. }
  3493. ])
  3494. };
  3495. a.prototype._setText = function (c) {
  3496. null ==
  3497. c && (c = "");
  3498. this._setBaseText(c);
  3499. this._inputUtils && this._inputUtils._setText(this._text)
  3500. };
  3501. Object.defineProperty(a.prototype, "displayAsPassword", {
  3502. get : function () {
  3503. return this._displayAsPassword
  3504. },
  3505. set : function (c) {
  3506. this._setDisplayAsPassword(c)
  3507. },
  3508. enumerable : !0,
  3509. configurable : !0
  3510. });
  3511. a.prototype._setDisplayAsPassword = function (c) {
  3512. this._displayAsPassword != c && (this._displayAsPassword = c, this._setText(this._text))
  3513. };
  3514. Object.defineProperty(a.prototype, "fontFamily", {
  3515. get : function () {
  3516. return this._fontFamily
  3517. },
  3518. set : function (c) {
  3519. this._setFontFamily(c)
  3520. },
  3521. enumerable : !0,
  3522. configurable : !0
  3523. });
  3524. a.prototype._setFontFamily = function (c) {
  3525. this._fontFamily != c && (this._setTextDirty(), this._fontFamily = c)
  3526. };
  3527. Object.defineProperty(a.prototype, "size", {
  3528. get : function () {
  3529. return this._size
  3530. },
  3531. set : function (c) {
  3532. this._setSize(c)
  3533. },
  3534. enumerable : !0,
  3535. configurable : !0
  3536. });
  3537. a.prototype._setSize = function (c) {
  3538. this._size != c && (this._setTextDirty(), this._size = c)
  3539. };
  3540. Object.defineProperty(a.prototype, "italic", {
  3541. get : function () {
  3542. return this._italic
  3543. },
  3544. set : function (c) {
  3545. this._setItalic(c)
  3546. },
  3547. enumerable : !0,
  3548. configurable : !0
  3549. });
  3550. a.prototype._setItalic = function (c) {
  3551. this._italic != c && (this._setTextDirty(), this._italic = c)
  3552. };
  3553. Object.defineProperty(a.prototype, "bold", {
  3554. get : function () {
  3555. return this._bold
  3556. },
  3557. set : function (c) {
  3558. this._setBold(c)
  3559. },
  3560. enumerable : !0,
  3561. configurable : !0
  3562. });
  3563. a.prototype._setBold = function (c) {
  3564. this._bold != c && (this._setTextDirty(), this._bold = c)
  3565. };
  3566. Object.defineProperty(a.prototype, "textColor", {
  3567. get : function () {
  3568. return this._textColor
  3569. },
  3570. set : function (c) {
  3571. this._setTextColor(c)
  3572. },
  3573. enumerable : !0,
  3574. configurable : !0
  3575. });
  3576. a.prototype._setTextColor =
  3577. function (c) {
  3578. this._textColor != c && (this._setTextDirty(), this._textColor = c, this._textColorString = b.toColorString(c))
  3579. };
  3580. Object.defineProperty(a.prototype, "strokeColor", {
  3581. get : function () {
  3582. return this._strokeColor
  3583. },
  3584. set : function (c) {
  3585. this._setStrokeColor(c)
  3586. },
  3587. enumerable : !0,
  3588. configurable : !0
  3589. });
  3590. a.prototype._setStrokeColor = function (c) {
  3591. this._strokeColor != c && (this._setTextDirty(), this._strokeColor = c, this._strokeColorString = b.toColorString(c))
  3592. };
  3593. Object.defineProperty(a.prototype, "stroke", {
  3594. get : function () {
  3595. return this._stroke
  3596. },
  3597. set : function (c) {
  3598. this._setStroke(c)
  3599. },
  3600. enumerable : !0,
  3601. configurable : !0
  3602. });
  3603. a.prototype._setStroke = function (c) {
  3604. this._stroke != c && (this._setTextDirty(), this._stroke = c)
  3605. };
  3606. Object.defineProperty(a.prototype, "textAlign", {
  3607. get : function () {
  3608. return this._textAlign
  3609. },
  3610. set : function (c) {
  3611. this._setTextAlign(c)
  3612. },
  3613. enumerable : !0,
  3614. configurable : !0
  3615. });
  3616. a.prototype._setTextAlign = function (c) {
  3617. this._textAlign != c && (this._setTextDirty(), this._textAlign = c)
  3618. };
  3619. Object.defineProperty(a.prototype, "verticalAlign", {
  3620. get : function () {
  3621. return this._verticalAlign
  3622. },
  3623. set : function (c) {
  3624. this._setVerticalAlign(c)
  3625. },
  3626. enumerable : !0,
  3627. configurable : !0
  3628. });
  3629. a.prototype._setVerticalAlign = function (c) {
  3630. this._verticalAlign != c && (this._setTextDirty(), this._verticalAlign = c)
  3631. };
  3632. Object.defineProperty(a.prototype, "maxChars", {
  3633. get : function () {
  3634. return this._maxChars
  3635. },
  3636. set : function (c) {
  3637. this._setMaxChars(c)
  3638. },
  3639. enumerable : !0,
  3640. configurable : !0
  3641. });
  3642. a.prototype._setMaxChars = function (c) {
  3643. this._maxChars != c && (this._maxChars = c)
  3644. };
  3645. Object.defineProperty(a.prototype, "scrollV", {
  3646. set : function (c) {
  3647. this._scrollV = c;
  3648. this._setDirty()
  3649. },
  3650. enumerable : !0,
  3651. configurable : !0
  3652. });
  3653. Object.defineProperty(a.prototype, "maxScrollV", {
  3654. get : function () {
  3655. return this._maxScrollV
  3656. },
  3657. enumerable : !0,
  3658. configurable : !0
  3659. });
  3660. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3661. get : function () {
  3662. return 0
  3663. },
  3664. enumerable : !0,
  3665. configurable : !0
  3666. });
  3667. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3668. get : function () {
  3669. return 0
  3670. },
  3671. enumerable : !0,
  3672. configurable : !0
  3673. });
  3674. Object.defineProperty(a.prototype, "caretIndex", {
  3675. get : function () {
  3676. return 0
  3677. },
  3678. enumerable : !0,
  3679. configurable : !0
  3680. });
  3681. a.prototype._setSelection =
  3682. function (c, a) {};
  3683. Object.defineProperty(a.prototype, "lineSpacing", {
  3684. get : function () {
  3685. return this._lineSpacing
  3686. },
  3687. set : function (c) {
  3688. this._setLineSpacing(c)
  3689. },
  3690. enumerable : !0,
  3691. configurable : !0
  3692. });
  3693. a.prototype._setLineSpacing = function (c) {
  3694. this._lineSpacing != c && (this._setTextDirty(), this._lineSpacing = c)
  3695. };
  3696. a.prototype._getLineHeight = function () {
  3697. return this._lineSpacing + this._size
  3698. };
  3699. Object.defineProperty(a.prototype, "numLines", {
  3700. get : function () {
  3701. return this._numLines
  3702. },
  3703. enumerable : !0,
  3704. configurable : !0
  3705. });
  3706. Object.defineProperty(a.prototype,
  3707. "multiline", {
  3708. get : function () {
  3709. return this._multiline
  3710. },
  3711. set : function (c) {
  3712. this._setMultiline(c)
  3713. },
  3714. enumerable : !0,
  3715. configurable : !0
  3716. });
  3717. a.prototype._setMultiline = function (c) {
  3718. this._multiline = c;
  3719. this._setDirty()
  3720. };
  3721. a.prototype.setFocus = function () {
  3722. b.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3723. };
  3724. a.prototype._onRemoveFromStage = function () {
  3725. d.prototype._onRemoveFromStage.call(this);
  3726. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3727. };
  3728. a.prototype._onAddToStage = function () {
  3729. d.prototype._onAddToStage.call(this);
  3730. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3731. };
  3732. a.prototype._updateBaseTransform = function () {
  3733. d.prototype._updateTransform.call(this)
  3734. };
  3735. a.prototype._updateTransform = function () {
  3736. this._type == b.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3737. };
  3738. a.prototype._render = function (c) {
  3739. this.drawText(c);
  3740. this._clearDirty()
  3741. };
  3742. a.prototype._measureBounds = function () {
  3743. return this.measureText()
  3744. };
  3745. Object.defineProperty(a.prototype, "textFlow", {
  3746. get : function () {
  3747. return this._textArr
  3748. },
  3749. set : function (c) {
  3750. this._isFlow = !0;
  3751. var a = "";
  3752. null == c && (c = []);
  3753. for (var b = 0; b < c.length; b++)
  3754. a += c[b].text;
  3755. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(c))
  3756. },
  3757. enumerable : !0,
  3758. configurable : !0
  3759. });
  3760. a.prototype.changeToPassText = function (c) {
  3761. if (this._displayAsPassword) {
  3762. for (var a = "", b = 0, d = c.length; b < d; b++)
  3763. switch (c.charAt(b)) {
  3764. case "\n":
  3765. a += "\n";
  3766. break;
  3767. case "\r":
  3768. break;
  3769. default:
  3770. a += "*"
  3771. }
  3772. return a
  3773. }
  3774. return c
  3775. };
  3776. a.prototype.setMiddleStyle =
  3777. function (c) {
  3778. this._isArrayChanged = !0;
  3779. this._textArr = c;
  3780. this._setSizeDirty()
  3781. };
  3782. Object.defineProperty(a.prototype, "textWidth", {
  3783. get : function () {
  3784. return this._textMaxWidth
  3785. },
  3786. enumerable : !0,
  3787. configurable : !0
  3788. });
  3789. Object.defineProperty(a.prototype, "textHeight", {
  3790. get : function () {
  3791. return this._textMaxHeight
  3792. },
  3793. enumerable : !0,
  3794. configurable : !0
  3795. });
  3796. a.prototype.appendText = function (c) {
  3797. this.appendElement({
  3798. text : c
  3799. })
  3800. };
  3801. a.prototype.appendElement = function (c) {
  3802. this._textArr.push(c);
  3803. this.setMiddleStyle(this._textArr)
  3804. };
  3805. a.prototype._getLinesArr =
  3806. function () {
  3807. if (!this._isArrayChanged)
  3808. return this._linesArr;
  3809. this._isArrayChanged = !1;
  3810. var c = this._textArr,
  3811. a = b.MainContext.instance.rendererContext;
  3812. this._linesArr = [];
  3813. this._textMaxWidth = this._textMaxHeight = 0;
  3814. if (this._hasWidthSet && 0 == this._explicitWidth)
  3815. return console.warn("\u6587\u672c\u5bbd\u5ea6\u88ab\u8bbe\u7f6e\u4e3a0"), this._numLines = 0, [{
  3816. width : 0,
  3817. height : 0,
  3818. elements : []
  3819. }
  3820. ];
  3821. var d = this._linesArr,
  3822. e = 0,
  3823. g = 0,
  3824. f = 0,
  3825. k;
  3826. this._isFlow || a.setupFont(this);
  3827. for (var m = 0; m < c.length; m++) {
  3828. var p = c[m];
  3829. p.style = p.style || {};
  3830. for (var q =
  3831. p.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  3832. null == d[f] && (k = {
  3833. width : 0,
  3834. height : 0,
  3835. elements : []
  3836. }, d[f] = k, g = e = 0);
  3837. g = this._type == b.TextFieldType.INPUT ? this._size : Math.max(g, p.style.size || this._size);
  3838. if ("" != q[r]) {
  3839. this._isFlow && a.setupFont(this, p.style);
  3840. var t = a.measureText(q[r]);
  3841. if (this._hasWidthSet)
  3842. if (e + t <= this._explicitWidth)
  3843. k.elements.push({
  3844. width : t,
  3845. text : q[r],
  3846. style : p.style
  3847. }), e += t;
  3848. else {
  3849. for (var s = 0, u = 0, v = q[r]; s < v.length; s++) {
  3850. t = a.measureText(v.charAt(s));
  3851. if (e + t > this._explicitWidth)
  3852. break;
  3853. u += t;
  3854. e += t
  3855. }
  3856. 0 < s && (k.elements.push({
  3857. width : u,
  3858. text : v.substring(0, s),
  3859. style : p.style
  3860. }), q[r] = v.substring(s));
  3861. r--
  3862. }
  3863. else
  3864. e += t, k.elements.push({
  3865. width : t,
  3866. text : q[r],
  3867. style : p.style
  3868. })
  3869. }
  3870. if (r < q.length - 1) {
  3871. k.width = e;
  3872. k.height = g;
  3873. this._textMaxWidth = Math.max(this._textMaxWidth, e);
  3874. this._textMaxHeight += g;
  3875. if (this._type == b.TextFieldType.INPUT && !this._multiline)
  3876. return this._numLines = d.length, d;
  3877. f++
  3878. }
  3879. }
  3880. m == c.length - 1 && k && (k.width = e, k.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, e), this._textMaxHeight += g)
  3881. }
  3882. this._numLines = d.length;
  3883. return d
  3884. };
  3885. a.prototype.measureText = function () {
  3886. return this._getLinesArr() ? b.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) * this._lineSpacing) : b.Rectangle.identity.initialize(0, 0, 0, 0)
  3887. };
  3888. a.prototype.drawText = function (c) {
  3889. var a = this._getLinesArr();
  3890. if (a) {
  3891. this._isFlow || c.setupFont(this);
  3892. var d = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3893. e = this._textMaxHeight + (this._numLines -
  3894. 1) * this._lineSpacing,
  3895. g = 0,
  3896. f = 0;
  3897. if (this._hasHeightSet)
  3898. if (e < this._explicitHeight) {
  3899. var k = 0;
  3900. this._verticalAlign == b.VerticalAlign.MIDDLE ? k = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (k = 1);
  3901. g += k * (this._explicitHeight - e)
  3902. } else
  3903. e > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3904. g = Math.round(g);
  3905. e = 0;
  3906. this._textAlign == b.HorizontalAlign.CENTER ? e = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (e = 1);
  3907. for (k = 0; f < this._numLines; f++) {
  3908. var m = a[f],
  3909. p = m.height,
  3910. g = g + p / 2;
  3911. if (0 != f && this._hasHeightSet &&
  3912. g > this._explicitHeight)
  3913. break;
  3914. for (var k = Math.round((d - m.width) * e), q = 0; q < m.elements.length; q++) {
  3915. var r = m.elements[q],
  3916. t = r.style.size || this._size;
  3917. this._type == b.TextFieldType.INPUT ? c.drawText(this, r.text, k, g + (p - t) / 2, r.width) : (this._isFlow && c.setupFont(this, r.style), c.drawText(this, r.text, k, g + (p - t) / 2, r.width, r.style));
  3918. k += r.width
  3919. }
  3920. g += p / 2 + this._lineSpacing
  3921. }
  3922. }
  3923. };
  3924. a.default_fontFamily = "Arial";
  3925. return a
  3926. }
  3927. (b.DisplayObject);
  3928. b.TextField = e;
  3929. e.prototype.__class__ = "egret.TextField"
  3930. })(egret || (egret = {}));
  3931. (function (b) {
  3932. var e = function () {
  3933. function b() {
  3934. this.resutlArr = []
  3935. }
  3936. b.prototype.parser = function (a) {
  3937. this.stackArray = [];
  3938. this.resutlArr = [];
  3939. for (var c = 0, b = a.length; c < b; ) {
  3940. var d = a.indexOf("<", c);
  3941. 0 > d ? (this.addToResultArr(a.substring(c)), c = b) : (this.addToResultArr(a.substring(c, d)), c = a.indexOf(">", d), "/" == a.charAt(d + 1) ? this.stackArray.pop() : this.addToArray(a.substring(d + 1, c)), c += 1)
  3942. }
  3943. return this.resutlArr
  3944. };
  3945. b.prototype.addToResultArr = function (a) {
  3946. if ("" != a) {
  3947. var c = [];
  3948. c.push(["&lt;", "<"]);
  3949. c.push(["&gt;", ">"]);
  3950. c.push(["&amp;",
  3951. "&"]);
  3952. c.push(["&quot;", '"']);
  3953. c.push(["&apos;;", "'"]);
  3954. for (var b = 0; b < c.length; b++)
  3955. a.replace(new RegExp(c[b][0], "g"), c[b][1]);
  3956. 0 < this.stackArray.length ? this.resutlArr.push({
  3957. text : a,
  3958. style : this.stackArray[this.stackArray.length - 1]
  3959. }) : this.resutlArr.push({
  3960. text : a
  3961. })
  3962. }
  3963. };
  3964. b.prototype.changeStringToObject = function (a) {
  3965. var c = {};
  3966. a = a.replace(/( )+/g, " ").split(" ");
  3967. for (var b = 0; b < a.length; b++)
  3968. this.addProperty(c, a[b]);
  3969. return c
  3970. };
  3971. b.prototype.addProperty = function (a, c) {
  3972. var b = c.replace(/( )*=( )*/g, "=").split("=");
  3973. b[1] && (b[1] =
  3974. b[1].replace(/(\"|\')/g, ""));
  3975. switch (b[0].toLowerCase()) {
  3976. case "color":
  3977. a.textColor = parseInt(b[1]);
  3978. break;
  3979. case "b":
  3980. a.bold = "true" == (b[1] || "true");
  3981. break;
  3982. case "i":
  3983. a.italic = "true" == (b[1] || "true");
  3984. break;
  3985. case "size":
  3986. a.size = parseInt(b[1]);
  3987. break;
  3988. case "fontFamily":
  3989. a.fontFamily = b[1]
  3990. }
  3991. };
  3992. b.prototype.addToArray = function (a) {
  3993. a = this.changeStringToObject(a);
  3994. if (0 != this.stackArray.length) {
  3995. var c = this.stackArray[this.stackArray.length - 1],
  3996. b;
  3997. for (b in c)
  3998. null == a[b] && (a[b] = c[b])
  3999. }
  4000. this.stackArray.push(a)
  4001. };
  4002. return b
  4003. }
  4004. ();
  4005. b.HtmlTextParser =
  4006. e;
  4007. e.prototype.__class__ = "egret.HtmlTextParser"
  4008. })(egret || (egret = {}));
  4009. (function (b) {
  4010. var e = function () {
  4011. function b() {}
  4012. b.DYNAMIC = "dynamic";
  4013. b.INPUT = "input";
  4014. return b
  4015. }
  4016. ();
  4017. b.TextFieldType = e;
  4018. e.prototype.__class__ = "egret.TextFieldType"
  4019. })(egret || (egret = {}));
  4020. __extends = this.__extends || function (b, e) {
  4021. function d() {
  4022. this.constructor = b
  4023. }
  4024. for (var a in e)
  4025. e.hasOwnProperty(a) && (b[a] = e[a]);
  4026. d.prototype = e.prototype;
  4027. b.prototype = new d
  4028. };
  4029. (function (b) {
  4030. var e = function (d) {
  4031. function a(c) {
  4032. d.call(this);
  4033. var a = c.bitmapData;
  4034. this.bitmapData = a;
  4035. this._textureMap = {};
  4036. this._sourceWidth = a.width;
  4037. this._sourceHeight = a.height;
  4038. this._bitmapX = c._bitmapX - c._offsetX;
  4039. this._bitmapY = c._bitmapY - c._offsetY
  4040. }
  4041. __extends(a, d);
  4042. a.prototype.getTexture = function (c) {
  4043. return this._textureMap[c]
  4044. };
  4045. a.prototype.createTexture = function (c, a, d, e, g, f, k, m, p) {
  4046. void 0 === f && (f = 0);
  4047. void 0 === k && (k = 0);
  4048. "undefined" === typeof m && (m = f + e);
  4049. "undefined" === typeof p && (p = k + g);
  4050. var q = new b.Texture,
  4051. r = b.MainContext.instance.rendererContext.texture_scale_factor;
  4052. q._bitmapData = this.bitmapData;
  4053. q._bitmapX = this._bitmapX + a;
  4054. q._bitmapY = this._bitmapY + d;
  4055. q._bitmapWidth = e * r;
  4056. q._bitmapHeight = g * r;
  4057. q._offsetX = f;
  4058. q._offsetY = k;
  4059. q._textureWidth = m * r;
  4060. q._textureHeight = p * r;
  4061. q._sourceWidth = this._sourceWidth;
  4062. q._sourceHeight = this._sourceHeight;
  4063. return this._textureMap[c] = q
  4064. };
  4065. return a
  4066. }
  4067. (b.HashObject);
  4068. b.SpriteSheet = e;
  4069. e.prototype.__class__ = "egret.SpriteSheet"
  4070. })(egret || (egret = {}));
  4071. __extends = this.__extends || function (b, e) {
  4072. function d() {
  4073. this.constructor = b
  4074. }
  4075. for (var a in e)
  4076. e.hasOwnProperty(a) && (b[a] = e[a]);
  4077. d.prototype = e.prototype;
  4078. b.prototype = new d
  4079. };
  4080. (function (b) {
  4081. var e = function (d) {
  4082. function a() {
  4083. d.call(this);
  4084. this._isFocus = !1;
  4085. this._isFirst = this._isFirst = !0
  4086. }
  4087. __extends(a, d);
  4088. a.prototype.init = function (c) {
  4089. this._text = c;
  4090. this.stageText = b.StageText.create();
  4091. c = this._text.localToGlobal();
  4092. this.stageText._open(c.x, c.y, this._text._explicitWidth, this._text._explicitHeight)
  4093. };
  4094. a.prototype._addStageText = function () {
  4095. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4096. this.stageText._add();
  4097. this.stageText._addListeners();
  4098. this.stageText.addEventListener("blur", this.onBlurHandler,
  4099. this);
  4100. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4101. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4102. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4103. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  4104. };
  4105. a.prototype._removeStageText = function () {
  4106. this.stageText._remove();
  4107. this.stageText._removeListeners();
  4108. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4109. this.stageText.removeEventListener("blur",
  4110. this.onBlurHandler, this);
  4111. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4112. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4113. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4114. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  4115. };
  4116. a.prototype._getText = function () {
  4117. return this.stageText._getText()
  4118. };
  4119. a.prototype._setText = function (c) {
  4120. this.stageText._setText(c)
  4121. };
  4122. a.prototype.onFocusHandler =
  4123. function (c) {
  4124. this.hideText()
  4125. };
  4126. a.prototype.onBlurHandler = function (c) {
  4127. this.showText()
  4128. };
  4129. a.prototype.onMouseDownHandler = function (c) {
  4130. c.stopPropagation();
  4131. this._text._visible && this.stageText._show()
  4132. };
  4133. a.prototype.onStageDownHandler = function (c) {
  4134. this.stageText._hide();
  4135. this.showText()
  4136. };
  4137. a.prototype.showText = function () {
  4138. this._isFocus && (this._isFocus = !1, this.resetText())
  4139. };
  4140. a.prototype.hideText = function () {
  4141. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4142. };
  4143. a.prototype.updateTextHandler = function (c) {
  4144. this.resetText();
  4145. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4146. };
  4147. a.prototype.resetText = function () {
  4148. this._text._setBaseText(this.stageText._getText())
  4149. };
  4150. a.prototype._updateTransform = function () {
  4151. var c = this._text._worldTransform.a,
  4152. a = this._text._worldTransform.b,
  4153. d = this._text._worldTransform.c,
  4154. e = this._text._worldTransform.d,
  4155. g = this._text._worldTransform.tx,
  4156. f = this._text._worldTransform.ty;
  4157. this._text._updateBaseTransform();
  4158. var k = this._text._worldTransform;
  4159. if (this._isFirst || c != k.a || a != k.b || d != k.c || e != k.d || g != k.tx || f !=
  4160. k.ty) {
  4161. this._isFirst = !1;
  4162. c = this._text.localToGlobal();
  4163. this.stageText.changePosition(c.x, c.y);
  4164. var m = this;
  4165. b.callLater(function () {
  4166. m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
  4167. }, this)
  4168. }
  4169. };
  4170. a.prototype._updateProperties = function () {
  4171. var c = this._text._stage;
  4172. if (null == c)
  4173. this.stageText._setVisible(!1);
  4174. else {
  4175. for (var a = this._text, d = a._visible; d; ) {
  4176. a = a.parent;
  4177. if (a == c)
  4178. break;
  4179. d = a._visible
  4180. }
  4181. this.stageText._setVisible(d)
  4182. }
  4183. this.stageText._setMultiline(this._text._multiline);
  4184. this.stageText._setMaxChars(this._text._maxChars);
  4185. this.stageText._setSize(this._text._size);
  4186. this.stageText._setTextColor(this._text._textColorString);
  4187. this.stageText._setTextFontFamily(this._text._fontFamily);
  4188. this.stageText._setBold(this._text._bold);
  4189. this.stageText._setItalic(this._text._italic);
  4190. this.stageText._setTextAlign(this._text._textAlign);
  4191. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4192. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4193. this.stageText._setTextType(this._text._displayAsPassword ?
  4194. "password" : "text");
  4195. this.stageText._setText(this._text._text);
  4196. this.stageText._resetStageText();
  4197. this._updateTransform()
  4198. };
  4199. return a
  4200. }
  4201. (b.HashObject);
  4202. b.InputController = e;
  4203. e.prototype.__class__ = "egret.InputController"
  4204. })(egret || (egret = {}));
  4205. __extends = this.__extends || function (b, e) {
  4206. function d() {
  4207. this.constructor = b
  4208. }
  4209. for (var a in e)
  4210. e.hasOwnProperty(a) && (b[a] = e[a]);
  4211. d.prototype = e.prototype;
  4212. b.prototype = new d
  4213. };
  4214. (function (b) {
  4215. var e = function (b) {
  4216. function a(a, l) {
  4217. b.call(this, a);
  4218. this.charList = this.parseConfig(l)
  4219. }
  4220. __extends(a, b);
  4221. a.prototype.getTexture = function (a) {
  4222. var b = this._textureMap[a];
  4223. if (!b) {
  4224. b = this.charList[a];
  4225. if (!b)
  4226. return null;
  4227. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  4228. this._textureMap[a] = b
  4229. }
  4230. return b
  4231. };
  4232. a.prototype.parseConfig = function (a) {
  4233. a = a.split("\r\n").join("\n");
  4234. a = a.split("\n");
  4235. for (var b = this.getConfigByKey(a[3], "count"), d = {}, e = 4; e < 4 + b; e++) {
  4236. var g = a[e],
  4237. f = String.fromCharCode(this.getConfigByKey(g,
  4238. "id")),
  4239. k = {};
  4240. d[f] = k;
  4241. k.x = this.getConfigByKey(g, "x");
  4242. k.y = this.getConfigByKey(g, "y");
  4243. k.width = this.getConfigByKey(g, "width");
  4244. k.height = this.getConfigByKey(g, "height");
  4245. k.offsetX = this.getConfigByKey(g, "xoffset");
  4246. k.offsetY = this.getConfigByKey(g, "yoffset")
  4247. }
  4248. return d
  4249. };
  4250. a.prototype.getConfigByKey = function (a, b) {
  4251. for (var d = a.split(" "), e = 0, g = d.length; e < g; e++) {
  4252. var f = d[e];
  4253. if (b == f.substring(0, b.length))
  4254. return d = f.substring(b.length + 1), parseInt(d)
  4255. }
  4256. return 0
  4257. };
  4258. return a
  4259. }
  4260. (b.SpriteSheet);
  4261. b.BitmapTextSpriteSheet = e;
  4262. e.prototype.__class__ =
  4263. "egret.BitmapTextSpriteSheet"
  4264. })(egret || (egret = {}));
  4265. __extends = this.__extends || function (b, e) {
  4266. function d() {
  4267. this.constructor = b
  4268. }
  4269. for (var a in e)
  4270. e.hasOwnProperty(a) && (b[a] = e[a]);
  4271. d.prototype = e.prototype;
  4272. b.prototype = new d
  4273. };
  4274. (function (b) {
  4275. var e = function (a) {
  4276. function c(c, e) {
  4277. a.call(this);
  4278. this.frameRate = 60;
  4279. c instanceof d ? (b.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = c) : this.delegate = new d(c, e);
  4280. this.delegate.setMovieClip(this)
  4281. }
  4282. __extends(c, a);
  4283. c.prototype.gotoAndPlay = function (a) {
  4284. this.delegate.gotoAndPlay(a)
  4285. };
  4286. c.prototype.gotoAndStop = function (a) {
  4287. this.delegate.gotoAndStop(a)
  4288. };
  4289. c.prototype.stop =
  4290. function () {
  4291. this.delegate.stop()
  4292. };
  4293. c.prototype.dispose = function () {
  4294. this.delegate.dispose()
  4295. };
  4296. c.prototype.release = function () {
  4297. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4298. this.dispose()
  4299. };
  4300. c.prototype.getCurrentFrameIndex = function () {
  4301. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4302. return this.delegate._currentFrameIndex
  4303. };
  4304. c.prototype.getTotalFrame = function () {
  4305. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4306. return this.delegate._totalFrame
  4307. };
  4308. c.prototype.setInterval = function (a) {
  4309. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4310. this.frameRate = 60 / a
  4311. };
  4312. c.prototype.getIsPlaying = function () {
  4313. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4314. return this.delegate.isPlaying
  4315. };
  4316. return c
  4317. }
  4318. (b.DisplayObjectContainer);
  4319. b.MovieClip = e;
  4320. e.prototype.__class__ = "egret.MovieClip";
  4321. var d = function () {
  4322. function a(a, d) {
  4323. this.data = a;
  4324. this._currentFrameIndex = this._passTime =
  4325. this._totalFrame = 0;
  4326. this._isPlaying = !1;
  4327. this._frameData = a;
  4328. this._spriteSheet = new b.SpriteSheet(d)
  4329. }
  4330. a.prototype.setMovieClip = function (a) {
  4331. this.movieClip = a;
  4332. this.bitmap = new b.Bitmap;
  4333. this.movieClip.addChild(this.bitmap)
  4334. };
  4335. a.prototype.gotoAndPlay = function (a) {
  4336. this.checkHasFrame(a);
  4337. this._isPlaying = !0;
  4338. this._currentFrameIndex = 0;
  4339. this._currentFrameName = a;
  4340. this._totalFrame = this._frameData.frames[a].totalFrame;
  4341. this.playNextFrame();
  4342. this._passTime = 0;
  4343. b.Ticker.getInstance().register(this.update, this)
  4344. };
  4345. a.prototype.gotoAndStop =
  4346. function (a) {
  4347. this.checkHasFrame(a);
  4348. this.stop();
  4349. this._currentFrameIndex = this._passTime = 0;
  4350. this._currentFrameName = a;
  4351. this._totalFrame = this._frameData.frames[a].totalFrame;
  4352. this.playNextFrame()
  4353. };
  4354. a.prototype.stop = function () {
  4355. this._isPlaying = !1;
  4356. b.Ticker.getInstance().unregister(this.update, this)
  4357. };
  4358. a.prototype.dispose = function () {};
  4359. a.prototype.checkHasFrame = function (a) {
  4360. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  4361. };
  4362. a.prototype.update = function (a) {
  4363. for (var b =
  4364. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b; )
  4365. 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  4366. this._passTime += a
  4367. };
  4368. a.prototype.playNextFrame = function (a) {
  4369. void 0 === a && (a = !0);
  4370. var d = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4371. if (a) {
  4372. a = this.getTexture(d.res);
  4373. var e = this.bitmap;
  4374. e.x = d.x;
  4375. e.y = d.y;
  4376. e.texture = a
  4377. }
  4378. null != d.action && this.movieClip.dispatchEventWith(d.action);
  4379. this._currentFrameIndex++;
  4380. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4381. 0, d.action != b.Event.COMPLETE && this.movieClip.dispatchEventWith(b.Event.COMPLETE))
  4382. };
  4383. a.prototype.getTexture = function (a) {
  4384. var b = this._frameData.res[a],
  4385. d = this._spriteSheet.getTexture(a);
  4386. d || (d = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4387. return d
  4388. };
  4389. return a
  4390. }
  4391. ();
  4392. b.DefaultMovieClipDelegate = d;
  4393. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4394. })(egret || (egret = {}));
  4395. __extends = this.__extends || function (b, e) {
  4396. function d() {
  4397. this.constructor = b
  4398. }
  4399. for (var a in e)
  4400. e.hasOwnProperty(a) && (b[a] = e[a]);
  4401. d.prototype = e.prototype;
  4402. b.prototype = new d
  4403. };
  4404. (function (b) {
  4405. var e = function (b) {
  4406. function a() {
  4407. b.call(this);
  4408. this._scaleY = this._scaleX = 1;
  4409. this._size = 30;
  4410. this._color = "#FFFFFF";
  4411. this._fontFamily = "Arial";
  4412. this._italic = this._bold = !1;
  4413. this._textAlign = "left";
  4414. this._multiline = this._visible = !1;
  4415. this._maxChars = 0
  4416. }
  4417. __extends(a, b);
  4418. a.prototype._getText = function () {
  4419. return null
  4420. };
  4421. a.prototype._setText = function (a) {};
  4422. a.prototype._setTextType = function (a) {};
  4423. a.prototype._getTextType = function () {
  4424. return null
  4425. };
  4426. a.prototype._open = function (a, b, d, e) {};
  4427. a.prototype._show = function () {};
  4428. a.prototype._add =
  4429. function () {};
  4430. a.prototype._remove = function () {};
  4431. a.prototype._hide = function () {};
  4432. a.prototype._addListeners = function () {};
  4433. a.prototype._removeListeners = function () {};
  4434. a.prototype._setScale = function (a, b) {
  4435. this._scaleX = a;
  4436. this._scaleY = b
  4437. };
  4438. a.prototype.changePosition = function (a, b) {};
  4439. a.prototype._setSize = function (a) {
  4440. this._size = a
  4441. };
  4442. a.prototype._setTextColor = function (a) {
  4443. this._color = a
  4444. };
  4445. a.prototype._setTextFontFamily = function (a) {
  4446. this._fontFamily = a
  4447. };
  4448. a.prototype._setBold = function (a) {
  4449. this._bold = a
  4450. };
  4451. a.prototype._setItalic =
  4452. function (a) {
  4453. this._italic = a
  4454. };
  4455. a.prototype._setTextAlign = function (a) {
  4456. this._textAlign = a
  4457. };
  4458. a.prototype._setVisible = function (a) {
  4459. this._visible = a
  4460. };
  4461. a.prototype._setWidth = function (a) {};
  4462. a.prototype._setHeight = function (a) {};
  4463. a.prototype._setMultiline = function (a) {
  4464. this._multiline = a
  4465. };
  4466. a.prototype._setMaxChars = function (a) {
  4467. this._maxChars = a
  4468. };
  4469. a.prototype._resetStageText = function () {};
  4470. a.create = function () {
  4471. return null
  4472. };
  4473. return a
  4474. }
  4475. (b.EventDispatcher);
  4476. b.StageText = e;
  4477. e.prototype.__class__ = "egret.StageText"
  4478. })(egret || (egret = {}));
  4479. (function (b) {
  4480. var e = function () {
  4481. function b() {}
  4482. b.GET = "get";
  4483. b.POST = "post";
  4484. return b
  4485. }
  4486. ();
  4487. b.URLRequestMethod = e;
  4488. e.prototype.__class__ = "egret.URLRequestMethod"
  4489. })(egret || (egret = {}));
  4490. (function (b) {
  4491. var e = function () {
  4492. function b() {}
  4493. b.BINARY = "binary";
  4494. b.TEXT = "text";
  4495. b.VARIABLES = "variables";
  4496. b.TEXTURE = "texture";
  4497. b.SOUND = "sound";
  4498. return b
  4499. }
  4500. ();
  4501. b.URLLoaderDataFormat = e;
  4502. e.prototype.__class__ = "egret.URLLoaderDataFormat"
  4503. })(egret || (egret = {}));
  4504. __extends = this.__extends || function (b, e) {
  4505. function d() {
  4506. this.constructor = b
  4507. }
  4508. for (var a in e)
  4509. e.hasOwnProperty(a) && (b[a] = e[a]);
  4510. d.prototype = e.prototype;
  4511. b.prototype = new d
  4512. };
  4513. (function (b) {
  4514. var e = function (b) {
  4515. function a(a) {
  4516. void 0 === a && (a = null);
  4517. b.call(this);
  4518. null !== a && this.decode(a)
  4519. }
  4520. __extends(a, b);
  4521. a.prototype.decode = function (a) {
  4522. this.variables || (this.variables = {});
  4523. a = a.split("+").join(" ");
  4524. for (var b, d = /[?&]?([^=]+)=([^&]*)/g; b = d.exec(a); )
  4525. this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  4526. };
  4527. a.prototype.toString = function () {
  4528. if (!this.variables)
  4529. return "";
  4530. var a = this.variables,
  4531. b = "",
  4532. d = !0,
  4533. e;
  4534. for (e in a)
  4535. d ? d = !1 : b += "&", b += e + "=" + a[e];
  4536. return b
  4537. };
  4538. return a
  4539. }
  4540. (b.HashObject);
  4541. b.URLVariables =
  4542. e;
  4543. e.prototype.__class__ = "egret.URLVariables"
  4544. })(egret || (egret = {}));
  4545. (function (b) {
  4546. var e = function () {
  4547. return function (b, a) {
  4548. this.name = b;
  4549. this.value = a
  4550. }
  4551. }
  4552. ();
  4553. b.URLRequestHeader = e;
  4554. e.prototype.__class__ = "egret.URLRequestHeader"
  4555. })(egret || (egret = {}));
  4556. __extends = this.__extends || function (b, e) {
  4557. function d() {
  4558. this.constructor = b
  4559. }
  4560. for (var a in e)
  4561. e.hasOwnProperty(a) && (b[a] = e[a]);
  4562. d.prototype = e.prototype;
  4563. b.prototype = new d
  4564. };
  4565. (function (b) {
  4566. var e = function (d) {
  4567. function a(a) {
  4568. void 0 === a && (a = null);
  4569. d.call(this);
  4570. this.method = b.URLRequestMethod.GET;
  4571. this.url = a
  4572. }
  4573. __extends(a, d);
  4574. return a
  4575. }
  4576. (b.HashObject);
  4577. b.URLRequest = e;
  4578. e.prototype.__class__ = "egret.URLRequest"
  4579. })(egret || (egret = {}));
  4580. __extends = this.__extends || function (b, e) {
  4581. function d() {
  4582. this.constructor = b
  4583. }
  4584. for (var a in e)
  4585. e.hasOwnProperty(a) && (b[a] = e[a]);
  4586. d.prototype = e.prototype;
  4587. b.prototype = new d
  4588. };
  4589. (function (b) {
  4590. var e = function (d) {
  4591. function a(a) {
  4592. void 0 === a && (a = null);
  4593. d.call(this);
  4594. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  4595. this._status = -1;
  4596. a && this.load(a)
  4597. }
  4598. __extends(a, d);
  4599. a.prototype.load = function (a) {
  4600. this._request = a;
  4601. this.data = null;
  4602. b.MainContext.instance.netContext.proceed(this)
  4603. };
  4604. return a
  4605. }
  4606. (b.EventDispatcher);
  4607. b.URLLoader = e;
  4608. e.prototype.__class__ = "egret.URLLoader"
  4609. })(egret || (egret = {}));
  4610. __extends = this.__extends || function (b, e) {
  4611. function d() {
  4612. this.constructor = b
  4613. }
  4614. for (var a in e)
  4615. e.hasOwnProperty(a) && (b[a] = e[a]);
  4616. d.prototype = e.prototype;
  4617. b.prototype = new d
  4618. };
  4619. (function (b) {
  4620. var e = function (d) {
  4621. function a() {
  4622. d.call(this);
  4623. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4624. }
  4625. __extends(a, d);
  4626. Object.defineProperty(a.prototype, "textureWidth", {
  4627. get : function () {
  4628. return this._textureWidth
  4629. },
  4630. enumerable : !0,
  4631. configurable : !0
  4632. });
  4633. Object.defineProperty(a.prototype, "textureHeight", {
  4634. get : function () {
  4635. return this._textureHeight
  4636. },
  4637. enumerable : !0,
  4638. configurable : !0
  4639. });
  4640. Object.defineProperty(a.prototype, "bitmapData", {
  4641. get : function () {
  4642. return this._bitmapData
  4643. },
  4644. enumerable : !0,
  4645. configurable : !0
  4646. });
  4647. a.prototype._setBitmapData = function (a) {
  4648. var d = b.MainContext.instance.rendererContext.texture_scale_factor;
  4649. this._bitmapData = a;
  4650. this._sourceWidth = a.width;
  4651. this._sourceHeight = a.height;
  4652. this._textureWidth = this._sourceWidth * d;
  4653. this._textureHeight = this._sourceHeight * d;
  4654. this._bitmapWidth = this._textureWidth;
  4655. this._bitmapHeight = this._textureHeight;
  4656. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4657. };
  4658. a.prototype.getPixel32 = function (a, b) {
  4659. return this._bitmapData.getContext("2d").getImageData(a,
  4660. b, 1, 1).data
  4661. };
  4662. return a
  4663. }
  4664. (b.HashObject);
  4665. b.Texture = e;
  4666. e.prototype.__class__ = "egret.Texture"
  4667. })(egret || (egret = {}));
  4668. __extends = this.__extends || function (b, e) {
  4669. function d() {
  4670. this.constructor = b
  4671. }
  4672. for (var a in e)
  4673. e.hasOwnProperty(a) && (b[a] = e[a]);
  4674. d.prototype = e.prototype;
  4675. b.prototype = new d
  4676. };
  4677. (function (b) {
  4678. var e = function (d) {
  4679. function a() {
  4680. d.call(this);
  4681. this._bitmapData = document.createElement("canvas");
  4682. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  4683. }
  4684. __extends(a, d);
  4685. a.prototype.drawToTexture = function (c) {
  4686. var d = this._bitmapData,
  4687. e = c.getBounds(b.Rectangle.identity);
  4688. if (0 == e.width || 0 == e.height)
  4689. return b.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4690. e.width = Math.floor(e.width);
  4691. e.height = Math.floor(e.height);
  4692. d.width = e.width;
  4693. d.height = e.height;
  4694. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e.width, this.renderContext._cacheCanvas.height = e.height);
  4695. a.identityRectangle.width = e.width;
  4696. a.identityRectangle.height = e.height;
  4697. c._worldTransform.identity();
  4698. c.worldAlpha = 1;
  4699. if (c instanceof b.DisplayObjectContainer) {
  4700. var d = c._anchorOffsetX,
  4701. n = c._anchorOffsetY;
  4702. if (0 != c._anchorX || 0 != c._anchorY)
  4703. d = c._anchorX * e.width, n = c._anchorY * e.height;
  4704. this._offsetX = e.x + d;
  4705. this._offsetY = e.y +
  4706. n;
  4707. c._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4708. e = c._children;
  4709. d = 0;
  4710. for (n = e.length; d < n; d++)
  4711. e[d]._updateTransform()
  4712. }
  4713. e = b.RenderFilter.getInstance();
  4714. d = e._drawAreaList.concat();
  4715. e._drawAreaList.length = 0;
  4716. this.renderContext.clearScreen();
  4717. this.renderContext.onRenderStart();
  4718. this.webGLTexture = null;
  4719. (n = c.mask || c._scrollRect) && this.renderContext.pushMask(n);
  4720. c._render(this.renderContext);
  4721. n && this.renderContext.popMask();
  4722. e.addDrawArea(a.identityRectangle);
  4723. this.renderContext.onRenderFinish();
  4724. e._drawAreaList =
  4725. d;
  4726. this._textureWidth = this._bitmapData.width;
  4727. this._textureHeight = this._bitmapData.height;
  4728. this._sourceWidth = this._textureWidth;
  4729. this._sourceHeight = this._textureHeight;
  4730. return !0
  4731. };
  4732. a.identityRectangle = new b.Rectangle;
  4733. return a
  4734. }
  4735. (b.Texture);
  4736. b.RenderTexture = e;
  4737. e.prototype.__class__ = "egret.RenderTexture"
  4738. })(egret || (egret = {}));
  4739. __extends = this.__extends || function (b, e) {
  4740. function d() {
  4741. this.constructor = b
  4742. }
  4743. for (var a in e)
  4744. e.hasOwnProperty(a) && (b[a] = e[a]);
  4745. d.prototype = e.prototype;
  4746. b.prototype = new d
  4747. };
  4748. (function (b) {
  4749. var e = function (d) {
  4750. function a() {
  4751. d.call(this);
  4752. this.renderCost = 0;
  4753. this.texture_scale_factor = 1;
  4754. this.profiler = b.Profiler.getInstance()
  4755. }
  4756. __extends(a, d);
  4757. a.prototype.clearScreen = function () {};
  4758. a.prototype.clearRect = function (a, b, d, e) {};
  4759. a.prototype.drawImage = function (a, b, d, e, g, f, k, m, p, q) {
  4760. this.profiler.onDrawImage()
  4761. };
  4762. a.prototype.setTransform = function (a) {};
  4763. a.prototype.setAlpha = function (a, b) {};
  4764. a.prototype.setupFont = function (a, b) {};
  4765. a.prototype.measureText = function (a) {
  4766. return 0
  4767. };
  4768. a.prototype.drawText = function (a,
  4769. b, d, e, g, f) {
  4770. this.profiler.onDrawImage()
  4771. };
  4772. a.prototype.strokeRect = function (a, b, d, e, g) {};
  4773. a.prototype.pushMask = function (a) {};
  4774. a.prototype.popMask = function () {};
  4775. a.prototype.onRenderStart = function () {};
  4776. a.prototype.onRenderFinish = function () {};
  4777. a.prototype.setGlobalColorTransform = function (a) {};
  4778. a.createRendererContext = function (a) {
  4779. return null
  4780. };
  4781. a.imageSmoothingEnabled = !0;
  4782. return a
  4783. }
  4784. (b.HashObject);
  4785. b.RendererContext = e;
  4786. e.prototype.__class__ = "egret.RendererContext"
  4787. })(egret || (egret = {}));
  4788. (function (b) {
  4789. var e = function () {
  4790. function b() {}
  4791. b.MOUSE = "mouse";
  4792. b.TOUCH = "touch";
  4793. b.mode = "touch";
  4794. return b
  4795. }
  4796. ();
  4797. b.InteractionMode = e;
  4798. e.prototype.__class__ = "egret.InteractionMode"
  4799. })(egret || (egret = {}));
  4800. __extends = this.__extends || function (b, e) {
  4801. function d() {
  4802. this.constructor = b
  4803. }
  4804. for (var a in e)
  4805. e.hasOwnProperty(a) && (b[a] = e[a]);
  4806. d.prototype = e.prototype;
  4807. b.prototype = new d
  4808. };
  4809. (function (b) {
  4810. var e = function (d) {
  4811. function a() {
  4812. d.call(this);
  4813. this._currentTouchTarget = {};
  4814. this.maxTouches = 2;
  4815. this.touchDownTarget = {};
  4816. this.touchingIdentifiers = [];
  4817. this.lastTouchY = this.lastTouchX = -1
  4818. }
  4819. __extends(a, d);
  4820. a.prototype.run = function () {};
  4821. a.prototype.getTouchData = function (a, b, d) {
  4822. var e = this._currentTouchTarget[a];
  4823. null == e && (e = {}, this._currentTouchTarget[a] = e);
  4824. e.stageX = b;
  4825. e.stageY = d;
  4826. e.identifier = a;
  4827. return e
  4828. };
  4829. a.prototype.dispatchEvent = function (a, d) {
  4830. b.TouchEvent.dispatchTouchEvent(d.target, a, d.identifier, d.stageX,
  4831. d.stageY, !1, !1, !1, !0 == this.touchDownTarget[d.identifier])
  4832. };
  4833. a.prototype.onTouchBegan = function (a, d, e) {
  4834. if (this.touchingIdentifiers.length != this.maxTouches) {
  4835. var n = b.MainContext.instance.stage.hitTest(a, d);
  4836. n && (a = this.getTouchData(e, a, d), this.touchDownTarget[e] = !0, a.target = n, a.beginTarget = n, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  4837. this.touchingIdentifiers.push(e)
  4838. }
  4839. };
  4840. a.prototype.onTouchMove = function (a, d, e) {
  4841. if (-1 != this.touchingIdentifiers.indexOf(e) && (a != this.lastTouchX || d != this.lastTouchY)) {
  4842. this.lastTouchX =
  4843. a;
  4844. this.lastTouchY = d;
  4845. var n = b.MainContext.instance.stage.hitTest(a, d);
  4846. n && (a = this.getTouchData(e, a, d), a.target = n, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  4847. }
  4848. };
  4849. a.prototype.onTouchEnd = function (a, d, e) {
  4850. var n = this.touchingIdentifiers.indexOf(e);
  4851. -1 != n && (this.touchingIdentifiers.splice(n, 1), n = b.MainContext.instance.stage.hitTest(a, d)) && (a = this.getTouchData(e, a, d), delete this.touchDownTarget[e], e = a.beginTarget, a.target = n, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), e == n ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  4852. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4853. };
  4854. return a
  4855. }
  4856. (b.HashObject);
  4857. b.TouchContext = e;
  4858. e.prototype.__class__ = "egret.TouchContext"
  4859. })(egret || (egret = {}));
  4860. __extends = this.__extends || function (b, e) {
  4861. function d() {
  4862. this.constructor = b
  4863. }
  4864. for (var a in e)
  4865. e.hasOwnProperty(a) && (b[a] = e[a]);
  4866. d.prototype = e.prototype;
  4867. b.prototype = new d
  4868. };
  4869. (function (b) {
  4870. var e = function (d) {
  4871. function a() {
  4872. d.call(this)
  4873. }
  4874. __extends(a, d);
  4875. a.prototype.proceed = function (a) {};
  4876. a._getUrl = function (a) {
  4877. var d = a.url;
  4878. -1 == d.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (d = d + "?" + a.data.toString());
  4879. return d
  4880. };
  4881. a.prototype.getChangeList = function () {
  4882. return []
  4883. };
  4884. return a
  4885. }
  4886. (b.HashObject);
  4887. b.NetContext = e;
  4888. e.prototype.__class__ = "egret.NetContext"
  4889. })(egret || (egret = {}));
  4890. __extends = this.__extends || function (b, e) {
  4891. function d() {
  4892. this.constructor = b
  4893. }
  4894. for (var a in e)
  4895. e.hasOwnProperty(a) && (b[a] = e[a]);
  4896. d.prototype = e.prototype;
  4897. b.prototype = new d
  4898. };
  4899. (function (b) {
  4900. var e = function (b) {
  4901. function a() {
  4902. b.call(this);
  4903. this.frameRate = 60
  4904. }
  4905. __extends(a, b);
  4906. a.prototype.executeMainLoop = function (a, b) {};
  4907. return a
  4908. }
  4909. (b.HashObject);
  4910. b.DeviceContext = e;
  4911. e.prototype.__class__ = "egret.DeviceContext"
  4912. })(egret || (egret = {}));
  4913. (function (b) {
  4914. var e = function () {
  4915. function b() {}
  4916. b.call = function (a, c) {};
  4917. b.addCallback = function (a, c) {};
  4918. return b
  4919. }
  4920. ();
  4921. b.ExternalInterface = e;
  4922. e.prototype.__class__ = "egret.ExternalInterface"
  4923. })(egret || (egret = {}));
  4924. __extends = this.__extends || function (b, e) {
  4925. function d() {
  4926. this.constructor = b
  4927. }
  4928. for (var a in e)
  4929. e.hasOwnProperty(a) && (b[a] = e[a]);
  4930. d.prototype = e.prototype;
  4931. b.prototype = new d
  4932. };
  4933. (function (b) {
  4934. var e = function (d) {
  4935. function a() {
  4936. d.call(this);
  4937. this.ua = navigator.userAgent.toLowerCase();
  4938. this.trans = this._getTrans()
  4939. }
  4940. __extends(a, d);
  4941. a.getInstance = function () {
  4942. null == a.instance && (a.instance = new a);
  4943. return a.instance
  4944. };
  4945. Object.defineProperty(a.prototype, "isMobile", {
  4946. get : function () {
  4947. 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 ");
  4948. return b.MainContext.deviceType ==
  4949. b.MainContext.DEVICE_MOBILE
  4950. },
  4951. enumerable : !0,
  4952. configurable : !0
  4953. });
  4954. a.prototype._getHeader = function (a) {
  4955. if ("transform" in a)
  4956. return "";
  4957. for (var b = ["webkit", "ms", "Moz", "O"], d = 0; d < b.length; d++)
  4958. if (b[d] + "Transform" in a)
  4959. return b[d];
  4960. return ""
  4961. };
  4962. a.prototype._getTrans = function () {
  4963. var a = document.createElement("div").style,
  4964. a = this._getHeader(a);
  4965. return "" == a ? "transform" : a + "Transform"
  4966. };
  4967. a.prototype.$new = function (a) {
  4968. return this.$(document.createElement(a))
  4969. };
  4970. a.prototype.$ = function (c) {
  4971. var d = document;
  4972. if (c = c instanceof HTMLElement ?
  4973. c : d.querySelector(c))
  4974. c.find = c.find || this.$, c.hasClass = c.hasClass || function (a) {
  4975. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4976. },
  4977. c.addClass = c.addClass || function (a) {
  4978. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4979. return this
  4980. },
  4981. c.removeClass = c.removeClass || function (a) {
  4982. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4983. return this
  4984. },
  4985. c.remove = c.remove || function () {},
  4986. c.appendTo = c.appendTo || function (a) {
  4987. a.appendChild(this);
  4988. return this
  4989. },
  4990. c.prependTo = c.prependTo ||
  4991. function (a) {
  4992. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4993. return this
  4994. },
  4995. c.transforms = c.transforms || function () {
  4996. 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);
  4997. return this
  4998. },
  4999. c.position = c.position || {
  5000. x : 0,
  5001. y : 0
  5002. },
  5003. c.rotation = c.rotation || 0,
  5004. c.scale = c.scale || {
  5005. x : 1,
  5006. y : 1
  5007. },
  5008. c.skew = c.skew || {
  5009. x : 0,
  5010. y : 0
  5011. },
  5012. c.translates = function (a, c) {
  5013. this.position.x = a;
  5014. this.position.y = c -
  5015. b.MainContext.instance.stage.stageHeight;
  5016. this.transforms();
  5017. return this
  5018. },
  5019. c.rotate = function (a) {
  5020. this.rotation = a;
  5021. this.transforms();
  5022. return this
  5023. },
  5024. c.resize = function (a, c) {
  5025. this.scale.x = a;
  5026. this.scale.y = c;
  5027. this.transforms();
  5028. return this
  5029. },
  5030. c.setSkew = function (a, c) {
  5031. this.skew.x = a;
  5032. this.skew.y = c;
  5033. this.transforms();
  5034. return this
  5035. };
  5036. return c
  5037. };
  5038. a.prototype.translate = function (a) {
  5039. return "translate(" + a.x + "px, " + a.y + "px) "
  5040. };
  5041. a.prototype.rotate = function (a) {
  5042. return "rotate(" + a + "deg) "
  5043. };
  5044. a.prototype.scale = function (a) {
  5045. return "scale(" + a.x + ", " +
  5046. a.y + ") "
  5047. };
  5048. a.prototype.skew = function (a) {
  5049. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5050. };
  5051. return a
  5052. }
  5053. (b.HashObject);
  5054. b.Browser = e;
  5055. e.prototype.__class__ = "egret.Browser"
  5056. })(egret || (egret = {}));
  5057. (function (b) {
  5058. (function (b) {
  5059. b.getItem = function (b) {
  5060. return null
  5061. };
  5062. b.setItem = function (b, a) {
  5063. return !1
  5064. };
  5065. b.removeItem = function (b) {};
  5066. b.clear = function () {}
  5067. })(b.localStorage || (b.localStorage = {}))
  5068. })(egret || (egret = {}));
  5069. (function (b) {
  5070. var e = function () {
  5071. function d() {}
  5072. d.parse = function (a) {
  5073. a = b.SAXParser.getInstance().parserXML(a);
  5074. if (!a || !a.childNodes)
  5075. return null;
  5076. for (var c = a.childNodes.length, e = !1, h = 0; h < c; h++) {
  5077. var n = a.childNodes[h];
  5078. if (1 == n.nodeType) {
  5079. e = !0;
  5080. break
  5081. }
  5082. }
  5083. return e ? d.parseNode(n) : null
  5084. };
  5085. d.parseNode = function (a) {
  5086. if (!a || 1 != a.nodeType)
  5087. return null;
  5088. var c = {};
  5089. c.localName = a.localName;
  5090. c.name = a.nodeName;
  5091. a.namespaceURI && (c.namespace = a.namespaceURI);
  5092. a.prefix && (c.prefix = a.prefix);
  5093. for (var b = a.attributes, e = b.length, n = 0; n < e; n++) {
  5094. var g =
  5095. b[n],
  5096. f = g.name;
  5097. 0 != f.indexOf("xmlns:") && (c["$" + f] = g.value)
  5098. }
  5099. b = a.childNodes;
  5100. e = b.length;
  5101. for (n = 0; n < e; n++)
  5102. if (g = d.parseNode(b[n]))
  5103. c.children || (c.children = []), g.parent = c, c.children.push(g);
  5104. !c.children && (a = a.textContent.trim()) && (c.text = a);
  5105. return c
  5106. };
  5107. d.findChildren = function (a, c, b) {
  5108. b ? b.length = 0 : b = [];
  5109. d.findByPath(a, c, b);
  5110. return b
  5111. };
  5112. d.findByPath = function (a, c, b) {
  5113. var e = c.indexOf("."),
  5114. n;
  5115. -1 == e ? (n = c, e = !0) : (n = c.substring(0, e), c = c.substring(e + 1), e = !1);
  5116. if (a = a.children)
  5117. for (var g = a.length, f = 0; f < g; f++) {
  5118. var k = a[f];
  5119. k.localName ==
  5120. n && (e ? b.push(k) : d.findByPath(k, c, b))
  5121. }
  5122. };
  5123. d.getAttributes = function (a, c) {
  5124. c ? c.length = 0 : c = [];
  5125. for (var b in a)
  5126. "$" == b.charAt(0) && c.push(b.substring(1));
  5127. return c
  5128. };
  5129. return d
  5130. }
  5131. ();
  5132. b.XML = e;
  5133. e.prototype.__class__ = "egret.XML"
  5134. })(egret || (egret = {}));
  5135. (function (b) {
  5136. var e = function () {
  5137. function a() {}
  5138. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5139. a.BIG_ENDIAN = "BIG_ENDIAN";
  5140. return a
  5141. }
  5142. ();
  5143. b.Endian = e;
  5144. e.prototype.__class__ = "egret.Endian";
  5145. var d = function () {
  5146. function a() {
  5147. this.length = this.position = 0;
  5148. this._mode = "";
  5149. this.maxlength = 0;
  5150. this._endian = e.LITTLE_ENDIAN;
  5151. this.isLittleEndian = !1;
  5152. this._mode = "Typed array";
  5153. this.maxlength = 4;
  5154. this.arraybytes = new ArrayBuffer(this.maxlength);
  5155. this.unalignedarraybytestemp = new ArrayBuffer(16);
  5156. this.endian = a.DEFAULT_ENDIAN
  5157. }
  5158. Object.defineProperty(a.prototype,
  5159. "endian", {
  5160. get : function () {
  5161. return this._endian
  5162. },
  5163. set : function (a) {
  5164. this._endian = a;
  5165. this.isLittleEndian = a == e.LITTLE_ENDIAN
  5166. },
  5167. enumerable : !0,
  5168. configurable : !0
  5169. });
  5170. a.prototype.ensureWriteableSpace = function (a) {
  5171. this.ensureSpace(a + this.position)
  5172. };
  5173. a.prototype.setArrayBuffer = function (a) {
  5174. this.ensureSpace(a.byteLength);
  5175. this.length = a.byteLength;
  5176. a = new Int8Array(a);
  5177. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  5178. this.position = 0
  5179. };
  5180. Object.defineProperty(a.prototype, "bytesAvailable", {
  5181. get : function () {
  5182. return this.length - this.position
  5183. },
  5184. enumerable : !0,
  5185. configurable : !0
  5186. });
  5187. a.prototype.ensureSpace = function (a) {
  5188. if (a > this.maxlength) {
  5189. a = a + 255 & -256;
  5190. var b = new ArrayBuffer(a),
  5191. d = new Uint8Array(this.arraybytes, 0, this.length);
  5192. (new Uint8Array(b, 0, this.length)).set(d);
  5193. this.arraybytes = b;
  5194. this.maxlength = a
  5195. }
  5196. };
  5197. a.prototype.writeByte = function (a) {
  5198. this.ensureWriteableSpace(1);
  5199. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  5200. this.position > this.length && (this.length = this.position)
  5201. };
  5202. a.prototype.readByte = function () {
  5203. if (this.position >= this.length)
  5204. throw "ByteArray out of bounds read. Positon=" +
  5205. this.position + ", Length=" + this.length;
  5206. return (new Int8Array(this.arraybytes))[this.position++]
  5207. };
  5208. a.prototype.readBytes = function (a, b, d) {
  5209. void 0 === b && (b = 0);
  5210. void 0 === d && (d = 0);
  5211. null == d && (d = a.length);
  5212. a.ensureWriteableSpace(b + d);
  5213. var e = new Int8Array(a.arraybytes),
  5214. g = new Int8Array(this.arraybytes);
  5215. e.set(g.subarray(this.position, this.position + d), b);
  5216. this.position += d;
  5217. d + b > a.length && (a.length += d + b - a.length)
  5218. };
  5219. a.prototype.writeUnsignedByte = function (a) {
  5220. this.ensureWriteableSpace(1);
  5221. (new Uint8Array(this.arraybytes))[this.position++] =
  5222. ~~a & 255;
  5223. this.position > this.length && (this.length = this.position)
  5224. };
  5225. a.prototype.readUnsignedByte = function () {
  5226. if (this.position >= this.length)
  5227. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  5228. return (new Uint8Array(this.arraybytes))[this.position++]
  5229. };
  5230. a.prototype.writeUnsignedShort = function (a) {
  5231. this.ensureWriteableSpace(2);
  5232. if (0 == (this.position & 1)) {
  5233. var b = new Uint16Array(this.arraybytes);
  5234. b[this.position >> 1] = ~~a & 65535
  5235. } else
  5236. b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] =
  5237. ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  5238. this.position += 2;
  5239. this.position > this.length && (this.length = this.position)
  5240. };
  5241. a.prototype.readUTFBytes = function (a) {
  5242. var b = "";
  5243. a = this.position + a;
  5244. for (var d = new DataView(this.arraybytes); this.position < a; ) {
  5245. var e = d.getUint8(this.position++);
  5246. if (128 > e) {
  5247. if (0 == e)
  5248. break;
  5249. b += String.fromCharCode(e)
  5250. } else if (224 > e)
  5251. b += String.fromCharCode((e & 63) << 6 | d.getUint8(this.position++) & 127);
  5252. else if (240 > e)
  5253. var g = d.getUint8(this.position++),
  5254. b = b + String.fromCharCode((e & 31) << 12 | (g & 127) << 6 | d.getUint8(this.position++) & 127);
  5255. else
  5256. var g = d.getUint8(this.position++), f = d.getUint8(this.position++), b = b + String.fromCharCode((e & 15) << 18 | (g & 127) << 12 | f << 6 & 127 | d.getUint8(this.position++) & 127)
  5257. }
  5258. return b
  5259. };
  5260. a.prototype.readInt = function () {
  5261. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  5262. this.position += 4;
  5263. return a
  5264. };
  5265. a.prototype.readShort = function () {
  5266. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  5267. this.position += 2;
  5268. return a
  5269. };
  5270. a.prototype.readDouble = function () {
  5271. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  5272. this.position += 8;
  5273. return a
  5274. };
  5275. a.prototype.readUnsignedShort = function () {
  5276. if (this.position > this.length + 2)
  5277. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5278. if (0 == (this.position & 1)) {
  5279. var a = new Uint16Array(this.arraybytes),
  5280. b = this.position >> 1;
  5281. this.position += 2;
  5282. return a[b]
  5283. }
  5284. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  5285. b = new Uint8Array(this.arraybytes,
  5286. this.position, 2);
  5287. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  5288. this.position += 2;
  5289. return a[0]
  5290. };
  5291. a.prototype.writeUnsignedInt = function (a) {
  5292. this.ensureWriteableSpace(4);
  5293. if (0 == (this.position & 3)) {
  5294. var b = new Uint32Array(this.arraybytes);
  5295. b[this.position >> 2] = ~~a & 4294967295
  5296. } else
  5297. 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);
  5298. this.position += 4;
  5299. this.position > this.length &&
  5300. (this.length = this.position)
  5301. };
  5302. a.prototype.readUnsignedInt = function () {
  5303. if (this.position > this.length + 4)
  5304. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5305. if (0 == (this.position & 3)) {
  5306. var a = new Uint32Array(this.arraybytes),
  5307. b = this.position >> 2;
  5308. this.position += 4;
  5309. return a[b]
  5310. }
  5311. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  5312. b = new Uint8Array(this.arraybytes, this.position, 4);
  5313. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5314. this.position += 4;
  5315. return a[0]
  5316. };
  5317. a.prototype.writeFloat =
  5318. function (a) {
  5319. this.ensureWriteableSpace(4);
  5320. if (0 == (this.position & 3)) {
  5321. var b = new Float32Array(this.arraybytes);
  5322. b[this.position >> 2] = a
  5323. } else
  5324. 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);
  5325. this.position += 4;
  5326. this.position > this.length && (this.length = this.position)
  5327. };
  5328. a.prototype.readFloat = function () {
  5329. if (this.position > this.length + 4)
  5330. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  5331. this.length;
  5332. if (0 == (this.position & 3)) {
  5333. var a = new Float32Array(this.arraybytes),
  5334. b = this.position >> 2;
  5335. this.position += 4;
  5336. return a[b]
  5337. }
  5338. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  5339. b = new Uint8Array(this.arraybytes, this.position, 4);
  5340. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5341. this.position += 4;
  5342. return a[0]
  5343. };
  5344. a.DEFAULT_ENDIAN = e.BIG_ENDIAN;
  5345. return a
  5346. }
  5347. ();
  5348. b.ByteArray = d;
  5349. d.prototype.__class__ = "egret.ByteArray"
  5350. })(egret || (egret = {}));
  5351. __extends = this.__extends || function (b, e) {
  5352. function d() {
  5353. this.constructor = b
  5354. }
  5355. for (var a in e)
  5356. e.hasOwnProperty(a) && (b[a] = e[a]);
  5357. d.prototype = e.prototype;
  5358. b.prototype = new d
  5359. };
  5360. (function (b) {
  5361. var e = function (d) {
  5362. function a(a, b, e) {
  5363. d.call(this);
  5364. this._target = null;
  5365. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5366. this._actions = this._steps = this.pluginData = null;
  5367. this.paused = !1;
  5368. this.duration = 0;
  5369. this._prevPos = -1;
  5370. this.position = null;
  5371. this._stepPosition = this._prevPosition = 0;
  5372. this.passive = !1;
  5373. this.initialize(a, b, e)
  5374. }
  5375. __extends(a, d);
  5376. a.get = function (c, b, d, e) {
  5377. void 0 === b && (b = null);
  5378. void 0 === d && (d = null);
  5379. void 0 === e && (e = !1);
  5380. e && a.removeTweens(c);
  5381. return new a(c, b, d)
  5382. };
  5383. a.removeTweens = function (c) {
  5384. if (c.tween_count) {
  5385. for (var b =
  5386. a._tweens, d = b.length - 1; 0 <= d; d--)
  5387. b[d]._target == c && (b[d].paused = !0, b.splice(d, 1));
  5388. c.tween_count = 0
  5389. }
  5390. };
  5391. a.pauseTweens = function (a) {
  5392. if (a.tween_count)
  5393. for (var d = b.Tween._tweens, e = d.length - 1; 0 <= e; e--)
  5394. d[e]._target == a && (d[e].paused = !0)
  5395. };
  5396. a.resumeTweens = function (a) {
  5397. if (a.tween_count)
  5398. for (var d = b.Tween._tweens, e = d.length - 1; 0 <= e; e--)
  5399. d[e]._target == a && (d[e].paused = !1)
  5400. };
  5401. a.tick = function (c, b) {
  5402. void 0 === b && (b = !1);
  5403. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  5404. var g = d[e];
  5405. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
  5406. 1 : c)
  5407. }
  5408. };
  5409. a._register = function (c, d) {
  5410. var e = c._target,
  5411. n = a._tweens;
  5412. if (d)
  5413. e && (e.tween_count = e.tween_count ? e.tween_count + 1 : 1), n.push(c), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5414. else
  5415. for (e && e.tween_count--, e = n.length; e--; )
  5416. if (n[e] == c) {
  5417. n.splice(e, 1);
  5418. break
  5419. }
  5420. };
  5421. a.removeAllTweens = function () {
  5422. for (var c = a._tweens, b = 0, d = c.length; b < d; b++) {
  5423. var e = c[b];
  5424. e.paused = !0;
  5425. e._target.tweenjs_count = 0
  5426. }
  5427. c.length = 0
  5428. };
  5429. a.prototype.initialize = function (c, b, d) {
  5430. this._target = c;
  5431. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  5432. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(c));
  5433. this.pluginData = d || {};
  5434. this._curQueueProps = {};
  5435. this._initQueueProps = {};
  5436. this._steps = [];
  5437. this._actions = [];
  5438. b && b.paused ? this.paused = !0 : a._register(this, !0);
  5439. b && null != b.position && this.setPosition(b.position, a.NONE)
  5440. };
  5441. a.prototype.setPosition = function (a, b) {
  5442. void 0 === b && (b = 1);
  5443. 0 > a && (a = 0);
  5444. var d = a,
  5445. e = !1;
  5446. d >= this.duration && (this.loop ? d %= this.duration : (d = this.duration, e = !0));
  5447. if (d == this._prevPos)
  5448. return e;
  5449. var g = this._prevPos;
  5450. this.position = this._prevPos = d;
  5451. this._prevPosition = a;
  5452. if (this._target)
  5453. if (e)
  5454. this._updateTargetProps(null, 1);
  5455. else if (0 < this._steps.length) {
  5456. for (var f = 0, k = this._steps.length; f < k && !(this._steps[f].t > d); f++);
  5457. f = this._steps[f - 1];
  5458. this._updateTargetProps(f, (this._stepPosition = d - f.t) / f.d)
  5459. }
  5460. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, d, !0)) : this._runActions(g, d));
  5461. e && this.setPaused(!0);
  5462. this.dispatchEventWith("change");
  5463. return e
  5464. };
  5465. a.prototype._runActions = function (a, b, d) {
  5466. void 0 === d && (d = !1);
  5467. var e = a,
  5468. g = b,
  5469. f = -1,
  5470. k = this._actions.length,
  5471. m = 1;
  5472. a > b && (e = b, g = a, f = k, k = m = -1);
  5473. for (; (f += m) != k; ) {
  5474. b = this._actions[f];
  5475. var p = b.t;
  5476. (p == g || p > e && p < g || d && p == a) && b.f.apply(b.o, b.p)
  5477. }
  5478. };
  5479. a.prototype._updateTargetProps = function (c, b) {
  5480. var d,
  5481. e,
  5482. g,
  5483. f;
  5484. if (c || 1 != b) {
  5485. if (this.passive = !!c.v)
  5486. return;
  5487. c.e && (b = c.e(b, 0, 1, 1));
  5488. d = c.p0;
  5489. e = c.p1
  5490. } else
  5491. this.passive = !1, d = e = this._curQueueProps;
  5492. for (var k in this._initQueueProps) {
  5493. null == (g = d[k]) && (d[k] = g = this._initQueueProps[k]);
  5494. null ==
  5495. (f = e[k]) && (e[k] = f = g);
  5496. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f : g : g + (f - g) * b;
  5497. var m = !1;
  5498. if (f = a._plugins[k])
  5499. for (var p = 0, q = f.length; p < q; p++) {
  5500. var r = f[p].tween(this, k, g, d, e, b, !!c && d == e, !c);
  5501. r == a.IGNORE ? m = !0 : g = r
  5502. }
  5503. m || (this._target[k] = g)
  5504. }
  5505. };
  5506. a.prototype.setPaused = function (c) {
  5507. this.paused = c;
  5508. a._register(this, !c);
  5509. return this
  5510. };
  5511. a.prototype._cloneProps = function (a) {
  5512. var b = {},
  5513. d;
  5514. for (d in a)
  5515. b[d] = a[d];
  5516. return b
  5517. };
  5518. a.prototype._addStep = function (a) {
  5519. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5520. return this
  5521. };
  5522. a.prototype._appendQueueProps = function (c) {
  5523. var b,
  5524. d,
  5525. e,
  5526. g,
  5527. f,
  5528. k;
  5529. for (k in c)
  5530. if (void 0 === this._initQueueProps[k]) {
  5531. d = this._target[k];
  5532. if (b = a._plugins[k])
  5533. for (e = 0, g = b.length; e < g; e++)
  5534. d = b[e].init(this, k, d);
  5535. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  5536. }
  5537. for (k in c) {
  5538. d = this._curQueueProps[k];
  5539. if (b = a._plugins[k])
  5540. for (f = f || {}, e = 0, g = b.length; e < g; e++)
  5541. b[e].step && b[e].step(this, k, d, c[k], f);
  5542. this._curQueueProps[k] = c[k]
  5543. }
  5544. f && this._appendQueueProps(f);
  5545. return this._curQueueProps
  5546. };
  5547. a.prototype._addAction = function (a) {
  5548. a.t =
  5549. this.duration;
  5550. this._actions.push(a);
  5551. return this
  5552. };
  5553. a.prototype._set = function (a, b) {
  5554. for (var d in a)
  5555. b[d] = a[d]
  5556. };
  5557. a.prototype.wait = function (a, b) {
  5558. if (null == a || 0 >= a)
  5559. return this;
  5560. var d = this._cloneProps(this._curQueueProps);
  5561. return this._addStep({
  5562. d : a,
  5563. p0 : d,
  5564. p1 : d,
  5565. v : b
  5566. })
  5567. };
  5568. a.prototype.to = function (a, b, d) {
  5569. void 0 === d && (d = void 0);
  5570. if (isNaN(b) || 0 > b)
  5571. b = 0;
  5572. return this._addStep({
  5573. d : b || 0,
  5574. p0 : this._cloneProps(this._curQueueProps),
  5575. e : d,
  5576. p1 : this._cloneProps(this._appendQueueProps(a))
  5577. })
  5578. };
  5579. a.prototype.call = function (a, b, d) {
  5580. void 0 === b && (b = void 0);
  5581. void 0 === d && (d = void 0);
  5582. return this._addAction({
  5583. f : a,
  5584. p : d ? d : [],
  5585. o : b ? b : this._target
  5586. })
  5587. };
  5588. a.prototype.set = function (a, b) {
  5589. void 0 === b && (b = null);
  5590. return this._addAction({
  5591. f : this._set,
  5592. o : this,
  5593. p : [a, b ? b : this._target]
  5594. })
  5595. };
  5596. a.prototype.play = function (a) {
  5597. a || (a = this);
  5598. return this.call(a.setPaused, a, [!1])
  5599. };
  5600. a.prototype.pause = function (a) {
  5601. a || (a = this);
  5602. return this.call(a.setPaused, a, [!0])
  5603. };
  5604. a.prototype.tick = function (a) {
  5605. this.paused || this.setPosition(this._prevPosition + a)
  5606. };
  5607. a.NONE = 0;
  5608. a.LOOP = 1;
  5609. a.REVERSE = 2;
  5610. a._tweens = [];
  5611. a.IGNORE = {};
  5612. a._plugins = {};
  5613. a._inited = !1;
  5614. return a
  5615. }
  5616. (b.EventDispatcher);
  5617. b.Tween = e;
  5618. e.prototype.__class__ = "egret.Tween"
  5619. })(egret || (egret = {}));
  5620. (function (b) {
  5621. var e = function () {
  5622. function d() {
  5623. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5624. }
  5625. d.get = function (a) {
  5626. -1 > a && (a = -1);
  5627. 1 < a && (a = 1);
  5628. return function (c) {
  5629. return 0 == a ? c : 0 > a ? c * (c * -a + 1 + a) : c * ((2 - c) * a + (1 - a))
  5630. }
  5631. };
  5632. d.getPowIn = function (a) {
  5633. return function (c) {
  5634. return Math.pow(c, a)
  5635. }
  5636. };
  5637. d.getPowOut = function (a) {
  5638. return function (c) {
  5639. return 1 - Math.pow(1 - c, a)
  5640. }
  5641. };
  5642. d.getPowInOut = function (a) {
  5643. return function (c) {
  5644. return 1 > (c *= 2) ? 0.5 * Math.pow(c, a) : 1 - 0.5 * Math.abs(Math.pow(2 - c, a))
  5645. }
  5646. };
  5647. d.sineIn = function (a) {
  5648. return 1 - Math.cos(a *
  5649. Math.PI / 2)
  5650. };
  5651. d.sineOut = function (a) {
  5652. return Math.sin(a * Math.PI / 2)
  5653. };
  5654. d.sineInOut = function (a) {
  5655. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5656. };
  5657. d.getBackIn = function (a) {
  5658. return function (c) {
  5659. return c * c * ((a + 1) * c - a)
  5660. }
  5661. };
  5662. d.getBackOut = function (a) {
  5663. return function (c) {
  5664. return --c * c * ((a + 1) * c + a) + 1
  5665. }
  5666. };
  5667. d.getBackInOut = function (a) {
  5668. a *= 1.525;
  5669. return function (c) {
  5670. return 1 > (c *= 2) ? 0.5 * c * c * ((a + 1) * c - a) : 0.5 * ((c -= 2) * c * ((a + 1) * c + a) + 2)
  5671. }
  5672. };
  5673. d.circIn = function (a) {
  5674. return - (Math.sqrt(1 - a * a) - 1)
  5675. };
  5676. d.circOut = function (a) {
  5677. return Math.sqrt(1 - --a * a)
  5678. };
  5679. d.circInOut = function (a) {
  5680. return 1 >
  5681. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5682. };
  5683. d.bounceIn = function (a) {
  5684. return 1 - d.bounceOut(1 - a)
  5685. };
  5686. d.bounceOut = function (a) {
  5687. 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
  5688. };
  5689. d.bounceInOut = function (a) {
  5690. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5691. };
  5692. d.getElasticIn = function (a, c) {
  5693. var b = 2 * Math.PI;
  5694. return function (d) {
  5695. if (0 == d || 1 == d)
  5696. return d;
  5697. var e = c / b * Math.asin(1 / a);
  5698. return - (a * Math.pow(2, 10 *
  5699. (d -= 1)) * Math.sin((d - e) * b / c))
  5700. }
  5701. };
  5702. d.getElasticOut = function (a, c) {
  5703. var b = 2 * Math.PI;
  5704. return function (d) {
  5705. if (0 == d || 1 == d)
  5706. return d;
  5707. var e = c / b * Math.asin(1 / a);
  5708. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * b / c) + 1
  5709. }
  5710. };
  5711. d.getElasticInOut = function (a, c) {
  5712. var b = 2 * Math.PI;
  5713. return function (d) {
  5714. var e = c / b * Math.asin(1 / a);
  5715. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * b / c) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * b / c) * 0.5 + 1
  5716. }
  5717. };
  5718. d.quadIn = d.getPowIn(2);
  5719. d.quadOut = d.getPowOut(2);
  5720. d.quadInOut = d.getPowInOut(2);
  5721. d.cubicIn = d.getPowIn(3);
  5722. d.cubicOut = d.getPowOut(3);
  5723. d.cubicInOut = d.getPowInOut(3);
  5724. d.quartIn = d.getPowIn(4);
  5725. d.quartOut = d.getPowOut(4);
  5726. d.quartInOut = d.getPowInOut(4);
  5727. d.quintIn = d.getPowIn(5);
  5728. d.quintOut = d.getPowOut(5);
  5729. d.quintInOut = d.getPowInOut(5);
  5730. d.backIn = d.getBackIn(1.7);
  5731. d.backOut = d.getBackOut(1.7);
  5732. d.backInOut = d.getBackInOut(1.7);
  5733. d.elasticIn = d.getElasticIn(1, 0.3);
  5734. d.elasticOut = d.getElasticOut(1, 0.3);
  5735. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5736. return d
  5737. }
  5738. ();
  5739. b.Ease = e;
  5740. e.prototype.__class__ = "egret.Ease"
  5741. })(egret || (egret = {}));
  5742. (function (b) {
  5743. var e = function () {
  5744. function b() {
  5745. this.type = b.EFFECT
  5746. }
  5747. b.prototype.play = function (a) {
  5748. void 0 === a && (a = !1);
  5749. var c = this.audio;
  5750. c && (isNaN(c.duration) || (c.currentTime = 0), c.loop = a, c.play())
  5751. };
  5752. b.prototype.pause = function () {
  5753. var a = this.audio;
  5754. a && a.pause()
  5755. };
  5756. b.prototype.load = function () {
  5757. var a = this.audio;
  5758. a && a.load()
  5759. };
  5760. b.prototype.addEventListener = function (a, c) {
  5761. this.audio && this.audio.addEventListener(a, c, !1)
  5762. };
  5763. b.prototype.removeEventListener = function (a, c) {
  5764. this.audio && this.audio.removeEventListener(a, c, !1)
  5765. };
  5766. b.prototype.setVolume =
  5767. function (a) {
  5768. var c = this.audio;
  5769. c && (c.volume = a)
  5770. };
  5771. b.prototype.getVolume = function () {
  5772. return this.audio ? this.audio.volume : 0
  5773. };
  5774. b.prototype.preload = function (a) {
  5775. this.type = a
  5776. };
  5777. b.prototype._setAudio = function (a) {
  5778. this.audio = a
  5779. };
  5780. b.MUSIC = "music";
  5781. b.EFFECT = "effect";
  5782. return b
  5783. }
  5784. ();
  5785. b.Sound = e;
  5786. e.prototype.__class__ = "egret.Sound"
  5787. })(egret || (egret = {}));
  5788. (function (b) {
  5789. var e = function () {
  5790. function b() {}
  5791. b.isNumber = function (a) {
  5792. return "number" === typeof a && !isNaN(a)
  5793. };
  5794. b.sin = function (a) {
  5795. a = Math.round(a);
  5796. a %= 360;
  5797. 0 > a && (a += 360);
  5798. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  5799. };
  5800. b.cos = function (a) {
  5801. a = Math.round(a);
  5802. a %= 360;
  5803. 0 > a && (a += 360);
  5804. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  5805. };
  5806. return b
  5807. }
  5808. ();
  5809. b.NumberUtils = e;
  5810. e.prototype.__class__ = "egret.NumberUtils"
  5811. })(egret ||
  5812. (egret = {}));
  5813. for (var egret_sin_map = {}, egret_cos_map = {}, i = 0; 90 >= i; i++)
  5814. egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD), egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  5815. Function.prototype.bind || (Function.prototype.bind = function (b) {
  5816. if ("function" !== typeof this)
  5817. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5818. var e = Array.prototype.slice.call(arguments, 1),
  5819. d = this,
  5820. a = function () {},
  5821. c = function () {
  5822. return d.apply(this instanceof a && b ? this : b, e.concat(Array.prototype.slice.call(arguments)))
  5823. };
  5824. a.prototype = this.prototype;
  5825. c.prototype = new a;
  5826. return c
  5827. });
  5828. var __extends = this.__extends || function (b, e) {
  5829. function d() {
  5830. this.constructor = b
  5831. }
  5832. for (var a in e)
  5833. e.hasOwnProperty(a) && (b[a] = e[a]);
  5834. d.prototype = e.prototype;
  5835. b.prototype = new d
  5836. }, RES;
  5837. (function (b) {
  5838. var e = function (b) {
  5839. function a(a, e, h) {
  5840. void 0 === e && (e = !1);
  5841. void 0 === h && (h = !1);
  5842. b.call(this, a, e, h);
  5843. this.itemsTotal = this.itemsLoaded = 0
  5844. }
  5845. __extends(a, b);
  5846. a.dispatchResourceEvent = function (c, b, d, e, g, f) {
  5847. void 0 === d && (d = "");
  5848. void 0 === e && (e = null);
  5849. void 0 === g && (g = 0);
  5850. void 0 === f && (f = 0);
  5851. var k = egret.Event._getPropertyData(a);
  5852. k.groupName = d;
  5853. k.resItem = e;
  5854. k.itemsLoaded = g;
  5855. k.itemsTotal = f;
  5856. egret.Event._dispatchByTarget(a, c, b, k)
  5857. };
  5858. a.ITEM_LOAD_ERROR = "itemLoadError";
  5859. a.CONFIG_COMPLETE = "configComplete";
  5860. a.CONFIG_LOAD_ERROR =
  5861. "configLoadError";
  5862. a.GROUP_PROGRESS = "groupProgress";
  5863. a.GROUP_COMPLETE = "groupComplete";
  5864. a.GROUP_LOAD_ERROR = "groupLoadError";
  5865. return a
  5866. }
  5867. (egret.Event);
  5868. b.ResourceEvent = e;
  5869. e.prototype.__class__ = "RES.ResourceEvent"
  5870. })(RES || (RES = {}));
  5871. (function (b) {
  5872. var e = function () {
  5873. function b(a, c, d) {
  5874. this._loaded = !1;
  5875. this.name = a;
  5876. this.url = c;
  5877. this.type = d
  5878. }
  5879. Object.defineProperty(b.prototype, "loaded", {
  5880. get : function () {
  5881. return this.data ? this.data.loaded : this._loaded
  5882. },
  5883. set : function (a) {
  5884. this.data && (this.data.loaded = a);
  5885. this._loaded = a
  5886. },
  5887. enumerable : !0,
  5888. configurable : !0
  5889. });
  5890. b.prototype.toString = function () {
  5891. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5892. };
  5893. b.TYPE_XML = "xml";
  5894. b.TYPE_IMAGE = "image";
  5895. b.TYPE_BIN = "bin";
  5896. b.TYPE_TEXT = "text";
  5897. b.TYPE_JSON =
  5898. "json";
  5899. b.TYPE_SHEET = "sheet";
  5900. b.TYPE_FONT = "font";
  5901. b.TYPE_SOUND = "sound";
  5902. return b
  5903. }
  5904. ();
  5905. b.ResourceItem = e;
  5906. e.prototype.__class__ = "RES.ResourceItem"
  5907. })(RES || (RES = {}));
  5908. (function (b) {
  5909. var e = function () {
  5910. function d() {
  5911. this.keyMap = {};
  5912. this.groupDic = {};
  5913. b.configInstance = this
  5914. }
  5915. d.prototype.getGroupByName = function (a) {
  5916. var c = [];
  5917. if (!this.groupDic[a])
  5918. return c;
  5919. a = this.groupDic[a];
  5920. for (var b = a.length, d = 0; d < b; d++)
  5921. c.push(this.parseResourceItem(a[d]));
  5922. return c
  5923. };
  5924. d.prototype.getRawGroupByName = function (a) {
  5925. return this.groupDic[a] ? this.groupDic[a] : []
  5926. };
  5927. d.prototype.createGroup = function (a, c, b) {
  5928. void 0 === b && (b = !1);
  5929. if (!b && this.groupDic[a] || !c || 0 == c.length)
  5930. return !1;
  5931. b = this.groupDic;
  5932. for (var d = [], e = c.length,
  5933. g = 0; g < e; g++) {
  5934. var f = c[g],
  5935. k = b[f];
  5936. if (k)
  5937. for (var f = k.length, m = 0; m < f; m++) {
  5938. var p = k[m];
  5939. -1 == d.indexOf(p) && d.push(p)
  5940. }
  5941. else (p = this.keyMap[f]) && -1 == d.indexOf(p) && d.push(p)
  5942. }
  5943. if (0 == d.length)
  5944. return !1;
  5945. this.groupDic[a] = d;
  5946. return !0
  5947. };
  5948. d.prototype.parseConfig = function (a, c) {
  5949. if (a) {
  5950. var b = a.resources;
  5951. if (b)
  5952. for (var d = b.length, e = 0; e < d; e++) {
  5953. var g = b[e],
  5954. f = g.url;
  5955. f && -1 == f.indexOf("://") && (g.url = c + f);
  5956. this.addItemToKeyMap(g)
  5957. }
  5958. if (b = a.groups)
  5959. for (d = b.length, e = 0; e < d; e++) {
  5960. for (var f = b[e], k = [], m = f.keys.split(","), p = m.length, q = 0; q < p; q++)
  5961. g = m[q].trim(),
  5962. (g = this.keyMap[g]) && -1 == k.indexOf(g) && k.push(g);
  5963. this.groupDic[f.name] = k
  5964. }
  5965. }
  5966. };
  5967. d.prototype.addSubkey = function (a, c) {
  5968. var b = this.keyMap[c];
  5969. b && !this.keyMap[a] && (this.keyMap[a] = b)
  5970. };
  5971. d.prototype.addItemToKeyMap = function (a) {
  5972. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  5973. if (a.hasOwnProperty("subkeys")) {
  5974. var c = a.subkeys.split(",");
  5975. a.subkeys = c;
  5976. for (var b = c.length, d = 0; d < b; d++) {
  5977. var e = c[d];
  5978. null == this.keyMap[e] && (this.keyMap[e] = a)
  5979. }
  5980. }
  5981. };
  5982. d.prototype.getName = function (a) {
  5983. return (a = this.keyMap[a]) ? a.name : ""
  5984. };
  5985. d.prototype.getType =
  5986. function (a) {
  5987. return (a = this.keyMap[a]) ? a.type : ""
  5988. };
  5989. d.prototype.getRawResourceItem = function (a) {
  5990. return this.keyMap[a]
  5991. };
  5992. d.prototype.getResourceItem = function (a) {
  5993. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  5994. };
  5995. d.prototype.parseResourceItem = function (a) {
  5996. var c = new b.ResourceItem(a.name, a.url, a.type);
  5997. c.data = a;
  5998. return c
  5999. };
  6000. return d
  6001. }
  6002. ();
  6003. b.ResourceConfig = e;
  6004. e.prototype.__class__ = "RES.ResourceConfig"
  6005. })(RES || (RES = {}));
  6006. __extends = this.__extends || function (b, e) {
  6007. function d() {
  6008. this.constructor = b
  6009. }
  6010. for (var a in e)
  6011. e.hasOwnProperty(a) && (b[a] = e[a]);
  6012. d.prototype = e.prototype;
  6013. b.prototype = new d
  6014. };
  6015. (function (b) {
  6016. var e = function (d) {
  6017. function a() {
  6018. d.call(this);
  6019. this.thread = 2;
  6020. this.loadingCount = 0;
  6021. this.groupTotalDic = {};
  6022. this.numLoadedDic = {};
  6023. this.itemListDic = {};
  6024. this.groupErrorDic = {};
  6025. this.retryTimesDic = {};
  6026. this.maxRetryTimes = 3;
  6027. this.failedList = [];
  6028. this.priorityQueue = {};
  6029. this.lazyLoadList = [];
  6030. this.analyzerDic = {};
  6031. this.queueIndex = 0
  6032. }
  6033. __extends(a, d);
  6034. a.prototype.isGroupInLoading = function (a) {
  6035. return void 0 !== this.itemListDic[a]
  6036. };
  6037. a.prototype.loadGroup = function (a, d, e) {
  6038. void 0 === e && (e = 0);
  6039. if (!this.itemListDic[d] && d)
  6040. if (a &&
  6041. 0 != a.length) {
  6042. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  6043. this.itemListDic[d] = a;
  6044. e = a.length;
  6045. for (var n = 0; n < e; n++)
  6046. a[n].groupName = d;
  6047. this.groupTotalDic[d] = a.length;
  6048. this.numLoadedDic[d] = 0;
  6049. this.next()
  6050. } else
  6051. egret.Logger.warning('RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4\uff1a"' + d + '"'), a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR), a.groupName = d, this.dispatchEvent(a)
  6052. };
  6053. a.prototype.loadItem = function (a) {
  6054. this.lazyLoadList.push(a);
  6055. a.groupName =
  6056. "";
  6057. this.next()
  6058. };
  6059. a.prototype.next = function () {
  6060. for (; this.loadingCount < this.thread; ) {
  6061. var a = this.getOneResourceItem();
  6062. if (!a)
  6063. break;
  6064. this.loadingCount++;
  6065. if (a.loaded)
  6066. this.onItemComplete(a);
  6067. else {
  6068. var d = this.analyzerDic[a.type];
  6069. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  6070. d.loadFile(a, this.onItemComplete, this)
  6071. }
  6072. }
  6073. };
  6074. a.prototype.getOneResourceItem = function () {
  6075. if (0 < this.failedList.length)
  6076. return this.failedList.shift();
  6077. var a = Number.NEGATIVE_INFINITY,
  6078. b;
  6079. for (b in this.priorityQueue)
  6080. a =
  6081. Math.max(a, b);
  6082. a = this.priorityQueue[a];
  6083. if (!a || 0 == a.length)
  6084. return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  6085. b = a.length;
  6086. for (var d, e = 0; e < b; e++) {
  6087. this.queueIndex >= b && (this.queueIndex = 0);
  6088. d = this.itemListDic[a[this.queueIndex]];
  6089. if (0 < d.length)
  6090. break;
  6091. this.queueIndex++
  6092. }
  6093. return 0 == d.length ? null : d.shift()
  6094. };
  6095. a.prototype.onItemComplete = function (a) {
  6096. this.loadingCount--;
  6097. var d = a.groupName;
  6098. if (!a.loaded) {
  6099. var e = this.retryTimesDic[a.name] || 1;
  6100. if (e > this.maxRetryTimes)
  6101. delete this.retryTimesDic[a.name], b.ResourceEvent.dispatchResourceEvent(this.resInstance,
  6102. b.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  6103. else {
  6104. this.retryTimesDic[a.name] = e + 1;
  6105. this.failedList.push(a);
  6106. this.next();
  6107. return
  6108. }
  6109. }
  6110. if (d) {
  6111. this.numLoadedDic[d]++;
  6112. var e = this.numLoadedDic[d],
  6113. n = this.groupTotalDic[d];
  6114. a.loaded || (this.groupErrorDic[d] = !0);
  6115. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, d, a, e, n);
  6116. e == n && (a = this.groupErrorDic[d], this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], delete this.groupErrorDic[d], a ? b.ResourceEvent.dispatchResourceEvent(this,
  6117. b.ResourceEvent.GROUP_LOAD_ERROR, d) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, d))
  6118. } else
  6119. this.callBack.call(this.resInstance, a);
  6120. this.next()
  6121. };
  6122. a.prototype.removeGroupName = function (a) {
  6123. for (var b in this.priorityQueue) {
  6124. for (var d = this.priorityQueue[b], e = d.length, g = 0, f = !1, e = d.length, k = 0; k < e; k++) {
  6125. if (d[k] == a) {
  6126. d.splice(g, 1);
  6127. f = !0;
  6128. break
  6129. }
  6130. g++
  6131. }
  6132. if (f) {
  6133. 0 == d.length && delete this.priorityQueue[b];
  6134. break
  6135. }
  6136. }
  6137. };
  6138. return a
  6139. }
  6140. (egret.EventDispatcher);
  6141. b.ResourceLoader = e;
  6142. e.prototype.__class__ = "RES.ResourceLoader"
  6143. })(RES ||
  6144. (RES = {}));
  6145. __extends = this.__extends || function (b, e) {
  6146. function d() {
  6147. this.constructor = b
  6148. }
  6149. for (var a in e)
  6150. e.hasOwnProperty(a) && (b[a] = e[a]);
  6151. d.prototype = e.prototype;
  6152. b.prototype = new d
  6153. };
  6154. (function (b) {
  6155. var e = function (d) {
  6156. function a() {
  6157. d.call(this);
  6158. this.resourceConfig = b.configInstance
  6159. }
  6160. __extends(a, d);
  6161. a.prototype.addSubkey = function (a, b) {
  6162. this.resourceConfig.addSubkey(a, b)
  6163. };
  6164. a.prototype.loadFile = function (a, b, d) {};
  6165. a.prototype.getRes = function (a) {};
  6166. a.prototype.destroyRes = function (a) {
  6167. return !1
  6168. };
  6169. a.getStringPrefix = function (a) {
  6170. if (!a)
  6171. return "";
  6172. var b = a.indexOf(".");
  6173. return -1 != b ? a.substring(0, b) : ""
  6174. };
  6175. a.getStringTail = function (a) {
  6176. if (!a)
  6177. return "";
  6178. var b = a.indexOf(".");
  6179. return -1 != b ? a.substring(b + 1) : ""
  6180. };
  6181. return a
  6182. }
  6183. (egret.HashObject);
  6184. b.AnalyzerBase = e;
  6185. e.prototype.__class__ = "RES.AnalyzerBase"
  6186. })(RES || (RES = {}));
  6187. __extends = this.__extends || function (b, e) {
  6188. function d() {
  6189. this.constructor = b
  6190. }
  6191. for (var a in e)
  6192. e.hasOwnProperty(a) && (b[a] = e[a]);
  6193. d.prototype = e.prototype;
  6194. b.prototype = new d
  6195. };
  6196. (function (b) {
  6197. var e = function (b) {
  6198. function a() {
  6199. b.call(this);
  6200. this.fileDic = {};
  6201. this.resItemDic = [];
  6202. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  6203. this.recycler = new egret.Recycler
  6204. }
  6205. __extends(a, b);
  6206. a.prototype.loadFile = function (a, b, d) {
  6207. if (this.fileDic[a.name])
  6208. b.call(d, a);
  6209. else {
  6210. var e = this.getLoader();
  6211. this.resItemDic[e.hashCode] = {
  6212. item : a,
  6213. func : b,
  6214. thisObject : d
  6215. };
  6216. e.load(new egret.URLRequest(a.url))
  6217. }
  6218. };
  6219. a.prototype.getLoader = function () {
  6220. var a = this.recycler.pop();
  6221. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  6222. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  6223. a.dataFormat = this._dataFormat;
  6224. return a
  6225. };
  6226. a.prototype.onLoadFinish = function (a) {
  6227. var b = a.target,
  6228. d = this.resItemDic[b.hashCode];
  6229. delete this.resItemDic[b.hashCode];
  6230. this.recycler.push(b);
  6231. var e = d.item,
  6232. g = d.func;
  6233. e.loaded = a.type == egret.Event.COMPLETE;
  6234. e.loaded && this.analyzeData(e, b.data);
  6235. g.call(d.thisObject, e)
  6236. };
  6237. a.prototype.analyzeData = function (a, b) {
  6238. var d = a.name;
  6239. !this.fileDic[d] && b && (this.fileDic[d] = b)
  6240. };
  6241. a.prototype.getRes =
  6242. function (a) {
  6243. return this.fileDic[a]
  6244. };
  6245. a.prototype.hasRes = function (a) {
  6246. return null != this.getRes(a)
  6247. };
  6248. a.prototype.destroyRes = function (a) {
  6249. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  6250. };
  6251. return a
  6252. }
  6253. (b.AnalyzerBase);
  6254. b.BinAnalyzer = e;
  6255. e.prototype.__class__ = "RES.BinAnalyzer"
  6256. })(RES || (RES = {}));
  6257. __extends = this.__extends || function (b, e) {
  6258. function d() {
  6259. this.constructor = b
  6260. }
  6261. for (var a in e)
  6262. e.hasOwnProperty(a) && (b[a] = e[a]);
  6263. d.prototype = e.prototype;
  6264. b.prototype = new d
  6265. };
  6266. (function (b) {
  6267. var e = function (b) {
  6268. function a() {
  6269. b.call(this);
  6270. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  6271. }
  6272. __extends(a, b);
  6273. a.prototype.analyzeData = function (a, b) {
  6274. var d = a.name;
  6275. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  6276. };
  6277. return a
  6278. }
  6279. (b.BinAnalyzer);
  6280. b.ImageAnalyzer = e;
  6281. e.prototype.__class__ = "RES.ImageAnalyzer"
  6282. })(RES || (RES = {}));
  6283. __extends = this.__extends || function (b, e) {
  6284. function d() {
  6285. this.constructor = b
  6286. }
  6287. for (var a in e)
  6288. e.hasOwnProperty(a) && (b[a] = e[a]);
  6289. d.prototype = e.prototype;
  6290. b.prototype = new d
  6291. };
  6292. (function (b) {
  6293. var e = function (b) {
  6294. function a() {
  6295. b.call(this);
  6296. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6297. }
  6298. __extends(a, b);
  6299. a.prototype.analyzeData = function (a, b) {
  6300. var d = a.name;
  6301. if (!this.fileDic[d] && b)
  6302. try {
  6303. this.fileDic[d] = JSON.parse(b)
  6304. } catch (e) {
  6305. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + "\ndata:" + b)
  6306. }
  6307. };
  6308. return a
  6309. }
  6310. (b.BinAnalyzer);
  6311. b.JsonAnalyzer = e;
  6312. e.prototype.__class__ = "RES.JsonAnalyzer"
  6313. })(RES || (RES = {}));
  6314. __extends = this.__extends || function (b, e) {
  6315. function d() {
  6316. this.constructor = b
  6317. }
  6318. for (var a in e)
  6319. e.hasOwnProperty(a) && (b[a] = e[a]);
  6320. d.prototype = e.prototype;
  6321. b.prototype = new d
  6322. };
  6323. (function (b) {
  6324. var e = function (b) {
  6325. function a() {
  6326. b.call(this);
  6327. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6328. }
  6329. __extends(a, b);
  6330. return a
  6331. }
  6332. (b.BinAnalyzer);
  6333. b.TextAnalyzer = e;
  6334. e.prototype.__class__ = "RES.TextAnalyzer"
  6335. })(RES || (RES = {}));
  6336. __extends = this.__extends || function (b, e) {
  6337. function d() {
  6338. this.constructor = b
  6339. }
  6340. for (var a in e)
  6341. e.hasOwnProperty(a) && (b[a] = e[a]);
  6342. d.prototype = e.prototype;
  6343. b.prototype = new d
  6344. };
  6345. (function (b) {
  6346. var e = function (d) {
  6347. function a() {
  6348. d.call(this);
  6349. this.sheetMap = {};
  6350. this.textureMap = {};
  6351. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6352. }
  6353. __extends(a, d);
  6354. a.prototype.getRes = function (a) {
  6355. var d = this.fileDic[a];
  6356. d || (d = this.textureMap[a]);
  6357. !d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = b.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  6358. return d
  6359. };
  6360. a.prototype.onLoadFinish = function (a) {
  6361. var b = a.target,
  6362. d = this.resItemDic[b.hashCode];
  6363. delete this.resItemDic[b.hashCode];
  6364. this.recycler.push(b);
  6365. var e =
  6366. d.item,
  6367. g = d.func;
  6368. e.loaded = a.type == egret.Event.COMPLETE;
  6369. e.loaded && this.analyzeData(e, b.data);
  6370. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, g, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : g.call(d.thisObject, e)
  6371. };
  6372. a.prototype.analyzeData = function (a, b) {
  6373. var d = a.name;
  6374. if (!this.fileDic[d] && b) {
  6375. var e;
  6376. if ("string" == typeof b) {
  6377. try {
  6378. e = JSON.parse(b)
  6379. } catch (g) {
  6380. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  6381. }
  6382. e && (this.sheetMap[d] =
  6383. e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  6384. } else
  6385. e = this.sheetMap[d], delete this.sheetMap[d], b && (e = this.parseSpriteSheet(b, e, a.data && a.data.subkeys ? "" : d), this.fileDic[d] = e)
  6386. }
  6387. };
  6388. a.prototype.getRelativePath = function (a, b) {
  6389. a = a.split("\\").join("/");
  6390. var d = a.lastIndexOf("/");
  6391. return a = -1 != d ? a.substring(0, d + 1) + b : b
  6392. };
  6393. a.prototype.parseSpriteSheet = function (a, b, d) {
  6394. b = b.frames;
  6395. if (!b)
  6396. return null;
  6397. var e = new egret.SpriteSheet(a),
  6398. g = this.textureMap,
  6399. f;
  6400. for (f in b) {
  6401. var k = b[f];
  6402. a = e.createTexture(f, k.x, k.y, k.w, k.h,
  6403. k.offX, k.offY, k.sourceW, k.sourceH);
  6404. k.scale9grid && (k = k.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(k[0]), parseInt(k[1]), parseInt(k[2]), parseInt(k[3])));
  6405. null == g[f] && (g[f] = a, d && this.addSubkey(f, d))
  6406. }
  6407. return e
  6408. };
  6409. return a
  6410. }
  6411. (b.BinAnalyzer);
  6412. b.SheetAnalyzer = e;
  6413. e.prototype.__class__ = "RES.SheetAnalyzer"
  6414. })(RES || (RES = {}));
  6415. __extends = this.__extends || function (b, e) {
  6416. function d() {
  6417. this.constructor = b
  6418. }
  6419. for (var a in e)
  6420. e.hasOwnProperty(a) && (b[a] = e[a]);
  6421. d.prototype = e.prototype;
  6422. b.prototype = new d
  6423. };
  6424. (function (b) {
  6425. var e = function (b) {
  6426. function a() {
  6427. b.call(this)
  6428. }
  6429. __extends(a, b);
  6430. a.prototype.analyzeData = function (a, b) {
  6431. var d = a.name;
  6432. if (!this.fileDic[d] && b) {
  6433. var e;
  6434. "string" == typeof b ? (e = b, this.sheetMap[d] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[d], delete this.sheetMap[d], b && (e = new egret.BitmapTextSpriteSheet(b, e), this.fileDic[d] = e))
  6435. }
  6436. };
  6437. a.prototype.getTexturePath = function (a, b) {
  6438. var d = "",
  6439. e = b.split("\n")[2],
  6440. g = e.indexOf('file="');
  6441. -1 != g && (e = e.substring(g + 6), g = e.indexOf('"'), d = e.substring(0,
  6442. g));
  6443. a = a.split("\\").join("/");
  6444. g = a.lastIndexOf("/");
  6445. return a = -1 != g ? a.substring(0, g + 1) + d : d
  6446. };
  6447. return a
  6448. }
  6449. (b.SheetAnalyzer);
  6450. b.FontAnalyzer = e;
  6451. e.prototype.__class__ = "RES.FontAnalyzer"
  6452. })(RES || (RES = {}));
  6453. __extends = this.__extends || function (b, e) {
  6454. function d() {
  6455. this.constructor = b
  6456. }
  6457. for (var a in e)
  6458. e.hasOwnProperty(a) && (b[a] = e[a]);
  6459. d.prototype = e.prototype;
  6460. b.prototype = new d
  6461. };
  6462. (function (b) {
  6463. var e = function (b) {
  6464. function a() {
  6465. b.call(this);
  6466. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  6467. }
  6468. __extends(a, b);
  6469. a.prototype.analyzeData = function (a, b) {
  6470. var d = a.name;
  6471. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.soundType ? b.preload(d.soundType) : b.preload(egret.Sound.EFFECT))
  6472. };
  6473. return a
  6474. }
  6475. (b.BinAnalyzer);
  6476. b.SoundAnalyzer = e;
  6477. e.prototype.__class__ = "RES.SoundAnalyzer"
  6478. })(RES || (RES = {}));
  6479. __extends = this.__extends || function (b, e) {
  6480. function d() {
  6481. this.constructor = b
  6482. }
  6483. for (var a in e)
  6484. e.hasOwnProperty(a) && (b[a] = e[a]);
  6485. d.prototype = e.prototype;
  6486. b.prototype = new d
  6487. };
  6488. (function (b) {
  6489. var e = function (b) {
  6490. function a() {
  6491. b.call(this);
  6492. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6493. }
  6494. __extends(a, b);
  6495. a.prototype.analyzeData = function (a, b) {
  6496. var d = a.name;
  6497. if (!this.fileDic[d] && b)
  6498. try {
  6499. var e = egret.XML.parse(b);
  6500. this.fileDic[d] = e
  6501. } catch (g) {}
  6502. };
  6503. return a
  6504. }
  6505. (b.BinAnalyzer);
  6506. b.XMLAnalyzer = e;
  6507. e.prototype.__class__ = "RES.XMLAnalyzer"
  6508. })(RES || (RES = {}));
  6509. __extends = this.__extends || function (b, e) {
  6510. function d() {
  6511. this.constructor = b
  6512. }
  6513. for (var a in e)
  6514. e.hasOwnProperty(a) && (b[a] = e[a]);
  6515. d.prototype = e.prototype;
  6516. b.prototype = new d
  6517. };
  6518. (function (b) {
  6519. b.loadConfig = function (a, b, e) {
  6520. void 0 === b && (b = "");
  6521. void 0 === e && (e = "json");
  6522. d.loadConfig(a, b, e)
  6523. };
  6524. b.loadGroup = function (a, b) {
  6525. void 0 === b && (b = 0);
  6526. d.loadGroup(a, b)
  6527. };
  6528. b.isGroupLoaded = function (a) {
  6529. return d.isGroupLoaded(a)
  6530. };
  6531. b.getGroupByName = function (a) {
  6532. return d.getGroupByName(a)
  6533. };
  6534. b.createGroup = function (a, b, e) {
  6535. void 0 === e && (e = !1);
  6536. return d.createGroup(a, b, e)
  6537. };
  6538. b.hasRes = function (a) {
  6539. return d.hasRes(a)
  6540. };
  6541. b.getRes = function (a) {
  6542. return d.getRes(a)
  6543. };
  6544. b.getResAsync = function (a, b, e) {
  6545. d.getResAsync(a, b, e)
  6546. };
  6547. b.getResByUrl =
  6548. function (a, b, e, h) {
  6549. void 0 === h && (h = "");
  6550. d.getResByUrl(a, b, e, h)
  6551. };
  6552. b.destroyRes = function (a) {
  6553. return d.destroyRes(a)
  6554. };
  6555. b.setMaxLoadingThread = function (a) {
  6556. d.setMaxLoadingThread(a)
  6557. };
  6558. b.addEventListener = function (a, b, e, h, n) {
  6559. void 0 === h && (h = !1);
  6560. void 0 === n && (n = 0);
  6561. d.addEventListener(a, b, e, h, n)
  6562. };
  6563. b.removeEventListener = function (a, b, e, h) {
  6564. void 0 === h && (h = !1);
  6565. d.removeEventListener(a, b, e, h)
  6566. };
  6567. var e = function (a) {
  6568. function c() {
  6569. a.call(this);
  6570. this.analyzerDic = {};
  6571. this.configItemList = [];
  6572. this.configComplete = this.callLaterFlag = !1;
  6573. this.loadedGroups =
  6574. [];
  6575. this.groupNameList = [];
  6576. this.asyncDic = {};
  6577. this.init()
  6578. }
  6579. __extends(c, a);
  6580. c.prototype.getAnalyzerByType = function (a) {
  6581. var c = this.analyzerDic[a];
  6582. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  6583. return c
  6584. };
  6585. c.prototype.init = function () {
  6586. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  6587. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer,
  6588. b.ResourceItem.TYPE_IMAGE);
  6589. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  6590. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  6591. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  6592. egret.Injector.hasMapRule(b.AnalyzerBase,
  6593. b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  6594. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  6595. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  6596. this.resConfig = new b.ResourceConfig;
  6597. this.resLoader = new b.ResourceLoader;
  6598. this.resLoader.callBack = this.onResourceItemComp;
  6599. this.resLoader.resInstance = this;
  6600. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  6601. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  6602. };
  6603. c.prototype.loadConfig = function (a, b, c) {
  6604. void 0 === c && (c = "json");
  6605. this.configItemList.push({
  6606. url : a,
  6607. resourceRoot : b,
  6608. type : c
  6609. });
  6610. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6611. };
  6612. c.prototype.startLoadConfig = function () {
  6613. this.callLaterFlag = !1;
  6614. var a = this.configItemList;
  6615. this.configItemList = [];
  6616. this.loadingConfigList = a;
  6617. for (var d = a.length, e = [], g = 0; g < d; g++) {
  6618. var f = a[g],
  6619. f = new b.ResourceItem(f.url, f.url, f.type);
  6620. e.push(f)
  6621. }
  6622. this.resLoader.loadGroup(e, c.GROUP_CONFIG, Number.MAX_VALUE)
  6623. };
  6624. c.prototype.isGroupLoaded = function (a) {
  6625. return -1 != this.loadedGroups.indexOf(a)
  6626. };
  6627. c.prototype.getGroupByName = function (a) {
  6628. return this.resConfig.getGroupByName(a)
  6629. };
  6630. c.prototype.loadGroup = function (a, c) {
  6631. void 0 === c && (c = 0);
  6632. if (-1 != this.loadedGroups.indexOf(a))
  6633. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE,
  6634. a);
  6635. else if (!this.resLoader.isGroupInLoading(a))
  6636. if (this.configComplete) {
  6637. var d = this.resConfig.getGroupByName(a);
  6638. this.resLoader.loadGroup(d, a, c)
  6639. } else
  6640. this.groupNameList.push({
  6641. name : a,
  6642. priority : c
  6643. })
  6644. };
  6645. c.prototype.createGroup = function (a, b, c) {
  6646. void 0 === c && (c = !1);
  6647. if (c) {
  6648. var d = this.loadedGroups.indexOf(a);
  6649. -1 != d && this.loadedGroups.splice(d, 1)
  6650. }
  6651. return this.resConfig.createGroup(a, b, c)
  6652. };
  6653. c.prototype.onGroupComp = function (a) {
  6654. if (a.groupName == c.GROUP_CONFIG) {
  6655. a = this.loadingConfigList.length;
  6656. for (var d = 0; d < a; d++) {
  6657. var e = this.loadingConfigList[d],
  6658. g = this.getAnalyzerByType(e.type),
  6659. f = g.getRes(e.url);
  6660. g.destroyRes(e.url);
  6661. this.resConfig.parseConfig(f, e.resourceRoot)
  6662. }
  6663. this.configComplete = !0;
  6664. this.loadingConfigList = null;
  6665. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  6666. e = this.groupNameList;
  6667. a = e.length;
  6668. for (d = 0; d < a; d++)
  6669. g = e[d], this.loadGroup(g.name, g.priority);
  6670. this.groupNameList = []
  6671. } else
  6672. this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  6673. };
  6674. c.prototype.onGroupError = function (a) {
  6675. a.groupName == c.GROUP_CONFIG ? (this.loadingConfigList =
  6676. null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  6677. };
  6678. c.prototype.hasRes = function (a) {
  6679. var c = this.resConfig.getType(a);
  6680. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a), "" == c) ? !1 : !0
  6681. };
  6682. c.prototype.getRes = function (a) {
  6683. var c = this.resConfig.getType(a);
  6684. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(c), "" == c) ? null : this.getAnalyzerByType(c).getRes(a)
  6685. };
  6686. c.prototype.getResAsync = function (a, c, d) {
  6687. var e = this.resConfig.getType(a),
  6688. f = this.resConfig.getName(a);
  6689. if ("" == e && (f = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(f), "" == e)) {
  6690. c.call(d, null);
  6691. return
  6692. }
  6693. (e = this.getAnalyzerByType(e).getRes(a)) ? c.call(d, e) : (a = {
  6694. key : a,
  6695. compFunc : c,
  6696. thisObject : d
  6697. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6698. };
  6699. c.prototype.getResByUrl = function (a, c, d, e) {
  6700. void 0 === e && (e = "");
  6701. if (a) {
  6702. e || (e = this.getTypeByUrl(a));
  6703. var f = this.getAnalyzerByType(e).getRes(a);
  6704. f ? c.call(d, f) :
  6705. (c = {
  6706. key : a,
  6707. compFunc : c,
  6708. thisObject : d
  6709. }, this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  6710. } else
  6711. c.call(d, null)
  6712. };
  6713. c.prototype.getTypeByUrl = function (a) {
  6714. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6715. switch (a) {
  6716. case b.ResourceItem.TYPE_XML:
  6717. case b.ResourceItem.TYPE_JSON:
  6718. case b.ResourceItem.TYPE_SHEET:
  6719. break;
  6720. case "png":
  6721. case "jpg":
  6722. case "gif":
  6723. a = b.ResourceItem.TYPE_IMAGE;
  6724. break;
  6725. case "fnt":
  6726. a = b.ResourceItem.TYPE_FONT;
  6727. break;
  6728. case "txt":
  6729. a = b.ResourceItem.TYPE_TEXT;
  6730. break;
  6731. case "mp3":
  6732. case "ogg":
  6733. case "mpeg":
  6734. case "wav":
  6735. case "m4a":
  6736. case "mp4":
  6737. case "aiff":
  6738. case "wma":
  6739. case "mid":
  6740. a = b.ResourceItem.TYPE_SOUND;
  6741. break;
  6742. default:
  6743. a = b.ResourceItem.TYPE_BIN
  6744. }
  6745. return a
  6746. };
  6747. c.prototype.onResourceItemComp = function (a) {
  6748. var b = this.asyncDic[a.name];
  6749. delete this.asyncDic[a.name];
  6750. a = this.getAnalyzerByType(a.type);
  6751. for (var c = b.length, d = 0; d < c; d++) {
  6752. var e = b[d],
  6753. k = a.getRes(e.key);
  6754. e.compFunc.call(e.thisObject, k, e.key)
  6755. }
  6756. };
  6757. c.prototype.destroyRes = function (a) {
  6758. var b = this.resConfig.getRawGroupByName(a);
  6759. if (b) {
  6760. var c =
  6761. this.loadedGroups.indexOf(a);
  6762. -1 != c && this.loadedGroups.splice(c, 1);
  6763. a = b.length;
  6764. for (var d = 0; d < a; d++) {
  6765. c = b[d];
  6766. c.loaded = !1;
  6767. var e = this.getAnalyzerByType(c.type);
  6768. e.destroyRes(c.name)
  6769. }
  6770. return !0
  6771. }
  6772. b = this.resConfig.getType(a);
  6773. if ("" == b)
  6774. return !1;
  6775. c = this.resConfig.getRawResourceItem(a);
  6776. c.loaded = !1;
  6777. e = this.getAnalyzerByType(b);
  6778. return e.destroyRes(a)
  6779. };
  6780. c.prototype.setMaxLoadingThread = function (a) {
  6781. 1 > a && (a = 1);
  6782. this.resLoader.thread = a
  6783. };
  6784. c.GROUP_CONFIG = "RES__CONFIG";
  6785. return c
  6786. }
  6787. (egret.EventDispatcher);
  6788. e.prototype.__class__ = "RES.Resource";
  6789. var d = new e
  6790. })(RES || (RES = {}));
  6791. __extends = this.__extends || function (b, e) {
  6792. function d() {
  6793. this.constructor = b
  6794. }
  6795. for (var a in e)
  6796. e.hasOwnProperty(a) && (b[a] = e[a]);
  6797. d.prototype = e.prototype;
  6798. b.prototype = new d
  6799. };
  6800. (function (b) {
  6801. var e = function (d) {
  6802. function a(b) {
  6803. void 0 === b && (b = 60);
  6804. d.call(this);
  6805. this.frameRate = b;
  6806. this._time = 0;
  6807. this._isActivate = !0;
  6808. 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 ||
  6809. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6810. a.requestAnimationFrame || (a.requestAnimationFrame = function (a) {
  6811. return window.setTimeout(a, 1E3 / b)
  6812. });
  6813. a.cancelAnimationFrame || (a.cancelAnimationFrame = function (a) {
  6814. return window.clearTimeout(a)
  6815. });
  6816. a.instance = this;
  6817. this.registerListener()
  6818. }
  6819. __extends(a, d);
  6820. a.prototype.enterFrame = function () {
  6821. var c = a.instance,
  6822. d = a._thisObject,
  6823. e = a._callback,
  6824. n = b.getTimer(),
  6825. g = n -
  6826. c._time;
  6827. c._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6828. e.call(d, g);
  6829. c._time = n
  6830. };
  6831. a.prototype.executeMainLoop = function (b, d) {
  6832. a._callback = b;
  6833. a._thisObject = d;
  6834. this.enterFrame()
  6835. };
  6836. a.prototype.reset = function () {
  6837. var c = a.instance;
  6838. c._requestAnimationId && (c._time = b.getTimer(), a.cancelAnimationFrame.call(window, c._requestAnimationId), c.enterFrame())
  6839. };
  6840. a.prototype.registerListener = function () {
  6841. var c = this,
  6842. d = function () {
  6843. c._isActivate && (c._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6844. },
  6845. e = function () {
  6846. c._isActivate || (c._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6847. },
  6848. n = function () {
  6849. document[g] ? d() : e()
  6850. };
  6851. window.addEventListener("focus", e, !1);
  6852. window.addEventListener("blur", d, !1);
  6853. var g,
  6854. f;
  6855. "undefined" !== typeof document.hidden ? (g = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (g = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (g = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ?
  6856. (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6857. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", d, !1));
  6858. g && f && document.addEventListener(f, n, !1)
  6859. };
  6860. return a
  6861. }
  6862. (b.DeviceContext);
  6863. b.HTML5DeviceContext = e;
  6864. e.prototype.__class__ = "egret.HTML5DeviceContext"
  6865. })(egret || (egret = {}));
  6866. var egret_html5_localStorage;
  6867. (function (b) {
  6868. b.getItem = function (b) {
  6869. return window.localStorage.getItem(b)
  6870. };
  6871. b.setItem = function (b, d) {
  6872. try {
  6873. return window.localStorage.setItem(b, d),
  6874. !0
  6875. } catch (a) {
  6876. return console.log("egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key=" + b + "&value=" + d),
  6877. !1
  6878. }
  6879. };
  6880. b.removeItem = function (b) {
  6881. window.localStorage.removeItem(b)
  6882. };
  6883. b.clear = function () {
  6884. window.localStorage.clear()
  6885. };
  6886. b.init = function () {
  6887. for (var e in b)
  6888. egret.localStorage[e] = b[e]
  6889. }
  6890. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6891. egret_html5_localStorage.init();
  6892. __extends = this.__extends || function (b, e) {
  6893. function d() {
  6894. this.constructor = b
  6895. }
  6896. for (var a in e)
  6897. e.hasOwnProperty(a) && (b[a] = e[a]);
  6898. d.prototype = e.prototype;
  6899. b.prototype = new d
  6900. };
  6901. (function (b) {
  6902. var e = function (d) {
  6903. function a(a) {
  6904. d.call(this);
  6905. this.globalAlpha = 1;
  6906. this.canvas = a || this.createCanvas();
  6907. this.canvasContext = this.canvas.getContext("2d");
  6908. this._cacheCanvas = document.createElement("canvas");
  6909. this._cacheCanvas.width = this.canvas.width;
  6910. this._cacheCanvas.height = this.canvas.height;
  6911. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  6912. this.onResize();
  6913. var b = this.canvasContext.setTransform,
  6914. e = this;
  6915. this._cacheCanvasContext.setTransform = function (a, c, d, k, m, p) {
  6916. e._matrixA = a;
  6917. e._matrixB =
  6918. c;
  6919. e._matrixC = d;
  6920. e._matrixD = k;
  6921. e._matrixTx = m;
  6922. e._matrixTy = p;
  6923. b.call(e._cacheCanvasContext, a, c, d, k, m, p)
  6924. };
  6925. this._matrixA = 1;
  6926. this._matrixC = this._matrixB = 0;
  6927. this._matrixD = 1;
  6928. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6929. this.initBlendMode()
  6930. }
  6931. __extends(a, d);
  6932. a.prototype.createCanvas = function () {
  6933. var a = b.Browser.getInstance().$("#egretCanvas");
  6934. if (!a) {
  6935. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  6936. a = b.Browser.getInstance().$new("canvas");
  6937. a.id = "egretCanvas";
  6938. d.appendChild(a)
  6939. }
  6940. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  6941. this.onResize, this);
  6942. return a
  6943. };
  6944. a.prototype.onResize = function () {
  6945. if (this.canvas) {
  6946. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6947. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6948. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6949. this.canvas.style.width = a.style.width;
  6950. this.canvas.style.height = a.style.height;
  6951. this._cacheCanvas.width = this.canvas.width;
  6952. this._cacheCanvas.height = this.canvas.height;
  6953. this._cacheCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6954. this._cacheCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6955. this._cacheCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6956. this._cacheCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6957. }
  6958. };
  6959. a.prototype.clearScreen = function () {
  6960. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  6961. var n = a[d];
  6962. this.clearRect(n.x, n.y, n.width, n.height)
  6963. }
  6964. a = b.MainContext.instance.stage;
  6965. this._cacheCanvasContext.clearRect(0,
  6966. 0, a.stageWidth, a.stageHeight);
  6967. this.renderCost = 0
  6968. };
  6969. a.prototype.clearRect = function (a, b, d, e) {
  6970. this.canvasContext.clearRect(a, b, d * window.devicePixelRatio, e * window.devicePixelRatio)
  6971. };
  6972. a.prototype.drawImage = function (a, e, h, n, g, f, k, m, p, q) {
  6973. void 0 === q && (q = void 0);
  6974. var r = a._bitmapData;
  6975. f += this._transformTx;
  6976. k += this._transformTy;
  6977. var t = b.getTimer();
  6978. void 0 === q ? this._cacheCanvasContext.drawImage(r, e, h, n, g, f, k, m, p) : this.drawRepeatImage(a, e, h, n, g, f, k, m, p, q);
  6979. d.prototype.drawImage.call(this, a, e, h, n, g, f, k, m, p, q);
  6980. this.renderCost +=
  6981. b.getTimer() - t
  6982. };
  6983. a.prototype.drawRepeatImage = function (a, d, e, n, g, f, k, m, p, q) {
  6984. if (void 0 === a.pattern) {
  6985. var r = b.MainContext.instance.rendererContext.texture_scale_factor,
  6986. t = a._bitmapData,
  6987. s = t;
  6988. if (t.width != n || t.height != g || 1 != r)
  6989. s = document.createElement("canvas"), s.width = n * r, s.height = g * r, s.getContext("2d").drawImage(t, d, e, n, g, 0, 0, n * r, g * r);
  6990. d = this._cacheCanvasContext.createPattern(s, q);
  6991. a.pattern = d
  6992. }
  6993. this._cacheCanvasContext.fillStyle = a.pattern;
  6994. this._cacheCanvasContext.translate(f, k);
  6995. this._cacheCanvasContext.fillRect(0,
  6996. 0, m, p);
  6997. this._cacheCanvasContext.translate(-f, -k)
  6998. };
  6999. a.prototype.setTransform = function (a) {
  7000. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this._cacheCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  7001. };
  7002. a.prototype.setAlpha =
  7003. function (a, d) {
  7004. a != this.globalAlpha && (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  7005. d ? (this.blendValue = this.blendModes[d], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  7006. };
  7007. a.prototype.initBlendMode = function () {
  7008. this.blendModes = {};
  7009. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  7010. this.blendModes[b.BlendMode.ADD] = "lighter"
  7011. };
  7012. a.prototype.setupFont = function (a, b) {
  7013. void 0 === b && (b = null);
  7014. b = b || {};
  7015. var d = null == b.size ? a._size : b.size,
  7016. e = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  7017. g = this._cacheCanvasContext,
  7018. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  7019. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  7020. g.font = f + (d + "px " + e);
  7021. g.textAlign = "left";
  7022. g.textBaseline = "middle"
  7023. };
  7024. a.prototype.measureText = function (a) {
  7025. return this._cacheCanvasContext.measureText(a).width
  7026. };
  7027. a.prototype.drawText = function (a, e, h, n, g, f) {
  7028. void 0 === f && (f = null);
  7029. this.setupFont(a, f);
  7030. f = f || {};
  7031. var k;
  7032. k = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  7033. var m;
  7034. m = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  7035. var p;
  7036. p = null != f.stroke ? f.stroke : a._stroke;
  7037. var q = this._cacheCanvasContext;
  7038. q.fillStyle = k;
  7039. q.strokeStyle = m;
  7040. p && (q.lineWidth = 2 * p, q.strokeText(e, h + this._transformTx, n + this._transformTy, g || 65535));
  7041. q.fillText(e, h + this._transformTx, n + this._transformTy, g || 65535);
  7042. d.prototype.drawText.call(this, a, e, h, n, g, f)
  7043. };
  7044. a.prototype.strokeRect =
  7045. function (a, b, d, e, g) {
  7046. this._cacheCanvasContext.strokeStyle = g;
  7047. this._cacheCanvasContext.strokeRect(a, b, d, e)
  7048. };
  7049. a.prototype.pushMask = function (a) {
  7050. this._cacheCanvasContext.save();
  7051. this._cacheCanvasContext.beginPath();
  7052. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  7053. this._cacheCanvasContext.clip();
  7054. this._cacheCanvasContext.closePath()
  7055. };
  7056. a.prototype.popMask = function () {
  7057. this._cacheCanvasContext.restore();
  7058. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  7059. };
  7060. a.prototype.onRenderStart =
  7061. function () {
  7062. this._cacheCanvasContext.save()
  7063. };
  7064. a.prototype.onRenderFinish = function () {
  7065. this._cacheCanvasContext.restore();
  7066. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  7067. for (var a = this._cacheCanvas.width, d = this._cacheCanvas.height, e = b.RenderFilter.getInstance().getDrawAreaList(), n = 0, g = e.length; n < g; n++) {
  7068. var f = e[n],
  7069. k = f.x,
  7070. m = f.y,
  7071. p = f.width,
  7072. f = f.height;
  7073. k + p > a && (p = a - k);
  7074. m + f > d && (f = d - m);
  7075. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, k, m, p, f, k, m, p, f)
  7076. }
  7077. };
  7078. return a
  7079. }
  7080. (b.RendererContext);
  7081. b.HTML5CanvasRenderer =
  7082. e;
  7083. e.prototype.__class__ = "egret.HTML5CanvasRenderer"
  7084. })(egret || (egret = {}));
  7085. var egret_h5_graphics;
  7086. (function (b) {
  7087. b.beginFill = function (b, a) {
  7088. void 0 === a && (a = 1);
  7089. var c = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  7090. this.fillStyleColor = c;
  7091. this.commandQueue.push(new e(this._setStyle, this, [c]))
  7092. };
  7093. b.drawRect = function (b, a, c, l) {
  7094. this.commandQueue.push(new e(function (a, b, c, d) {
  7095. var e = this.renderContext;
  7096. this.canvasContext.beginPath();
  7097. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  7098. this.canvasContext.closePath()
  7099. }, this, [b, a, c, l]));
  7100. this._fill()
  7101. };
  7102. b.drawCircle = function (b, a, c) {
  7103. this.commandQueue.push(new e(function (a,
  7104. b, c) {
  7105. var d = this.renderContext;
  7106. this.canvasContext.beginPath();
  7107. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  7108. this.canvasContext.closePath()
  7109. }, this, [b, a, c]));
  7110. this._fill()
  7111. };
  7112. b.drawRoundRect = function (b, a, c, l, h, n) {
  7113. this.commandQueue.push(new e(function (a, b, c, d, e, l) {
  7114. var h = this.renderContext;
  7115. a = h._transformTx + a;
  7116. b = h._transformTy + b;
  7117. e /= 2;
  7118. l = l ? l / 2 : e;
  7119. c = a + c;
  7120. d = b + d;
  7121. h = d - l;
  7122. this.canvasContext.beginPath();
  7123. this.canvasContext.moveTo(c, h);
  7124. this.canvasContext.quadraticCurveTo(c, d, c - e, d);
  7125. this.canvasContext.lineTo(a +
  7126. e, d);
  7127. this.canvasContext.quadraticCurveTo(a, d, a, d - l);
  7128. this.canvasContext.lineTo(a, b + l);
  7129. this.canvasContext.quadraticCurveTo(a, b, a + e, b);
  7130. this.canvasContext.lineTo(c - e, b);
  7131. this.canvasContext.quadraticCurveTo(c, b, c, b + l);
  7132. this.canvasContext.lineTo(c, h);
  7133. this.canvasContext.closePath()
  7134. }, this, [b, a, c, l, h, n]));
  7135. this._fill()
  7136. };
  7137. b.drawEllipse = function (b, a, c, l) {
  7138. this.commandQueue.push(new e(function (a, b, c, d) {
  7139. var e = this.renderContext;
  7140. this.canvasContext.save();
  7141. a = e._transformTx + a;
  7142. b = e._transformTy + b;
  7143. var e = c > d ? c : d,
  7144. l = c / e;
  7145. d /=
  7146. e;
  7147. this.canvasContext.scale(l, d);
  7148. this.canvasContext.beginPath();
  7149. this.canvasContext.moveTo((a + c) / l, b / d);
  7150. this.canvasContext.arc(a / l, b / d, e, 0, 2 * Math.PI);
  7151. this.canvasContext.closePath();
  7152. this.canvasContext.restore();
  7153. this.canvasContext.stroke()
  7154. }, this, [b, a, c, l]));
  7155. this._fill()
  7156. };
  7157. b.lineStyle = function (b, a, c, l, h, n, g, f) {
  7158. void 0 === b && (b = NaN);
  7159. void 0 === a && (a = 0);
  7160. void 0 === c && (c = 1);
  7161. void 0 === l && (l = !1);
  7162. void 0 === h && (h = "normal");
  7163. void 0 === n && (n = null);
  7164. void 0 === g && (g = null);
  7165. void 0 === f && (f = 3);
  7166. this.strokeStyleColor && (this.createEndLineCommand(),
  7167. this.commandQueue.push(this.endLineCommand));
  7168. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + c + ")";
  7169. this.commandQueue.push(new e(function (a, b) {
  7170. this.canvasContext.lineWidth = a;
  7171. this.canvasContext.strokeStyle = b;
  7172. this.canvasContext.beginPath()
  7173. }, this, [b, a]));
  7174. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  7175. this.moveTo(this.lineX, this.lineY)
  7176. };
  7177. b.lineTo = function (b, a) {
  7178. this.commandQueue.push(new e(function (a, b) {
  7179. var d = this.renderContext;
  7180. this.canvasContext.lineTo(d._transformTx +
  7181. a, d._transformTy + b)
  7182. }, this, [b, a]));
  7183. this.lineX = b;
  7184. this.lineY = a
  7185. };
  7186. b.curveTo = function (b, a, c, l) {
  7187. this.commandQueue.push(new e(function (a, b, c, d) {
  7188. var e = this.renderContext;
  7189. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, e._transformTx + c, e._transformTy + d)
  7190. }, this, [b, a, c, l]));
  7191. this.lineX = c;
  7192. this.lineY = l
  7193. };
  7194. b.moveTo = function (b, a) {
  7195. this.commandQueue.push(new e(function (a, b) {
  7196. var d = this.renderContext;
  7197. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + b)
  7198. }, this, [b, a]))
  7199. };
  7200. b.clear = function () {
  7201. this.lineY =
  7202. this.lineX = this.commandQueue.length = 0;
  7203. this.fillStyleColor = this.strokeStyleColor = null
  7204. };
  7205. b.createEndFillCommand = function () {
  7206. this.endFillCommand || (this.endFillCommand = new e(function () {
  7207. this.canvasContext.fill();
  7208. this.canvasContext.closePath()
  7209. }, this, null))
  7210. };
  7211. b.endFill = function () {
  7212. null != this.fillStyleColor && this._fill();
  7213. this.fillStyleColor = null
  7214. };
  7215. b._fill = function () {
  7216. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  7217. };
  7218. b.createEndLineCommand = function () {
  7219. this.endLineCommand ||
  7220. (this.endLineCommand = new e(function () {
  7221. this.canvasContext.stroke();
  7222. this.canvasContext.closePath()
  7223. }, this, null))
  7224. };
  7225. b._draw = function (b) {
  7226. var a = this.commandQueue.length;
  7227. if (0 != a) {
  7228. this.renderContext = b;
  7229. b = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  7230. b.save();
  7231. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  7232. for (var c = 0; c < a; c++) {
  7233. var e = this.commandQueue[c];
  7234. e.method.apply(e.thisObject, e.args)
  7235. }
  7236. b.restore()
  7237. }
  7238. };
  7239. var e = function () {
  7240. return function (b, a, c) {
  7241. this.method = b;
  7242. this.thisObject = a;
  7243. this.args = c
  7244. }
  7245. }
  7246. ();
  7247. e.prototype.__class__ = "egret_h5_graphics.Command";
  7248. b._setStyle = function (b) {
  7249. this.canvasContext.fillStyle = b;
  7250. this.canvasContext.beginPath()
  7251. };
  7252. b.init = function () {
  7253. for (var d in b)
  7254. egret.Graphics.prototype[d] = b[d];
  7255. egret.RendererContext.createRendererContext = function (a) {
  7256. return new egret.HTML5CanvasRenderer(a)
  7257. }
  7258. }
  7259. })(egret_h5_graphics || (egret_h5_graphics = {}));
  7260. egret_h5_graphics.init();
  7261. __extends = this.__extends || function (b, e) {
  7262. function d() {
  7263. this.constructor = b
  7264. }
  7265. for (var a in e)
  7266. e.hasOwnProperty(a) && (b[a] = e[a]);
  7267. d.prototype = e.prototype;
  7268. b.prototype = new d
  7269. };
  7270. (function (b) {
  7271. var e = function (d) {
  7272. function a(a) {
  7273. d.call(this);
  7274. this.size = 2E3;
  7275. this.vertSize = 5;
  7276. this.contextLost = !1;
  7277. this.glContextId = 0;
  7278. this.currentBlendMode = "";
  7279. this.currentBaseTexture = null;
  7280. this.currentBatchSize = 0;
  7281. this.maskList = [];
  7282. this.maskDataFreeList = [];
  7283. this.canvasContext = document.createElement("canvas").getContext("2d");
  7284. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  7285. this.canvas = a || this.createCanvas();
  7286. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7287. this.canvas.addEventListener("webglcontextrestored",
  7288. this.handleContextRestored.bind(this), !1);
  7289. this.onResize();
  7290. this.projectionX = this.canvas.width / 2;
  7291. this.projectionY = -this.canvas.height / 2;
  7292. a = 6 * this.size;
  7293. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7294. this.indices = new Uint16Array(a);
  7295. for (var e = 0, h = 0; e < a; e += 6, h += 4)
  7296. this.indices[e + 0] = h + 0, this.indices[e + 1] = h + 1, this.indices[e + 2] = h + 2, this.indices[e + 3] = h + 0, this.indices[e + 4] = h + 2, this.indices[e + 5] = h + 3;
  7297. this.initWebGL();
  7298. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7299. this.worldTransform = new b.Matrix;
  7300. this.initBlendMode();
  7301. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  7302. b.TextField.prototype._draw = function (a) {
  7303. this.getDirty() && (this.cacheAsBitmap = !0);
  7304. b.DisplayObject.prototype._draw.call(this, a)
  7305. }
  7306. }
  7307. __extends(a, d);
  7308. a.prototype.createCanvas = function () {
  7309. var a = b.Browser.getInstance().$("#egretCanvas");
  7310. if (!a) {
  7311. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  7312. a = b.Browser.getInstance().$new("canvas");
  7313. a.id = "egretCanvas";
  7314. d.appendChild(a)
  7315. }
  7316. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  7317. this.onResize, this);
  7318. return a
  7319. };
  7320. a.prototype.onResize = function () {
  7321. if (this.canvas) {
  7322. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7323. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  7324. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  7325. this.canvas.style.width = a.style.width;
  7326. this.canvas.style.height = a.style.height;
  7327. this.projectionX = this.canvas.width / 2;
  7328. this.projectionY = -this.canvas.height / 2
  7329. }
  7330. };
  7331. a.prototype.handleContextLost = function () {
  7332. this.contextLost = !0
  7333. };
  7334. a.prototype.handleContextRestored =
  7335. function () {
  7336. this.initWebGL();
  7337. this.shaderManager.setContext(this.gl);
  7338. this.contextLost = !1
  7339. };
  7340. a.prototype.initWebGL = function () {
  7341. for (var a = {
  7342. stencil : !0
  7343. }, b, d = ["experimental-webgl", "webgl"], e = 0; e < d.length; e++) {
  7344. try {
  7345. b = this.canvas.getContext(d[e], a)
  7346. } catch (g) {}
  7347. if (b)
  7348. break
  7349. }
  7350. if (!b)
  7351. throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  7352. this.setContext(b)
  7353. };
  7354. a.prototype.setContext = function (a) {
  7355. this.gl = a;
  7356. a.id = this.glContextId++;
  7357. this.vertexBuffer = a.createBuffer();
  7358. this.indexBuffer = a.createBuffer();
  7359. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  7360. this.indexBuffer);
  7361. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7362. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7363. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7364. a.disable(a.DEPTH_TEST);
  7365. a.disable(a.CULL_FACE);
  7366. a.enable(a.BLEND);
  7367. a.colorMask(!0, !0, !0, !0)
  7368. };
  7369. a.prototype.initBlendMode = function () {
  7370. this.blendModesWebGL = {};
  7371. this.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  7372. this.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  7373. };
  7374. a.prototype.start =
  7375. function () {
  7376. if (!this.contextLost) {
  7377. var a = this.gl;
  7378. a.activeTexture(a.TEXTURE0);
  7379. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7380. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7381. var b;
  7382. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  7383. this.shaderManager.activateShader(b);
  7384. b.syncUniforms();
  7385. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7386. var d = 4 * this.vertSize;
  7387. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, d, 0);
  7388. a.vertexAttribPointer(b.aTextureCoord,
  7389. 2, a.FLOAT, !1, d, 8);
  7390. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, d, 16)
  7391. }
  7392. };
  7393. a.prototype.clearScreen = function () {
  7394. var a = this.gl;
  7395. a.colorMask(!0, !0, !0, !0);
  7396. for (var d = b.RenderFilter.getInstance().getDrawAreaList(), e = 0, n = d.length; e < n; e++) {
  7397. var g = d[e];
  7398. a.viewport(g.x, g.y, g.width, g.height);
  7399. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7400. a.clearColor(0, 0, 0, 0);
  7401. a.clear(a.COLOR_BUFFER_BIT)
  7402. }
  7403. d = b.MainContext.instance.stage;
  7404. a.viewport(0, 0, d.stageWidth, d.stageHeight);
  7405. this.renderCost = 0
  7406. };
  7407. a.prototype.setBlendMode = function (a) {
  7408. a ||
  7409. (a = b.BlendMode.NORMAL);
  7410. if (this.currentBlendMode != a) {
  7411. var d = this.blendModesWebGL[a];
  7412. d && (this._draw(), this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = a)
  7413. }
  7414. };
  7415. a.prototype.drawRepeatImage = function (a, d, e, n, g, f, k, m, p, q) {
  7416. q = b.MainContext.instance.rendererContext.texture_scale_factor;
  7417. n *= q;
  7418. for (g *= q; f < m; f += n)
  7419. for (var r = k; r < p; r += g) {
  7420. var t = Math.min(n, m - f),
  7421. s = Math.min(g, p - r);
  7422. this.drawImage(a, d, e, t / q, s / q, f, r, t, s)
  7423. }
  7424. };
  7425. a.prototype.drawImage = function (a, b, d, e, g, f, k, m, p, q) {
  7426. void 0 === q && (q = void 0);
  7427. if (!this.contextLost)
  7428. if (void 0 !==
  7429. q)
  7430. this.drawRepeatImage(a, b, d, e, g, f, k, m, p, q);
  7431. else {
  7432. this.createWebGLTexture(a);
  7433. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1)
  7434. this._draw(), this.currentBaseTexture = a.webGLTexture;
  7435. var r = this.worldTransform,
  7436. t = r.a,
  7437. s = r.b,
  7438. u = r.c,
  7439. v = r.d,
  7440. x = r.tx,
  7441. y = r.ty;
  7442. 0 == f && 0 == k || r.append(1, 0, 0, 1, f, k);
  7443. 1 == e / m && 1 == g / p || r.append(m / e, 0, 0, p / g, 0, 0);
  7444. f = r.a;
  7445. k = r.b;
  7446. m = r.c;
  7447. p = r.d;
  7448. q = r.tx;
  7449. var w = r.ty;
  7450. r.a = t;
  7451. r.b = s;
  7452. r.c = u;
  7453. r.d = v;
  7454. r.tx = x;
  7455. r.ty = y;
  7456. t = a._sourceWidth;
  7457. s = a._sourceHeight;
  7458. a = e;
  7459. r = g;
  7460. b /= t;
  7461. d /= s;
  7462. e /= t;
  7463. g /= s;
  7464. t = this.vertices;
  7465. s = 4 * this.currentBatchSize * this.vertSize;
  7466. u = this.worldAlpha;
  7467. t[s++] = q;
  7468. t[s++] = w;
  7469. t[s++] = b;
  7470. t[s++] = d;
  7471. t[s++] = u;
  7472. t[s++] = f * a + q;
  7473. t[s++] = k * a + w;
  7474. t[s++] = e + b;
  7475. t[s++] = d;
  7476. t[s++] = u;
  7477. t[s++] = f * a + m * r + q;
  7478. t[s++] = p * r + k * a + w;
  7479. t[s++] = e + b;
  7480. t[s++] = g + d;
  7481. t[s++] = u;
  7482. t[s++] = m * r + q;
  7483. t[s++] = p * r + w;
  7484. t[s++] = b;
  7485. t[s++] = g + d;
  7486. t[s++] = u;
  7487. this.currentBatchSize++
  7488. }
  7489. };
  7490. a.prototype._draw = function () {
  7491. if (0 != this.currentBatchSize && !this.contextLost) {
  7492. var a = b.getTimer();
  7493. this.start();
  7494. var d = this.gl;
  7495. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  7496. var e = this.vertices.subarray(0,
  7497. 4 * this.currentBatchSize * this.vertSize);
  7498. d.bufferSubData(d.ARRAY_BUFFER, 0, e);
  7499. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  7500. this.currentBatchSize = 0;
  7501. this.renderCost += b.getTimer() - a;
  7502. b.Profiler.getInstance().onDrawImage()
  7503. }
  7504. };
  7505. a.prototype.setTransform = function (a) {
  7506. var b = this.worldTransform;
  7507. b.a = a.a;
  7508. b.b = a.b;
  7509. b.c = a.c;
  7510. b.d = a.d;
  7511. b.tx = a.tx;
  7512. b.ty = a.ty
  7513. };
  7514. a.prototype.setAlpha = function (a, b) {
  7515. this.worldAlpha = a;
  7516. this.setBlendMode(b)
  7517. };
  7518. a.prototype.createWebGLTexture = function (a) {
  7519. if (!a.webGLTexture) {
  7520. var b =
  7521. this.gl;
  7522. a.webGLTexture = b.createTexture();
  7523. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  7524. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7525. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  7526. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7527. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7528. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7529. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7530. b.bindTexture(b.TEXTURE_2D, null)
  7531. }
  7532. };
  7533. a.prototype.pushMask =
  7534. function (a) {
  7535. this._draw();
  7536. var b = this.gl;
  7537. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  7538. var d = this.maskDataFreeList.pop();
  7539. d ? (d.x = a.x, d.y = a.y, d.w = a.width, d.h = a.height) : d = {
  7540. x : a.x,
  7541. y : a.y,
  7542. w : a.width,
  7543. h : a.height
  7544. };
  7545. this.maskList.push(d);
  7546. b.colorMask(!1, !1, !1, !1);
  7547. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  7548. this.renderGraphics(d);
  7549. b.colorMask(!0, !0, !0, !0);
  7550. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  7551. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  7552. };
  7553. a.prototype.popMask = function () {
  7554. this._draw();
  7555. var a = this.gl,
  7556. b = this.maskList.pop();
  7557. 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));
  7558. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  7559. };
  7560. a.prototype.setGlobalColorTransform = function (a) {
  7561. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7562. a = a.concat();
  7563. var b = this.shaderManager.colorTransformShader;
  7564. b.uniforms.colorAdd.value.w =
  7565. a.splice(19, 1)[0] / 255;
  7566. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7567. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7568. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7569. b.uniforms.matrix.value = a
  7570. }
  7571. };
  7572. a.prototype.setupFont = function (a, b) {
  7573. var d = this.canvasContext,
  7574. e = a.italic ? "italic " : "normal ",
  7575. e = e + (a.bold ? "bold " : "normal "),
  7576. e = e + (a.size + "px " + a.fontFamily);
  7577. d.font = e;
  7578. d.textAlign = "left";
  7579. d.textBaseline = "middle"
  7580. };
  7581. a.prototype.measureText = function (a) {
  7582. return this.canvasContext.measureText(a).width
  7583. };
  7584. a.prototype.renderGraphics =
  7585. function (a) {
  7586. var b = this.gl,
  7587. d = this.shaderManager.primitiveShader;
  7588. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7589. this.updateGraphics(a);
  7590. this.shaderManager.activateShader(d);
  7591. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7592. b.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  7593. b.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  7594. b.uniform2f(d.offsetVector, 0, 0);
  7595. b.uniform3fv(d.tintColor, [1, 1, 1]);
  7596. b.uniform1f(d.alpha, this.worldAlpha);
  7597. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7598. b.vertexAttribPointer(d.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7599. b.vertexAttribPointer(d.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7600. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7601. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7602. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7603. };
  7604. a.prototype.updateGraphics =
  7605. function (a) {
  7606. var b = this.gl;
  7607. this.buildRectangle(a);
  7608. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7609. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7610. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7611. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7612. };
  7613. a.prototype.buildRectangle = function (a) {
  7614. var b = a.x,
  7615. d = a.y,
  7616. e = a.w;
  7617. a = a.h;
  7618. var g = this.graphicsPoints,
  7619. f = this.graphicsIndices,
  7620. k = g.length / 6;
  7621. g.push(b, d);
  7622. g.push(0, 0, 0, 1);
  7623. g.push(b + e, d);
  7624. g.push(0, 0, 0, 1);
  7625. g.push(b, d + a);
  7626. g.push(0, 0, 0, 1);
  7627. g.push(b + e, d + a);
  7628. g.push(0, 0, 0, 1);
  7629. f.push(k, k, k + 1, k + 2, k + 3, k + 3)
  7630. };
  7631. return a
  7632. }
  7633. (b.RendererContext);
  7634. b.WebGLRenderer = e;
  7635. e.prototype.__class__ = "egret.WebGLRenderer"
  7636. })(egret || (egret = {}));
  7637. (function (b) {
  7638. var e = function () {
  7639. function b() {}
  7640. b.compileProgram = function (a, c, e) {
  7641. e = b.compileFragmentShader(a, e);
  7642. c = b.compileVertexShader(a, c);
  7643. var h = a.createProgram();
  7644. a.attachShader(h, c);
  7645. a.attachShader(h, e);
  7646. a.linkProgram(h);
  7647. a.getProgramParameter(h, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  7648. return h
  7649. };
  7650. b.compileFragmentShader = function (a, c) {
  7651. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  7652. };
  7653. b.compileVertexShader = function (a, c) {
  7654. return b._compileShader(a, c, a.VERTEX_SHADER)
  7655. };
  7656. b._compileShader =
  7657. function (a, b, d) {
  7658. d = a.createShader(d);
  7659. a.shaderSource(d, b);
  7660. a.compileShader(d);
  7661. return a.getShaderParameter(d, a.COMPILE_STATUS) ? d : (console.log(a.getShaderInfoLog(d)), null)
  7662. };
  7663. b.checkCanUseWebGL = function () {
  7664. if (void 0 == b.canUseWebGL)
  7665. try {
  7666. var a = document.createElement("canvas");
  7667. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7668. } catch (c) {
  7669. b.canUseWebGL = !1
  7670. }
  7671. return b.canUseWebGL
  7672. };
  7673. return b
  7674. }
  7675. ();
  7676. b.WebGLUtils = e;
  7677. e.prototype.__class__ = "egret.WebGLUtils"
  7678. })(egret || (egret = {}));
  7679. __extends = this.__extends || function (b, e) {
  7680. function d() {
  7681. this.constructor = b
  7682. }
  7683. for (var a in e)
  7684. e.hasOwnProperty(a) && (b[a] = e[a]);
  7685. d.prototype = e.prototype;
  7686. b.prototype = new d
  7687. };
  7688. (function (b) {
  7689. var e = function () {
  7690. function b(a) {
  7691. this.maxAttibs = 10;
  7692. this.attribState = [];
  7693. this.tempAttribState = [];
  7694. for (var c = 0; c < this.maxAttibs; c++)
  7695. this.attribState[c] = !1;
  7696. this.setContext(a)
  7697. }
  7698. b.prototype.setContext = function (b) {
  7699. this.gl = b;
  7700. this.primitiveShader = new c(b);
  7701. this.defaultShader = new d(b);
  7702. this.colorTransformShader = new a(b);
  7703. this.activateShader(this.defaultShader)
  7704. };
  7705. b.prototype.activateShader = function (a) {
  7706. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  7707. a)
  7708. };
  7709. b.prototype.setAttribs = function (a) {
  7710. var b,
  7711. c;
  7712. c = this.tempAttribState.length;
  7713. for (b = 0; b < c; b++)
  7714. this.tempAttribState[b] = !1;
  7715. c = a.length;
  7716. for (b = 0; b < c; b++)
  7717. this.tempAttribState[a[b]] = !0;
  7718. a = this.gl;
  7719. c = this.attribState.length;
  7720. for (b = 0; b < c; b++)
  7721. this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7722. };
  7723. return b
  7724. }
  7725. ();
  7726. b.WebGLShaderManager = e;
  7727. e.prototype.__class__ = "egret.WebGLShaderManager";
  7728. var d = function () {
  7729. function a(b) {
  7730. this.defaultVertexSrc =
  7731. "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  7732. this.program = null;
  7733. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7734. this.gl = b;
  7735. this.init()
  7736. }
  7737. a.prototype.init = function () {
  7738. var a = this.gl,
  7739. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7740. a.useProgram(c);
  7741. this.uSampler = a.getUniformLocation(c, "uSampler");
  7742. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7743. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7744. this.dimensions = a.getUniformLocation(c, "dimensions");
  7745. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7746. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  7747. this.colorAttribute =
  7748. a.getAttribLocation(c, "aColor");
  7749. -1 === this.colorAttribute && (this.colorAttribute = 2);
  7750. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7751. for (var d in this.uniforms)
  7752. this.uniforms[d].uniformLocation = a.getUniformLocation(c, d);
  7753. this.initUniforms();
  7754. this.program = c
  7755. };
  7756. a.prototype.initUniforms = function () {
  7757. if (this.uniforms) {
  7758. var a = this.gl,
  7759. b,
  7760. c;
  7761. for (c in this.uniforms) {
  7762. b = this.uniforms[c];
  7763. var d = b.type;
  7764. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv :
  7765. "mat3" === d ? b.glFunc = a.uniformMatrix3fv : "mat4" === d && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + d], b.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  7766. }
  7767. }
  7768. };
  7769. a.prototype.syncUniforms = function () {
  7770. if (this.uniforms) {
  7771. var a,
  7772. b = this.gl,
  7773. c;
  7774. for (c in this.uniforms)
  7775. a = this.uniforms[c], 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x,
  7776. a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  7777. }
  7778. };
  7779. return a
  7780. }
  7781. ();
  7782. b.EgretShader = d;
  7783. d.prototype.__class__ = "egret.EgretShader";
  7784. var a = function (a) {
  7785. function b(c) {
  7786. a.call(this, c);
  7787. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  7788. this.uniforms = {
  7789. matrix : {
  7790. type : "mat4",
  7791. value : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7792. },
  7793. colorAdd : {
  7794. type : "4f",
  7795. value : {
  7796. x : 0,
  7797. y : 0,
  7798. z : 0,
  7799. w : 0
  7800. }
  7801. }
  7802. };
  7803. this.init()
  7804. }
  7805. __extends(b, a);
  7806. return b
  7807. }
  7808. (d);
  7809. b.ColorTransformShader = a;
  7810. a.prototype.__class__ = "egret.ColorTransformShader";
  7811. var c = function () {
  7812. function a(b) {
  7813. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  7814. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7815. 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}";
  7816. this.gl = b;
  7817. this.init()
  7818. }
  7819. a.prototype.init = function () {
  7820. var a = this.gl,
  7821. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7822. a.useProgram(c);
  7823. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7824. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7825. this.tintColor = a.getUniformLocation(c, "tint");
  7826. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7827. this.colorAttribute = a.getAttribLocation(c, "aColor");
  7828. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7829. this.translationMatrix = a.getUniformLocation(c,
  7830. "translationMatrix");
  7831. this.alpha = a.getUniformLocation(c, "alpha");
  7832. this.program = c
  7833. };
  7834. return a
  7835. }
  7836. ();
  7837. b.PrimitiveShader = c;
  7838. c.prototype.__class__ = "egret.PrimitiveShader"
  7839. })(egret || (egret = {}));
  7840. __extends = this.__extends || function (b, e) {
  7841. function d() {
  7842. this.constructor = b
  7843. }
  7844. for (var a in e)
  7845. e.hasOwnProperty(a) && (b[a] = e[a]);
  7846. d.prototype = e.prototype;
  7847. b.prototype = new d
  7848. };
  7849. (function (b) {
  7850. var e = function (d) {
  7851. function a() {
  7852. d.call(this)
  7853. }
  7854. __extends(a, d);
  7855. a.prototype.proceed = function (a) {
  7856. function d() {
  7857. if (4 == n.readyState)
  7858. if (n.status != a._status && (a._status = n.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, n.status)), 400 <= n.status || 0 == n.status)
  7859. b.IOErrorEvent.dispatchIOErrorEvent(a);
  7860. else {
  7861. switch (a.dataFormat) {
  7862. case b.URLLoaderDataFormat.TEXT:
  7863. a.data = n.responseText;
  7864. break;
  7865. case b.URLLoaderDataFormat.VARIABLES:
  7866. a.data = new b.URLVariables(n.responseText);
  7867. break;
  7868. case b.URLLoaderDataFormat.BINARY:
  7869. a.data =
  7870. n.response;
  7871. break;
  7872. default:
  7873. a.data = n.responseText
  7874. }
  7875. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7876. }
  7877. }
  7878. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE)
  7879. this.loadTexture(a);
  7880. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND)
  7881. this.loadSound(a);
  7882. else {
  7883. var e = a._request,
  7884. n = this.getXHR();
  7885. n.onreadystatechange = d;
  7886. var g = b.NetContext._getUrl(e);
  7887. n.open(e.method, g, !0);
  7888. this.setResponseType(n, a.dataFormat);
  7889. e.method != b.URLRequestMethod.GET && e.data ? e.data instanceof b.URLVariables ? (n.setRequestHeader("Content-Type",
  7890. "application/x-www-form-urlencoded"), n.send(e.data.toString())) : (n.setRequestHeader("Content-Type", "multipart/form-data"), n.send(e.data)) : n.send()
  7891. }
  7892. };
  7893. a.prototype.loadSound = function (a) {
  7894. function d(g) {
  7895. window.clearTimeout(n.__timeoutId);
  7896. n.removeEventListener("canplaythrough", d, !1);
  7897. n.removeEventListener("error", e, !1);
  7898. g = new b.Sound;
  7899. g._setAudio(n);
  7900. a.data = g;
  7901. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7902. }
  7903. function e(g) {
  7904. window.clearTimeout(n.__timeoutId);
  7905. n.removeEventListener("canplaythrough",
  7906. d, !1);
  7907. n.removeEventListener("error", e, !1);
  7908. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7909. }
  7910. var n = new Audio(a._request.url);
  7911. n.__timeoutId = window.setTimeout(d, 100);
  7912. n.addEventListener("canplaythrough", d, !1);
  7913. n.addEventListener("error", e, !1);
  7914. n.load()
  7915. };
  7916. a.prototype.getXHR = function () {
  7917. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7918. };
  7919. a.prototype.setResponseType = function (a, d) {
  7920. switch (d) {
  7921. case b.URLLoaderDataFormat.TEXT:
  7922. case b.URLLoaderDataFormat.VARIABLES:
  7923. a.responseType = b.URLLoaderDataFormat.TEXT;
  7924. break;
  7925. case b.URLLoaderDataFormat.BINARY:
  7926. a.responseType = "arraybuffer";
  7927. break;
  7928. default:
  7929. a.responseType = d
  7930. }
  7931. };
  7932. a.prototype.loadTexture = function (a) {
  7933. var d = a._request,
  7934. e = new Image;
  7935. e.onload = function (d) {
  7936. e.onerror = null;
  7937. e.onload = null;
  7938. d = new b.Texture;
  7939. d._setBitmapData(e);
  7940. a.data = d;
  7941. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7942. };
  7943. e.onerror = function (d) {
  7944. e.onerror = null;
  7945. e.onload = null;
  7946. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7947. };
  7948. e.src = d.url
  7949. };
  7950. return a
  7951. }
  7952. (b.NetContext);
  7953. b.HTML5NetContext = e;
  7954. e.prototype.__class__ = "egret.HTML5NetContext"
  7955. })(egret ||
  7956. (egret = {}));
  7957. __extends = this.__extends || function (b, e) {
  7958. function d() {
  7959. this.constructor = b
  7960. }
  7961. for (var a in e)
  7962. e.hasOwnProperty(a) && (b[a] = e[a]);
  7963. d.prototype = e.prototype;
  7964. b.prototype = new d
  7965. };
  7966. (function (b) {
  7967. var e = function (d) {
  7968. function a() {
  7969. d.call(this);
  7970. this._isTouchDown = !1;
  7971. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7972. }
  7973. __extends(a, d);
  7974. a.prototype.prevent = function (a) {
  7975. a.stopPropagation();
  7976. !0 != a.isScroll && a.preventDefault()
  7977. };
  7978. a.prototype.run = function () {
  7979. var a = this;
  7980. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function (b) {
  7981. a._onTouchBegin(b);
  7982. a.prevent(b)
  7983. }, !1), this.rootDiv.addEventListener("MSPointerMove", function (b) {
  7984. a._onTouchMove(b);
  7985. a.prevent(b)
  7986. },
  7987. !1), this.rootDiv.addEventListener("MSPointerUp", function (b) {
  7988. a._onTouchEnd(b);
  7989. a.prevent(b)
  7990. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7991. window.addEventListener("mousedown", function (b) {
  7992. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7993. });
  7994. window.addEventListener("mouseup", function (b) {
  7995. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7996. a._isTouchDown = !1
  7997. })
  7998. };
  7999. a.prototype.addMouseListener = function () {
  8000. var a = this;
  8001. this.rootDiv.addEventListener("mousedown", function (b) {
  8002. a._onTouchBegin(b)
  8003. });
  8004. this.rootDiv.addEventListener("mousemove", function (b) {
  8005. a._onTouchMove(b)
  8006. });
  8007. this.rootDiv.addEventListener("mouseup", function (b) {
  8008. a._onTouchEnd(b)
  8009. })
  8010. };
  8011. a.prototype.addTouchListener = function () {
  8012. var a = this;
  8013. this.rootDiv.addEventListener("touchstart", function (b) {
  8014. for (var d = b.changedTouches.length, e = 0; e < d; e++)
  8015. a._onTouchBegin(b.changedTouches[e]);
  8016. a.prevent(b)
  8017. }, !1);
  8018. this.rootDiv.addEventListener("touchmove",
  8019. function (b) {
  8020. for (var d = b.changedTouches.length, e = 0; e < d; e++)
  8021. a._onTouchMove(b.changedTouches[e]);
  8022. a.prevent(b)
  8023. }, !1);
  8024. this.rootDiv.addEventListener("touchend", function (b) {
  8025. for (var d = b.changedTouches.length, e = 0; e < d; e++)
  8026. a._onTouchEnd(b.changedTouches[e]);
  8027. a.prevent(b)
  8028. }, !1);
  8029. this.rootDiv.addEventListener("touchcancel", function (b) {
  8030. for (var d = b.changedTouches.length, e = 0; e < d; e++)
  8031. a._onTouchEnd(b.changedTouches[e]);
  8032. a.prevent(b)
  8033. }, !1)
  8034. };
  8035. a.prototype.inOutOfCanvas = function (a) {
  8036. var d = this.getLocation(this.rootDiv, a);
  8037. a = d.x;
  8038. var d = d.y,
  8039. e = b.MainContext.instance.stage;
  8040. return 0 > a || 0 > d || a > e.stageWidth || d > e.stageHeight ? !0 : !1
  8041. };
  8042. a.prototype.dispatchLeaveStageEvent = function () {
  8043. this.touchingIdentifiers.length = 0;
  8044. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  8045. };
  8046. a.prototype._onTouchBegin = function (a) {
  8047. var b = this.getLocation(this.rootDiv, a),
  8048. d = -1;
  8049. a.hasOwnProperty("identifier") && (d = a.identifier);
  8050. this.onTouchBegan(b.x, b.y, d)
  8051. };
  8052. a.prototype._onTouchMove = function (a) {
  8053. var b = this.getLocation(this.rootDiv, a),
  8054. d = -1;
  8055. a.hasOwnProperty("identifier") &&
  8056. (d = a.identifier);
  8057. this.onTouchMove(b.x, b.y, d)
  8058. };
  8059. a.prototype._onTouchEnd = function (a) {
  8060. var b = this.getLocation(this.rootDiv, a),
  8061. d = -1;
  8062. a.hasOwnProperty("identifier") && (d = a.identifier);
  8063. this.onTouchEnd(b.x, b.y, d)
  8064. };
  8065. a.prototype.getLocation = function (a, d) {
  8066. var e = document.documentElement,
  8067. n = window,
  8068. g,
  8069. f;
  8070. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  8071. g += n.pageXOffset - e.clientLeft;
  8072. f += n.pageYOffset - e.clientTop;
  8073. null != d.pageX ? (e = d.pageX, n = d.pageY) : (g -= document.body.scrollLeft,
  8074. f -= document.body.scrollTop, e = d.clientX, n = d.clientY);
  8075. var k = b.Point.identity;
  8076. k.x = (e - g) / b.StageDelegate.getInstance().getScaleX();
  8077. k.y = (n - f) / b.StageDelegate.getInstance().getScaleY();
  8078. return k
  8079. };
  8080. return a
  8081. }
  8082. (b.TouchContext);
  8083. b.HTML5TouchContext = e;
  8084. e.prototype.__class__ = "egret.HTML5TouchContext"
  8085. })(egret || (egret = {}));
  8086. __extends = this.__extends || function (b, e) {
  8087. function d() {
  8088. this.constructor = b
  8089. }
  8090. for (var a in e)
  8091. e.hasOwnProperty(a) && (b[a] = e[a]);
  8092. d.prototype = e.prototype;
  8093. b.prototype = new d
  8094. };
  8095. (function (b) {
  8096. var e = function (d) {
  8097. function a() {
  8098. d.call(this);
  8099. this._hasListeners = !1;
  8100. this._inputType = "";
  8101. this._isShow = !1;
  8102. this.textValue = "";
  8103. this._height = this._width = 0;
  8104. this._styleInfoes = {};
  8105. var a = b.StageDelegate.getInstance().getScaleX(),
  8106. e = b.StageDelegate.getInstance().getScaleY(),
  8107. h = b.Browser.getInstance().$new("div");
  8108. h.position.x = 0;
  8109. h.position.y = 0;
  8110. h.scale.x = a;
  8111. h.scale.y = e;
  8112. h.transforms();
  8113. h.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  8114. this.div = h;
  8115. e = b.MainContext.instance.stage;
  8116. a = e.stageWidth;
  8117. e = e.stageHeight;
  8118. h = new b.Shape;
  8119. h.width = a;
  8120. h.height = e;
  8121. h.touchEnabled = !0;
  8122. this._shape = h;
  8123. this.getStageDelegateDiv().appendChild(this.div)
  8124. }
  8125. __extends(a, d);
  8126. a.prototype.getStageDelegateDiv = function () {
  8127. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8128. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8129. return a
  8130. };
  8131. a.prototype._setMultiline = function (a) {
  8132. d.prototype._setMultiline.call(this, a);
  8133. this.createInput()
  8134. };
  8135. a.prototype.callHandler =
  8136. function (a) {
  8137. a.stopPropagation()
  8138. };
  8139. a.prototype._add = function () {
  8140. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8141. };
  8142. a.prototype._remove = function () {
  8143. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8144. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8145. };
  8146. a.prototype._addListeners = function () {
  8147. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  8148. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8149. };
  8150. a.prototype._removeListeners = function () {
  8151. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  8152. };
  8153. a.prototype.createInput = function () {
  8154. var a = this._multiline ? "textarea" : "input";
  8155. this._inputType != a && (this._inputType =
  8156. a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {}, a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline",
  8157. "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8158. };
  8159. a.prototype._open = function (a, b, d, e) {};
  8160. a.prototype._setScale = function (a, e) {
  8161. d.prototype._setScale.call(this, a, e);
  8162. var h = b.StageDelegate.getInstance().getScaleX(),
  8163. n = b.StageDelegate.getInstance().getScaleY();
  8164. this.div.scale.x = h * a;
  8165. this.div.scale.y = n * e;
  8166. this.div.transforms()
  8167. };
  8168. a.prototype.changePosition = function (a, d) {
  8169. var e = b.StageDelegate.getInstance().getScaleX(),
  8170. n = b.StageDelegate.getInstance().getScaleY();
  8171. this.div.position.x = a * e;
  8172. this.div.position.y = d * n;
  8173. this.div.transforms()
  8174. };
  8175. a.prototype.setStyles = function () {
  8176. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  8177. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  8178. this.setElementStyle("textAlign", this._textAlign);
  8179. this.setElementStyle("fontSize", this._size + "px");
  8180. this.setElementStyle("color", "#000000");
  8181. this.setElementStyle("width", this._width + "px");
  8182. this.setElementStyle("height", this._height +
  8183. "px");
  8184. this.setElementStyle("border", "1px solid red");
  8185. this.setElementStyle("display", "block")
  8186. };
  8187. a.prototype._show = function () {
  8188. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8189. this._isShow = !0;
  8190. var a = this._getText();
  8191. this.inputElement.value = a;
  8192. var d = this;
  8193. this.inputElement.oninput = function () {
  8194. d.textValue = d.inputElement.value;
  8195. d.dispatchEvent(new b.Event("updateText"))
  8196. };
  8197. this.setStyles();
  8198. this.inputElement.focus();
  8199. this.inputElement.selectionStart =
  8200. a.length;
  8201. this.inputElement.selectionEnd = a.length;
  8202. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  8203. };
  8204. a.prototype._hide = function () {
  8205. if (null != this.inputElement) {
  8206. this._isShow = !1;
  8207. this.inputElement.oninput = function () {};
  8208. this.setElementStyle("border", "none");
  8209. this.setElementStyle("display", "none");
  8210. this.inputElement.value = "";
  8211. this.setElementStyle("width", "0px");
  8212. window.scrollTo(0, 0);
  8213. var a = this;
  8214. b.setTimeout(function () {
  8215. a.inputElement.blur();
  8216. window.scrollTo(0, 0)
  8217. }, this, 50);
  8218. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8219. }
  8220. };
  8221. a.prototype._getText = function () {
  8222. this.textValue || (this.textValue = "");
  8223. return this.textValue
  8224. };
  8225. a.prototype._setText = function (a) {
  8226. this.textValue = a;
  8227. this.resetText()
  8228. };
  8229. a.prototype.resetText = function () {
  8230. this.inputElement && (this.inputElement.value = this.textValue)
  8231. };
  8232. a.prototype._setWidth = function (a) {
  8233. this._width = a
  8234. };
  8235. a.prototype._setHeight = function (a) {
  8236. this._height = a
  8237. };
  8238. a.prototype.setElementStyle = function (a, b) {
  8239. this.inputElement && this._styleInfoes[a] !=
  8240. b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8241. };
  8242. return a
  8243. }
  8244. (b.StageText);
  8245. b.HTML5StageText = e;
  8246. e.prototype.__class__ = "egret.HTML5StageText"
  8247. })(egret || (egret = {}));
  8248. egret.StageText.create = function () {
  8249. return new egret.HTML5StageText
  8250. };
  8251. var XiaobinTool = function () {
  8252. function b() {}
  8253. b.createBitmapByName = function (b) {
  8254. var d = new egret.Bitmap;
  8255. b = RES.getRes(b);
  8256. d.texture = b;
  8257. return d
  8258. };
  8259. b.creatMovieClip = function (b, d, a) {
  8260. void 0 === a && (a = "");
  8261. b = RES.getRes(b);
  8262. var c = RES.getRes(d);
  8263. b = new egret.MovieClip(b, c);
  8264. b.name = d;
  8265. b.frameRate = 60;
  8266. b.gotoAndPlay(a);
  8267. return b
  8268. };
  8269. b.hitTest = function (b, d) {
  8270. var a = b.getBounds(),
  8271. c = d.getBounds();
  8272. a.x = b.x;
  8273. a.y = b.y;
  8274. c.x = d.x;
  8275. c.y = d.y;
  8276. a.width = b.width * b.scaleX;
  8277. a.height = b.height * b.scaleY;
  8278. c.width = d.width * d.scaleX;
  8279. c.height = d.height * d.scaleY;
  8280. return a.intersects(c)
  8281. };
  8282. b.GAME_SCORE = "0";
  8283. b.JIANG_CHI = "0";
  8284. b.KEY = "best_score";
  8285. b.dn = "";
  8286. b.ppp = "";
  8287. b.ccc = "";
  8288. b.shouquan = !1;
  8289. return b
  8290. }
  8291. ();
  8292. XiaobinTool.prototype.__class__ = "XiaobinTool";
  8293. var __extends = this.__extends || function (b, e) {
  8294. function d() {
  8295. this.constructor = b
  8296. }
  8297. for (var a in e)
  8298. e.hasOwnProperty(a) && (b[a] = e[a]);
  8299. d.prototype = e.prototype;
  8300. b.prototype = new d
  8301. }, ScoreSixMc = function (b) {
  8302. function e() {
  8303. b.call(this);
  8304. this.num = 0;
  8305. this.space = 40;
  8306. this.theJSON = "numberText_json";
  8307. this.thePNG = "numberText_png";
  8308. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8309. }
  8310. __extends(e, b);
  8311. e.prototype.onAddToStage = function (b) {
  8312. this.handredthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG,
  8313. "n0");
  8314. this.addChild(this.handredthousandText);
  8315. this.handredthousandText.x = 0;
  8316. this.tenthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8317. this.addChild(this.tenthousandText);
  8318. this.tenthousandText.x = this.handredthousandText.x + this.space;
  8319. this.thousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8320. this.addChild(this.thousandText);
  8321. this.thousandText.x = this.tenthousandText.x + this.space;
  8322. this.handredText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8323. this.addChild(this.handredText);
  8324. this.handredText.x = this.thousandText.x + this.space;
  8325. this.tenText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8326. this.addChild(this.tenText);
  8327. this.tenText.x = this.handredText.x + this.space;
  8328. this.oneText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8329. this.addChild(this.oneText);
  8330. this.oneText.x = this.tenText.x + this.space
  8331. };
  8332. e.prototype.setNum = function (b) {
  8333. this.num = b;
  8334. b = Math.floor(this.num / 1E5).toString();
  8335. this.handredthousandText.gotoAndStop("n" + b.toString());
  8336. 0 == b && (this.handredthousandText.visible =
  8337. !1);
  8338. 0 < Math.floor(this.num / 1E5) && (this.handredthousandText.visible = !0);
  8339. b = Math.floor(this.num / 1E4).toString();
  8340. b = b.slice(b.length - 1, b.length);
  8341. this.tenthousandText.gotoAndStop("n" + b.toString());
  8342. !1 == this.handredthousandText.visible && 0 == b && (this.tenthousandText.visible = !1);
  8343. 0 < Math.floor(this.num / 1E4) && (this.tenthousandText.visible = !0);
  8344. b = Math.floor(this.num / 1E3).toString();
  8345. b = b.slice(b.length - 1, b.length);
  8346. this.thousandText.gotoAndStop("n" + b.toString());
  8347. !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible &&
  8348. 0 == b && (this.thousandText.visible = !1);
  8349. 0 < Math.floor(this.num / 1E3) && (this.thousandText.visible = !0);
  8350. b = Math.floor(this.num / 100).toString();
  8351. b = b.slice(b.length - 1, b.length);
  8352. this.handredText.gotoAndStop("n" + b.toString());
  8353. !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.handredText.visible = !1);
  8354. 0 < Math.floor(this.num / 100) && (this.handredText.visible = !0);
  8355. b = Math.floor(this.num / 10).toString();
  8356. b = b.slice(b.length - 1, b.length);
  8357. this.tenText.gotoAndStop("n" +
  8358. b.toString());
  8359. !1 == this.handredText.visible && !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.tenText.visible = !1);
  8360. 0 < Math.floor(this.num / 10) && (this.tenText.visible = !0);
  8361. b = this.num.toString();
  8362. b = b.slice(b.length - 1, b.length);
  8363. this.oneText.gotoAndStop("n" + b.toString())
  8364. };
  8365. e.isCreat = !1;
  8366. return e
  8367. }
  8368. (egret.Sprite);
  8369. ScoreSixMc.prototype.__class__ = "ScoreSixMc";
  8370. var __extends = this.__extends || function (b, e) {
  8371. function d() {
  8372. this.constructor = b
  8373. }
  8374. for (var a in e)
  8375. e.hasOwnProperty(a) && (b[a] = e[a]);
  8376. d.prototype = e.prototype;
  8377. b.prototype = new d
  8378. }, GameOverPanel = function (b) {
  8379. function e() {
  8380. b.call(this);
  8381. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.ats, this)
  8382. }
  8383. __extends(e, b);
  8384. e.prototype.ats = function (b) {
  8385. this.stageW = this.stage.stageWidth;
  8386. this.stageH = this.stage.stageHeight;
  8387. b = XiaobinTool.createBitmapByName("gameOverPanel_png");
  8388. this.addChild(b);
  8389. this.sixScoreMc = new ScoreSixMc;
  8390. this.sixScoreMc.x =
  8391. 135;
  8392. this.sixScoreMc.y = 305;
  8393. this.sixScoreMc.space = 22;
  8394. this.addChild(this.sixScoreMc);
  8395. this.sixScoreMc.setNum(e.scoreNum);
  8396. var a = XiaobinTool.createBitmapByName("replay_btn_png");
  8397. this.addChild(a);
  8398. a.anchorOffsetX = a.width / 2;
  8399. a.x = b.width / 2;
  8400. a.y = 385;
  8401. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doReplay, this);
  8402. a.touchEnabled = !0;
  8403. var c = XiaobinTool.createBitmapByName("more_btn_png");
  8404. this.addChild(c);
  8405. c.anchorOffsetX = c.width / 2;
  8406. c.x = b.width / 2 + 130;
  8407. c.y = a.y;
  8408. c.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doMore,
  8409. this);
  8410. c.touchEnabled = !0;
  8411. c = XiaobinTool.createBitmapByName("share_btn_png");
  8412. this.addChild(c);
  8413. c.anchorOffsetX = c.width / 2;
  8414. c.x = b.width / 2 - 130;
  8415. c.y = a.y;
  8416. c.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doShare, this);
  8417. c.touchEnabled = !0
  8418. };
  8419. e.prototype.doReplay = function (b) {
  8420. b.target.parent && b.target.parent.removeChild(b.target);
  8421. b = new egret.Event("click_replay_btn", !0);
  8422. this.dispatchEvent(b)
  8423. };
  8424. e.prototype.doShare = function (b) {
  8425. play68_submitScore(window.myPlay68Score);
  8426. };
  8427. e.prototype.doMore = function (b) {
  8428. Play68.goHome();
  8429. };
  8430. e.scoreNum = 0;
  8431. e.duiNum = 0;
  8432. return e
  8433. }
  8434. (egret.Sprite);
  8435. GameOverPanel.prototype.__class__ = "GameOverPanel";
  8436. var __extends = this.__extends || function (b, e) {
  8437. function d() {
  8438. this.constructor = b
  8439. }
  8440. for (var a in e)
  8441. e.hasOwnProperty(a) && (b[a] = e[a]);
  8442. d.prototype = e.prototype;
  8443. b.prototype = new d
  8444. }, StartBtn = function (b) {
  8445. function e() {
  8446. b.call(this);
  8447. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8448. }
  8449. __extends(e, b);
  8450. e.prototype.onAddToStage = function (b) {
  8451. this.bgBMP = new egret.Bitmap;
  8452. this.addChild(this.bgBMP);
  8453. this.bgBMP.texture = RES.getRes("start_btn_png")
  8454. };
  8455. return e
  8456. }
  8457. (egret.Sprite);
  8458. StartBtn.prototype.__class__ = "StartBtn";
  8459. var __extends = this.__extends || function (b, e) {
  8460. function d() {
  8461. this.constructor = b
  8462. }
  8463. for (var a in e)
  8464. e.hasOwnProperty(a) && (b[a] = e[a]);
  8465. d.prototype = e.prototype;
  8466. b.prototype = new d
  8467. }, HomePage = function (b) {
  8468. function e() {
  8469. b.call(this);
  8470. this.stageH = this.stageW = 0;
  8471. this.homePage = null;
  8472. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.startGame, this)
  8473. }
  8474. __extends(e, b);
  8475. e.prototype.startGame = function (b) {
  8476. b = XiaobinTool.createBitmapByName("homepage_jpg");
  8477. this.addChild(b);
  8478. this.stageW = this.stage.stageWidth;
  8479. this.stageH = this.stage.stageHeight;
  8480. null == this.homePage && (b = XiaobinTool.createBitmapByName("startPanel_png"), this.addChild(b), b.x = (this.stageW - b.width) / 2, b.y = 560, b = XiaobinTool.createBitmapByName("homepageLight_png"), this.addChild(b), b.anchorOffsetX = b.width / 2, b.anchorOffsetY = -0, b.x = this.stageW / 2, b.y = 0, b.rotation = -20, egret.Tween.get(b, {
  8481. loop : !0
  8482. }).to({
  8483. rotation : 20
  8484. }, 1500).wait(0).to({
  8485. rotation : -20
  8486. }, 1500).wait(0), b = XiaobinTool.createBitmapByName("title_png"), this.addChild(b), b.x = (this.stageW - b.width) / 2, b.y = 20, b = XiaobinTool.createBitmapByName("logo_png"),
  8487. this.addChild(b), b.x = (this.stageW - b.width) / 2, b.y = this.stageH - b.height, this.startBtn = new StartBtn, this.addChild(this.startBtn), this.startBtn.x = (this.stageW - this.startBtn.width) / 2, this.startBtn.y = 580, this.startBtn.touchEnabled = !0, this.startBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this));
  8488. this.touchEnabled = !0
  8489. };
  8490. e.prototype.doHelp = function (b) {
  8491. null == this.helpMc && (this.helpMc = XiaobinTool.creatMovieClip("pageMc_json", "pageMc_png", "yd1"), this.addChild(this.helpMc), this.upBtn = XiaobinTool.createBitmapByName("up_png"),
  8492. this.addChild(this.upBtn), this.upBtn.x = 20, this.upBtn.y = 760, this.upBtn.touchEnabled = !0, this.downBtn = XiaobinTool.createBitmapByName("down_png"), this.addChild(this.downBtn), this.downBtn.x = 20, this.downBtn.y = this.upBtn.y, this.downBtn.touchEnabled = !0, this.backBtn = XiaobinTool.createBitmapByName("back_png"), this.addChild(this.backBtn), this.backBtn.x = this.stageW - this.downBtn.width - 20, this.backBtn.y = this.upBtn.y, this.backBtn.touchEnabled = !0, this.upBtn.visible = !1, this.downBtn.visible = !0, this.upBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN,
  8493. this.doUp, this), this.downBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doDown, this), this.backBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doBack, this))
  8494. };
  8495. e.prototype.doBack = function (b) {
  8496. console.log("doBack");
  8497. this.removeChild(this.upBtn);
  8498. this.removeChild(this.downBtn);
  8499. this.removeChild(this.backBtn);
  8500. this.removeChild(this.helpMc);
  8501. this.helpMc = null
  8502. };
  8503. e.prototype.doUp = function (b) {
  8504. console.log("doUp");
  8505. this.helpMc.gotoAndStop("yd1");
  8506. this.upBtn.visible = !1;
  8507. this.downBtn.visible = !0
  8508. };
  8509. e.prototype.doDown =
  8510. function (b) {
  8511. console.log("doDown");
  8512. this.helpMc.gotoAndStop("yd2");
  8513. this.upBtn.visible = !0;
  8514. this.downBtn.visible = !1
  8515. };
  8516. e.prototype.doShare = function (b) {
  8517. console.log("doShare")
  8518. };
  8519. e.prototype.doMore = function (b) {
  8520. console.log("doMore")
  8521. };
  8522. e.prototype.loop = function (b) {};
  8523. e.prototype.onTouchBegin = function (b) {
  8524. b = new egret.Event("click_start_btn", !0);
  8525. this.dispatchEvent(b)
  8526. };
  8527. return e
  8528. }
  8529. (egret.Sprite);
  8530. HomePage.prototype.__class__ = "HomePage";
  8531. var __extends = this.__extends || function (b, e) {
  8532. function d() {
  8533. this.constructor = b
  8534. }
  8535. for (var a in e)
  8536. e.hasOwnProperty(a) && (b[a] = e[a]);
  8537. d.prototype = e.prototype;
  8538. b.prototype = new d
  8539. }, InGame = function (b) {
  8540. function e() {
  8541. b.call(this);
  8542. this.scoreNum = this.stageH = this.stageW = 0;
  8543. this.gameOver = !1;
  8544. this.allTime = this.curTime = 30;
  8545. this.space = 20;
  8546. this.speed = -2;
  8547. this.dengArr = [];
  8548. this.speedArr = [];
  8549. this.x_speedArr = [];
  8550. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.ats, this)
  8551. }
  8552. __extends(e, b);
  8553. e.prototype.ats = function (b) {
  8554. this.stageW = this.stage.stageWidth;
  8555. this.stageH = this.stage.stageHeight;
  8556. this.touchEnabled = !0;
  8557. this.creatBg();
  8558. this.bgShape = new egret.Shape;
  8559. this.addChild(this.bgShape);
  8560. this.bgShape.alpha = 0.7;
  8561. this.bgShape.graphics.beginFill(0, 0.5);
  8562. this.bgShape.graphics.drawRect(0, 0, 500, 900);
  8563. this.bgShape.graphics.endFill();
  8564. this.container = new egret.Sprite;
  8565. this.addChild(this.container);
  8566. this.creatTip();
  8567. this.creatPoint();
  8568. this.creatTimer();
  8569. this.creatTimeBar();
  8570. this.creatScoreTxt();
  8571. this.creatScoreMc();
  8572. this.bgMusic = RES.getRes("bgSound");
  8573. this.bgMusic.play();
  8574. this.bgMusic.addEventListener("ended",
  8575. this.rePlay.bind(this));
  8576. this.addEventListener(egret.Event.ENTER_FRAME, this.loop, this);
  8577. this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this)
  8578. };
  8579. e.prototype.rePlay = function () {
  8580. this.bgMusic.load();
  8581. this.bgMusic.play()
  8582. };
  8583. e.prototype.onTouchTap = function (b) {
  8584. null == this.tip && !0 != this.gameOver && (this.touchX = b.stageX, this.touchY = b.stageY, this.p.x = this.touchX, this.p.y = this.touchY, this.checkHit())
  8585. };
  8586. e.prototype.checkHit = function () {
  8587. for (var b = 0; b < this.dengArr.length; b++) {
  8588. var a = this.dengArr[b];
  8589. if (0 == a.rotation && XiaobinTool.hitTest(this.p, a)) {
  8590. a.gotoAndStop("liang");
  8591. a.rotation = -1 + Math.random();
  8592. b = Math.abs(Math.floor(this.speedArr[b]));
  8593. this.scoreNum += b;
  8594. this.scoreMc.setNum(this.scoreNum);
  8595. this.bgShape.alpha -= 0.02;
  8596. 0 > this.bgShape.alpha && (this.bgShape.alpha = 0);
  8597. break
  8598. }
  8599. }
  8600. };
  8601. e.prototype.loop = function (b) {
  8602. null == this.tip && !0 != this.gameOver && (this.updateTimeBar(), this.moveDeng())
  8603. };
  8604. e.prototype.moveDeng = function () {
  8605. for (var b = 0; b < this.dengArr.length; b++) {
  8606. var a = this.dengArr[b];
  8607. a.y > this.stageH / 2 ? (a.x += this.x_speedArr[b],
  8608. 50 > a.x && (a.x = 50), 430 < a.x && (a.x = 430)) : (a.alpha -= 0.003, 0 > a.alpha && (a.alpha = 0));
  8609. a.scaleX -= 0.003;
  8610. a.scaleY -= 0.003;
  8611. 0.4 > a.scaleX && (a.alpha = 0.4);
  8612. 0.4 > a.scaleX && (a.alpha = 0.4);
  8613. a.y += this.speedArr[b];
  8614. a.y < 0 - a.height - 100 && (this.container.removeChild(a), this.dengArr.splice(b, 1), this.x_speedArr.splice(b, 1), this.speedArr.splice(b, 1))
  8615. }
  8616. };
  8617. e.prototype.updateTimeBar = function () {
  8618. this.bar1 && (this.rect = new egret.Rectangle(0, 0, this.curTime / this.allTime * this.bar1.width, 300), this.bar1.mask = this.rect)
  8619. };
  8620. e.prototype.creatBg = function () {
  8621. this.bg =
  8622. XiaobinTool.createBitmapByName("bg_jpg");
  8623. this.addChild(this.bg)
  8624. };
  8625. e.prototype.creatScoreMc = function () {
  8626. var b = new ScoreSixMc;
  8627. this.scoreMc = b;
  8628. this.scoreMc.space = 22;
  8629. this.addChild(b);
  8630. this.scoreMc.setNum(this.scoreNum);
  8631. this.scoreMc.x = 330;
  8632. this.scoreMc.y = 52
  8633. };
  8634. e.prototype.creatScoreTxt = function () {
  8635. this.scoreTxt = XiaobinTool.createBitmapByName("scoreTxt_png");
  8636. this.addChild(this.scoreTxt);
  8637. this.scoreTxt.x = this.stageW - this.scoreTxt.width - 10;
  8638. this.scoreTxt.y = 20
  8639. };
  8640. e.prototype.creatTimeBar = function () {
  8641. this.bar2 = XiaobinTool.createBitmapByName("bar2_png");
  8642. this.addChild(this.bar2);
  8643. this.bar2.x = 70;
  8644. this.bar2.y = 30;
  8645. this.bar1 = XiaobinTool.createBitmapByName("bar1_png");
  8646. this.addChild(this.bar1);
  8647. this.bar1.x = this.bar2.x;
  8648. this.bar1.y = 30;
  8649. this.shp = new egret.Shape;
  8650. this.addChild(this.shp);
  8651. this.timeTxt = XiaobinTool.createBitmapByName("timeTxt_png");
  8652. this.addChild(this.timeTxt);
  8653. this.timeTxt.x = 10;
  8654. this.timeTxt.y = 22
  8655. };
  8656. e.prototype.creatPoint = function () {
  8657. this.p = XiaobinTool.createBitmapByName("p_png");
  8658. this.addChild(this.p);
  8659. this.p.alpha = 0.001;
  8660. this.p.anchorOffsetX = this.p.width /
  8661. 2;
  8662. this.p.anchorOffsetY = this.p.height / 2
  8663. };
  8664. e.prototype.creatTip = function () {
  8665. this.tip = XiaobinTool.createBitmapByName("tip_png");
  8666. this.addChild(this.tip)
  8667. };
  8668. e.prototype.creatTimer = function () {
  8669. this.timer = new egret.Timer(1E3);
  8670. this.timer.addEventListener(egret.TimerEvent.TIMER, this.doTimer, this);
  8671. this.timer.start()
  8672. };
  8673. e.prototype.doTimer = function (b) {
  8674. null != this.tip ? (this.removeChild(this.tip), this.tip = null) : (this.count++, 0 < this.curTime && (this.curTime--, this.updateTimeBar(), this.creatDeng()), 0 == this.curTime && this.makeGameOver())
  8675. };
  8676. e.prototype.creatDeng = function () {
  8677. Math.random();
  8678. for (var b = 0; 3 > b; b++) {
  8679. var a = XiaobinTool.creatMovieClip("deng_json", "deng_png", "an");
  8680. this.container.addChild(a);
  8681. a.x = 100 + (a.width + this.space) * b;
  8682. a.y = this.stageH - 50;
  8683. this.dengArr.push(a);
  8684. var a = -1 + 2 * Math.random(),
  8685. c = 0,
  8686. c = 50 < this.curTime ? 2 + -1 * Math.random() : 40 < this.curTime ? 1 + -2 * Math.random() : 30 < this.curTime ? 0 + -2 * Math.random() : 20 < this.curTime ? -0.5 + -3 * Math.random() : 10 < this.curTime ? -1 + -4 * Math.random() : -1 + -5 * Math.random();
  8687. this.speedArr.push(c);
  8688. this.x_speedArr.push(a)
  8689. }
  8690. };
  8691. e.prototype.makeGameOver = function () {
  8692. this.timer.removeEventListener(egret.TimerEvent.TIMER, this.doTimer, this);
  8693. this.removeEventListener(egret.Event.ENTER_FRAME, this.loop, this);
  8694. GameOverPanel.scoreNum = this.scoreNum;
  8695. var b = new egret.Shape;
  8696. this.addChild(b);
  8697. b.graphics.beginFill(0, 0.5);
  8698. b.graphics.drawRect(0, 0, 800, 800);
  8699. b.graphics.endFill();
  8700. b = new GameOverPanel;
  8701. this.addChild(b);
  8702. b.x = 30;
  8703. b.y = -740;
  8704. egret.Tween.get(b, {
  8705. loop : !1
  8706. }).to({
  8707. y : 0
  8708. }, 1500, egret.Ease.bounceOut).wait(0);
  8709. this.gameOver = !0;
  8710. window.myPlay68Score = this.scoreNum;
  8711. updateShare(this.scoreNum);
  8712. this.bgMusic.pause()
  8713. };
  8714. return e
  8715. }
  8716. (egret.Sprite);
  8717. InGame.prototype.__class__ = "InGame";
  8718. var __extends = this.__extends || function (b, e) {
  8719. function d() {
  8720. this.constructor = b
  8721. }
  8722. for (var a in e)
  8723. e.hasOwnProperty(a) && (b[a] = e[a]);
  8724. d.prototype = e.prototype;
  8725. b.prototype = new d
  8726. }, LoadingUI = function (b) {
  8727. function e() {
  8728. b.call(this);
  8729. this.createView()
  8730. }
  8731. __extends(e, b);
  8732. e.prototype.createView = function () {
  8733. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8734. RES.loadConfig("resource/resource.json", "resource/");
  8735. this.textField = new egret.TextField
  8736. };
  8737. e.prototype.setProgress = function (b, a) {
  8738. this.textField.text =
  8739. "" + Math.floor(b / a * 100) + "%";
  8740. this.textField.x = 240 - this.textField.width / 2;
  8741. this.bar1 && (this.rect = new egret.Rectangle(0, 0, b / a * this.bar1.width, 200), this.bar1.mask = this.rect);
  8742. this.mc && (this.mc.x = b / a * 480, this.mc.y = 400)
  8743. };
  8744. e.prototype.onConfigComplete = function (b) {
  8745. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8746. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8747. RES.loadGroup("preload")
  8748. };
  8749. e.prototype.onResourceLoadComplete = function (b) {
  8750. "preload" ==
  8751. b.groupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), this.createPic(), this.createText(), this.createShape())
  8752. };
  8753. e.prototype.createShape = function () {
  8754. this.shape = new egret.Shape;
  8755. this.addChild(this.shape)
  8756. };
  8757. e.prototype.createText = function () {
  8758. this.addChild(this.textField);
  8759. this.textField.x = 240;
  8760. this.textField.y = 660;
  8761. this.textField.width = 720;
  8762. this.textField.height = 100;
  8763. this.textField.size = 30;
  8764. this.textField.textColor = 15733805;
  8765. this.textField.textAlign = "center"
  8766. };
  8767. e.prototype.createPic =
  8768. function () {
  8769. this.pic = XiaobinTool.createBitmapByName("loadBg_jpg");
  8770. this.addChild(this.pic);
  8771. this.graphics.beginFill(0, 1);
  8772. this.graphics.drawRect(0, 0, 720, 960);
  8773. this.graphics.endFill();
  8774. this.bar2 = XiaobinTool.createBitmapByName("bar22_png");
  8775. this.addChild(this.bar2);
  8776. this.bar2.x = 240 - this.bar2.width / 2;
  8777. this.bar2.y = 610;
  8778. this.bar1 = XiaobinTool.createBitmapByName("bar11_png");
  8779. this.addChild(this.bar1);
  8780. this.bar1.x = 240 - this.bar1.width / 2;
  8781. this.bar1.y = this.bar2.y + 1;
  8782. this.shp = new egret.Shape;
  8783. this.addChild(this.shp)
  8784. };
  8785. e.prototype.createMc =
  8786. function () {
  8787. this.mc = XiaobinTool.creatMovieClip("hero_json", "hero_png", "wait");
  8788. this.addChild(this.mc)
  8789. };
  8790. return e
  8791. }
  8792. (egret.Sprite);
  8793. LoadingUI.prototype.__class__ = "LoadingUI";
  8794. var __extends = this.__extends || function (b, e) {
  8795. function d() {
  8796. this.constructor = b
  8797. }
  8798. for (var a in e)
  8799. e.hasOwnProperty(a) && (b[a] = e[a]);
  8800. d.prototype = e.prototype;
  8801. b.prototype = new d
  8802. }, Main = function (b) {
  8803. function e() {
  8804. b.call(this);
  8805. this.moveTime = 400;
  8806. this.stageH = this.stageW = 0;
  8807. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8808. }
  8809. __extends(e, b);
  8810. e.prototype.onAddToStage = function (b) {
  8811. this.loadingView = new LoadingUI;
  8812. this.stage.addChild(this.loadingView);
  8813. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE,
  8814. this.onConfigComplete, this);
  8815. RES.loadConfig("resource/resource.json", "resource/")
  8816. };
  8817. e.prototype.onConfigComplete = function (b) {
  8818. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8819. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8820. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  8821. RES.loadGroup("preload")
  8822. };
  8823. e.prototype.onResourceLoadComplete = function (b) {
  8824. "preload" == b.groupName && RES.loadGroup("loading");
  8825. "loading" == b.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  8826. };
  8827. e.prototype.onResourceProgress = function (b) {
  8828. this.loadingView.setProgress(b.itemsLoaded, b.itemsTotal)
  8829. };
  8830. e.prototype.createGameScene = function () {
  8831. this.stageW = this.stage.stageWidth;
  8832. this.stageH = this.stage.stageHeight;
  8833. null == this.homepage && (this.homepage =
  8834. new HomePage);
  8835. this.addChild(this.homepage);
  8836. this.addEventListener("click_start_btn", this.doClickStart, this);
  8837. this.addEventListener("click_replay_btn", this.doReplay, this);
  8838. this.addEventListener("click_next_btn", this.doReplay, this);
  8839. this.addEventListener("click_home_btn", this.doHome, this)
  8840. };
  8841. e.prototype.doHome = function (b) {
  8842. null != this.ingame && (this.removeChild(this.ingame), this.ingame = null);
  8843. null == this.homepage && (this.homepage = new HomePage);
  8844. this.addChild(this.homepage)
  8845. };
  8846. e.prototype.doReplay = function () {
  8847. null !=
  8848. this.ingame && (this.removeChild(this.ingame), this.ingame = null);
  8849. this.createIngame()
  8850. };
  8851. e.prototype.createIngame = function () {
  8852. if (null == this.ingame) {
  8853. this.ingame = new InGame;
  8854. this.addChild(this.ingame);
  8855. var b = new egret.Rectangle(0, 0, this.stageW, 960);
  8856. this.ingame.mask = b
  8857. }
  8858. //ih5game.start()
  8859. };
  8860. e.prototype.doClickStart = function () {
  8861. null != this.homepage && (this.removeChild(this.homepage), this.homepage = null);
  8862. this.createIngame()
  8863. };
  8864. return e
  8865. }
  8866. (egret.DisplayObjectContainer);
  8867. Main.prototype.__class__ = "Main";