game-min.js 307 KB

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