game-min.js 266 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018
  1. var egret;
  2. (function (b) {
  3. var d = function () {
  4. function b() {
  5. this._hashCode = b.hashCount++
  6. }
  7. Object.defineProperty(b.prototype, "hashCode", {
  8. get : function () {
  9. return this._hashCode
  10. },
  11. enumerable : !0,
  12. configurable : !0
  13. });
  14. b.hashCount = 1;
  15. return b
  16. }
  17. ();
  18. b.HashObject = d;
  19. d.prototype.__class__ = "egret.HashObject"
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends || function (b, d) {
  22. function e() {
  23. this.constructor = b
  24. }
  25. for (var a in d)
  26. d.hasOwnProperty(a) && (b[a] = d[a]);
  27. e.prototype = d.prototype;
  28. b.prototype = new e
  29. };
  30. (function (b) {
  31. var d = function (b) {
  32. function a(c) {
  33. void 0 === c && (c = 300);
  34. b.call(this);
  35. this.objectPool = [];
  36. this._length = 0;
  37. 1 > c && (c = 1);
  38. this.autoDisposeTime = c;
  39. this.frameCount = 0
  40. }
  41. __extends(a, b);
  42. a.prototype._checkFrame = function () {
  43. this.frameCount--;
  44. 0 >= this.frameCount && this.dispose()
  45. };
  46. Object.defineProperty(a.prototype, "length", {
  47. get : function () {
  48. return this._length
  49. },
  50. enumerable : !0,
  51. configurable : !0
  52. });
  53. a.prototype.push = function (c) {
  54. var k = this.objectPool;
  55. -1 == k.indexOf(c) && (k.push(c), this._length++, 0 == this.frameCount && (this.frameCount =
  56. this.autoDisposeTime, a._callBackList.push(this)))
  57. };
  58. a.prototype.pop = function () {
  59. if (0 == this._length)
  60. return null;
  61. this._length--;
  62. return this.objectPool.pop()
  63. };
  64. a.prototype.dispose = function () {
  65. 0 < this._length && (this.objectPool = [], this._length = 0);
  66. this.frameCount = 0;
  67. var c = a._callBackList,
  68. k = c.indexOf(this);
  69. -1 != k && c.splice(k, 1)
  70. };
  71. a._callBackList = [];
  72. return a
  73. }
  74. (b.HashObject);
  75. b.Recycler = d;
  76. d.prototype.__class__ = "egret.Recycler"
  77. })(egret || (egret = {}));
  78. (function (b) {
  79. b.__START_TIME;
  80. b.getTimer = function () {
  81. return Date.now() - b.__START_TIME
  82. }
  83. })(egret || (egret = {}));
  84. (function (b) {
  85. b.__callLaterFunctionList = [];
  86. b.__callLaterThisList = [];
  87. b.__callLaterArgsList = [];
  88. b.callLater = function (d, e) {
  89. for (var a = [], c = 2; c < arguments.length; c++)
  90. a[c - 2] = arguments[c];
  91. b.__callLaterFunctionList.push(d);
  92. b.__callLaterThisList.push(e);
  93. b.__callLaterArgsList.push(a)
  94. };
  95. b.__callAsyncFunctionList = [];
  96. b.__callAsyncThisList = [];
  97. b.__callAsyncArgsList = [];
  98. b.__callAsync = function (d, e) {
  99. for (var a = [], c = 2; c < arguments.length; c++)
  100. a[c - 2] = arguments[c];
  101. b.__callAsyncFunctionList.push(d);
  102. b.__callAsyncThisList.push(e);
  103. b.__callAsyncArgsList.push(a)
  104. }
  105. })(egret || (egret = {}));
  106. var egret_dom;
  107. (function (b) {
  108. function d() {
  109. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], c = 0; c < a.length; c++)
  110. if (a[c] + "ransform" in b)
  111. return a[c];
  112. return a[0]
  113. }
  114. b.header = "";
  115. b.getHeader = d;
  116. b.getTrans = function (e) {
  117. "" == b.header && (b.header = d());
  118. return b.header + e.substring(1, e.length)
  119. }
  120. })(egret_dom || (egret_dom = {}));
  121. __extends = this.__extends || function (b, d) {
  122. function e() {
  123. this.constructor = b
  124. }
  125. for (var a in d)
  126. d.hasOwnProperty(a) && (b[a] = d[a]);
  127. e.prototype = d.prototype;
  128. b.prototype = new e
  129. };
  130. (function (b) {
  131. var d = function (e) {
  132. function a(c, a, l) {
  133. void 0 === a && (a = !1);
  134. void 0 === l && (l = !1);
  135. e.call(this);
  136. this._eventPhase = 2;
  137. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  138. this.isNew = !0;
  139. this._type = c;
  140. this._bubbles = a;
  141. this._cancelable = l
  142. }
  143. __extends(a, e);
  144. Object.defineProperty(a.prototype, "type", {
  145. get : function () {
  146. return this._type
  147. },
  148. enumerable : !0,
  149. configurable : !0
  150. });
  151. Object.defineProperty(a.prototype, "bubbles", {
  152. get : function () {
  153. return this._bubbles
  154. },
  155. enumerable : !0,
  156. configurable : !0
  157. });
  158. Object.defineProperty(a.prototype, "cancelable", {
  159. get : function () {
  160. return this._cancelable
  161. },
  162. enumerable : !0,
  163. configurable : !0
  164. });
  165. Object.defineProperty(a.prototype, "eventPhase", {
  166. get : function () {
  167. return this._eventPhase
  168. },
  169. enumerable : !0,
  170. configurable : !0
  171. });
  172. Object.defineProperty(a.prototype, "currentTarget", {
  173. get : function () {
  174. return this._currentTarget
  175. },
  176. enumerable : !0,
  177. configurable : !0
  178. });
  179. Object.defineProperty(a.prototype, "target", {
  180. get : function () {
  181. return this._target
  182. },
  183. enumerable : !0,
  184. configurable : !0
  185. });
  186. a.prototype.isDefaultPrevented =
  187. function () {
  188. return this._isDefaultPrevented
  189. };
  190. a.prototype.preventDefault = function () {
  191. this._cancelable && (this._isDefaultPrevented = !0)
  192. };
  193. a.prototype.stopPropagation = function () {
  194. this._bubbles && (this._isPropagationStopped = !0)
  195. };
  196. a.prototype.stopImmediatePropagation = function () {
  197. this._bubbles && (this._isPropagationImmediateStopped = !0)
  198. };
  199. a.prototype._reset = function () {
  200. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  201. null, this._eventPhase = 2)
  202. };
  203. a._dispatchByTarget = function (c, a, l, e, d, f) {
  204. void 0 === d && (d = !1);
  205. void 0 === f && (f = !1);
  206. var h = c.eventRecycler;
  207. h || (h = c.eventRecycler = new b.Recycler);
  208. var n = h.pop();
  209. n ? n._type = l : n = new c(l);
  210. n._bubbles = d;
  211. n._cancelable = f;
  212. if (e)
  213. for (var p in e)
  214. n[p] = e[p], null !== n[p] && (e[p] = null);
  215. c = a.dispatchEvent(n);
  216. h.push(n);
  217. return c
  218. };
  219. a._getPropertyData = function (c) {
  220. var a = c._props;
  221. a || (a = c._props = {});
  222. return a
  223. };
  224. a.dispatchEvent = function (c, k, l, b) {
  225. void 0 === l && (l = !1);
  226. var e = a._getPropertyData(a);
  227. b && (e.data = b);
  228. a._dispatchByTarget(a,
  229. c, k, e, l)
  230. };
  231. a.ADDED_TO_STAGE = "addedToStage";
  232. a.REMOVED_FROM_STAGE = "removedFromStage";
  233. a.ADDED = "added";
  234. a.REMOVED = "removed";
  235. a.COMPLETE = "complete";
  236. a.ENTER_FRAME = "enterFrame";
  237. a.RENDER = "render";
  238. a.FINISH_RENDER = "finishRender";
  239. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  240. a.LEAVE_STAGE = "leaveStage";
  241. a.RESIZE = "resize";
  242. a.CHANGE = "change";
  243. a.ACTIVATE = "activate";
  244. a.DEACTIVATE = "deactivate";
  245. a.CLOSE = "close";
  246. a.CONNECT = "connect";
  247. return a
  248. }
  249. (b.HashObject);
  250. b.Event = d;
  251. d.prototype.__class__ = "egret.Event"
  252. })(egret || (egret = {}));
  253. __extends = this.__extends || function (b, d) {
  254. function e() {
  255. this.constructor = b
  256. }
  257. for (var a in d)
  258. d.hasOwnProperty(a) && (b[a] = d[a]);
  259. e.prototype = d.prototype;
  260. b.prototype = new e
  261. };
  262. (function (b) {
  263. var d = function (b) {
  264. function a(c, a, l) {
  265. void 0 === a && (a = !1);
  266. void 0 === l && (l = !1);
  267. b.call(this, c, a, l);
  268. this._status = 0
  269. }
  270. __extends(a, b);
  271. Object.defineProperty(a.prototype, "status", {
  272. get : function () {
  273. return this._status
  274. },
  275. enumerable : !0,
  276. configurable : !0
  277. });
  278. a.dispatchHTTPStatusEvent = function (c, k) {
  279. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  280. a.httpStatusEvent._status = k;
  281. c.dispatchEvent(a.httpStatusEvent)
  282. };
  283. a.HTTP_STATUS = "httpStatus";
  284. a.httpStatusEvent = null;
  285. return a
  286. }
  287. (b.Event);
  288. b.HTTPStatusEvent =
  289. d;
  290. d.prototype.__class__ = "egret.HTTPStatusEvent"
  291. })(egret || (egret = {}));
  292. __extends = this.__extends || function (b, d) {
  293. function e() {
  294. this.constructor = b
  295. }
  296. for (var a in d)
  297. d.hasOwnProperty(a) && (b[a] = d[a]);
  298. e.prototype = d.prototype;
  299. b.prototype = new e
  300. };
  301. (function (b) {
  302. var d = function (e) {
  303. function a(c, a, b) {
  304. void 0 === a && (a = !1);
  305. void 0 === b && (b = !1);
  306. e.call(this, c, a, b)
  307. }
  308. __extends(a, e);
  309. a.dispatchIOErrorEvent = function (c) {
  310. b.Event._dispatchByTarget(a, c, a.IO_ERROR)
  311. };
  312. a.IO_ERROR = "ioError";
  313. return a
  314. }
  315. (b.Event);
  316. b.IOErrorEvent = d;
  317. d.prototype.__class__ = "egret.IOErrorEvent"
  318. })(egret || (egret = {}));
  319. __extends = this.__extends || function (b, d) {
  320. function e() {
  321. this.constructor = b
  322. }
  323. for (var a in d)
  324. d.hasOwnProperty(a) && (b[a] = d[a]);
  325. e.prototype = d.prototype;
  326. b.prototype = new e
  327. };
  328. (function (b) {
  329. var d = function (e) {
  330. function a(c, a, b, m, d, f, h, n, p, q) {
  331. void 0 === a && (a = !0);
  332. void 0 === b && (b = !0);
  333. void 0 === m && (m = 0);
  334. void 0 === d && (d = 0);
  335. void 0 === f && (f = 0);
  336. void 0 === h && (h = !1);
  337. void 0 === n && (n = !1);
  338. void 0 === q && (q = !1);
  339. e.call(this, c, a, b);
  340. this._stageY = this._stageX = 0;
  341. this.touchPointID = m;
  342. this._stageX = d;
  343. this._stageY = f;
  344. this.ctrlKey = h;
  345. this.altKey = n;
  346. this.touchDown = q
  347. }
  348. __extends(a, e);
  349. Object.defineProperty(a.prototype, "stageX", {
  350. get : function () {
  351. return this._stageX
  352. },
  353. enumerable : !0,
  354. configurable : !0
  355. });
  356. Object.defineProperty(a.prototype,
  357. "stageY", {
  358. get : function () {
  359. return this._stageY
  360. },
  361. enumerable : !0,
  362. configurable : !0
  363. });
  364. Object.defineProperty(a.prototype, "localX", {
  365. get : function () {
  366. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  367. },
  368. enumerable : !0,
  369. configurable : !0
  370. });
  371. Object.defineProperty(a.prototype, "localY", {
  372. get : function () {
  373. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  374. },
  375. enumerable : !0,
  376. configurable : !0
  377. });
  378. a.dispatchTouchEvent = function (c, k, l, e, d, f, h, n, p) {
  379. void 0 === l && (l = 0);
  380. void 0 === e && (e = 0);
  381. void 0 === d && (d = 0);
  382. void 0 === f && (f = !1);
  383. void 0 === h && (h = !1);
  384. void 0 === n && (n = !1);
  385. void 0 === p && (p = !1);
  386. var q = b.Event._getPropertyData(a);
  387. q.touchPointID = l;
  388. q._stageX = e;
  389. q._stageY = d;
  390. q.ctrlKey = f;
  391. q.altKey = h;
  392. q.shiftKey = n;
  393. q.touchDown = p;
  394. b.Event._dispatchByTarget(a, c, k, q, !0, !0)
  395. };
  396. a.TOUCH_TAP = "touchTap";
  397. a.TOUCH_MOVE = "touchMove";
  398. a.TOUCH_BEGIN = "touchBegin";
  399. a.TOUCH_END = "touchEnd";
  400. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  401. a.TOUCH_ROLL_OUT = "touchRollOut";
  402. a.TOUCH_ROLL_OVER = "touchRollOver";
  403. a.TOUCH_OUT =
  404. "touchOut";
  405. a.TOUCH_OVER = "touchOver";
  406. return a
  407. }
  408. (b.Event);
  409. b.TouchEvent = d;
  410. d.prototype.__class__ = "egret.TouchEvent"
  411. })(egret || (egret = {}));
  412. __extends = this.__extends || function (b, d) {
  413. function e() {
  414. this.constructor = b
  415. }
  416. for (var a in d)
  417. d.hasOwnProperty(a) && (b[a] = d[a]);
  418. e.prototype = d.prototype;
  419. b.prototype = new e
  420. };
  421. (function (b) {
  422. var d = function (e) {
  423. function a(c, a, b) {
  424. void 0 === a && (a = !1);
  425. void 0 === b && (b = !1);
  426. e.call(this, c, a, b)
  427. }
  428. __extends(a, e);
  429. a.dispatchTimerEvent = function (c, k) {
  430. b.Event._dispatchByTarget(a, c, k)
  431. };
  432. a.TIMER = "timer";
  433. a.TIMER_COMPLETE = "timerComplete";
  434. return a
  435. }
  436. (b.Event);
  437. b.TimerEvent = d;
  438. d.prototype.__class__ = "egret.TimerEvent"
  439. })(egret || (egret = {}));
  440. __extends = this.__extends || function (b, d) {
  441. function e() {
  442. this.constructor = b
  443. }
  444. for (var a in d)
  445. d.hasOwnProperty(a) && (b[a] = d[a]);
  446. e.prototype = d.prototype;
  447. b.prototype = new e
  448. };
  449. (function (b) {
  450. var d = function (e) {
  451. function a(c, a, b, m, d) {
  452. void 0 === a && (a = !1);
  453. void 0 === b && (b = !1);
  454. void 0 === m && (m = 0);
  455. void 0 === d && (d = 0);
  456. e.call(this, c, a, b);
  457. this.bytesLoaded = m;
  458. this.bytesTotal = d
  459. }
  460. __extends(a, e);
  461. a.dispatchProgressEvent = function (c, k, l, e) {
  462. void 0 === l && (l = 0);
  463. void 0 === e && (e = 0);
  464. b.Event._dispatchByTarget(a, c, k, {
  465. bytesLoaded : l,
  466. bytesTotal : e
  467. })
  468. };
  469. a.PROGRESS = "progress";
  470. a.SOCKET_DATA = "socketData";
  471. return a
  472. }
  473. (b.Event);
  474. b.ProgressEvent = d;
  475. d.prototype.__class__ = "egret.ProgressEvent"
  476. })(egret || (egret = {}));
  477. (function (b) {
  478. var d = function () {
  479. function b() {}
  480. b.CAPTURING_PHASE = 1;
  481. b.AT_TARGET = 2;
  482. b.BUBBLING_PHASE = 3;
  483. return b
  484. }
  485. ();
  486. b.EventPhase = d;
  487. d.prototype.__class__ = "egret.EventPhase"
  488. })(egret || (egret = {}));
  489. __extends = this.__extends || function (b, d) {
  490. function e() {
  491. this.constructor = b
  492. }
  493. for (var a in d)
  494. d.hasOwnProperty(a) && (b[a] = d[a]);
  495. e.prototype = d.prototype;
  496. b.prototype = new e
  497. };
  498. (function (b) {
  499. var d = function (e) {
  500. function a(c) {
  501. void 0 === c && (c = null);
  502. e.call(this);
  503. this._eventTarget = c ? c : this
  504. }
  505. __extends(a, e);
  506. a.prototype.addEventListener = function (c, a, l, e, d) {
  507. void 0 === e && (e = !1);
  508. void 0 === d && (d = 0);
  509. "undefined" === typeof e && (e = !1);
  510. "undefined" === typeof d && (d = 0);
  511. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  512. e ? (this._captureEventsMap || (this._captureEventsMap = {}), e = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), e = this._eventsMap);
  513. var f = e[c];
  514. f || (f = e[c] = []);
  515. this._insertEventBin(f, a, l, d)
  516. };
  517. a.prototype._insertEventBin = function (c, a, b, e, d) {
  518. void 0 === d && (d = void 0);
  519. for (var f = -1, h = c.length, n = 0; n < h; n++) {
  520. var p = c[n];
  521. if (p.listener === a && p.thisObject === b && p.display === d)
  522. return !1;
  523. -1 == f && p.priority < e && (f = n)
  524. }
  525. a = {
  526. listener : a,
  527. thisObject : b,
  528. priority : e
  529. };
  530. d && (a.display = d);
  531. -1 != f ? c.splice(f, 0, a) : c.push(a);
  532. return !0
  533. };
  534. a.prototype.removeEventListener = function (c, a, b, e) {
  535. void 0 === e && (e = !1);
  536. if (e = e ? this._captureEventsMap : this._eventsMap) {
  537. var d = e[c];
  538. d && (this._removeEventBin(d,
  539. a, b), 0 == d.length && delete e[c])
  540. }
  541. };
  542. a.prototype._removeEventBin = function (c, a, b, e) {
  543. void 0 === e && (e = void 0);
  544. for (var d = c.length, f = 0; f < d; f++) {
  545. var h = c[f];
  546. if (h.listener === a && h.thisObject === b && h.display === e)
  547. return c.splice(f, 1), !0
  548. }
  549. return !1
  550. };
  551. a.prototype.hasEventListener = function (c) {
  552. return this._eventsMap && this._eventsMap[c] || this._captureEventsMap && this._captureEventsMap[c]
  553. };
  554. a.prototype.willTrigger = function (c) {
  555. return this.hasEventListener(c)
  556. };
  557. a.prototype.dispatchEvent = function (c) {
  558. c._reset();
  559. c._target = this._eventTarget;
  560. c._currentTarget = this._eventTarget;
  561. return this._notifyListener(c)
  562. };
  563. a.prototype._notifyListener = function (c) {
  564. var a = 1 == c._eventPhase ? this._captureEventsMap : this._eventsMap;
  565. if (!a)
  566. return !0;
  567. a = a[c._type];
  568. if (!a)
  569. return !0;
  570. var b = a.length;
  571. if (0 == b)
  572. return !0;
  573. for (var a = a.concat(), e = 0; e < b; e++) {
  574. var d = a[e];
  575. d.listener.call(d.thisObject, c);
  576. if (c._isPropagationImmediateStopped)
  577. break
  578. }
  579. return !c._isDefaultPrevented
  580. };
  581. a.prototype.dispatchEventWith = function (c, a, l) {
  582. void 0 === a && (a = !1);
  583. b.Event.dispatchEvent(this, c, a, l)
  584. };
  585. return a
  586. }
  587. (b.HashObject);
  588. b.EventDispatcher = d;
  589. d.prototype.__class__ = "egret.EventDispatcher"
  590. })(egret || (egret = {}));
  591. __extends = this.__extends || function (b, d) {
  592. function e() {
  593. this.constructor = b
  594. }
  595. for (var a in d)
  596. d.hasOwnProperty(a) && (b[a] = d[a]);
  597. e.prototype = d.prototype;
  598. b.prototype = new e
  599. };
  600. (function (b) {
  601. var d = function (e) {
  602. function a() {
  603. e.call(this);
  604. this.reuseEvent = new b.Event("")
  605. }
  606. __extends(a, e);
  607. a.prototype.run = function () {
  608. b.Ticker.getInstance().run();
  609. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  610. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  611. this.touchContext.run()
  612. };
  613. a.prototype.renderLoop = function (c) {
  614. if (0 < b.__callLaterFunctionList.length) {
  615. var k = b.__callLaterFunctionList;
  616. b.__callLaterFunctionList = [];
  617. var l = b.__callLaterThisList;
  618. b.__callLaterThisList = [];
  619. var e = b.__callLaterArgsList;
  620. b.__callLaterArgsList = []
  621. }
  622. c = this.stage;
  623. var d = a.cachedEvent;
  624. d._type = b.Event.RENDER;
  625. this.dispatchEvent(d);
  626. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  627. k && this.doCallLaterList(k, l, e);
  628. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  629. k = this.rendererContext;
  630. k.onRenderStart();
  631. k.clearScreen();
  632. c._updateTransform();
  633. d._type = b.Event.FINISH_UPDATE_TRANSFORM;
  634. this.dispatchEvent(d);
  635. c._draw(k);
  636. d._type = b.Event.FINISH_RENDER;
  637. this.dispatchEvent(d);
  638. k.onRenderFinish()
  639. };
  640. a.prototype.broadcastEnterFrame = function (c) {
  641. c = this.reuseEvent;
  642. c._type = b.Event.ENTER_FRAME;
  643. this.dispatchEvent(c);
  644. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), l = a.length, e = 0; e < l; e++) {
  645. var d = a[e];
  646. c._target = d.display;
  647. c._currentTarget = d.display;
  648. d.listener.call(d.thisObject, c)
  649. }
  650. a = b.Recycler._callBackList;
  651. for (e = a.length - 1; 0 <= e; e--)
  652. a[e]._checkFrame()
  653. };
  654. a.prototype.broadcastRender = function () {
  655. var c = this.reuseEvent;
  656. c._type = b.Event.RENDER;
  657. for (var a = b.DisplayObject._renderCallBackList.concat(),
  658. l = a.length, e = 0; e < l; e++) {
  659. var d = a[e],
  660. f = d.display;
  661. c._target = f;
  662. c._currentTarget = f;
  663. d.listener.call(d.thisObject, c)
  664. }
  665. };
  666. a.prototype.doCallLaterList = function (c, a, b) {
  667. for (var e = c.length, d = 0; d < e; d++) {
  668. var f = c[d];
  669. null != f && f.apply(a[d], b[d])
  670. }
  671. };
  672. a.prototype.doCallAsyncList = function () {
  673. var c = b.__callAsyncFunctionList.concat(),
  674. a = b.__callAsyncThisList.concat(),
  675. l = b.__callAsyncArgsList.concat();
  676. b.__callAsyncFunctionList.length = 0;
  677. b.__callAsyncThisList.length = 0;
  678. for (var e = b.__callAsyncArgsList.length = 0; e < c.length; e++) {
  679. var d =
  680. c[e];
  681. null != d && d.apply(a[e], l[e])
  682. }
  683. };
  684. a.DEVICE_PC = "web";
  685. a.DEVICE_MOBILE = "native";
  686. a.RUNTIME_HTML5 = "runtime_html5";
  687. a.RUNTIME_NATIVE = "runtime_native";
  688. a.cachedEvent = new b.Event("");
  689. return a
  690. }
  691. (b.EventDispatcher);
  692. b.MainContext = d;
  693. d.prototype.__class__ = "egret.MainContext"
  694. })(egret || (egret = {}));
  695. var testDeviceType = function () {
  696. if (!this.navigator)
  697. return !0;
  698. var b = navigator.userAgent.toLowerCase();
  699. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  700. }, testRuntimeType = function () {
  701. return this.navigator ? !0 : !1
  702. };
  703. egret.MainContext.instance = new egret.MainContext;
  704. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  705. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  706. delete testDeviceType;
  707. delete testRuntimeType;
  708. (function (b) {
  709. var d = function () {
  710. function e() {
  711. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  712. this._maxDeltaTime = 500;
  713. this._totalDeltaTime = 0
  714. }
  715. e.getInstance = function () {
  716. null == e.instance && (e.instance = new e);
  717. return e.instance
  718. };
  719. e.prototype.run = function () {
  720. b.Ticker.getInstance().register(this.update, this);
  721. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, b.MainContext.instance.stage.addChild(this._txt));
  722. var a = b.MainContext.instance;
  723. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  724. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  725. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  726. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  727. };
  728. e.prototype.onEnterFrame = function (a) {
  729. this._lastTime = b.getTimer()
  730. };
  731. e.prototype.onStartRender = function (a) {
  732. a = b.getTimer();
  733. this._logicPerformanceCost = a - this._lastTime;
  734. this._lastTime = a
  735. };
  736. e.prototype.onFinishUpdateTransform =
  737. function (a) {
  738. a = b.getTimer();
  739. this._updateTransformPerformanceCost = a - this._lastTime;
  740. this._lastTime = a
  741. };
  742. e.prototype.onFinishRender = function (a) {
  743. a = b.getTimer();
  744. this._renderPerformanceCost = a - this._lastTime;
  745. this._lastTime = a
  746. };
  747. e.prototype.update = function (a) {
  748. this._tick++;
  749. this._totalDeltaTime += a;
  750. if (this._totalDeltaTime >= this._maxDeltaTime) {
  751. a = (this._preDrawCount - 1).toString();
  752. var c = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  753. "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  754. this._txt.text = "draw:" + a + "\ncost:" + c + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  755. this._tick = this._totalDeltaTime = 0
  756. }
  757. this._preDrawCount = 0
  758. };
  759. e.prototype.onDrawImage = function () {
  760. this._preDrawCount++
  761. };
  762. return e
  763. }
  764. ();
  765. b.Profiler = d;
  766. d.prototype.__class__ = "egret.Profiler"
  767. })(egret || (egret = {}));
  768. __extends = this.__extends || function (b, d) {
  769. function e() {
  770. this.constructor = b
  771. }
  772. for (var a in d)
  773. d.hasOwnProperty(a) && (b[a] = d[a]);
  774. e.prototype = d.prototype;
  775. b.prototype = new e
  776. };
  777. (function (b) {
  778. var d = function (e) {
  779. function a() {
  780. e.apply(this, arguments);
  781. this._timeScale = 1;
  782. this._paused = !1;
  783. this.callBackList = []
  784. }
  785. __extends(a, e);
  786. a.prototype.run = function () {
  787. b.__START_TIME = (new Date).getTime();
  788. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  789. };
  790. a.prototype.update = function (c) {
  791. var a = this.callBackList.concat(),
  792. b = a.length;
  793. c *= this._timeScale;
  794. c *= this._timeScale;
  795. for (var e = 0; e < b; e++) {
  796. var d = a[e];
  797. d.listener.call(d.thisObject, c)
  798. }
  799. };
  800. a.prototype.register = function (c, a, b) {
  801. void 0 === b &&
  802. (b = 0);
  803. this._insertEventBin(this.callBackList, c, a, b)
  804. };
  805. a.prototype.unregister = function (c, a) {
  806. this._removeEventBin(this.callBackList, c, a)
  807. };
  808. a.prototype.setTimeout = function (c, a, l) {
  809. for (var e = [], d = 3; d < arguments.length; d++)
  810. e[d - 3] = arguments[d];
  811. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  812. b.setTimeout.apply(null, [c, a, l].concat(e))
  813. };
  814. a.prototype.setTimeScale = function (c) {
  815. this._timeScale = c
  816. };
  817. a.prototype.getTimeScale = function () {
  818. return this._timeScale
  819. };
  820. a.prototype.pause = function () {
  821. this._paused = !0
  822. };
  823. a.prototype.resume = function () {
  824. this._paused = !1
  825. };
  826. a.getInstance = function () {
  827. null == a.instance && (a.instance = new a);
  828. return a.instance
  829. };
  830. return a
  831. }
  832. (b.EventDispatcher);
  833. b.Ticker = d;
  834. d.prototype.__class__ = "egret.Ticker"
  835. })(egret || (egret = {}));
  836. (function (b) {
  837. var d = function () {
  838. function b() {}
  839. b.LEFT = "left";
  840. b.RIGHT = "right";
  841. b.CENTER = "center";
  842. b.JUSTIFY = "justify";
  843. b.CONTENT_JUSTIFY = "contentJustify";
  844. return b
  845. }
  846. ();
  847. b.HorizontalAlign = d;
  848. d.prototype.__class__ = "egret.HorizontalAlign"
  849. })(egret || (egret = {}));
  850. (function (b) {
  851. var d = function () {
  852. function b() {}
  853. b.TOP = "top";
  854. b.BOTTOM = "bottom";
  855. b.MIDDLE = "middle";
  856. b.JUSTIFY = "justify";
  857. b.CONTENT_JUSTIFY = "contentJustify";
  858. return b
  859. }
  860. ();
  861. b.VerticalAlign = d;
  862. d.prototype.__class__ = "egret.VerticalAlign"
  863. })(egret || (egret = {}));
  864. __extends = this.__extends || function (b, d) {
  865. function e() {
  866. this.constructor = b
  867. }
  868. for (var a in d)
  869. d.hasOwnProperty(a) && (b[a] = d[a]);
  870. e.prototype = d.prototype;
  871. b.prototype = new e
  872. };
  873. (function (b) {
  874. var d = function (e) {
  875. function a(c, a) {
  876. void 0 === a && (a = 0);
  877. e.call(this);
  878. this._currentCount = 0;
  879. this.delay = c;
  880. this.repeatCount = a
  881. }
  882. __extends(a, e);
  883. a.prototype.currentCount = function () {
  884. return this._currentCount
  885. };
  886. Object.defineProperty(a.prototype, "running", {
  887. get : function () {
  888. return this._running
  889. },
  890. enumerable : !0,
  891. configurable : !0
  892. });
  893. a.prototype.reset = function () {
  894. this.stop();
  895. this._currentCount = 0
  896. };
  897. a.prototype.start = function () {
  898. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount =
  899. 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  900. };
  901. a.prototype.stop = function () {
  902. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  903. };
  904. a.prototype.onEnterFrame = function (c) {
  905. c = b.getTimer();
  906. c - this.lastTime > this.delay && (this.lastTime = c, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER_COMPLETE)))
  907. };
  908. return a
  909. }
  910. (b.EventDispatcher);
  911. b.Timer = d;
  912. d.prototype.__class__ = "egret.Timer"
  913. })(egret || (egret = {}));
  914. (function (b) {
  915. function d(b) {
  916. b = b.prototype ? b.prototype : b.__proto__;
  917. if (b.hasOwnProperty("__class__"))
  918. return b.__class__;
  919. var a = b.constructor.toString(),
  920. c = a.indexOf("("),
  921. a = a.substring(9, c);
  922. Object.defineProperty(b, "__class__", {
  923. value : a,
  924. enumerable : !1,
  925. writable : !0
  926. });
  927. return a
  928. }
  929. b.getQualifiedClassName = d;
  930. b.getQualifiedSuperclassName = function (b) {
  931. b = b.prototype ? b.prototype : b.__proto__;
  932. if (b.hasOwnProperty("__superclass__"))
  933. return b.__superclass__;
  934. var a = Object.getPrototypeOf(b);
  935. if (null == a)
  936. return null;
  937. a = d(a.constructor);
  938. if (!a)
  939. return null;
  940. Object.defineProperty(b, "__superclass__", {
  941. value : a,
  942. enumerable : !1,
  943. writable : !0
  944. });
  945. return a
  946. }
  947. })(egret || (egret = {}));
  948. (function (b) {
  949. var d = {};
  950. b.getDefinitionByName = function (b) {
  951. if (!b)
  952. return null;
  953. var a = d[b];
  954. if (a)
  955. return a;
  956. for (var c = b.split("."), k = c.length, a = __global, l = 0; l < k; l++)
  957. if (a = a[c[l]], !a)
  958. return null;
  959. return d[b] = a
  960. }
  961. })(egret || (egret = {}));
  962. var __global = __global || this;
  963. (function (b) {
  964. function d(c) {
  965. for (var a in e) {
  966. var b = e[a];
  967. b.delay -= c;
  968. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete e[a])
  969. }
  970. }
  971. var e = {},
  972. a = 0;
  973. b.setTimeout = function (c, k, l) {
  974. for (var m = [], g = 3; g < arguments.length; g++)
  975. m[g - 3] = arguments[g];
  976. m = {
  977. listener : c,
  978. thisObject : k,
  979. delay : l,
  980. params : m
  981. };
  982. 0 == a && b.Ticker.getInstance().register(d, null);
  983. a++;
  984. e[a] = m;
  985. return a
  986. };
  987. b.clearTimeout = function (c) {
  988. delete e[c]
  989. }
  990. })(egret || (egret = {}));
  991. (function (b) {
  992. b.hasDefinition = function (d) {
  993. return b.getDefinitionByName(d) ? !0 : !1
  994. }
  995. })(egret || (egret = {}));
  996. (function (b) {
  997. b.toColorString = function (b) {
  998. if (isNaN(b) || 0 > b)
  999. b = 0;
  1000. 16777215 < b && (b = 16777215);
  1001. for (b = b.toString(16).toUpperCase(); 6 > b.length; )
  1002. b = "0" + b;
  1003. return "#" + b
  1004. }
  1005. })(egret || (egret = {}));
  1006. __extends = this.__extends || function (b, d) {
  1007. function e() {
  1008. this.constructor = b
  1009. }
  1010. for (var a in d)
  1011. d.hasOwnProperty(a) && (b[a] = d[a]);
  1012. e.prototype = d.prototype;
  1013. b.prototype = new e
  1014. };
  1015. (function (b) {
  1016. var d = function (e) {
  1017. function a(c, a, b, d, g, f) {
  1018. void 0 === c && (c = 1);
  1019. void 0 === a && (a = 0);
  1020. void 0 === b && (b = 0);
  1021. void 0 === d && (d = 1);
  1022. void 0 === g && (g = 0);
  1023. void 0 === f && (f = 0);
  1024. e.call(this);
  1025. this.a = c;
  1026. this.b = a;
  1027. this.c = b;
  1028. this.d = d;
  1029. this.tx = g;
  1030. this.ty = f
  1031. }
  1032. __extends(a, e);
  1033. a.prototype.prepend = function (c, a, b, e, d, f) {
  1034. var h = this.tx;
  1035. if (1 != c || 0 != a || 0 != b || 1 != e) {
  1036. var n = this.a,
  1037. p = this.c;
  1038. this.a = n * c + this.b * b;
  1039. this.b = n * a + this.b * e;
  1040. this.c = p * c + this.d * b;
  1041. this.d = p * a + this.d * e
  1042. }
  1043. this.tx = h * c + this.ty * b + d;
  1044. this.ty = h * a + this.ty * e + f;
  1045. return this
  1046. };
  1047. a.prototype.append =
  1048. function (c, a, b, e, d, f) {
  1049. var h = this.a,
  1050. n = this.b,
  1051. p = this.c,
  1052. q = this.d;
  1053. if (1 != c || 0 != a || 0 != b || 1 != e)
  1054. this.a = c * h + a * p, this.b = c * n + a * q, this.c = b * h + e * p, this.d = b * n + e * q;
  1055. this.tx = d * h + f * p + this.tx;
  1056. this.ty = d * n + f * q + this.ty;
  1057. return this
  1058. };
  1059. a.prototype.prependTransform = function (c, k, b, e, d, f, h, n, p) {
  1060. if (d % 360) {
  1061. var q = d * a.DEG_TO_RAD;
  1062. d = Math.cos(q);
  1063. q = Math.sin(q)
  1064. } else
  1065. d = 1, q = 0;
  1066. if (n || p)
  1067. this.tx -= n, this.ty -= p;
  1068. f || h ? (f *= a.DEG_TO_RAD, h *= a.DEG_TO_RAD, this.prepend(d * b, q * b, -q * e, d * e, 0, 0), this.prepend(Math.cos(h), Math.sin(h), -Math.sin(f), Math.cos(f),
  1069. c, k)) : this.prepend(d * b, q * b, -q * e, d * e, c, k);
  1070. return this
  1071. };
  1072. a.prototype.appendTransform = function (c, k, b, e, d, f, h, n, p) {
  1073. if (d % 360) {
  1074. var q = d * a.DEG_TO_RAD;
  1075. d = Math.cos(q);
  1076. q = Math.sin(q)
  1077. } else
  1078. d = 1, q = 0;
  1079. 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, k), this.append(d * b, q * b, -q * e, d * e, 0, 0)) : this.append(d * b, q * b, -q * e, d * e, c, k);
  1080. if (n || p)
  1081. this.tx -= n * this.a + p * this.c, this.ty -= n * this.b + p * this.d;
  1082. return this
  1083. };
  1084. a.prototype.rotate = function (c) {
  1085. var a = Math.cos(c);
  1086. c = Math.sin(c);
  1087. var b = this.a,
  1088. e = this.c,
  1089. d = this.tx;
  1090. this.a = b * a - this.b * c;
  1091. this.b = b * c + this.b * a;
  1092. this.c = e * a - this.d * c;
  1093. this.d = e * c + this.d * a;
  1094. this.tx = d * a - this.ty * c;
  1095. this.ty = d * c + this.ty * a;
  1096. return this
  1097. };
  1098. a.prototype.skew = function (c, k) {
  1099. c *= a.DEG_TO_RAD;
  1100. k *= a.DEG_TO_RAD;
  1101. this.append(Math.cos(k), Math.sin(k), -Math.sin(c), Math.cos(c), 0, 0);
  1102. return this
  1103. };
  1104. a.prototype.scale = function (c, a) {
  1105. this.a *= c;
  1106. this.d *= a;
  1107. this.c *= c;
  1108. this.b *= a;
  1109. this.tx *= c;
  1110. this.ty *= a;
  1111. return this
  1112. };
  1113. a.prototype.translate = function (c, a) {
  1114. this.tx += c;
  1115. this.ty += a;
  1116. return this
  1117. };
  1118. a.prototype.identity = function () {
  1119. this.a =
  1120. this.d = 1;
  1121. this.b = this.c = this.tx = this.ty = 0;
  1122. return this
  1123. };
  1124. a.prototype.identityMatrix = function (c) {
  1125. this.a = c.a;
  1126. this.b = c.b;
  1127. this.c = c.c;
  1128. this.d = c.d;
  1129. this.tx = c.tx;
  1130. this.ty = c.ty;
  1131. return this
  1132. };
  1133. a.prototype.invert = function () {
  1134. var c = this.a,
  1135. a = this.b,
  1136. b = this.c,
  1137. e = this.d,
  1138. d = this.tx,
  1139. f = c * e - a * b;
  1140. this.a = e / f;
  1141. this.b = -a / f;
  1142. this.c = -b / f;
  1143. this.d = c / f;
  1144. this.tx = (b * this.ty - e * d) / f;
  1145. this.ty = - (c * this.ty - a * d) / f;
  1146. return this
  1147. };
  1148. a.transformCoords = function (c, a, l) {
  1149. var e = b.Point.identity;
  1150. e.x = c.a * a + c.c * l + c.tx;
  1151. e.y = c.d * l + c.b * a + c.ty;
  1152. return e
  1153. };
  1154. a.prototype.toArray =
  1155. function (c) {
  1156. this.array || (this.array = new Float32Array(9));
  1157. 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);
  1158. this.array[8] = 1;
  1159. return this.array
  1160. };
  1161. a.identity = new a;
  1162. a.DEG_TO_RAD = Math.PI / 180;
  1163. return a
  1164. }
  1165. (b.HashObject);
  1166. b.Matrix = d;
  1167. d.prototype.__class__ =
  1168. "egret.Matrix"
  1169. })(egret || (egret = {}));
  1170. __extends = this.__extends || function (b, d) {
  1171. function e() {
  1172. this.constructor = b
  1173. }
  1174. for (var a in d)
  1175. d.hasOwnProperty(a) && (b[a] = d[a]);
  1176. e.prototype = d.prototype;
  1177. b.prototype = new e
  1178. };
  1179. (function (b) {
  1180. var d = function (b) {
  1181. function a(c, a) {
  1182. void 0 === c && (c = 0);
  1183. void 0 === a && (a = 0);
  1184. b.call(this);
  1185. this.x = c;
  1186. this.y = a
  1187. }
  1188. __extends(a, b);
  1189. a.prototype.clone = function () {
  1190. return new a(this.x, this.y)
  1191. };
  1192. a.prototype.equals = function (c) {
  1193. return this.x == c.x && this.y == c.y
  1194. };
  1195. a.distance = function (c, a) {
  1196. return Math.sqrt((c.x - a.x) * (c.x - a.x) + (c.y - a.y) * (c.y - a.y))
  1197. };
  1198. a.identity = new a(0, 0);
  1199. return a
  1200. }
  1201. (b.HashObject);
  1202. b.Point = d;
  1203. d.prototype.__class__ = "egret.Point"
  1204. })(egret || (egret = {}));
  1205. __extends = this.__extends || function (b, d) {
  1206. function e() {
  1207. this.constructor = b
  1208. }
  1209. for (var a in d)
  1210. d.hasOwnProperty(a) && (b[a] = d[a]);
  1211. e.prototype = d.prototype;
  1212. b.prototype = new e
  1213. };
  1214. (function (b) {
  1215. var d = function (b) {
  1216. function a(c, a, l, d) {
  1217. void 0 === c && (c = 0);
  1218. void 0 === a && (a = 0);
  1219. void 0 === l && (l = 0);
  1220. void 0 === d && (d = 0);
  1221. b.call(this);
  1222. this.x = c;
  1223. this.y = a;
  1224. this.width = l;
  1225. this.height = d
  1226. }
  1227. __extends(a, b);
  1228. Object.defineProperty(a.prototype, "right", {
  1229. get : function () {
  1230. return this.x + this.width
  1231. },
  1232. set : function (c) {
  1233. this.width = c - this.x
  1234. },
  1235. enumerable : !0,
  1236. configurable : !0
  1237. });
  1238. Object.defineProperty(a.prototype, "bottom", {
  1239. get : function () {
  1240. return this.y + this.height
  1241. },
  1242. set : function (c) {
  1243. this.height = c - this.y
  1244. },
  1245. enumerable : !0,
  1246. configurable : !0
  1247. });
  1248. a.prototype.initialize = function (c, a, b, e) {
  1249. this.x = c;
  1250. this.y = a;
  1251. this.width = b;
  1252. this.height = e;
  1253. return this
  1254. };
  1255. a.prototype.contains = function (c, a) {
  1256. return this.x <= c && this.x + this.width >= c && this.y <= a && this.y + this.height >= a
  1257. };
  1258. a.prototype.intersects = function (c) {
  1259. var a = c.right,
  1260. b = c.bottom,
  1261. e = this.right,
  1262. d = this.bottom;
  1263. 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, d) || c.contains(e, this.y) || c.contains(e, d) ? !0 : !1
  1264. };
  1265. a.prototype.clone =
  1266. function () {
  1267. return new a(this.x, this.y, this.width, this.height)
  1268. };
  1269. a.prototype.containsPoint = function (c) {
  1270. return this.x < c.x && this.x + this.width > c.x && this.y < c.y && this.y + this.height > c.y ? !0 : !1
  1271. };
  1272. a.identity = new a(0, 0, 0, 0);
  1273. return a
  1274. }
  1275. (b.HashObject);
  1276. b.Rectangle = d;
  1277. d.prototype.__class__ = "egret.Rectangle"
  1278. })(egret || (egret = {}));
  1279. (function (b) {
  1280. var d = function () {
  1281. function e() {}
  1282. e.fatal = function (a, c) {
  1283. void 0 === c && (c = null);
  1284. b.Logger.traceToConsole("Fatal", a, c);
  1285. throw Error(b.Logger.getTraceCode("Fatal", a, c));
  1286. };
  1287. e.info = function (a, c) {
  1288. void 0 === c && (c = null);
  1289. b.Logger.traceToConsole("Info", a, c)
  1290. };
  1291. e.warning = function (a, c) {
  1292. void 0 === c && (c = null);
  1293. b.Logger.traceToConsole("Warning", a, c)
  1294. };
  1295. e.traceToConsole = function (a, c, k) {
  1296. console.log(b.Logger.getTraceCode(a, c, k))
  1297. };
  1298. e.getTraceCode = function (a, c, k) {
  1299. return "[" + a + "]" + c + ":" + (null == k ? "" : k)
  1300. };
  1301. return e
  1302. }
  1303. ();
  1304. b.Logger =
  1305. d;
  1306. d.prototype.__class__ = "egret.Logger"
  1307. })(egret || (egret = {}));
  1308. __extends = this.__extends || function (b, d) {
  1309. function e() {
  1310. this.constructor = b
  1311. }
  1312. for (var a in d)
  1313. d.hasOwnProperty(a) && (b[a] = d[a]);
  1314. e.prototype = d.prototype;
  1315. b.prototype = new e
  1316. };
  1317. (function (b) {
  1318. var d = function (e) {
  1319. function a() {
  1320. e.call(this);
  1321. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1322. this._xmlDict = {};
  1323. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1324. }
  1325. __extends(a, e);
  1326. a.getInstance = function () {
  1327. a._instance || (a._instance = new a);
  1328. return a._instance
  1329. };
  1330. a.prototype.parserXML = function (c) {
  1331. for (var a = 0; "\n" == c.charAt(a) || "\t" == c.charAt(a) || "\r" == c.charAt(a) || " " == c.charAt(a); )
  1332. a++;
  1333. 0 != a && (c = c.substring(a, c.length));
  1334. this._isSupportDOMParser ?
  1335. a = this._parser.parseFromString(c, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(c));
  1336. null == a && b.Logger.info("xml not found!");
  1337. return a
  1338. };
  1339. a._instance = null;
  1340. return a
  1341. }
  1342. (b.HashObject);
  1343. b.SAXParser = d;
  1344. d.prototype.__class__ = "egret.SAXParser"
  1345. })(egret || (egret = {}));
  1346. __extends = this.__extends || function (b, d) {
  1347. function e() {
  1348. this.constructor = b
  1349. }
  1350. for (var a in d)
  1351. d.hasOwnProperty(a) && (b[a] = d[a]);
  1352. e.prototype = d.prototype;
  1353. b.prototype = new e
  1354. };
  1355. (function (b) {
  1356. var d = function (c) {
  1357. function k() {
  1358. c.call(this);
  1359. this._designHeight = this._designWidth = 0;
  1360. this._scaleY = this._scaleX = 1;
  1361. this._stageHeight = this._stageWidth = this._offSetY = 0
  1362. }
  1363. __extends(k, c);
  1364. k.getInstance = function () {
  1365. null == k.instance && (a.initialize(), k.instance = new k);
  1366. return k.instance
  1367. };
  1368. k.prototype.setDesignSize = function (c, a, k) {
  1369. this._designWidth = c;
  1370. this._designHeight = a;
  1371. k && (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"),
  1372. this._setResolutionPolicy(k))
  1373. };
  1374. k.prototype._setResolutionPolicy = function (c) {
  1375. this._resolutionPolicy = c;
  1376. c.init(this);
  1377. c._apply(this, this._designWidth, this._designHeight)
  1378. };
  1379. k.prototype.getScaleX = function () {
  1380. return this._scaleX
  1381. };
  1382. k.prototype.getScaleY = function () {
  1383. return this._scaleY
  1384. };
  1385. k.prototype.getOffSetY = function () {
  1386. return this._offSetY
  1387. };
  1388. k.canvas_name = "egretCanvas";
  1389. k.canvas_div_name = "gameDiv";
  1390. return k
  1391. }
  1392. (b.HashObject);
  1393. b.StageDelegate = d;
  1394. d.prototype.__class__ = "egret.StageDelegate";
  1395. var e = function () {
  1396. function c(a,
  1397. k) {
  1398. this._containerStrategy = a;
  1399. this._contentStrategy = k
  1400. }
  1401. c.prototype.init = function (c) {
  1402. this._containerStrategy.init(c);
  1403. this._contentStrategy.init(c)
  1404. };
  1405. c.prototype._apply = function (c, a, k) {
  1406. this._containerStrategy._apply(c, a, k);
  1407. this._contentStrategy._apply(c, a, k)
  1408. };
  1409. return c
  1410. }
  1411. ();
  1412. b.ResolutionPolicy = e;
  1413. e.prototype.__class__ = "egret.ResolutionPolicy";
  1414. var a = function () {
  1415. function a() {}
  1416. a.initialize = function () {
  1417. a.EQUAL_TO_FRAME = new c
  1418. };
  1419. a.prototype.init = function (c) {};
  1420. a.prototype._apply = function (c, a, k) {};
  1421. a.prototype._setupContainer =
  1422. function () {
  1423. var c = document.body,
  1424. a;
  1425. 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")
  1426. };
  1427. return a
  1428. }
  1429. ();
  1430. b.ContainerStrategy = a;
  1431. a.prototype.__class__ = "egret.ContainerStrategy";
  1432. var c = function (c) {
  1433. function a() {
  1434. c.apply(this, arguments)
  1435. }
  1436. __extends(a, c);
  1437. a.prototype._apply = function (c) {
  1438. this._setupContainer()
  1439. };
  1440. return a
  1441. }
  1442. (a);
  1443. b.EqualToFrame = c;
  1444. c.prototype.__class__ = "egret.EqualToFrame";
  1445. e = function () {
  1446. function c() {}
  1447. c.prototype.init = function (c) {};
  1448. c.prototype._apply = function (c, a, k) {};
  1449. c.prototype.setEgretSize = function (c, a, k, l, e, p) {
  1450. void 0 === p && (p = 0);
  1451. b.StageDelegate.getInstance()._stageWidth = Math.round(c);
  1452. b.StageDelegate.getInstance()._stageHeight =
  1453. Math.round(a);
  1454. c = document.getElementById(d.canvas_div_name);
  1455. c.style.width = k + "px";
  1456. c.style.height = l + "px";
  1457. c.style.top = p + "px"
  1458. };
  1459. c.prototype._getClientWidth = function () {
  1460. return document.documentElement.clientWidth
  1461. };
  1462. c.prototype._getClientHeight = function () {
  1463. return document.documentElement.clientHeight
  1464. };
  1465. return c
  1466. }
  1467. ();
  1468. b.ContentStrategy = e;
  1469. e.prototype.__class__ = "egret.ContentStrategy";
  1470. var k = function (c) {
  1471. function a(k) {
  1472. void 0 === k && (k = 0);
  1473. c.call(this);
  1474. this.minWidth = k
  1475. }
  1476. __extends(a, c);
  1477. a.prototype._apply = function (c, a, k) {
  1478. a =
  1479. this._getClientWidth();
  1480. var b = this._getClientHeight(),
  1481. l = b / k,
  1482. e = a / l,
  1483. d = 1;
  1484. 0 != this.minWidth && (d = Math.min(1, e / this.minWidth));
  1485. this.setEgretSize(e / d, k, a, b * d);
  1486. c._scaleX = l * d;
  1487. c._scaleY = l * d
  1488. };
  1489. return a
  1490. }
  1491. (e);
  1492. b.FixedHeight = k;
  1493. k.prototype.__class__ = "egret.FixedHeight";
  1494. k = function (c) {
  1495. function a(k) {
  1496. void 0 === k && (k = 0);
  1497. c.call(this);
  1498. this.minHeight = k
  1499. }
  1500. __extends(a, c);
  1501. a.prototype._apply = function (c, a, k) {
  1502. k = this._getClientWidth();
  1503. var b = this._getClientHeight(),
  1504. l = k / a,
  1505. e = b / l,
  1506. d = 1;
  1507. 0 != this.minHeight && (d = Math.min(1, e / this.minHeight));
  1508. this.setEgretSize(a,
  1509. e / d, k * d, b, k * (1 - d) / 2);
  1510. c._scaleX = l * d;
  1511. c._scaleY = l * d
  1512. };
  1513. return a
  1514. }
  1515. (e);
  1516. b.FixedWidth = k;
  1517. k.prototype.__class__ = "egret.FixedWidth";
  1518. k = function (c) {
  1519. function a(k, b) {
  1520. c.call(this);
  1521. this.width = k;
  1522. this.height = b
  1523. }
  1524. __extends(a, c);
  1525. a.prototype._apply = function (c, a, k) {
  1526. k = this.width;
  1527. var b = this.height,
  1528. l = k / a;
  1529. this.setEgretSize(a, b / l, k, b);
  1530. c._scaleX = l;
  1531. c._scaleY = l
  1532. };
  1533. return a
  1534. }
  1535. (e);
  1536. b.FixedSize = k;
  1537. k.prototype.__class__ = "egret.FixedSize";
  1538. k = function (c) {
  1539. function a() {
  1540. c.call(this)
  1541. }
  1542. __extends(a, c);
  1543. a.prototype._apply = function (c, a, k) {
  1544. this.setEgretSize(a,
  1545. k, a, k, Math.floor((a - a) / 2));
  1546. c._scaleX = 1;
  1547. c._scaleY = 1
  1548. };
  1549. return a
  1550. }
  1551. (e);
  1552. b.NoScale = k;
  1553. k.prototype.__class__ = "egret.NoScale";
  1554. k = function (c) {
  1555. function a() {
  1556. c.call(this)
  1557. }
  1558. __extends(a, c);
  1559. a.prototype._apply = function (c, a, k) {
  1560. var b = this._getClientWidth(),
  1561. l = this._getClientHeight(),
  1562. e = b,
  1563. d = l,
  1564. m = e / a < d / k ? e / a : d / k,
  1565. e = a * m,
  1566. d = k * m,
  1567. b = Math.floor((b - e) / 2);
  1568. c._offSetY = Math.floor((l - d) / 2);
  1569. this.setEgretSize(a, k / 1, 1 * e, d, b, c._offSetY);
  1570. c._scaleX = 1 * m;
  1571. c._scaleY = 1 * m
  1572. };
  1573. return a
  1574. }
  1575. (e);
  1576. b.ShowAll = k;
  1577. k.prototype.__class__ = "egret.ShowAll";
  1578. e = function (c) {
  1579. function a() {
  1580. c.call(this)
  1581. }
  1582. __extends(a, c);
  1583. a.prototype._apply = function (c, a, k) {
  1584. var b = this._getClientWidth(),
  1585. l = this._getClientHeight(),
  1586. b = b / a,
  1587. l = l / k;
  1588. this.setEgretSize(a, k, a * b, k * l);
  1589. c._scaleX = b;
  1590. c._scaleY = l
  1591. };
  1592. return a
  1593. }
  1594. (e);
  1595. b.FullScreen = e;
  1596. e.prototype.__class__ = "egret.FullScreen"
  1597. })(egret || (egret = {}));
  1598. __extends = this.__extends || function (b, d) {
  1599. function e() {
  1600. this.constructor = b
  1601. }
  1602. for (var a in d)
  1603. d.hasOwnProperty(a) && (b[a] = d[a]);
  1604. e.prototype = d.prototype;
  1605. b.prototype = new e
  1606. };
  1607. (function (b) {
  1608. var d = function (e) {
  1609. function a() {
  1610. e.call(this);
  1611. this._originalData = {};
  1612. this._drawAreaList = []
  1613. }
  1614. __extends(a, e);
  1615. a.getInstance = function () {
  1616. null == a.instance && (a.instance = new a);
  1617. return a.instance
  1618. };
  1619. a.prototype.addDrawArea = function (c) {
  1620. this._drawAreaList.push(c)
  1621. };
  1622. a.prototype.clearDrawArea = function () {
  1623. this._drawAreaList = []
  1624. };
  1625. a.prototype.drawImage = function (c, a, l, e, d, f, h, n, p, q, r) {
  1626. void 0 === r && (r = void 0);
  1627. h = h || 0;
  1628. n = n || 0;
  1629. var s = a._texture_to_render;
  1630. if (null != s && 0 != f && 0 != d && 0 != p && 0 != q)
  1631. if (0 != this._drawAreaList.length &&
  1632. b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1633. var t = b.DisplayObject.getTransformBounds(a._getSize(b.Rectangle.identity), a._worldTransform);
  1634. a._worldBounds.initialize(t.x, t.y, t.width, t.height);
  1635. t = this._originalData;
  1636. t.sourceX = l;
  1637. t.sourceY = e;
  1638. t.sourceWidth = d;
  1639. t.sourceHeight = f;
  1640. t.destX = h;
  1641. t.destY = n;
  1642. t.destWidth = p;
  1643. t.destHeight = q;
  1644. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1645. if (!this.ignoreRender(a, u[v], t.destX, t.destY)) {
  1646. c.drawImage(s, l, e, d, f, h, n, p, q, r);
  1647. break
  1648. }
  1649. } else
  1650. c.drawImage(s, l, e, d, f, h, n,
  1651. p, q, r)
  1652. };
  1653. a.prototype.ignoreRender = function (c, a, b, e) {
  1654. var d = c._worldBounds;
  1655. b *= c._worldTransform.a;
  1656. e *= c._worldTransform.d;
  1657. return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + e <= a.y || d.y + e >= a.y + a.height ? !0 : !1
  1658. };
  1659. a.prototype.getDrawAreaList = function () {
  1660. var c;
  1661. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  1662. this.onResize, this)), c = this._defaultDrawAreaList) : c = this._drawAreaList;
  1663. return c
  1664. };
  1665. a.prototype.onResize = function () {
  1666. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1667. this._defaultDrawAreaList = null
  1668. };
  1669. return a
  1670. }
  1671. (b.HashObject);
  1672. b.RenderFilter = d;
  1673. d.prototype.__class__ = "egret.RenderFilter"
  1674. })(egret || (egret = {}));
  1675. (function (b) {
  1676. var d = function () {
  1677. function e() {}
  1678. e.mapClass = function (a, c, k) {
  1679. void 0 === k && (k = "");
  1680. a = this.getKey(a) + "#" + k;
  1681. this.mapClassDic[a] = c
  1682. };
  1683. e.getKey = function (a) {
  1684. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1685. };
  1686. e.mapValue = function (a, c, k) {
  1687. void 0 === k && (k = "");
  1688. a = this.getKey(a) + "#" + k;
  1689. this.mapValueDic[a] = c
  1690. };
  1691. e.hasMapRule = function (a, c) {
  1692. void 0 === c && (c = "");
  1693. var k = this.getKey(a) + "#" + c;
  1694. return this.mapValueDic[k] || this.mapClassDic[k] ? !0 : !1
  1695. };
  1696. e.getInstance = function (a, c) {
  1697. void 0 === c && (c = "");
  1698. var k = this.getKey(a) + "#" +
  1699. c;
  1700. if (this.mapValueDic[k])
  1701. return this.mapValueDic[k];
  1702. var b = this.mapClassDic[k];
  1703. if (b)
  1704. return b = new b, this.mapValueDic[k] = b, delete this.mapClassDic[k], b;
  1705. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + k + "\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");
  1706. };
  1707. e.mapClassDic = {};
  1708. e.mapValueDic = {};
  1709. return e
  1710. }
  1711. ();
  1712. b.Injector = d;
  1713. d.prototype.__class__ = "egret.Injector"
  1714. })(egret ||
  1715. (egret = {}));
  1716. (function (b) {
  1717. var d = function () {
  1718. function b() {}
  1719. b.NORMAL = "normal";
  1720. b.ADD = "add";
  1721. return b
  1722. }
  1723. ();
  1724. b.BlendMode = d;
  1725. d.prototype.__class__ = "egret.BlendMode"
  1726. })(egret || (egret = {}));
  1727. __extends = this.__extends || function (b, d) {
  1728. function e() {
  1729. this.constructor = b
  1730. }
  1731. for (var a in d)
  1732. d.hasOwnProperty(a) && (b[a] = d[a]);
  1733. e.prototype = d.prototype;
  1734. b.prototype = new e
  1735. };
  1736. (function (b) {
  1737. var d = function (e) {
  1738. function a() {
  1739. e.call(this);
  1740. this.__hack_local_matrix = null;
  1741. this._sizeDirty = this._normalDirty = !0;
  1742. this._parent = this._texture_to_render = null;
  1743. this._y = this._x = 0;
  1744. this._scaleY = this._scaleX = 1;
  1745. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1746. this._visible = !0;
  1747. this._rotation = 0;
  1748. this._alpha = 1;
  1749. this._skewY = this._skewX = 0;
  1750. this._touchEnabled = !1;
  1751. this._scrollRect = this.blendMode = null;
  1752. this._hasHeightSet = this._hasWidthSet = !1;
  1753. this._worldBounds = this.mask = null;
  1754. this.worldAlpha =
  1755. 1;
  1756. this._rectH = this._rectW = 0;
  1757. this._stage = null;
  1758. this._cacheDirty = this._cacheAsBitmap = !1;
  1759. this._colorTransform = null;
  1760. this._worldTransform = new b.Matrix;
  1761. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1762. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1763. }
  1764. __extends(a, e);
  1765. a.prototype._setDirty = function () {
  1766. this._normalDirty = !0
  1767. };
  1768. a.prototype.getDirty = function () {
  1769. return this._normalDirty || this._sizeDirty
  1770. };
  1771. a.prototype._setParentSizeDirty = function () {
  1772. var c = this._parent;
  1773. !c || c._hasWidthSet || c._hasHeightSet || c._setSizeDirty()
  1774. };
  1775. a.prototype._setSizeDirty =
  1776. function () {
  1777. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1778. };
  1779. a.prototype._clearDirty = function () {
  1780. this._normalDirty = !1
  1781. };
  1782. a.prototype._clearSizeDirty = function () {
  1783. this._sizeDirty = !1
  1784. };
  1785. Object.defineProperty(a.prototype, "parent", {
  1786. get : function () {
  1787. return this._parent
  1788. },
  1789. enumerable : !0,
  1790. configurable : !0
  1791. });
  1792. a.prototype._parentChanged = function (c) {
  1793. this._parent = c
  1794. };
  1795. Object.defineProperty(a.prototype, "x", {
  1796. get : function () {
  1797. return this._x
  1798. },
  1799. set : function (c) {
  1800. this._setX(c)
  1801. },
  1802. enumerable : !0,
  1803. configurable : !0
  1804. });
  1805. a.prototype._setX = function (c) {
  1806. b.NumberUtils.isNumber(c) && this._x != c && (this._x = c, this._setDirty(), this._setParentSizeDirty())
  1807. };
  1808. Object.defineProperty(a.prototype, "y", {
  1809. get : function () {
  1810. return this._y
  1811. },
  1812. set : function (c) {
  1813. this._setY(c)
  1814. },
  1815. enumerable : !0,
  1816. configurable : !0
  1817. });
  1818. a.prototype._setY = function (c) {
  1819. b.NumberUtils.isNumber(c) && this._y != c && (this._y = c, this._setDirty(), this._setParentSizeDirty())
  1820. };
  1821. Object.defineProperty(a.prototype, "scaleX", {
  1822. get : function () {
  1823. return this._scaleX
  1824. },
  1825. set : function (c) {
  1826. b.NumberUtils.isNumber(c) &&
  1827. this._scaleX != c && (this._scaleX = c, this._setDirty(), this._setParentSizeDirty())
  1828. },
  1829. enumerable : !0,
  1830. configurable : !0
  1831. });
  1832. Object.defineProperty(a.prototype, "scaleY", {
  1833. get : function () {
  1834. return this._scaleY
  1835. },
  1836. set : function (c) {
  1837. b.NumberUtils.isNumber(c) && this._scaleY != c && (this._scaleY = c, this._setDirty(), this._setParentSizeDirty())
  1838. },
  1839. enumerable : !0,
  1840. configurable : !0
  1841. });
  1842. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1843. get : function () {
  1844. return this._anchorOffsetX
  1845. },
  1846. set : function (c) {
  1847. b.NumberUtils.isNumber(c) && this._anchorOffsetX !=
  1848. c && (this._anchorOffsetX = c, this._setDirty(), this._setParentSizeDirty())
  1849. },
  1850. enumerable : !0,
  1851. configurable : !0
  1852. });
  1853. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1854. get : function () {
  1855. return this._anchorOffsetY
  1856. },
  1857. set : function (c) {
  1858. b.NumberUtils.isNumber(c) && this._anchorOffsetY != c && (this._anchorOffsetY = c, this._setDirty(), this._setParentSizeDirty())
  1859. },
  1860. enumerable : !0,
  1861. configurable : !0
  1862. });
  1863. Object.defineProperty(a.prototype, "anchorX", {
  1864. get : function () {
  1865. return this._anchorX
  1866. },
  1867. set : function (c) {
  1868. this._setAnchorX(c)
  1869. },
  1870. enumerable : !0,
  1871. configurable : !0
  1872. });
  1873. a.prototype._setAnchorX = function (c) {
  1874. b.NumberUtils.isNumber(c) && this._anchorX != c && (this._anchorX = c, this._setDirty(), this._setParentSizeDirty())
  1875. };
  1876. Object.defineProperty(a.prototype, "anchorY", {
  1877. get : function () {
  1878. return this._anchorY
  1879. },
  1880. set : function (c) {
  1881. this._setAnchorY(c)
  1882. },
  1883. enumerable : !0,
  1884. configurable : !0
  1885. });
  1886. a.prototype._setAnchorY = function (c) {
  1887. b.NumberUtils.isNumber(c) && this._anchorY != c && (this._anchorY = c, this._setDirty(), this._setParentSizeDirty())
  1888. };
  1889. Object.defineProperty(a.prototype, "visible", {
  1890. get : function () {
  1891. return this._visible
  1892. },
  1893. set : function (c) {
  1894. this._setVisible(c)
  1895. },
  1896. enumerable : !0,
  1897. configurable : !0
  1898. });
  1899. a.prototype._setVisible = function (c) {
  1900. this._visible != c && (this._visible = c, this._setSizeDirty())
  1901. };
  1902. Object.defineProperty(a.prototype, "rotation", {
  1903. get : function () {
  1904. return this._rotation
  1905. },
  1906. set : function (c) {
  1907. b.NumberUtils.isNumber(c) && this._rotation != c && (this._rotation = c, this._setSizeDirty())
  1908. },
  1909. enumerable : !0,
  1910. configurable : !0
  1911. });
  1912. Object.defineProperty(a.prototype, "alpha", {
  1913. get : function () {
  1914. return this._alpha
  1915. },
  1916. set : function (c) {
  1917. b.NumberUtils.isNumber(c) &&
  1918. this._alpha != c && (this._alpha = c, this._setDirty(), this._setCacheDirty())
  1919. },
  1920. enumerable : !0,
  1921. configurable : !0
  1922. });
  1923. Object.defineProperty(a.prototype, "skewX", {
  1924. get : function () {
  1925. return this._skewX
  1926. },
  1927. set : function (c) {
  1928. b.NumberUtils.isNumber(c) && this._skewX != c && (this._skewX = c, this._setSizeDirty())
  1929. },
  1930. enumerable : !0,
  1931. configurable : !0
  1932. });
  1933. Object.defineProperty(a.prototype, "skewY", {
  1934. get : function () {
  1935. return this._skewY
  1936. },
  1937. set : function (c) {
  1938. b.NumberUtils.isNumber(c) && this._skewY != c && (this._skewY = c, this._setSizeDirty())
  1939. },
  1940. enumerable : !0,
  1941. configurable : !0
  1942. });
  1943. Object.defineProperty(a.prototype, "touchEnabled", {
  1944. get : function () {
  1945. return this._touchEnabled
  1946. },
  1947. set : function (c) {
  1948. this._setTouchEnabled(c)
  1949. },
  1950. enumerable : !0,
  1951. configurable : !0
  1952. });
  1953. a.prototype._setTouchEnabled = function (c) {
  1954. this._touchEnabled = c
  1955. };
  1956. Object.defineProperty(a.prototype, "scrollRect", {
  1957. get : function () {
  1958. return this._scrollRect
  1959. },
  1960. set : function (c) {
  1961. this._setScrollRect(c)
  1962. },
  1963. enumerable : !0,
  1964. configurable : !0
  1965. });
  1966. a.prototype._setScrollRect = function (c) {
  1967. this._scrollRect = c;
  1968. this._setSizeDirty()
  1969. };
  1970. Object.defineProperty(a.prototype,
  1971. "measuredWidth", {
  1972. get : function () {
  1973. return this._measureBounds().width
  1974. },
  1975. enumerable : !0,
  1976. configurable : !0
  1977. });
  1978. Object.defineProperty(a.prototype, "measuredHeight", {
  1979. get : function () {
  1980. return this._measureBounds().height
  1981. },
  1982. enumerable : !0,
  1983. configurable : !0
  1984. });
  1985. Object.defineProperty(a.prototype, "explicitWidth", {
  1986. get : function () {
  1987. return this._explicitWidth
  1988. },
  1989. enumerable : !0,
  1990. configurable : !0
  1991. });
  1992. Object.defineProperty(a.prototype, "explicitHeight", {
  1993. get : function () {
  1994. return this._explicitHeight
  1995. },
  1996. enumerable : !0,
  1997. configurable : !0
  1998. });
  1999. Object.defineProperty(a.prototype,
  2000. "width", {
  2001. get : function () {
  2002. return this._getSize(b.Rectangle.identity).width
  2003. },
  2004. set : function (c) {
  2005. this._setWidth(c)
  2006. },
  2007. enumerable : !0,
  2008. configurable : !0
  2009. });
  2010. Object.defineProperty(a.prototype, "height", {
  2011. get : function () {
  2012. return this._getSize(b.Rectangle.identity).height
  2013. },
  2014. set : function (c) {
  2015. this._setHeight(c)
  2016. },
  2017. enumerable : !0,
  2018. configurable : !0
  2019. });
  2020. a.prototype._setWidth = function (c) {
  2021. this._setSizeDirty();
  2022. this._setCacheDirty();
  2023. this._explicitWidth = c;
  2024. this._hasWidthSet = b.NumberUtils.isNumber(c)
  2025. };
  2026. a.prototype._setHeight = function (c) {
  2027. this._setSizeDirty();
  2028. this._setCacheDirty();
  2029. this._explicitHeight = c;
  2030. this._hasHeightSet = b.NumberUtils.isNumber(c)
  2031. };
  2032. a.prototype._draw = function (c) {
  2033. if (this._visible && !this.drawCacheTexture(c)) {
  2034. this._colorTransform && c.setGlobalColorTransform(this._colorTransform.matrix);
  2035. c.setAlpha(this.worldAlpha, this.blendMode);
  2036. c.setTransform(this._worldTransform);
  2037. var a = this.mask || this._scrollRect;
  2038. a && c.pushMask(a);
  2039. this._render(c);
  2040. a && c.popMask();
  2041. this._colorTransform && c.setGlobalColorTransform(null)
  2042. }
  2043. this.destroyCacheBounds()
  2044. };
  2045. a.prototype.drawCacheTexture =
  2046. function (c) {
  2047. if (!1 == this._cacheAsBitmap)
  2048. return !1;
  2049. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight))
  2050. this._cacheDirty = !this._makeBitmapCache();
  2051. if (null == this._texture_to_render)
  2052. return !1;
  2053. var a = this._texture_to_render,
  2054. l = a._offsetX,
  2055. e = a._offsetY,
  2056. d = a._textureWidth,
  2057. a = a._textureHeight;
  2058. this._updateTransform();
  2059. c.setAlpha(this.worldAlpha, this.blendMode);
  2060. c.setTransform(this._worldTransform);
  2061. var f = b.MainContext.instance.rendererContext.texture_scale_factor;
  2062. b.RenderFilter.getInstance().drawImage(c, this, 0, 0, d * f, a * f, l, e, d, a);
  2063. return !0
  2064. };
  2065. a.prototype._updateTransform = function () {
  2066. this._calculateWorldTransform()
  2067. };
  2068. a.prototype._calculateWorldTransform = function () {
  2069. var c = this._worldTransform,
  2070. a = this._parent;
  2071. c.identityMatrix(a._worldTransform);
  2072. this._getMatrix(c);
  2073. var b = this._scrollRect;
  2074. b && c.append(1, 0, 0, 1, -b.x, -b.y);
  2075. this.worldAlpha = a.worldAlpha * this._alpha
  2076. };
  2077. a.prototype._render = function (c) {};
  2078. a.prototype.getBounds =
  2079. function (c, a) {
  2080. void 0 === a && (a = !0);
  2081. var l = this._measureBounds(),
  2082. e = this._hasWidthSet ? this._explicitWidth : l.width,
  2083. d = this._hasHeightSet ? this._explicitHeight : l.height;
  2084. this._rectW = l.width;
  2085. this._rectH = l.height;
  2086. this._clearSizeDirty();
  2087. var f = l.x,
  2088. l = l.y,
  2089. h = 0,
  2090. n = 0;
  2091. a && (0 != this._anchorX || 0 != this._anchorY ? (h = e * this._anchorX, n = d * this._anchorY) : (h = this._anchorOffsetX, n = this._anchorOffsetY));
  2092. this._cacheBounds.initialize(f - h, l - n, e, d);
  2093. e = this._cacheBounds;
  2094. c || (c = new b.Rectangle);
  2095. return c.initialize(e.x, e.y, e.width, e.height)
  2096. };
  2097. a.prototype.destroyCacheBounds = function () {
  2098. this._cacheBounds.x = 0;
  2099. this._cacheBounds.y = 0;
  2100. this._cacheBounds.width = 0;
  2101. this._cacheBounds.height = 0
  2102. };
  2103. a.prototype._getConcatenatedMatrix = function () {
  2104. for (var c = a.identityMatrixForGetConcatenated.identity(), k = this; null != k; ) {
  2105. if (0 != k._anchorX || 0 != k._anchorY) {
  2106. var l = k._getSize(b.Rectangle.identity);
  2107. c.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, l.width * k._anchorX, l.height * k._anchorY)
  2108. } else
  2109. c.prependTransform(k._x, k._y, k._scaleX, k._scaleY,
  2110. k._rotation, k._skewX, k._skewY, k._anchorOffsetX, k._anchorOffsetY);
  2111. k = k._parent
  2112. }
  2113. return c
  2114. };
  2115. a.prototype.localToGlobal = function (c, a, l) {
  2116. void 0 === c && (c = 0);
  2117. void 0 === a && (a = 0);
  2118. var e = this._getConcatenatedMatrix();
  2119. e.append(1, 0, 0, 1, c, a);
  2120. l || (l = new b.Point);
  2121. l.x = e.tx;
  2122. l.y = e.ty;
  2123. return l
  2124. };
  2125. a.prototype.globalToLocal = function (c, a, l) {
  2126. void 0 === c && (c = 0);
  2127. void 0 === a && (a = 0);
  2128. var e = this._getConcatenatedMatrix();
  2129. e.invert();
  2130. e.append(1, 0, 0, 1, c, a);
  2131. l || (l = new b.Point);
  2132. l.x = e.tx;
  2133. l.y = e.ty;
  2134. return l
  2135. };
  2136. a.prototype.hitTest = function (c, a, e) {
  2137. void 0 ===
  2138. e && (e = !1);
  2139. if (!this._visible || !e && !this._touchEnabled)
  2140. return null;
  2141. e = this._getSize(b.Rectangle.identity);
  2142. return 0 <= c && c < e.width && 0 <= a && a < e.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
  2143. };
  2144. a.prototype.hitTestPoint = function (c, a, e) {
  2145. c = this.globalToLocal(c,
  2146. a);
  2147. return e ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), e = this._hitTestPointTexture, e.drawToTexture(this), 0 != e.getPixel32(c.x - this._hitTestPointTexture._offsetX, c.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(c.x, c.y, !0)
  2148. };
  2149. a.prototype._getMatrix = function (c) {
  2150. c || (c = b.Matrix.identity.identity());
  2151. var a,
  2152. e;
  2153. e = this._getOffsetPoint();
  2154. a = e.x;
  2155. e = e.y;
  2156. var d = this.__hack_local_matrix;
  2157. d ? (c.append(d.a, d.b, d.c, d.d, d.tx, d.ty), c.append(1, 0, 0, 1, -a, -e)) : c.appendTransform(this._x,
  2158. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, e);
  2159. return c
  2160. };
  2161. a.prototype._getSize = function (c) {
  2162. return this._hasHeightSet && this._hasWidthSet ? c.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(c)
  2163. };
  2164. a.prototype._measureSize = function (c) {
  2165. this._sizeDirty ? (c = this._measureBounds(), this._rectW = c.width, this._rectH = c.height, this._clearSizeDirty()) : (c.width = this._rectW, c.height = this._rectH);
  2166. c.x = 0;
  2167. c.y = 0;
  2168. return c
  2169. };
  2170. a.prototype._measureBounds = function () {
  2171. return b.Rectangle.identity.initialize(0,
  2172. 0, 0, 0)
  2173. };
  2174. a.prototype._getOffsetPoint = function () {
  2175. var c = this._anchorOffsetX,
  2176. a = this._anchorOffsetY;
  2177. if (0 != this._anchorX || 0 != this._anchorY)
  2178. a = this._getSize(b.Rectangle.identity), c = this._anchorX * a.width, a = this._anchorY * a.height;
  2179. var e = b.Point.identity;
  2180. e.x = c;
  2181. e.y = a;
  2182. return e
  2183. };
  2184. a.prototype._onAddToStage = function () {
  2185. this._stage = b.MainContext.instance.stage;
  2186. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2187. };
  2188. a.prototype._onRemoveFromStage = function () {
  2189. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2190. };
  2191. Object.defineProperty(a.prototype, "stage", {
  2192. get : function () {
  2193. return this._stage
  2194. },
  2195. enumerable : !0,
  2196. configurable : !0
  2197. });
  2198. a.prototype.addEventListener = function (c, k, l, d, g) {
  2199. void 0 === d && (d = !1);
  2200. void 0 === g && (g = 0);
  2201. e.prototype.addEventListener.call(this, c, k, l, d, g);
  2202. ((d = c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._insertEventBin(d ? a._enterFrameCallBackList : a._renderCallBackList, k, l, g, this)
  2203. };
  2204. a.prototype.removeEventListener = function (c, k, l, d) {
  2205. void 0 === d && (d = !1);
  2206. e.prototype.removeEventListener.call(this, c, k, l, d);
  2207. ((d =
  2208. c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._removeEventBin(d ? a._enterFrameCallBackList : a._renderCallBackList, k, l, this)
  2209. };
  2210. a.prototype.dispatchEvent = function (c) {
  2211. if (!c._bubbles)
  2212. return e.prototype.dispatchEvent.call(this, c);
  2213. for (var a = [], b = this; b; )
  2214. a.push(b), b = b._parent;
  2215. c._reset();
  2216. this._dispatchPropagationEvent(c, a);
  2217. return !c._isDefaultPrevented
  2218. };
  2219. a.prototype._dispatchPropagationEvent = function (c, a, b) {
  2220. b = a.length;
  2221. for (var e = 1, d = b - 1; 0 <= d; d--) {
  2222. var f = a[d];
  2223. c._currentTarget = f;
  2224. c._target = this;
  2225. c._eventPhase = e;
  2226. f._notifyListener(c);
  2227. if (c._isPropagationStopped || c._isPropagationImmediateStopped)
  2228. return
  2229. }
  2230. f = a[0];
  2231. c._currentTarget = f;
  2232. c._target = this;
  2233. c._eventPhase = 2;
  2234. f._notifyListener(c);
  2235. if (!c._isPropagationStopped && !c._isPropagationImmediateStopped)
  2236. for (e = 3, d = 1; d < b && (f = a[d], c._currentTarget = f, c._target = this, c._eventPhase = e, f._notifyListener(c), !c._isPropagationStopped && !c._isPropagationImmediateStopped); d++);
  2237. };
  2238. a.prototype.willTrigger = function (c) {
  2239. for (var a = this; a; ) {
  2240. if (a.hasEventListener(c))
  2241. return !0;
  2242. a = a._parent
  2243. }
  2244. return !1
  2245. };
  2246. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2247. get : function () {
  2248. return this._cacheAsBitmap
  2249. },
  2250. set : function (c) {
  2251. (this._cacheAsBitmap = c) ? b.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2252. },
  2253. enumerable : !0,
  2254. configurable : !0
  2255. });
  2256. a.prototype._makeBitmapCache = function () {
  2257. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2258. var c = this.renderTexture.drawToTexture(this);
  2259. this._texture_to_render = c ? this.renderTexture : null;
  2260. return c
  2261. };
  2262. a.prototype._setCacheDirty = function (c) {
  2263. void 0 === c && (c = !0);
  2264. this._cacheDirty =
  2265. c
  2266. };
  2267. a.getTransformBounds = function (c, a) {
  2268. var b = c.x,
  2269. e = c.y,
  2270. d = c.width,
  2271. f = c.height;
  2272. (b || e) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -e);
  2273. var h = d * a.a,
  2274. d = d * a.b,
  2275. n = f * a.c,
  2276. f = f * a.d,
  2277. p = a.tx,
  2278. q = a.ty,
  2279. r = p,
  2280. s = p,
  2281. t = q,
  2282. u = q;
  2283. (b = h + p) < r ? r = b : b > s && (s = b);
  2284. (b = h + n + p) < r ? r = b : b > s && (s = b);
  2285. (b = n + p) < r ? r = b : b > s && (s = b);
  2286. (e = d + q) < t ? t = e : e > u && (u = e);
  2287. (e = d + f + q) < t ? t = e : e > u && (u = e);
  2288. (e = f + q) < t ? t = e : e > u && (u = e);
  2289. return c.initialize(r, t, s - r, u - t)
  2290. };
  2291. Object.defineProperty(a.prototype, "colorTransform", {
  2292. get : function () {
  2293. return this._colorTransform
  2294. },
  2295. set : function (c) {
  2296. this._colorTransform =
  2297. c
  2298. },
  2299. enumerable : !0,
  2300. configurable : !0
  2301. });
  2302. a.identityMatrixForGetConcatenated = new b.Matrix;
  2303. a._enterFrameCallBackList = [];
  2304. a._renderCallBackList = [];
  2305. return a
  2306. }
  2307. (b.EventDispatcher);
  2308. b.DisplayObject = d;
  2309. d.prototype.__class__ = "egret.DisplayObject";
  2310. d = function () {
  2311. function b() {
  2312. this.matrix = null
  2313. }
  2314. b.prototype.updateColor = function (a, c, k, b, e, d, f, h) {};
  2315. return b
  2316. }
  2317. ();
  2318. b.ColorTransform = d;
  2319. d.prototype.__class__ = "egret.ColorTransform"
  2320. })(egret || (egret = {}));
  2321. __extends = this.__extends || function (b, d) {
  2322. function e() {
  2323. this.constructor = b
  2324. }
  2325. for (var a in d)
  2326. d.hasOwnProperty(a) && (b[a] = d[a]);
  2327. e.prototype = d.prototype;
  2328. b.prototype = new e
  2329. };
  2330. (function (b) {
  2331. var d = function (e) {
  2332. function a() {
  2333. e.call(this);
  2334. this._touchChildren = !0;
  2335. this._children = []
  2336. }
  2337. __extends(a, e);
  2338. Object.defineProperty(a.prototype, "touchChildren", {
  2339. get : function () {
  2340. return this._touchChildren
  2341. },
  2342. set : function (c) {
  2343. this._touchChildren = c
  2344. },
  2345. enumerable : !0,
  2346. configurable : !0
  2347. });
  2348. Object.defineProperty(a.prototype, "numChildren", {
  2349. get : function () {
  2350. return this._children.length
  2351. },
  2352. enumerable : !0,
  2353. configurable : !0
  2354. });
  2355. a.prototype.setChildIndex = function (c, a) {
  2356. this.doSetChildIndex(c, a)
  2357. };
  2358. a.prototype.doSetChildIndex = function (c,
  2359. a) {
  2360. var e = this._children.indexOf(c);
  2361. 0 > e && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2362. this._children.splice(e, 1);
  2363. 0 > a || this._children.length <= a ? this._children.push(c) : this._children.splice(a, 0, c)
  2364. };
  2365. a.prototype.addChild = function (c) {
  2366. var a = this._children.length;
  2367. c._parent == this && a--;
  2368. return this._doAddChild(c, a)
  2369. };
  2370. a.prototype.addChildAt = function (c, a) {
  2371. return this._doAddChild(c, a)
  2372. };
  2373. a.prototype._doAddChild = function (c, k, e) {
  2374. void 0 === e && (e = !0);
  2375. if (c == this)
  2376. return c;
  2377. if (0 > k || k > this._children.length)
  2378. return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2379. c;
  2380. var d = c._parent;
  2381. if (d == this)
  2382. return this.doSetChildIndex(c, k), c;
  2383. d && (k = d._children.indexOf(c), 0 <= k && d._doRemoveChild(k));
  2384. this._children.splice(k, 0, c);
  2385. c._parentChanged(this);
  2386. e && c.dispatchEventWith(b.Event.ADDED, !0);
  2387. if (this._stage)
  2388. for (c._onAddToStage(), k = a.__EVENT__ADD_TO_STAGE_LIST; 0 < k.length; )
  2389. k.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2390. c._setDirty();
  2391. this._setSizeDirty();
  2392. return c
  2393. };
  2394. a.prototype.removeChild = function (c) {
  2395. c = this._children.indexOf(c);
  2396. if (0 <= c)
  2397. return this._doRemoveChild(c);
  2398. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2399. return null
  2400. };
  2401. a.prototype.removeChildAt = function (c) {
  2402. if (0 <= c && c < this._children.length)
  2403. return this._doRemoveChild(c);
  2404. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2405. return null
  2406. };
  2407. a.prototype._doRemoveChild = function (c, k) {
  2408. void 0 === k && (k = !0);
  2409. var e = this._children,
  2410. d = e[c];
  2411. k && d.dispatchEventWith(b.Event.REMOVED, !0);
  2412. if (this._stage) {
  2413. d._onRemoveFromStage();
  2414. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length; ) {
  2415. var f = g.shift();
  2416. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2417. f._stage = null
  2418. }
  2419. }
  2420. d._parentChanged(null);
  2421. e.splice(c, 1);
  2422. this._setSizeDirty();
  2423. return d
  2424. };
  2425. a.prototype.getChildAt = function (c) {
  2426. if (0 <= c && c < this._children.length)
  2427. return this._children[c];
  2428. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2429. return null
  2430. };
  2431. a.prototype.contains = function (c) {
  2432. for (; c; ) {
  2433. if (c == this)
  2434. return !0;
  2435. c = c._parent
  2436. }
  2437. return !1
  2438. };
  2439. a.prototype.swapChildrenAt = function (c, a) {
  2440. 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")
  2441. };
  2442. a.prototype.swapChildren = function (c, a) {
  2443. var e = this._children.indexOf(c),
  2444. d = this._children.indexOf(a);
  2445. -1 == e || -1 == d ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(e, d)
  2446. };
  2447. a.prototype._swapChildrenAt = function (c, a) {
  2448. if (c != a) {
  2449. var b = this._children,
  2450. e = b[c];
  2451. b[c] = b[a];
  2452. b[a] = e
  2453. }
  2454. };
  2455. a.prototype.getChildIndex = function (c) {
  2456. return this._children.indexOf(c)
  2457. };
  2458. a.prototype.removeChildren = function () {
  2459. for (var c = this._children.length - 1; 0 <= c; c--)
  2460. this._doRemoveChild(c)
  2461. };
  2462. a.prototype._updateTransform =
  2463. function () {
  2464. if (this._visible) {
  2465. e.prototype._updateTransform.call(this);
  2466. for (var c = 0, a = this._children.length; c < a; c++)
  2467. this._children[c]._updateTransform()
  2468. }
  2469. };
  2470. a.prototype._render = function (c) {
  2471. for (var a = 0, b = this._children.length; a < b; a++)
  2472. this._children[a]._draw(c)
  2473. };
  2474. a.prototype._measureBounds = function () {
  2475. for (var c = 0, a = 0, e = 0, d = 0, g = this._children.length, f = 0; f < g; f++) {
  2476. var h = this._children[f];
  2477. if (h._visible) {
  2478. var n = h.getBounds(b.Rectangle.identity, !1),
  2479. p = n.x,
  2480. q = n.y,
  2481. r = n.width,
  2482. n = n.height,
  2483. h = h._getMatrix(),
  2484. h = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p,
  2485. q, r, n), h),
  2486. p = h.x,
  2487. q = h.y,
  2488. r = h.width + h.x,
  2489. h = h.height + h.y;
  2490. if (p < c || 0 == f)
  2491. c = p;
  2492. if (r > a || 0 == f)
  2493. a = r;
  2494. if (q < e || 0 == f)
  2495. e = q;
  2496. if (h > d || 0 == f)
  2497. d = h
  2498. }
  2499. }
  2500. return b.Rectangle.identity.initialize(c, e, a - c, d - e)
  2501. };
  2502. a.prototype.hitTest = function (c, a, l) {
  2503. void 0 === l && (l = !1);
  2504. var d;
  2505. if (!this._visible)
  2506. return null;
  2507. if (this._scrollRect) {
  2508. if (c < this._scrollRect.x || a < this._scrollRect.y || c > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height)
  2509. return null
  2510. } else if (this.mask && (this.mask.x > c || c > this.mask.x + this.mask.width || this.mask.y >
  2511. a || a > this.mask.y + this.mask.height))
  2512. return null;
  2513. for (var g = this._children, f = this._touchChildren, h = g.length - 1; 0 <= h; h--) {
  2514. var n = g[h],
  2515. p = n._getMatrix(),
  2516. q = n._scrollRect;
  2517. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2518. p.invert();
  2519. p = b.Matrix.transformCoords(p, c, a);
  2520. if (n = n.hitTest(p.x, p.y, !0)) {
  2521. if (!f)
  2522. return this;
  2523. if (n._touchEnabled && f)
  2524. return n;
  2525. d = this
  2526. }
  2527. }
  2528. return d ? d : this._texture_to_render || this.graphics ? e.prototype.hitTest.call(this, c, a, l) : null
  2529. };
  2530. a.prototype._onAddToStage = function () {
  2531. e.prototype._onAddToStage.call(this);
  2532. for (var c = this._children.length,
  2533. a = 0; a < c; a++)
  2534. this._children[a]._onAddToStage()
  2535. };
  2536. a.prototype._onRemoveFromStage = function () {
  2537. e.prototype._onRemoveFromStage.call(this);
  2538. for (var c = this._children.length, a = 0; a < c; a++)
  2539. this._children[a]._onRemoveFromStage()
  2540. };
  2541. a.prototype.getChildByName = function (c) {
  2542. for (var a = this._children, b = a.length, e, d = 0; d < b; d++)
  2543. if (e = a[d], e.name == c)
  2544. return e;
  2545. return null
  2546. };
  2547. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2548. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2549. return a
  2550. }
  2551. (b.DisplayObject);
  2552. b.DisplayObjectContainer = d;
  2553. d.prototype.__class__ = "egret.DisplayObjectContainer"
  2554. })(egret ||
  2555. (egret = {}));
  2556. __extends = this.__extends || function (b, d) {
  2557. function e() {
  2558. this.constructor = b
  2559. }
  2560. for (var a in d)
  2561. d.hasOwnProperty(a) && (b[a] = d[a]);
  2562. e.prototype = d.prototype;
  2563. b.prototype = new e
  2564. };
  2565. (function (b) {
  2566. var d = function (e) {
  2567. function a(c, a) {
  2568. void 0 === c && (c = 480);
  2569. void 0 === a && (a = 800);
  2570. e.call(this);
  2571. this.touchEnabled = !0;
  2572. this._stage = this;
  2573. this._stageWidth = c;
  2574. this._stageHeight = a
  2575. }
  2576. __extends(a, e);
  2577. a.prototype.invalidate = function () {
  2578. a._invalidateRenderFlag = !0
  2579. };
  2580. Object.defineProperty(a.prototype, "scaleMode", {
  2581. get : function () {
  2582. return this._scaleMode
  2583. },
  2584. set : function (c) {
  2585. this._scaleMode != c && (this._scaleMode = c, this.setResolutionPolicy())
  2586. },
  2587. enumerable : !0,
  2588. configurable : !0
  2589. });
  2590. a.prototype.changeSize = function () {
  2591. this.setResolutionPolicy();
  2592. this.dispatchEventWith(b.Event.RESIZE)
  2593. };
  2594. a.prototype.setResolutionPolicy = function () {
  2595. var c = {};
  2596. c[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2597. c[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2598. c[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2599. c[b.StageScaleMode.EXACT_FIT] = new b.FullScreen;
  2600. c = c[this._scaleMode];
  2601. if (!c)
  2602. throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2603. var a = new b.EqualToFrame,
  2604. c = new b.ResolutionPolicy(a, c);
  2605. b.StageDelegate.getInstance()._setResolutionPolicy(c);
  2606. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2607. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2608. };
  2609. Object.defineProperty(a.prototype, "stageWidth", {
  2610. get : function () {
  2611. return this._stageWidth
  2612. },
  2613. enumerable : !0,
  2614. configurable : !0
  2615. });
  2616. Object.defineProperty(a.prototype, "stageHeight", {
  2617. get : function () {
  2618. return this._stageHeight
  2619. },
  2620. enumerable : !0,
  2621. configurable : !0
  2622. });
  2623. a.prototype.hitTest = function (c, a, e) {
  2624. if (!this._touchEnabled)
  2625. return null;
  2626. var d;
  2627. if (!this._touchChildren)
  2628. return this;
  2629. e = this._children;
  2630. for (var g = e.length - 1; 0 <= g; g--) {
  2631. d = e[g];
  2632. var f = d._getMatrix(),
  2633. h = d._scrollRect;
  2634. h && f.append(1, 0, 0, 1, -h.x, -h.y);
  2635. f.invert();
  2636. f = b.Matrix.transformCoords(f, c, a);
  2637. if ((d = d.hitTest(f.x, f.y, !0)) && d._touchEnabled)
  2638. return d
  2639. }
  2640. return this
  2641. };
  2642. a.prototype.getBounds = function (c) {
  2643. c || (c = new b.Rectangle);
  2644. return c.initialize(0, 0, this._stageWidth, this._stageHeight)
  2645. };
  2646. a.prototype._updateTransform = function () {
  2647. for (var c = 0, a = this._children.length; c < a; c++)
  2648. this._children[c]._updateTransform()
  2649. };
  2650. Object.defineProperty(a.prototype, "focus", {
  2651. get : function () {
  2652. return null
  2653. },
  2654. enumerable : !0,
  2655. configurable : !0
  2656. });
  2657. a._invalidateRenderFlag =
  2658. !1;
  2659. return a
  2660. }
  2661. (b.DisplayObjectContainer);
  2662. b.Stage = d;
  2663. d.prototype.__class__ = "egret.Stage"
  2664. })(egret || (egret = {}));
  2665. (function (b) {
  2666. var d = function () {
  2667. function b() {}
  2668. b.NO_BORDER = "noBorder";
  2669. b.NO_SCALE = "noScale";
  2670. b.SHOW_ALL = "showAll";
  2671. b.EXACT_FIT = "exactFit";
  2672. return b
  2673. }
  2674. ();
  2675. b.StageScaleMode = d;
  2676. d.prototype.__class__ = "egret.StageScaleMode"
  2677. })(egret || (egret = {}));
  2678. __extends = this.__extends || function (b, d) {
  2679. function e() {
  2680. this.constructor = b
  2681. }
  2682. for (var a in d)
  2683. d.hasOwnProperty(a) && (b[a] = d[a]);
  2684. e.prototype = d.prototype;
  2685. b.prototype = new e
  2686. };
  2687. (function (b) {
  2688. var d = function (e) {
  2689. function a(c) {
  2690. void 0 === c && (c = null);
  2691. e.call(this);
  2692. this._lastTouchPosition = new b.Point(0, 0);
  2693. this._lastTouchTime = 0;
  2694. this._lastTouchEvent = null;
  2695. this._velocitys = [];
  2696. this._content = null;
  2697. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2698. this._scrollTop = this._scrollLeft = 0;
  2699. this._vCanScroll = this._hCanScroll = !1;
  2700. this.touchEnabled = !0;
  2701. c && this.setContent(c)
  2702. }
  2703. __extends(a, e);
  2704. a.prototype.setContent = function (c) {
  2705. this._content && (this._removeEvents(), e.prototype.removeChildAt.call(this,
  2706. 0));
  2707. this._content = c;
  2708. e.prototype.addChild.call(this, c);
  2709. this._addEvents();
  2710. this._explicitWidth || this._getContentWidth();
  2711. this._explicitHeight || this._getContentHeight()
  2712. };
  2713. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2714. get : function () {
  2715. return this._verticalScrollPolicy
  2716. },
  2717. set : function (c) {
  2718. c != this._verticalScrollPolicy && (this._verticalScrollPolicy = c)
  2719. },
  2720. enumerable : !0,
  2721. configurable : !0
  2722. });
  2723. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2724. get : function () {
  2725. return this._horizontalScrollPolicy
  2726. },
  2727. set : function (c) {
  2728. c !=
  2729. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = c)
  2730. },
  2731. enumerable : !0,
  2732. configurable : !0
  2733. });
  2734. Object.defineProperty(a.prototype, "scrollLeft", {
  2735. get : function () {
  2736. return this._scrollLeft
  2737. },
  2738. set : function (c) {
  2739. c != this._scrollLeft && (this._scrollLeft = c, this._validatePosition(!1, !0), this._updateContentPosition())
  2740. },
  2741. enumerable : !0,
  2742. configurable : !0
  2743. });
  2744. Object.defineProperty(a.prototype, "scrollTop", {
  2745. get : function () {
  2746. return this._scrollTop
  2747. },
  2748. set : function (c) {
  2749. c != this._scrollTop && (this._scrollTop = c, this._validatePosition(!0,
  2750. !1), this._updateContentPosition())
  2751. },
  2752. enumerable : !0,
  2753. configurable : !0
  2754. });
  2755. a.prototype.setScrollPosition = function (c, a, b) {
  2756. void 0 === b && (b = !1);
  2757. if (!b || 0 != c || 0 != a)
  2758. if (b || this._scrollTop != c || this._scrollLeft != a) {
  2759. if (b) {
  2760. b = this._isOnTheEdge(!0);
  2761. var e = this._isOnTheEdge(!1);
  2762. this._scrollTop += b ? c / 2 : c;
  2763. this._scrollLeft += e ? a / 2 : a
  2764. } else
  2765. this._scrollTop = c, this._scrollLeft = a;
  2766. this._validatePosition(!0, !0);
  2767. this._updateContentPosition()
  2768. }
  2769. };
  2770. a.prototype._isOnTheEdge = function (c) {
  2771. void 0 === c && (c = !0);
  2772. var a = this._scrollTop,
  2773. b = this._scrollLeft;
  2774. return c ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2775. };
  2776. a.prototype._validatePosition = function (c, a) {
  2777. void 0 === c && (c = !1);
  2778. void 0 === a && (a = !1);
  2779. if (c) {
  2780. var b = this.height,
  2781. e = this._getContentHeight();
  2782. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2783. this._scrollTop = Math.min(this._scrollTop, e > b ? e - b / 2 : e / 2)
  2784. }
  2785. a && (b = this.width, e = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, e > b ? e - b / 2 : e / 2))
  2786. };
  2787. a.prototype._setWidth = function (c) {
  2788. this._explicitWidth !=
  2789. c && (e.prototype._setWidth.call(this, c), this._updateContentPosition())
  2790. };
  2791. a.prototype._setHeight = function (c) {
  2792. this._explicitHeight != c && (e.prototype._setHeight.call(this, c), this._updateContentPosition())
  2793. };
  2794. a.prototype._updateContentPosition = function () {
  2795. var c = this.getBounds(b.Rectangle.identity);
  2796. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, c.width, c.height);
  2797. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2798. };
  2799. a.prototype._checkScrollPolicy = function () {
  2800. var c = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2801. this._getContentWidth(), this.width);
  2802. this._hCanScroll = c;
  2803. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2804. this._vCanScroll = a;
  2805. return c || a
  2806. };
  2807. a.prototype.__checkScrollPolicy = function (c, a, b) {
  2808. return "on" == c ? !0 : "off" == c ? !1 : a > b
  2809. };
  2810. a.prototype._addEvents = function () {
  2811. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2812. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2813. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2814. this, !0)
  2815. };
  2816. a.prototype._removeEvents = function () {
  2817. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2818. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2819. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2820. };
  2821. a.prototype._onTouchBegin = function (c) {
  2822. c._isDefaultPrevented || (b.Tween.removeTweens(this), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END,
  2823. this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(c), c.preventDefault())
  2824. };
  2825. a.prototype._onTouchBeginCapture = function (c) {
  2826. var k = this._checkScrollPolicy();
  2827. if (k) {
  2828. for (var e = c.target; e != this; ) {
  2829. if (e instanceof a && (k = e._checkScrollPolicy()))
  2830. return;
  2831. e = e.parent
  2832. }
  2833. c.stopPropagation();
  2834. this.delayTouchBeginEvent = this.cloneTouchEvent(c);
  2835. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100,
  2836. 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2837. this.touchBeginTimer.start();
  2838. this._onTouchBegin(c)
  2839. }
  2840. };
  2841. a.prototype._onTouchEndCapture = function (c) {
  2842. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2843. };
  2844. a.prototype._onTouchBeginTimer = function () {
  2845. this.touchBeginTimer.stop();
  2846. var c = this.delayTouchBeginEvent;
  2847. this.delayTouchBeginEvent = null;
  2848. this.dispatchPropagationEvent(c)
  2849. };
  2850. a.prototype.dispatchPropagationEvent = function (c) {
  2851. for (var a = [], b = c._target; b; )
  2852. a.push(b),
  2853. b = b.parent;
  2854. for (var e = this._content, d = 1; ; d += 2) {
  2855. b = a[d];
  2856. if (!b || b === e)
  2857. break;
  2858. a.unshift(b)
  2859. }
  2860. this._dispatchPropagationEvent(c, a)
  2861. };
  2862. a.prototype._dispatchPropagationEvent = function (c, a, b) {
  2863. for (var e = a.length, d = 0; d < e; d++) {
  2864. var f = a[d];
  2865. c._currentTarget = f;
  2866. c._target = this;
  2867. c._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  2868. f._notifyListener(c);
  2869. if (c._isPropagationStopped || c._isPropagationImmediateStopped)
  2870. break
  2871. }
  2872. };
  2873. a.prototype._onTouchMove = function (c) {
  2874. if (this._lastTouchPosition.x != c.stageX || this._lastTouchPosition.y != c.stageY) {
  2875. this.delayTouchBeginEvent &&
  2876. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2877. this.touchChildren = !1;
  2878. var a = this._getPointChange(c);
  2879. this.setScrollPosition(a.y, a.x, !0);
  2880. this._calcVelocitys(c);
  2881. this._logTouchEvent(c)
  2882. }
  2883. };
  2884. a.prototype._onTouchEnd = function (c) {
  2885. this.touchChildren = !0;
  2886. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2887. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2888. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE,
  2889. this._onTouchEnd, this);
  2890. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2891. this._moveAfterTouchEnd()
  2892. };
  2893. a.prototype._onEnterFrame = function (c) {
  2894. c = b.getTimer();
  2895. 100 < c - this._lastTouchTime && 300 > c - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2896. };
  2897. a.prototype._logTouchEvent = function (c) {
  2898. this._lastTouchPosition.x = c.stageX;
  2899. this._lastTouchPosition.y = c.stageY;
  2900. this._lastTouchEvent = this.cloneTouchEvent(c);
  2901. this._lastTouchTime = b.getTimer()
  2902. };
  2903. a.prototype._getPointChange = function (c) {
  2904. return {
  2905. x : !1 ===
  2906. this._hCanScroll ? 0 : this._lastTouchPosition.x - c.stageX,
  2907. y : !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - c.stageY
  2908. }
  2909. };
  2910. a.prototype._calcVelocitys = function (c) {
  2911. var a = b.getTimer();
  2912. if (0 == this._lastTouchTime)
  2913. this._lastTouchTime = a;
  2914. else {
  2915. var e = this._getPointChange(c),
  2916. a = a - this._lastTouchTime;
  2917. e.x /= a;
  2918. e.y /= a;
  2919. this._velocitys.push(e);
  2920. 5 < this._velocitys.length && this._velocitys.shift();
  2921. this._lastTouchPosition.x = c.stageX;
  2922. this._lastTouchPosition.y = c.stageY
  2923. }
  2924. };
  2925. a.prototype._getContentWidth = function () {
  2926. return this._content.explicitWidth ||
  2927. this._content.width
  2928. };
  2929. a.prototype._getContentHeight = function () {
  2930. return this._content.explicitHeight || this._content.height
  2931. };
  2932. a.prototype.getMaxScrollLeft = function () {
  2933. var c = this._getContentWidth() - this.width;
  2934. return Math.max(0, c)
  2935. };
  2936. a.prototype.getMaxScrollTop = function () {
  2937. var c = this._getContentHeight() - this.height;
  2938. return Math.max(0, c)
  2939. };
  2940. a.prototype._moveAfterTouchEnd = function () {
  2941. if (0 != this._velocitys.length) {
  2942. for (var c = 0, b = 0, e = 0, d = 0; d < this._velocitys.length; d++)
  2943. var g = this._velocitys[d], f = a.weight[d], c = c + g.x * f,
  2944. b = b + g.y * f, e = e + f;
  2945. this._velocitys.length = 0;
  2946. c /= e;
  2947. b /= e;
  2948. g = Math.abs(c);
  2949. e = Math.abs(b);
  2950. f = this.getMaxScrollLeft();
  2951. d = this.getMaxScrollTop();
  2952. c = 0.02 < g ? this.getAnimationDatas(c, this._scrollLeft, f) : {
  2953. position : this._scrollLeft,
  2954. duration : 1
  2955. };
  2956. b = 0.02 < e ? this.getAnimationDatas(b, this._scrollTop, d) : {
  2957. position : this._scrollTop,
  2958. duration : 1
  2959. };
  2960. this.setScrollLeft(c.position, c.duration);
  2961. this.setScrollTop(b.position, b.duration)
  2962. }
  2963. };
  2964. a.prototype.setScrollTop = function (c, a) {
  2965. void 0 === a && (a = 0);
  2966. var e = Math.min(this.getMaxScrollTop(), Math.max(c,
  2967. 0));
  2968. if (0 == a)
  2969. return this.scrollTop = e, null;
  2970. var d = b.Tween.get(this).to({
  2971. scrollTop : c
  2972. }, a, b.Ease.quartOut);
  2973. e != c && d.to({
  2974. scrollTop : e
  2975. }, 300, b.Ease.quintOut)
  2976. };
  2977. a.prototype.setScrollLeft = function (c, a) {
  2978. void 0 === a && (a = 0);
  2979. var e = Math.min(this.getMaxScrollLeft(), Math.max(c, 0));
  2980. if (0 == a)
  2981. return this.scrollLeft = e, null;
  2982. var d = b.Tween.get(this).to({
  2983. scrollLeft : c
  2984. }, a, b.Ease.quartOut);
  2985. e != c && d.to({
  2986. scrollLeft : e
  2987. }, 300, b.Ease.quintOut)
  2988. };
  2989. a.prototype.getAnimationDatas = function (c, a, b) {
  2990. var e = Math.abs(c),
  2991. d = 0,
  2992. f = a + 500 * c;
  2993. if (0 > f || f > b)
  2994. for (f =
  2995. a; Infinity != Math.abs(c) && 0.02 < Math.abs(c); )
  2996. f += c, c = 0 > f || f > b ? 0.998 * c * 0.95 : 0.998 * c, d++;
  2997. else
  2998. d = 500 * -Math.log(0.02 / e);
  2999. return {
  3000. position : Math.min(b + 50, Math.max(f, -50)),
  3001. duration : d
  3002. }
  3003. };
  3004. a.prototype.cloneTouchEvent = function (c) {
  3005. var a = new b.TouchEvent(c._type, c._bubbles, c.cancelable);
  3006. a.touchPointID = c.touchPointID;
  3007. a._stageX = c._stageX;
  3008. a._stageY = c._stageY;
  3009. a.ctrlKey = c.ctrlKey;
  3010. a.altKey = c.altKey;
  3011. a.shiftKey = c.shiftKey;
  3012. a.touchDown = c.touchDown;
  3013. a._isDefaultPrevented = !1;
  3014. a._target = c._target;
  3015. return a
  3016. };
  3017. a.prototype.throwNotSupportedError =
  3018. function () {
  3019. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  3020. };
  3021. a.prototype.addChild = function (c) {
  3022. this.throwNotSupportedError();
  3023. return null
  3024. };
  3025. a.prototype.addChildAt = function (c, a) {
  3026. this.throwNotSupportedError();
  3027. return null
  3028. };
  3029. a.prototype.removeChild = function (c) {
  3030. this.throwNotSupportedError();
  3031. return null
  3032. };
  3033. a.prototype.removeChildAt = function (c) {
  3034. this.throwNotSupportedError();
  3035. return null
  3036. };
  3037. a.prototype.setChildIndex = function (c, a) {
  3038. this.throwNotSupportedError()
  3039. };
  3040. a.prototype.swapChildren = function (c,
  3041. a) {
  3042. this.throwNotSupportedError()
  3043. };
  3044. a.prototype.swapChildrenAt = function (c, a) {
  3045. this.throwNotSupportedError()
  3046. };
  3047. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3048. return a
  3049. }
  3050. (b.DisplayObjectContainer);
  3051. b.ScrollView = d;
  3052. d.prototype.__class__ = "egret.ScrollView"
  3053. })(egret || (egret = {}));
  3054. __extends = this.__extends || function (b, d) {
  3055. function e() {
  3056. this.constructor = b
  3057. }
  3058. for (var a in d)
  3059. d.hasOwnProperty(a) && (b[a] = d[a]);
  3060. e.prototype = d.prototype;
  3061. b.prototype = new e
  3062. };
  3063. (function (b) {
  3064. var d = function (e) {
  3065. function a(c, a, d) {
  3066. void 0 === a && (a = NaN);
  3067. void 0 === d && (d = NaN);
  3068. e.call(this, c);
  3069. this.content = c;
  3070. this.width = NaN == a ? this._getContentWidth() : a;
  3071. this.height = NaN == d ? this._getContentHeight() : d;
  3072. b.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView")
  3073. }
  3074. __extends(a, e);
  3075. Object.defineProperty(a.prototype, "scrollXEnabled", {
  3076. get : function () {
  3077. return "off" != this.horizontalScrollPolicy
  3078. },
  3079. set : function (c) {
  3080. b.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  3081. this.horizontalScrollPolicy = c ? "auto" : "off"
  3082. },
  3083. enumerable : !0,
  3084. configurable : !0
  3085. });
  3086. Object.defineProperty(a.prototype, "scrollYEnabled", {
  3087. get : function () {
  3088. return "off" != this.verticalScrollPolicy
  3089. },
  3090. set : function (c) {
  3091. b.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  3092. this.verticalScrollPolicy = c ? "auto" : "off"
  3093. },
  3094. enumerable : !0,
  3095. configurable : !0
  3096. });
  3097. return a
  3098. }
  3099. (b.ScrollView);
  3100. b.Scroller = d;
  3101. d.prototype.__class__ = "egret.Scroller"
  3102. })(egret || (egret = {}));
  3103. (function (b) {
  3104. var d = function () {
  3105. function b() {}
  3106. b.REPEAT = "repeat";
  3107. b.SCALE = "scale";
  3108. return b
  3109. }
  3110. ();
  3111. b.BitmapFillMode = d;
  3112. d.prototype.__class__ = "egret.BitmapFillMode"
  3113. })(egret || (egret = {}));
  3114. __extends = this.__extends || function (b, d) {
  3115. function e() {
  3116. this.constructor = b
  3117. }
  3118. for (var a in d)
  3119. d.hasOwnProperty(a) && (b[a] = d[a]);
  3120. e.prototype = d.prototype;
  3121. b.prototype = new e
  3122. };
  3123. (function (b) {
  3124. var d = function (e) {
  3125. function a(c) {
  3126. e.call(this);
  3127. this.debug = !1;
  3128. this.debugColor = 16711680;
  3129. this.scale9Grid = null;
  3130. this.fillMode = "scale";
  3131. c && (this._texture = c, this._setSizeDirty())
  3132. }
  3133. __extends(a, e);
  3134. Object.defineProperty(a.prototype, "texture", {
  3135. get : function () {
  3136. return this._texture
  3137. },
  3138. set : function (c) {
  3139. c != this._texture && (this._setSizeDirty(), this._texture = c)
  3140. },
  3141. enumerable : !0,
  3142. configurable : !0
  3143. });
  3144. a.prototype._render = function (c) {
  3145. var b = this._texture;
  3146. b ? (this._texture_to_render = b, a._drawBitmap(c, this._hasWidthSet ? this._explicitWidth :
  3147. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  3148. };
  3149. a._drawBitmap = function (c, b, e, d) {
  3150. var g = d._texture_to_render;
  3151. if (g) {
  3152. var f = g._textureWidth,
  3153. h = g._textureHeight;
  3154. if ("scale" == d.fillMode) {
  3155. var n = d.scale9Grid || g.scale9Grid;
  3156. if (n && f - n.width < b && h - n.height < e)
  3157. a.drawScale9GridImage(c, d, n, b, e);
  3158. else {
  3159. var n = g._offsetX,
  3160. p = g._offsetY,
  3161. q = g._bitmapWidth || f,
  3162. r = g._bitmapHeight || h;
  3163. b /= f;
  3164. n = Math.round(n * b);
  3165. b = Math.round(q * b);
  3166. e /= h;
  3167. p = Math.round(p * e);
  3168. e = Math.round(r * e);
  3169. a.renderFilter.drawImage(c,
  3170. d, g._bitmapX, g._bitmapY, q, r, n, p, b, e)
  3171. }
  3172. } else
  3173. a.drawRepeatImage(c, d, b, e, d.fillMode)
  3174. }
  3175. };
  3176. a.drawRepeatImage = function (c, a, e, d, g) {
  3177. var f = a._texture_to_render;
  3178. if (f) {
  3179. var h = f._textureWidth,
  3180. n = f._textureHeight,
  3181. p = f._bitmapX,
  3182. q = f._bitmapY,
  3183. h = f._bitmapWidth || h,
  3184. n = f._bitmapHeight || n,
  3185. r = f._offsetX,
  3186. f = f._offsetY;
  3187. b.RenderFilter.getInstance().drawImage(c, a, p, q, h, n, r, f, e, d, g)
  3188. }
  3189. };
  3190. a.drawScale9GridImage = function (c, a, e, d, g) {
  3191. var f = a._texture_to_render;
  3192. if (f && e) {
  3193. var h = b.RenderFilter.getInstance(),
  3194. n = f._textureWidth,
  3195. p = f._textureHeight,
  3196. q = f._bitmapX,
  3197. r = f._bitmapY,
  3198. s = f._bitmapWidth || n,
  3199. t = f._bitmapHeight || p,
  3200. u = f._offsetX,
  3201. f = f._offsetY;
  3202. e = b.Rectangle.identity.initialize(e.x - Math.round(u), e.y - Math.round(u), e.width, e.height);
  3203. u = Math.round(u);
  3204. f = Math.round(f);
  3205. d -= n - s;
  3206. g -= p - t;
  3207. e.y == e.bottom && (e.bottom < t ? e.bottom++ : e.y--);
  3208. e.x == e.right && (e.right < s ? e.right++ : e.x--);
  3209. var n = q + e.x,
  3210. p = q + e.right,
  3211. v = s - e.right,
  3212. x = r + e.y,
  3213. y = r + e.bottom,
  3214. w = t - e.bottom,
  3215. z = u + e.x,
  3216. A = f + e.y,
  3217. t = g - (t - e.bottom),
  3218. s = d - (s - e.right);
  3219. h.drawImage(c, a, q, r, e.x, e.y, u, f, e.x, e.y);
  3220. h.drawImage(c, a, n, r, e.width,
  3221. e.y, z, f, s - e.x, e.y);
  3222. h.drawImage(c, a, p, r, v, e.y, u + s, f, d - s, e.y);
  3223. h.drawImage(c, a, q, x, e.x, e.height, u, A, e.x, t - e.y);
  3224. h.drawImage(c, a, n, x, e.width, e.height, z, A, s - e.x, t - e.y);
  3225. h.drawImage(c, a, p, x, v, e.height, u + s, A, d - s, t - e.y);
  3226. h.drawImage(c, a, q, y, e.x, w, u, f + t, e.x, g - t);
  3227. h.drawImage(c, a, n, y, e.width, w, z, f + t, s - e.x, g - t);
  3228. h.drawImage(c, a, p, y, v, w, u + s, f + t, d - s, g - t)
  3229. }
  3230. };
  3231. a.prototype._measureBounds = function () {
  3232. var c = this._texture;
  3233. return c ? b.Rectangle.identity.initialize(c._offsetX, c._offsetY, c._textureWidth, c._textureHeight) : e.prototype._measureBounds.call(this)
  3234. };
  3235. a.debug = !1;
  3236. a.renderFilter = b.RenderFilter.getInstance();
  3237. return a
  3238. }
  3239. (b.DisplayObject);
  3240. b.Bitmap = d;
  3241. d.prototype.__class__ = "egret.Bitmap"
  3242. })(egret || (egret = {}));
  3243. __extends = this.__extends || function (b, d) {
  3244. function e() {
  3245. this.constructor = b
  3246. }
  3247. for (var a in d)
  3248. d.hasOwnProperty(a) && (b[a] = d[a]);
  3249. e.prototype = d.prototype;
  3250. b.prototype = new e
  3251. };
  3252. (function (b) {
  3253. var d = function (e) {
  3254. function a() {
  3255. e.call(this);
  3256. this._text = "";
  3257. this._textChanged = !1;
  3258. this._bitmapPool = []
  3259. }
  3260. __extends(a, e);
  3261. Object.defineProperty(a.prototype, "text", {
  3262. get : function () {
  3263. return this._text
  3264. },
  3265. set : function (c) {
  3266. this._textChanged = !0;
  3267. this._text = c;
  3268. this._setSizeDirty()
  3269. },
  3270. enumerable : !0,
  3271. configurable : !0
  3272. });
  3273. a.prototype._updateTransform = function () {
  3274. this.visible && (this._textChanged && this._renderText(), e.prototype._updateTransform.call(this))
  3275. };
  3276. a.prototype._renderText = function (c) {
  3277. var a = c = 0;
  3278. this._textChanged &&
  3279. this.removeChildren();
  3280. for (var e = 0, d = this.text.length; e < d; e++) {
  3281. var g = this.text.charAt(e),
  3282. f = this.spriteSheet.getTexture(g);
  3283. if (null == f)
  3284. console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + g);
  3285. else {
  3286. var g = f._offsetX,
  3287. h = f._offsetY,
  3288. n = f._textureWidth;
  3289. if (this._textChanged) {
  3290. var p = this._bitmapPool[e];
  3291. p || (p = new b.Bitmap, this._bitmapPool.push(p));
  3292. p.texture = f;
  3293. this.addChild(p);
  3294. p.x = c
  3295. }
  3296. c += n + g;
  3297. h + f._textureHeight > a && (a = h + f._textureHeight)
  3298. }
  3299. }
  3300. this._textChanged = !1;
  3301. return b.Rectangle.identity.initialize(0, 0,
  3302. c, a)
  3303. };
  3304. a.prototype._measureBounds = function () {
  3305. return this._renderText(!0)
  3306. };
  3307. return a
  3308. }
  3309. (b.DisplayObjectContainer);
  3310. b.BitmapText = d;
  3311. d.prototype.__class__ = "egret.BitmapText"
  3312. })(egret || (egret = {}));
  3313. (function (b) {
  3314. var d = function () {
  3315. function b() {
  3316. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3317. this.commandQueue = []
  3318. }
  3319. b.prototype.beginFill = function (a, c) {};
  3320. b.prototype._setStyle = function (a) {};
  3321. b.prototype.drawRect = function (a, c, b, e) {
  3322. this.checkRect(a, c, b, e)
  3323. };
  3324. b.prototype.drawCircle = function (a, c, b) {
  3325. this.checkRect(a - b, c - b, 2 * b, 2 * b)
  3326. };
  3327. b.prototype.drawRoundRect = function (a, c, b, e, d, g) {
  3328. this.checkRect(a, c, b, e)
  3329. };
  3330. b.prototype.drawEllipse = function (a, c, b, e) {
  3331. this.checkRect(a - b, c - e, 2 * b, 2 * e)
  3332. };
  3333. b.prototype.lineStyle =
  3334. function (a, c, b, e, d, g, f, h) {};
  3335. b.prototype.lineTo = function (a, c) {
  3336. this.checkPoint(a, c)
  3337. };
  3338. b.prototype.curveTo = function (a, c, b, e) {
  3339. this.checkPoint(a, c);
  3340. this.checkPoint(b, e)
  3341. };
  3342. b.prototype.moveTo = function (a, c) {
  3343. this.checkPoint(a, c)
  3344. };
  3345. b.prototype.clear = function () {
  3346. this._maxY = this._maxX = this._minY = this._minX = 0
  3347. };
  3348. b.prototype.endFill = function () {};
  3349. b.prototype._draw = function (a) {};
  3350. b.prototype.checkRect = function (a, c, b, e) {
  3351. this._minX = Math.min(this._minX, a);
  3352. this._minY = Math.min(this._minY, c);
  3353. this._maxX = Math.max(this._maxX, a +
  3354. b);
  3355. this._maxY = Math.max(this._maxY, c + e)
  3356. };
  3357. b.prototype.checkPoint = function (a, c) {
  3358. this._minX = Math.min(this._minX, a);
  3359. this._minY = Math.min(this._minY, c);
  3360. this._maxX = Math.max(this._maxX, a);
  3361. this._maxY = Math.max(this._maxY, c);
  3362. this._lastX = a;
  3363. this._lastY = c
  3364. };
  3365. return b
  3366. }
  3367. ();
  3368. b.Graphics = d;
  3369. d.prototype.__class__ = "egret.Graphics";
  3370. (function () {
  3371. return function (b, a, c) {
  3372. this.method = b;
  3373. this.thisObject = a;
  3374. this.args = c
  3375. }
  3376. })().prototype.__class__ = "egret.Command"
  3377. })(egret || (egret = {}));
  3378. __extends = this.__extends || function (b, d) {
  3379. function e() {
  3380. this.constructor = b
  3381. }
  3382. for (var a in d)
  3383. d.hasOwnProperty(a) && (b[a] = d[a]);
  3384. e.prototype = d.prototype;
  3385. b.prototype = new e
  3386. };
  3387. (function (b) {
  3388. var d = function (e) {
  3389. function a() {
  3390. e.call(this)
  3391. }
  3392. __extends(a, e);
  3393. Object.defineProperty(a.prototype, "graphics", {
  3394. get : function () {
  3395. this._graphics || (this._graphics = new b.Graphics);
  3396. return this._graphics
  3397. },
  3398. enumerable : !0,
  3399. configurable : !0
  3400. });
  3401. a.prototype._render = function (c) {
  3402. this._graphics && this._graphics._draw(c)
  3403. };
  3404. return a
  3405. }
  3406. (b.DisplayObject);
  3407. b.Shape = d;
  3408. d.prototype.__class__ = "egret.Shape"
  3409. })(egret || (egret = {}));
  3410. __extends = this.__extends || function (b, d) {
  3411. function e() {
  3412. this.constructor = b
  3413. }
  3414. for (var a in d)
  3415. d.hasOwnProperty(a) && (b[a] = d[a]);
  3416. e.prototype = d.prototype;
  3417. b.prototype = new e
  3418. };
  3419. (function (b) {
  3420. var d = function (e) {
  3421. function a() {
  3422. e.call(this)
  3423. }
  3424. __extends(a, e);
  3425. Object.defineProperty(a.prototype, "graphics", {
  3426. get : function () {
  3427. this._graphics || (this._graphics = new b.Graphics);
  3428. return this._graphics
  3429. },
  3430. enumerable : !0,
  3431. configurable : !0
  3432. });
  3433. a.prototype._render = function (c) {
  3434. this._graphics && this._graphics._draw(c);
  3435. e.prototype._render.call(this, c)
  3436. };
  3437. return a
  3438. }
  3439. (b.DisplayObjectContainer);
  3440. b.Sprite = d;
  3441. d.prototype.__class__ = "egret.Sprite"
  3442. })(egret || (egret = {}));
  3443. __extends = this.__extends || function (b, d) {
  3444. function e() {
  3445. this.constructor = b
  3446. }
  3447. for (var a in d)
  3448. d.hasOwnProperty(a) && (b[a] = d[a]);
  3449. e.prototype = d.prototype;
  3450. b.prototype = new e
  3451. };
  3452. (function (b) {
  3453. var d = function (e) {
  3454. function a() {
  3455. e.call(this);
  3456. this._inputEnabled = !1;
  3457. this._text = this._type = "";
  3458. this._displayAsPassword = !1;
  3459. this._fontFamily = a.default_fontFamily;
  3460. this._size = 30;
  3461. this._textColorString = "#FFFFFF";
  3462. this._textColor = 16777215;
  3463. this._strokeColorString = "#000000";
  3464. this._stroke = this._strokeColor = 0;
  3465. this._textAlign = "left";
  3466. this._verticalAlign = "top";
  3467. this._maxChars = 0;
  3468. this._scrollV = -1;
  3469. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3470. this._isFlow = this._multiline = !1;
  3471. this._textArr = [];
  3472. this._isArrayChanged =
  3473. !1;
  3474. this._textMaxHeight = this._textMaxWidth = 0;
  3475. this._linesArr = []
  3476. }
  3477. __extends(a, e);
  3478. a.prototype.isInput = function () {
  3479. return this._type == b.TextFieldType.INPUT
  3480. };
  3481. a.prototype._setTouchEnabled = function (c) {
  3482. e.prototype._setTouchEnabled.call(this, c);
  3483. this.isInput() && (this._inputEnabled = !0)
  3484. };
  3485. Object.defineProperty(a.prototype, "type", {
  3486. get : function () {
  3487. return this._type
  3488. },
  3489. set : function (c) {
  3490. this._setType(c)
  3491. },
  3492. enumerable : !0,
  3493. configurable : !0
  3494. });
  3495. a.prototype._setType = function (c) {
  3496. this._type != c && (this._type = c, this._type == b.TextFieldType.INPUT ?
  3497. (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3498. };
  3499. Object.defineProperty(a.prototype, "text", {
  3500. get : function () {
  3501. return this._getText()
  3502. },
  3503. set : function (c) {
  3504. this._setText(c)
  3505. },
  3506. enumerable : !0,
  3507. configurable : !0
  3508. });
  3509. a.prototype._getText = function () {
  3510. return this._type ==
  3511. b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3512. };
  3513. a.prototype._setSizeDirty = function () {
  3514. e.prototype._setSizeDirty.call(this);
  3515. this._isArrayChanged = !0
  3516. };
  3517. a.prototype._setTextDirty = function () {
  3518. this._setSizeDirty()
  3519. };
  3520. a.prototype._setBaseText = function (c) {
  3521. null == c && (c = "");
  3522. this._isFlow = !1;
  3523. if (this._text != c || this._displayAsPassword)
  3524. this._setTextDirty(), this._text = c, c = "", c = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3525. text : c
  3526. }
  3527. ])
  3528. };
  3529. a.prototype._setText = function (c) {
  3530. null ==
  3531. c && (c = "");
  3532. this._setBaseText(c);
  3533. this._inputUtils && this._inputUtils._setText(this._text)
  3534. };
  3535. Object.defineProperty(a.prototype, "displayAsPassword", {
  3536. get : function () {
  3537. return this._displayAsPassword
  3538. },
  3539. set : function (c) {
  3540. this._setDisplayAsPassword(c)
  3541. },
  3542. enumerable : !0,
  3543. configurable : !0
  3544. });
  3545. a.prototype._setDisplayAsPassword = function (c) {
  3546. this._displayAsPassword != c && (this._displayAsPassword = c, this._setText(this._text))
  3547. };
  3548. Object.defineProperty(a.prototype, "fontFamily", {
  3549. get : function () {
  3550. return this._fontFamily
  3551. },
  3552. set : function (c) {
  3553. this._setFontFamily(c)
  3554. },
  3555. enumerable : !0,
  3556. configurable : !0
  3557. });
  3558. a.prototype._setFontFamily = function (c) {
  3559. this._fontFamily != c && (this._setTextDirty(), this._fontFamily = c)
  3560. };
  3561. Object.defineProperty(a.prototype, "size", {
  3562. get : function () {
  3563. return this._size
  3564. },
  3565. set : function (c) {
  3566. this._setSize(c)
  3567. },
  3568. enumerable : !0,
  3569. configurable : !0
  3570. });
  3571. a.prototype._setSize = function (c) {
  3572. this._size != c && (this._setTextDirty(), this._size = c)
  3573. };
  3574. Object.defineProperty(a.prototype, "italic", {
  3575. get : function () {
  3576. return this._italic
  3577. },
  3578. set : function (c) {
  3579. this._setItalic(c)
  3580. },
  3581. enumerable : !0,
  3582. configurable : !0
  3583. });
  3584. a.prototype._setItalic = function (c) {
  3585. this._italic != c && (this._setTextDirty(), this._italic = c)
  3586. };
  3587. Object.defineProperty(a.prototype, "bold", {
  3588. get : function () {
  3589. return this._bold
  3590. },
  3591. set : function (c) {
  3592. this._setBold(c)
  3593. },
  3594. enumerable : !0,
  3595. configurable : !0
  3596. });
  3597. a.prototype._setBold = function (c) {
  3598. this._bold != c && (this._setTextDirty(), this._bold = c)
  3599. };
  3600. Object.defineProperty(a.prototype, "textColor", {
  3601. get : function () {
  3602. return this._textColor
  3603. },
  3604. set : function (c) {
  3605. this._setTextColor(c)
  3606. },
  3607. enumerable : !0,
  3608. configurable : !0
  3609. });
  3610. a.prototype._setTextColor =
  3611. function (c) {
  3612. this._textColor != c && (this._setTextDirty(), this._textColor = c, this._textColorString = b.toColorString(c))
  3613. };
  3614. Object.defineProperty(a.prototype, "strokeColor", {
  3615. get : function () {
  3616. return this._strokeColor
  3617. },
  3618. set : function (c) {
  3619. this._setStrokeColor(c)
  3620. },
  3621. enumerable : !0,
  3622. configurable : !0
  3623. });
  3624. a.prototype._setStrokeColor = function (c) {
  3625. this._strokeColor != c && (this._setTextDirty(), this._strokeColor = c, this._strokeColorString = b.toColorString(c))
  3626. };
  3627. Object.defineProperty(a.prototype, "stroke", {
  3628. get : function () {
  3629. return this._stroke
  3630. },
  3631. set : function (c) {
  3632. this._setStroke(c)
  3633. },
  3634. enumerable : !0,
  3635. configurable : !0
  3636. });
  3637. a.prototype._setStroke = function (c) {
  3638. this._stroke != c && (this._setTextDirty(), this._stroke = c)
  3639. };
  3640. Object.defineProperty(a.prototype, "textAlign", {
  3641. get : function () {
  3642. return this._textAlign
  3643. },
  3644. set : function (c) {
  3645. this._setTextAlign(c)
  3646. },
  3647. enumerable : !0,
  3648. configurable : !0
  3649. });
  3650. a.prototype._setTextAlign = function (c) {
  3651. this._textAlign != c && (this._setTextDirty(), this._textAlign = c)
  3652. };
  3653. Object.defineProperty(a.prototype, "verticalAlign", {
  3654. get : function () {
  3655. return this._verticalAlign
  3656. },
  3657. set : function (c) {
  3658. this._setVerticalAlign(c)
  3659. },
  3660. enumerable : !0,
  3661. configurable : !0
  3662. });
  3663. a.prototype._setVerticalAlign = function (c) {
  3664. this._verticalAlign != c && (this._setTextDirty(), this._verticalAlign = c)
  3665. };
  3666. Object.defineProperty(a.prototype, "maxChars", {
  3667. get : function () {
  3668. return this._maxChars
  3669. },
  3670. set : function (c) {
  3671. this._setMaxChars(c)
  3672. },
  3673. enumerable : !0,
  3674. configurable : !0
  3675. });
  3676. a.prototype._setMaxChars = function (c) {
  3677. this._maxChars != c && (this._maxChars = c)
  3678. };
  3679. Object.defineProperty(a.prototype, "scrollV", {
  3680. set : function (c) {
  3681. this._scrollV = c;
  3682. this._setDirty()
  3683. },
  3684. enumerable : !0,
  3685. configurable : !0
  3686. });
  3687. Object.defineProperty(a.prototype, "maxScrollV", {
  3688. get : function () {
  3689. return this._maxScrollV
  3690. },
  3691. enumerable : !0,
  3692. configurable : !0
  3693. });
  3694. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3695. get : function () {
  3696. return 0
  3697. },
  3698. enumerable : !0,
  3699. configurable : !0
  3700. });
  3701. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3702. get : function () {
  3703. return 0
  3704. },
  3705. enumerable : !0,
  3706. configurable : !0
  3707. });
  3708. Object.defineProperty(a.prototype, "caretIndex", {
  3709. get : function () {
  3710. return 0
  3711. },
  3712. enumerable : !0,
  3713. configurable : !0
  3714. });
  3715. a.prototype._setSelection =
  3716. function (c, a) {};
  3717. Object.defineProperty(a.prototype, "lineSpacing", {
  3718. get : function () {
  3719. return this._lineSpacing
  3720. },
  3721. set : function (c) {
  3722. this._setLineSpacing(c)
  3723. },
  3724. enumerable : !0,
  3725. configurable : !0
  3726. });
  3727. a.prototype._setLineSpacing = function (c) {
  3728. this._lineSpacing != c && (this._setTextDirty(), this._lineSpacing = c)
  3729. };
  3730. a.prototype._getLineHeight = function () {
  3731. return this._lineSpacing + this._size
  3732. };
  3733. Object.defineProperty(a.prototype, "numLines", {
  3734. get : function () {
  3735. return this._numLines
  3736. },
  3737. enumerable : !0,
  3738. configurable : !0
  3739. });
  3740. Object.defineProperty(a.prototype,
  3741. "multiline", {
  3742. get : function () {
  3743. return this._multiline
  3744. },
  3745. set : function (c) {
  3746. this._setMultiline(c)
  3747. },
  3748. enumerable : !0,
  3749. configurable : !0
  3750. });
  3751. a.prototype._setMultiline = function (c) {
  3752. this._multiline = c;
  3753. this._setDirty()
  3754. };
  3755. a.prototype.setFocus = function () {
  3756. b.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3757. };
  3758. a.prototype._onRemoveFromStage = function () {
  3759. e.prototype._onRemoveFromStage.call(this);
  3760. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3761. };
  3762. a.prototype._onAddToStage = function () {
  3763. e.prototype._onAddToStage.call(this);
  3764. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3765. };
  3766. a.prototype._updateBaseTransform = function () {
  3767. e.prototype._updateTransform.call(this)
  3768. };
  3769. a.prototype._updateTransform = function () {
  3770. this._type == b.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3771. };
  3772. a.prototype._render = function (c) {
  3773. this.drawText(c);
  3774. this._clearDirty()
  3775. };
  3776. a.prototype._measureBounds = function () {
  3777. return this.measureText()
  3778. };
  3779. Object.defineProperty(a.prototype, "textFlow", {
  3780. set : function (c) {
  3781. this._isFlow = !0;
  3782. for (var a = "", b = 0; b < c.length; b++)
  3783. a += c[b].text;
  3784. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(c))
  3785. },
  3786. enumerable : !0,
  3787. configurable : !0
  3788. });
  3789. a.prototype.changeToPassText = function (c) {
  3790. if (this._displayAsPassword) {
  3791. for (var a = "", b = 0, e = c.length; b < e; b++)
  3792. switch (c.charAt(b)) {
  3793. case "\n":
  3794. a += "\n";
  3795. break;
  3796. case "\r":
  3797. break;
  3798. default:
  3799. a += "*"
  3800. }
  3801. return a
  3802. }
  3803. return c
  3804. };
  3805. a.prototype.setMiddleStyle = function (c) {
  3806. this._isArrayChanged = !0;
  3807. this._textArr = c;
  3808. this._setSizeDirty()
  3809. };
  3810. Object.defineProperty(a.prototype, "textWidth", {
  3811. get : function () {
  3812. return this._textMaxWidth
  3813. },
  3814. enumerable : !0,
  3815. configurable : !0
  3816. });
  3817. Object.defineProperty(a.prototype, "textHeight", {
  3818. get : function () {
  3819. return this._textMaxHeight
  3820. },
  3821. enumerable : !0,
  3822. configurable : !0
  3823. });
  3824. a.prototype.appendText = function (c) {
  3825. this.appendElement({
  3826. text : c
  3827. })
  3828. };
  3829. a.prototype.appendElement = function (c) {
  3830. this._textArr.push(c);
  3831. this.setMiddleStyle(this._textArr)
  3832. };
  3833. a.prototype._getLinesArr = function () {
  3834. if (!this._isArrayChanged)
  3835. return this._linesArr;
  3836. this._isArrayChanged = !1;
  3837. var c = this._textArr,
  3838. a = b.MainContext.instance.rendererContext;
  3839. this._linesArr = [];
  3840. this._textMaxWidth = this._textMaxHeight = 0;
  3841. var e = this._linesArr,
  3842. d = 0,
  3843. g = 0,
  3844. f = 0,
  3845. h;
  3846. this._isFlow || a.setupFont(this);
  3847. for (var n = 0; n < c.length; n++) {
  3848. var p = c[n];
  3849. p.style = p.style || {};
  3850. for (var q = p.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  3851. null == e[f] && (h = {
  3852. width : 0,
  3853. height : 0,
  3854. elements : []
  3855. }, e[f] = h, g = d = 0);
  3856. g = this._type == b.TextFieldType.INPUT ? this._size : Math.max(g, p.style.size || this._size);
  3857. if ("" != q[r]) {
  3858. this._isFlow &&
  3859. a.setupFont(this, p.style);
  3860. var s = a.measureText(q[r]);
  3861. if (this._hasWidthSet)
  3862. if (d + s <= this._explicitWidth)
  3863. h.elements.push({
  3864. width : s,
  3865. text : q[r],
  3866. style : p.style
  3867. }), d += s;
  3868. else {
  3869. for (var t = 0, u = 0, v = q[r]; t < v.length; t++) {
  3870. s = a.measureText(v.charAt(t));
  3871. if (d + s > this._explicitWidth)
  3872. break;
  3873. u += s;
  3874. d += s
  3875. }
  3876. 0 < t && (h.elements.push({
  3877. width : u,
  3878. text : v.substring(0, t),
  3879. style : p.style
  3880. }), q[r] = v.substring(t));
  3881. r--
  3882. }
  3883. else
  3884. d += s, h.elements.push({
  3885. width : s,
  3886. text : q[r],
  3887. style : p.style
  3888. })
  3889. }
  3890. if (r < q.length - 1) {
  3891. h.width = d;
  3892. h.height = g;
  3893. this._textMaxWidth = Math.max(this._textMaxWidth,
  3894. d);
  3895. this._textMaxHeight += g;
  3896. if (this._type == b.TextFieldType.INPUT && !this._multiline)
  3897. return this._numLines = e.length, e;
  3898. f++
  3899. }
  3900. }
  3901. n == c.length - 1 && h && (h.width = d, h.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, d), this._textMaxHeight += g)
  3902. }
  3903. this._numLines = e.length;
  3904. return e
  3905. };
  3906. a.prototype.measureText = function () {
  3907. return this._getLinesArr() ? b.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) *
  3908. this._lineSpacing) : b.Rectangle.identity.initialize(0, 0, 0, 0)
  3909. };
  3910. a.prototype.drawText = function (c) {
  3911. var a = this._getLinesArr();
  3912. if (a) {
  3913. this._isFlow || c.setupFont(this);
  3914. var e = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3915. d = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  3916. g = 0,
  3917. f = 0;
  3918. if (this._hasHeightSet)
  3919. if (d < this._explicitHeight) {
  3920. var h = 0;
  3921. this._verticalAlign == b.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (h = 1);
  3922. g += h * (this._explicitHeight - d)
  3923. } else
  3924. d > this._explicitHeight &&
  3925. (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3926. g = Math.round(g);
  3927. d = 0;
  3928. this._textAlign == b.HorizontalAlign.CENTER ? d = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (d = 1);
  3929. for (h = 0; f < this._numLines; f++) {
  3930. var n = a[f],
  3931. p = n.height,
  3932. g = g + p / 2;
  3933. if (0 != f && this._hasHeightSet && g > this._explicitHeight)
  3934. break;
  3935. for (var h = Math.round((e - n.width) * d), q = 0; q < n.elements.length; q++) {
  3936. var r = n.elements[q],
  3937. s = r.style.size || this._size;
  3938. this._type == b.TextFieldType.INPUT ? c.drawText(this, r.text, h, g + (p - s) / 2, r.width) : (this._isFlow &&
  3939. c.setupFont(this, r.style), c.drawText(this, r.text, h, g + (p - s) / 2, r.width, r.style));
  3940. h += r.width
  3941. }
  3942. g += p / 2 + this._lineSpacing
  3943. }
  3944. }
  3945. };
  3946. a.default_fontFamily = "Arial";
  3947. return a
  3948. }
  3949. (b.DisplayObject);
  3950. b.TextField = d;
  3951. d.prototype.__class__ = "egret.TextField"
  3952. })(egret || (egret = {}));
  3953. (function (b) {
  3954. var d = function () {
  3955. function b() {
  3956. this.resutlArr = []
  3957. }
  3958. b.prototype.parser = function (a) {
  3959. this.stackArray = [];
  3960. this.resutlArr = [];
  3961. for (var c = 0, b = a.length; c < b; ) {
  3962. var e = a.indexOf("<", c);
  3963. 0 > e ? (this.addToResultArr(a.substring(c)), c = b) : (this.addToResultArr(a.substring(c, e)), c = a.indexOf(">", e), "/" == a.charAt(e + 1) ? this.stackArray.pop() : this.addToArray(a.substring(e + 1, c)), c += 1)
  3964. }
  3965. return this.resutlArr
  3966. };
  3967. b.prototype.addToResultArr = function (a) {
  3968. if ("" != a) {
  3969. var c = [];
  3970. c.push(["&lt;", "<"]);
  3971. c.push(["&gt;", ">"]);
  3972. c.push(["&amp;",
  3973. "&"]);
  3974. c.push(["&quot;", '"']);
  3975. c.push(["&apos;;", "'"]);
  3976. for (var b = 0; b < c.length; b++)
  3977. a.replace(new RegExp(c[b][0], "g"), c[b][1]);
  3978. 0 < this.stackArray.length ? this.resutlArr.push({
  3979. text : a,
  3980. style : this.stackArray[this.stackArray.length - 1]
  3981. }) : this.resutlArr.push({
  3982. text : a
  3983. })
  3984. }
  3985. };
  3986. b.prototype.changeStringToObject = function (a) {
  3987. var c = {};
  3988. a = a.replace(/( )+/g, " ").split(" ");
  3989. for (var b = 0; b < a.length; b++)
  3990. this.addProperty(c, a[b]);
  3991. return c
  3992. };
  3993. b.prototype.addProperty = function (a, c) {
  3994. var b = c.replace(/( )*=( )*/g, "=").split("=");
  3995. b[1] && (b[1] =
  3996. b[1].replace(/(\"|\')/g, ""));
  3997. switch (b[0].toLowerCase()) {
  3998. case "color":
  3999. a.textColor = parseInt(b[1]);
  4000. break;
  4001. case "b":
  4002. a.bold = "true" == (b[1] || "true");
  4003. break;
  4004. case "i":
  4005. a.italic = "true" == (b[1] || "true");
  4006. break;
  4007. case "size":
  4008. a.size = parseInt(b[1]);
  4009. break;
  4010. case "fontFamily":
  4011. a.fontFamily = b[1]
  4012. }
  4013. };
  4014. b.prototype.addToArray = function (a) {
  4015. a = this.changeStringToObject(a);
  4016. if (0 != this.stackArray.length) {
  4017. var c = this.stackArray[this.stackArray.length - 1],
  4018. b;
  4019. for (b in c)
  4020. null == a[b] && (a[b] = c[b])
  4021. }
  4022. this.stackArray.push(a)
  4023. };
  4024. return b
  4025. }
  4026. ();
  4027. b.HtmlTextParser =
  4028. d;
  4029. d.prototype.__class__ = "egret.HtmlTextParser"
  4030. })(egret || (egret = {}));
  4031. (function (b) {
  4032. var d = function () {
  4033. function b() {}
  4034. b.DYNAMIC = "dynamic";
  4035. b.INPUT = "input";
  4036. return b
  4037. }
  4038. ();
  4039. b.TextFieldType = d;
  4040. d.prototype.__class__ = "egret.TextFieldType"
  4041. })(egret || (egret = {}));
  4042. __extends = this.__extends || function (b, d) {
  4043. function e() {
  4044. this.constructor = b
  4045. }
  4046. for (var a in d)
  4047. d.hasOwnProperty(a) && (b[a] = d[a]);
  4048. e.prototype = d.prototype;
  4049. b.prototype = new e
  4050. };
  4051. (function (b) {
  4052. var d = function (e) {
  4053. function a(c) {
  4054. e.call(this);
  4055. var a = c.bitmapData;
  4056. this.bitmapData = a;
  4057. this._textureMap = {};
  4058. this._sourceWidth = a.width;
  4059. this._sourceHeight = a.height;
  4060. this._bitmapX = c._bitmapX - c._offsetX;
  4061. this._bitmapY = c._bitmapY - c._offsetY
  4062. }
  4063. __extends(a, e);
  4064. a.prototype.getTexture = function (c) {
  4065. return this._textureMap[c]
  4066. };
  4067. a.prototype.createTexture = function (c, a, e, d, g, f, h, n, p) {
  4068. void 0 === f && (f = 0);
  4069. void 0 === h && (h = 0);
  4070. "undefined" === typeof n && (n = f + d);
  4071. "undefined" === typeof p && (p = h + g);
  4072. var q = new b.Texture;
  4073. q._bitmapData =
  4074. this.bitmapData;
  4075. q._bitmapX = this._bitmapX + a;
  4076. q._bitmapY = this._bitmapY + e;
  4077. q._bitmapWidth = d;
  4078. q._bitmapHeight = g;
  4079. q._offsetX = f;
  4080. q._offsetY = h;
  4081. q._textureWidth = n;
  4082. q._textureHeight = p;
  4083. q._sourceWidth = this._sourceWidth;
  4084. q._sourceHeight = this._sourceHeight;
  4085. return this._textureMap[c] = q
  4086. };
  4087. return a
  4088. }
  4089. (b.HashObject);
  4090. b.SpriteSheet = d;
  4091. d.prototype.__class__ = "egret.SpriteSheet"
  4092. })(egret || (egret = {}));
  4093. __extends = this.__extends || function (b, d) {
  4094. function e() {
  4095. this.constructor = b
  4096. }
  4097. for (var a in d)
  4098. d.hasOwnProperty(a) && (b[a] = d[a]);
  4099. e.prototype = d.prototype;
  4100. b.prototype = new e
  4101. };
  4102. (function (b) {
  4103. var d = function (e) {
  4104. function a() {
  4105. e.call(this);
  4106. b.Logger.warning("TextInput \u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextField\u4ee3\u66ff\uff0c\u5e76\u8bbe\u7f6etype\u4e3aTextFieldType.INPUT");
  4107. this.type = b.TextFieldType.INPUT
  4108. }
  4109. __extends(a, e);
  4110. a.prototype.setText = function (c) {
  4111. b.Logger.warning("TextField.setText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u8bbe\u7f6e");
  4112. this.text = c
  4113. };
  4114. a.prototype.getText = function () {
  4115. b.Logger.warning("TextField.getText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u83b7\u53d6");
  4116. return this.text
  4117. };
  4118. a.prototype.setTextType = function (c) {
  4119. b.Logger.warning("TextField.setTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u8bbe\u7f6e");
  4120. this.displayAsPassword = "password" == c
  4121. };
  4122. a.prototype.getTextType = function () {
  4123. b.Logger.warning("TextField.getTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u83b7\u53d6");
  4124. return this.displayAsPassword ? "password" : "text"
  4125. };
  4126. return a
  4127. }
  4128. (b.TextField);
  4129. b.TextInput = d;
  4130. d.prototype.__class__ = "egret.TextInput"
  4131. })(egret ||
  4132. (egret = {}));
  4133. __extends = this.__extends || function (b, d) {
  4134. function e() {
  4135. this.constructor = b
  4136. }
  4137. for (var a in d)
  4138. d.hasOwnProperty(a) && (b[a] = d[a]);
  4139. e.prototype = d.prototype;
  4140. b.prototype = new e
  4141. };
  4142. (function (b) {
  4143. var d = function (e) {
  4144. function a() {
  4145. e.call(this);
  4146. this._isFocus = !1;
  4147. this._isFirst = this._isFirst = !0
  4148. }
  4149. __extends(a, e);
  4150. a.prototype.init = function (c) {
  4151. this._text = c;
  4152. this.stageText = b.StageText.create();
  4153. c = this._text.localToGlobal();
  4154. this.stageText._open(c.x, c.y, this._text._explicitWidth, this._text._explicitHeight)
  4155. };
  4156. a.prototype._addStageText = function () {
  4157. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4158. this.stageText._add();
  4159. this.stageText._addListeners();
  4160. this.stageText.addEventListener("blur", this.onBlurHandler,
  4161. this);
  4162. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4163. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4164. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4165. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  4166. };
  4167. a.prototype._removeStageText = function () {
  4168. this.stageText._remove();
  4169. this.stageText._removeListeners();
  4170. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4171. this.stageText.removeEventListener("blur",
  4172. this.onBlurHandler, this);
  4173. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4174. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4175. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4176. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  4177. };
  4178. a.prototype._getText = function () {
  4179. return this.stageText._getText()
  4180. };
  4181. a.prototype._setText = function (c) {
  4182. this.stageText._setText(c)
  4183. };
  4184. a.prototype.onFocusHandler =
  4185. function (c) {
  4186. this.hideText()
  4187. };
  4188. a.prototype.onBlurHandler = function (c) {
  4189. this.showText()
  4190. };
  4191. a.prototype.onMouseDownHandler = function (c) {
  4192. c.stopPropagation();
  4193. this._text._visible && this.stageText._show()
  4194. };
  4195. a.prototype.onStageDownHandler = function (c) {
  4196. this.stageText._hide();
  4197. this.showText()
  4198. };
  4199. a.prototype.showText = function () {
  4200. this._isFocus && (this._isFocus = !1, this.resetText())
  4201. };
  4202. a.prototype.hideText = function () {
  4203. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4204. };
  4205. a.prototype.updateTextHandler = function (c) {
  4206. this.resetText();
  4207. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4208. };
  4209. a.prototype.resetText = function () {
  4210. this._text._setBaseText(this.stageText._getText())
  4211. };
  4212. a.prototype._updateTransform = function () {
  4213. var c = this._text._worldTransform.a,
  4214. a = this._text._worldTransform.b,
  4215. e = this._text._worldTransform.c,
  4216. d = this._text._worldTransform.d,
  4217. g = this._text._worldTransform.tx,
  4218. f = this._text._worldTransform.ty;
  4219. this._text._updateBaseTransform();
  4220. var h = this._text._worldTransform;
  4221. if (this._isFirst || c != h.a || a != h.b || e != h.c || d != h.d || g != h.tx || f !=
  4222. h.ty) {
  4223. this._isFirst = !1;
  4224. c = this._text.localToGlobal();
  4225. this.stageText.changePosition(c.x, c.y);
  4226. var n = this;
  4227. b.callLater(function () {
  4228. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  4229. }, this)
  4230. }
  4231. };
  4232. a.prototype._updateProperties = function () {
  4233. var c = this._text._stage;
  4234. if (null == c)
  4235. this.stageText._setVisible(!1);
  4236. else {
  4237. for (var a = this._text, e = a._visible; e; ) {
  4238. a = a.parent;
  4239. if (a == c)
  4240. break;
  4241. e = a._visible
  4242. }
  4243. this.stageText._setVisible(e)
  4244. }
  4245. this.stageText._setMultiline(this._text._multiline);
  4246. this.stageText._setMaxChars(this._text._maxChars);
  4247. this.stageText._setSize(this._text._size);
  4248. this.stageText._setTextColor(this._text._textColorString);
  4249. this.stageText._setTextFontFamily(this._text._fontFamily);
  4250. this.stageText._setBold(this._text._bold);
  4251. this.stageText._setItalic(this._text._italic);
  4252. this.stageText._setTextAlign(this._text._textAlign);
  4253. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4254. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4255. this.stageText._setTextType(this._text._displayAsPassword ?
  4256. "password" : "text");
  4257. this.stageText._setText(this._text._text);
  4258. this.stageText._resetStageText();
  4259. this._updateTransform()
  4260. };
  4261. return a
  4262. }
  4263. (b.HashObject);
  4264. b.InputController = d;
  4265. d.prototype.__class__ = "egret.InputController"
  4266. })(egret || (egret = {}));
  4267. __extends = this.__extends || function (b, d) {
  4268. function e() {
  4269. this.constructor = b
  4270. }
  4271. for (var a in d)
  4272. d.hasOwnProperty(a) && (b[a] = d[a]);
  4273. e.prototype = d.prototype;
  4274. b.prototype = new e
  4275. };
  4276. (function (b) {
  4277. var d = function (b) {
  4278. function a(c, a) {
  4279. b.call(this, c);
  4280. this.charList = this.parseConfig(a)
  4281. }
  4282. __extends(a, b);
  4283. a.prototype.getTexture = function (c) {
  4284. var a = this._textureMap[c];
  4285. if (!a) {
  4286. a = this.charList[c];
  4287. if (!a)
  4288. return null;
  4289. a = this.createTexture(c, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  4290. this._textureMap[c] = a
  4291. }
  4292. return a
  4293. };
  4294. a.prototype.parseConfig = function (c) {
  4295. c = c.split("\r\n").join("\n");
  4296. c = c.split("\n");
  4297. for (var a = this.getConfigByKey(c[3], "count"), b = {}, e = 4; e < 4 + a; e++) {
  4298. var d = c[e],
  4299. f = String.fromCharCode(this.getConfigByKey(d,
  4300. "id")),
  4301. h = {};
  4302. b[f] = h;
  4303. h.x = this.getConfigByKey(d, "x");
  4304. h.y = this.getConfigByKey(d, "y");
  4305. h.width = this.getConfigByKey(d, "width");
  4306. h.height = this.getConfigByKey(d, "height");
  4307. h.offsetX = this.getConfigByKey(d, "xoffset");
  4308. h.offsetY = this.getConfigByKey(d, "yoffset")
  4309. }
  4310. return b
  4311. };
  4312. a.prototype.getConfigByKey = function (c, a) {
  4313. for (var b = c.split(" "), e = 0, d = b.length; e < d; e++) {
  4314. var f = b[e];
  4315. if (a == f.substring(0, a.length))
  4316. return b = f.substring(a.length + 1), parseInt(b)
  4317. }
  4318. return 0
  4319. };
  4320. return a
  4321. }
  4322. (b.SpriteSheet);
  4323. b.BitmapTextSpriteSheet = d;
  4324. d.prototype.__class__ =
  4325. "egret.BitmapTextSpriteSheet"
  4326. })(egret || (egret = {}));
  4327. __extends = this.__extends || function (b, d) {
  4328. function e() {
  4329. this.constructor = b
  4330. }
  4331. for (var a in d)
  4332. d.hasOwnProperty(a) && (b[a] = d[a]);
  4333. e.prototype = d.prototype;
  4334. b.prototype = new e
  4335. };
  4336. (function (b) {
  4337. var d = function (a) {
  4338. function c(c, d) {
  4339. a.call(this);
  4340. this.frameRate = 60;
  4341. c instanceof e ? (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 e(c, d);
  4342. this.delegate.setMovieClip(this)
  4343. }
  4344. __extends(c, a);
  4345. c.prototype.gotoAndPlay = function (c) {
  4346. this.delegate.gotoAndPlay(c)
  4347. };
  4348. c.prototype.gotoAndStop = function (c) {
  4349. this.delegate.gotoAndStop(c)
  4350. };
  4351. c.prototype.stop =
  4352. function () {
  4353. this.delegate.stop()
  4354. };
  4355. c.prototype.dispose = function () {
  4356. this.delegate.dispose()
  4357. };
  4358. c.prototype.release = function () {
  4359. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4360. this.dispose()
  4361. };
  4362. c.prototype.getCurrentFrameIndex = function () {
  4363. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4364. return this.delegate._currentFrameIndex
  4365. };
  4366. c.prototype.getTotalFrame = function () {
  4367. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4368. return this.delegate._totalFrame
  4369. };
  4370. c.prototype.setInterval = function (c) {
  4371. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4372. this.frameRate = 60 / c
  4373. };
  4374. c.prototype.getIsPlaying = function () {
  4375. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4376. return this.delegate.isPlaying
  4377. };
  4378. return c
  4379. }
  4380. (b.DisplayObjectContainer);
  4381. b.MovieClip = d;
  4382. d.prototype.__class__ = "egret.MovieClip";
  4383. var e = function () {
  4384. function a(c, a) {
  4385. this.data = c;
  4386. this._currentFrameIndex = this._passTime =
  4387. this._totalFrame = 0;
  4388. this._isPlaying = !1;
  4389. this._frameData = c;
  4390. this._spriteSheet = new b.SpriteSheet(a)
  4391. }
  4392. a.prototype.setMovieClip = function (c) {
  4393. this.movieClip = c;
  4394. this.bitmap = new b.Bitmap;
  4395. this.movieClip.addChild(this.bitmap)
  4396. };
  4397. a.prototype.gotoAndPlay = function (c) {
  4398. this.checkHasFrame(c);
  4399. this._isPlaying = !0;
  4400. this._currentFrameIndex = 0;
  4401. this._currentFrameName = c;
  4402. this._totalFrame = this._frameData.frames[c].totalFrame;
  4403. this.playNextFrame();
  4404. this._passTime = 0;
  4405. b.Ticker.getInstance().register(this.update, this)
  4406. };
  4407. a.prototype.gotoAndStop =
  4408. function (c) {
  4409. this.checkHasFrame(c);
  4410. this.stop();
  4411. this._currentFrameIndex = this._passTime = 0;
  4412. this._currentFrameName = c;
  4413. this._totalFrame = this._frameData.frames[c].totalFrame;
  4414. this.playNextFrame()
  4415. };
  4416. a.prototype.stop = function () {
  4417. this._isPlaying = !1;
  4418. b.Ticker.getInstance().unregister(this.update, this)
  4419. };
  4420. a.prototype.dispose = function () {};
  4421. a.prototype.checkHasFrame = function (c) {
  4422. void 0 == this._frameData.frames[c] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", c)
  4423. };
  4424. a.prototype.update = function (c) {
  4425. for (var a =
  4426. 1E3 / this.movieClip.frameRate, a = Math.floor((this._passTime % a + c) / a); 1 <= a; )
  4427. 1 == a ? this.playNextFrame() : this.playNextFrame(!1), a--;
  4428. this._passTime += c
  4429. };
  4430. a.prototype.playNextFrame = function (c) {
  4431. void 0 === c && (c = !0);
  4432. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4433. if (c) {
  4434. c = this.getTexture(a.res);
  4435. var e = this.bitmap;
  4436. e.x = a.x;
  4437. e.y = a.y;
  4438. e.texture = c
  4439. }
  4440. null != a.action && this.movieClip.dispatchEventWith(a.action);
  4441. this._currentFrameIndex++;
  4442. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4443. 0, a.action != b.Event.COMPLETE && this.movieClip.dispatchEventWith(b.Event.COMPLETE))
  4444. };
  4445. a.prototype.getTexture = function (a) {
  4446. var b = this._frameData.res[a],
  4447. e = this._spriteSheet.getTexture(a);
  4448. e || (e = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4449. return e
  4450. };
  4451. return a
  4452. }
  4453. ();
  4454. b.DefaultMovieClipDelegate = e;
  4455. e.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4456. })(egret || (egret = {}));
  4457. __extends = this.__extends || function (b, d) {
  4458. function e() {
  4459. this.constructor = b
  4460. }
  4461. for (var a in d)
  4462. d.hasOwnProperty(a) && (b[a] = d[a]);
  4463. e.prototype = d.prototype;
  4464. b.prototype = new e
  4465. };
  4466. (function (b) {
  4467. var d = function (b) {
  4468. function a() {
  4469. b.call(this);
  4470. this._scaleY = this._scaleX = 1;
  4471. this._size = 30;
  4472. this._color = "#FFFFFF";
  4473. this._fontFamily = "Arial";
  4474. this._italic = this._bold = !1;
  4475. this._textAlign = "left";
  4476. this._multiline = this._visible = !1;
  4477. this._maxChars = 0
  4478. }
  4479. __extends(a, b);
  4480. a.prototype._getText = function () {
  4481. return null
  4482. };
  4483. a.prototype._setText = function (a) {};
  4484. a.prototype._setTextType = function (a) {};
  4485. a.prototype._getTextType = function () {
  4486. return null
  4487. };
  4488. a.prototype._open = function (a, b, e, d) {};
  4489. a.prototype._show = function () {};
  4490. a.prototype._add =
  4491. function () {};
  4492. a.prototype._remove = function () {};
  4493. a.prototype._hide = function () {};
  4494. a.prototype._addListeners = function () {};
  4495. a.prototype._removeListeners = function () {};
  4496. a.prototype._setScale = function (a, b) {
  4497. this._scaleX = a;
  4498. this._scaleY = b
  4499. };
  4500. a.prototype.changePosition = function (a, b) {};
  4501. a.prototype._setSize = function (a) {
  4502. this._size = a
  4503. };
  4504. a.prototype._setTextColor = function (a) {
  4505. this._color = a
  4506. };
  4507. a.prototype._setTextFontFamily = function (a) {
  4508. this._fontFamily = a
  4509. };
  4510. a.prototype._setBold = function (a) {
  4511. this._bold = a
  4512. };
  4513. a.prototype._setItalic =
  4514. function (a) {
  4515. this._italic = a
  4516. };
  4517. a.prototype._setTextAlign = function (a) {
  4518. this._textAlign = a
  4519. };
  4520. a.prototype._setVisible = function (a) {
  4521. this._visible = a
  4522. };
  4523. a.prototype._setWidth = function (a) {};
  4524. a.prototype._setHeight = function (a) {};
  4525. a.prototype._setMultiline = function (a) {
  4526. this._multiline = a
  4527. };
  4528. a.prototype._setMaxChars = function (a) {
  4529. this._maxChars = a
  4530. };
  4531. a.prototype._resetStageText = function () {};
  4532. a.create = function () {
  4533. return null
  4534. };
  4535. return a
  4536. }
  4537. (b.EventDispatcher);
  4538. b.StageText = d;
  4539. d.prototype.__class__ = "egret.StageText"
  4540. })(egret || (egret = {}));
  4541. (function (b) {
  4542. var d = function () {
  4543. function b() {}
  4544. b.GET = "get";
  4545. b.POST = "post";
  4546. return b
  4547. }
  4548. ();
  4549. b.URLRequestMethod = d;
  4550. d.prototype.__class__ = "egret.URLRequestMethod"
  4551. })(egret || (egret = {}));
  4552. (function (b) {
  4553. var d = function () {
  4554. function b() {}
  4555. b.BINARY = "binary";
  4556. b.TEXT = "text";
  4557. b.VARIABLES = "variables";
  4558. b.TEXTURE = "texture";
  4559. b.SOUND = "sound";
  4560. return b
  4561. }
  4562. ();
  4563. b.URLLoaderDataFormat = d;
  4564. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  4565. })(egret || (egret = {}));
  4566. __extends = this.__extends || function (b, d) {
  4567. function e() {
  4568. this.constructor = b
  4569. }
  4570. for (var a in d)
  4571. d.hasOwnProperty(a) && (b[a] = d[a]);
  4572. e.prototype = d.prototype;
  4573. b.prototype = new e
  4574. };
  4575. (function (b) {
  4576. var d = function (b) {
  4577. function a(a) {
  4578. void 0 === a && (a = null);
  4579. b.call(this);
  4580. null !== a && this.decode(a)
  4581. }
  4582. __extends(a, b);
  4583. a.prototype.decode = function (a) {
  4584. this.variables || (this.variables = {});
  4585. a = a.split("+").join(" ");
  4586. for (var b, e = /[?&]?([^=]+)=([^&]*)/g; b = e.exec(a); )
  4587. this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  4588. };
  4589. a.prototype.toString = function () {
  4590. if (!this.variables)
  4591. return "";
  4592. var a = this.variables,
  4593. b = "",
  4594. e = !0,
  4595. d;
  4596. for (d in a)
  4597. e ? e = !1 : b += "&", b += d + "=" + a[d];
  4598. return b
  4599. };
  4600. return a
  4601. }
  4602. (b.HashObject);
  4603. b.URLVariables =
  4604. d;
  4605. d.prototype.__class__ = "egret.URLVariables"
  4606. })(egret || (egret = {}));
  4607. __extends = this.__extends || function (b, d) {
  4608. function e() {
  4609. this.constructor = b
  4610. }
  4611. for (var a in d)
  4612. d.hasOwnProperty(a) && (b[a] = d[a]);
  4613. e.prototype = d.prototype;
  4614. b.prototype = new e
  4615. };
  4616. (function (b) {
  4617. var d = function (e) {
  4618. function a(a) {
  4619. void 0 === a && (a = null);
  4620. e.call(this);
  4621. this.method = b.URLRequestMethod.GET;
  4622. this.url = a
  4623. }
  4624. __extends(a, e);
  4625. return a
  4626. }
  4627. (b.HashObject);
  4628. b.URLRequest = d;
  4629. d.prototype.__class__ = "egret.URLRequest"
  4630. })(egret || (egret = {}));
  4631. __extends = this.__extends || function (b, d) {
  4632. function e() {
  4633. this.constructor = b
  4634. }
  4635. for (var a in d)
  4636. d.hasOwnProperty(a) && (b[a] = d[a]);
  4637. e.prototype = d.prototype;
  4638. b.prototype = new e
  4639. };
  4640. (function (b) {
  4641. var d = function (e) {
  4642. function a(a) {
  4643. void 0 === a && (a = null);
  4644. e.call(this);
  4645. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  4646. this._status = -1;
  4647. a && this.load(a)
  4648. }
  4649. __extends(a, e);
  4650. a.prototype.load = function (a) {
  4651. this._request = a;
  4652. this.data = null;
  4653. b.MainContext.instance.netContext.proceed(this)
  4654. };
  4655. return a
  4656. }
  4657. (b.EventDispatcher);
  4658. b.URLLoader = d;
  4659. d.prototype.__class__ = "egret.URLLoader"
  4660. })(egret || (egret = {}));
  4661. __extends = this.__extends || function (b, d) {
  4662. function e() {
  4663. this.constructor = b
  4664. }
  4665. for (var a in d)
  4666. d.hasOwnProperty(a) && (b[a] = d[a]);
  4667. e.prototype = d.prototype;
  4668. b.prototype = new e
  4669. };
  4670. (function (b) {
  4671. var d = function (e) {
  4672. function a() {
  4673. e.call(this);
  4674. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4675. }
  4676. __extends(a, e);
  4677. Object.defineProperty(a.prototype, "textureWidth", {
  4678. get : function () {
  4679. return this._textureWidth
  4680. },
  4681. enumerable : !0,
  4682. configurable : !0
  4683. });
  4684. Object.defineProperty(a.prototype, "textureHeight", {
  4685. get : function () {
  4686. return this._textureHeight
  4687. },
  4688. enumerable : !0,
  4689. configurable : !0
  4690. });
  4691. Object.defineProperty(a.prototype, "bitmapData", {
  4692. get : function () {
  4693. return this._bitmapData
  4694. },
  4695. enumerable : !0,
  4696. configurable : !0
  4697. });
  4698. a.prototype._setBitmapData = function (a) {
  4699. var e = b.MainContext.instance.rendererContext.texture_scale_factor;
  4700. this._bitmapData = a;
  4701. this._sourceWidth = a.width;
  4702. this._sourceHeight = a.height;
  4703. this._textureWidth = this._sourceWidth * e;
  4704. this._textureHeight = this._sourceHeight * e;
  4705. this._bitmapWidth = this._textureWidth;
  4706. this._bitmapHeight = this._textureHeight;
  4707. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4708. };
  4709. a.prototype.getPixel32 = function (a, b) {
  4710. return this._bitmapData.getContext("2d").getImageData(a,
  4711. b, 1, 1).data
  4712. };
  4713. return a
  4714. }
  4715. (b.HashObject);
  4716. b.Texture = d;
  4717. d.prototype.__class__ = "egret.Texture"
  4718. })(egret || (egret = {}));
  4719. __extends = this.__extends || function (b, d) {
  4720. function e() {
  4721. this.constructor = b
  4722. }
  4723. for (var a in d)
  4724. d.hasOwnProperty(a) && (b[a] = d[a]);
  4725. e.prototype = d.prototype;
  4726. b.prototype = new e
  4727. };
  4728. (function (b) {
  4729. var d = function (e) {
  4730. function a() {
  4731. e.call(this);
  4732. this._bitmapData = document.createElement("canvas");
  4733. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  4734. }
  4735. __extends(a, e);
  4736. a.prototype.drawToTexture = function (c) {
  4737. var e = this._bitmapData,
  4738. d = c.getBounds(b.Rectangle.identity);
  4739. if (0 == d.width || 0 == d.height)
  4740. return b.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4741. d.width = Math.floor(d.width);
  4742. d.height = Math.floor(d.height);
  4743. e.width = d.width;
  4744. e.height = d.height;
  4745. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = d.width, this.renderContext._cacheCanvas.height = d.height);
  4746. a.identityRectangle.width = d.width;
  4747. a.identityRectangle.height = d.height;
  4748. c._worldTransform.identity();
  4749. c.worldAlpha = 1;
  4750. if (c instanceof b.DisplayObjectContainer) {
  4751. var e = c._anchorOffsetX,
  4752. m = c._anchorOffsetY;
  4753. if (0 != c._anchorX || 0 != c._anchorY)
  4754. e = c._anchorX * d.width, m = c._anchorY * d.height;
  4755. this._offsetX = d.x + e;
  4756. this._offsetY = d.y +
  4757. m;
  4758. c._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4759. d = c._children;
  4760. e = 0;
  4761. for (m = d.length; e < m; e++)
  4762. d[e]._updateTransform()
  4763. }
  4764. d = b.RenderFilter.getInstance();
  4765. e = d._drawAreaList.concat();
  4766. d._drawAreaList.length = 0;
  4767. this.renderContext.clearScreen();
  4768. this.renderContext.onRenderStart();
  4769. this.webGLTexture = null;
  4770. (m = c.mask || c._scrollRect) && this.renderContext.pushMask(m);
  4771. c._render(this.renderContext);
  4772. m && this.renderContext.popMask();
  4773. d.addDrawArea(a.identityRectangle);
  4774. this.renderContext.onRenderFinish();
  4775. d._drawAreaList =
  4776. e;
  4777. this._textureWidth = this._bitmapData.width;
  4778. this._textureHeight = this._bitmapData.height;
  4779. this._sourceWidth = this._textureWidth;
  4780. this._sourceHeight = this._textureHeight;
  4781. return !0
  4782. };
  4783. a.identityRectangle = new b.Rectangle;
  4784. return a
  4785. }
  4786. (b.Texture);
  4787. b.RenderTexture = d;
  4788. d.prototype.__class__ = "egret.RenderTexture"
  4789. })(egret || (egret = {}));
  4790. __extends = this.__extends || function (b, d) {
  4791. function e() {
  4792. this.constructor = b
  4793. }
  4794. for (var a in d)
  4795. d.hasOwnProperty(a) && (b[a] = d[a]);
  4796. e.prototype = d.prototype;
  4797. b.prototype = new e
  4798. };
  4799. (function (b) {
  4800. var d = function (e) {
  4801. function a() {
  4802. e.call(this);
  4803. this.renderCost = 0;
  4804. this.texture_scale_factor = 1;
  4805. this.profiler = b.Profiler.getInstance()
  4806. }
  4807. __extends(a, e);
  4808. a.prototype.clearScreen = function () {};
  4809. a.prototype.clearRect = function (a, b, e, d) {};
  4810. a.prototype.drawImage = function (a, b, e, d, g, f, h, n, p, q) {
  4811. this.profiler.onDrawImage()
  4812. };
  4813. a.prototype.setTransform = function (a) {};
  4814. a.prototype.setAlpha = function (a, b) {};
  4815. a.prototype.setupFont = function (a, b) {};
  4816. a.prototype.measureText = function (a) {
  4817. return 0
  4818. };
  4819. a.prototype.drawText = function (a,
  4820. b, e, d, g, f) {
  4821. this.profiler.onDrawImage()
  4822. };
  4823. a.prototype.strokeRect = function (a, b, e, d, g) {};
  4824. a.prototype.pushMask = function (a) {};
  4825. a.prototype.popMask = function () {};
  4826. a.prototype.onRenderStart = function () {};
  4827. a.prototype.onRenderFinish = function () {};
  4828. a.prototype.setGlobalColorTransform = function (a) {};
  4829. a.createRendererContext = function (a) {
  4830. return null
  4831. };
  4832. a.imageSmoothingEnabled = !0;
  4833. return a
  4834. }
  4835. (b.HashObject);
  4836. b.RendererContext = d;
  4837. d.prototype.__class__ = "egret.RendererContext"
  4838. })(egret || (egret = {}));
  4839. (function (b) {
  4840. var d = function () {
  4841. function b() {}
  4842. b.MOUSE = "mouse";
  4843. b.TOUCH = "touch";
  4844. b.mode = "touch";
  4845. return b
  4846. }
  4847. ();
  4848. b.InteractionMode = d;
  4849. d.prototype.__class__ = "egret.InteractionMode"
  4850. })(egret || (egret = {}));
  4851. __extends = this.__extends || function (b, d) {
  4852. function e() {
  4853. this.constructor = b
  4854. }
  4855. for (var a in d)
  4856. d.hasOwnProperty(a) && (b[a] = d[a]);
  4857. e.prototype = d.prototype;
  4858. b.prototype = new e
  4859. };
  4860. (function (b) {
  4861. var d = function (e) {
  4862. function a() {
  4863. e.call(this);
  4864. this._currentTouchTarget = {};
  4865. this.maxTouches = 2;
  4866. this.touchDownTarget = {};
  4867. this.touchingIdentifiers = [];
  4868. this.lastTouchY = this.lastTouchX = -1
  4869. }
  4870. __extends(a, e);
  4871. a.prototype.run = function () {};
  4872. a.prototype.getTouchData = function (a, b, e) {
  4873. var d = this._currentTouchTarget[a];
  4874. null == d && (d = {}, this._currentTouchTarget[a] = d);
  4875. d.stageX = b;
  4876. d.stageY = e;
  4877. d.identifier = a;
  4878. return d
  4879. };
  4880. a.prototype.dispatchEvent = function (a, e) {
  4881. b.TouchEvent.dispatchTouchEvent(e.target, a, e.identifier, e.stageX,
  4882. e.stageY, !1, !1, !1, !0 == this.touchDownTarget[e.identifier])
  4883. };
  4884. a.prototype.onTouchBegan = function (a, e, d) {
  4885. if (this.touchingIdentifiers.length != this.maxTouches) {
  4886. var m = b.MainContext.instance.stage.hitTest(a, e);
  4887. m && (a = this.getTouchData(d, a, e), this.touchDownTarget[d] = !0, a.target = m, a.beginTarget = m, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  4888. this.touchingIdentifiers.push(d)
  4889. }
  4890. };
  4891. a.prototype.onTouchMove = function (a, e, d) {
  4892. if (-1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || e != this.lastTouchY)) {
  4893. this.lastTouchX =
  4894. a;
  4895. this.lastTouchY = e;
  4896. var m = b.MainContext.instance.stage.hitTest(a, e);
  4897. m && (a = this.getTouchData(d, a, e), a.target = m, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  4898. }
  4899. };
  4900. a.prototype.onTouchEnd = function (a, e, d) {
  4901. var m = this.touchingIdentifiers.indexOf(d);
  4902. -1 != m && (this.touchingIdentifiers.splice(m, 1), m = b.MainContext.instance.stage.hitTest(a, e)) && (a = this.getTouchData(d, a, e), delete this.touchDownTarget[d], d = a.beginTarget, a.target = m, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == m ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  4903. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4904. };
  4905. return a
  4906. }
  4907. (b.HashObject);
  4908. b.TouchContext = d;
  4909. d.prototype.__class__ = "egret.TouchContext"
  4910. })(egret || (egret = {}));
  4911. __extends = this.__extends || function (b, d) {
  4912. function e() {
  4913. this.constructor = b
  4914. }
  4915. for (var a in d)
  4916. d.hasOwnProperty(a) && (b[a] = d[a]);
  4917. e.prototype = d.prototype;
  4918. b.prototype = new e
  4919. };
  4920. (function (b) {
  4921. var d = function (e) {
  4922. function a() {
  4923. e.call(this)
  4924. }
  4925. __extends(a, e);
  4926. a.prototype.proceed = function (a) {};
  4927. a._getUrl = function (a) {
  4928. var e = a.url;
  4929. -1 == e.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (e = e + "?" + a.data.toString());
  4930. return e
  4931. };
  4932. a.prototype.getChangeList = function () {
  4933. return []
  4934. };
  4935. return a
  4936. }
  4937. (b.HashObject);
  4938. b.NetContext = d;
  4939. d.prototype.__class__ = "egret.NetContext"
  4940. })(egret || (egret = {}));
  4941. __extends = this.__extends || function (b, d) {
  4942. function e() {
  4943. this.constructor = b
  4944. }
  4945. for (var a in d)
  4946. d.hasOwnProperty(a) && (b[a] = d[a]);
  4947. e.prototype = d.prototype;
  4948. b.prototype = new e
  4949. };
  4950. (function (b) {
  4951. var d = function (b) {
  4952. function a() {
  4953. b.call(this);
  4954. this.frameRate = 60
  4955. }
  4956. __extends(a, b);
  4957. a.prototype.executeMainLoop = function (a, b) {};
  4958. return a
  4959. }
  4960. (b.HashObject);
  4961. b.DeviceContext = d;
  4962. d.prototype.__class__ = "egret.DeviceContext"
  4963. })(egret || (egret = {}));
  4964. (function (b) {
  4965. var d = function () {
  4966. function b() {}
  4967. b.call = function (a, c) {};
  4968. b.addCallback = function (a, c) {};
  4969. return b
  4970. }
  4971. ();
  4972. b.ExternalInterface = d;
  4973. d.prototype.__class__ = "egret.ExternalInterface"
  4974. })(egret || (egret = {}));
  4975. __extends = this.__extends || function (b, d) {
  4976. function e() {
  4977. this.constructor = b
  4978. }
  4979. for (var a in d)
  4980. d.hasOwnProperty(a) && (b[a] = d[a]);
  4981. e.prototype = d.prototype;
  4982. b.prototype = new e
  4983. };
  4984. (function (b) {
  4985. var d = function (e) {
  4986. function a() {
  4987. e.call(this);
  4988. this.ua = navigator.userAgent.toLowerCase();
  4989. this.trans = this._getTrans()
  4990. }
  4991. __extends(a, e);
  4992. a.getInstance = function () {
  4993. null == a.instance && (a.instance = new a);
  4994. return a.instance
  4995. };
  4996. Object.defineProperty(a.prototype, "isMobile", {
  4997. get : function () {
  4998. 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 ");
  4999. return b.MainContext.deviceType ==
  5000. b.MainContext.DEVICE_MOBILE
  5001. },
  5002. enumerable : !0,
  5003. configurable : !0
  5004. });
  5005. a.prototype._getHeader = function (a) {
  5006. if ("transform" in a)
  5007. return "";
  5008. for (var b = ["webkit", "ms", "Moz", "O"], e = 0; e < b.length; e++)
  5009. if (b[e] + "Transform" in a)
  5010. return b[e];
  5011. return ""
  5012. };
  5013. a.prototype._getTrans = function () {
  5014. var a = document.createElement("div").style,
  5015. a = this._getHeader(a);
  5016. return "" == a ? "transform" : a + "Transform"
  5017. };
  5018. a.prototype.$new = function (a) {
  5019. return this.$(document.createElement(a))
  5020. };
  5021. a.prototype.$ = function (c) {
  5022. var e = document;
  5023. if (c = c instanceof HTMLElement ?
  5024. c : e.querySelector(c))
  5025. c.find = c.find || this.$, c.hasClass = c.hasClass || function (a) {
  5026. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  5027. },
  5028. c.addClass = c.addClass || function (a) {
  5029. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  5030. return this
  5031. },
  5032. c.removeClass = c.removeClass || function (a) {
  5033. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  5034. return this
  5035. },
  5036. c.remove = c.remove || function () {},
  5037. c.appendTo = c.appendTo || function (a) {
  5038. a.appendChild(this);
  5039. return this
  5040. },
  5041. c.prependTo = c.prependTo ||
  5042. function (a) {
  5043. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  5044. return this
  5045. },
  5046. c.transforms = c.transforms || function () {
  5047. 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);
  5048. return this
  5049. },
  5050. c.position = c.position || {
  5051. x : 0,
  5052. y : 0
  5053. },
  5054. c.rotation = c.rotation || 0,
  5055. c.scale = c.scale || {
  5056. x : 1,
  5057. y : 1
  5058. },
  5059. c.skew = c.skew || {
  5060. x : 0,
  5061. y : 0
  5062. },
  5063. c.translates = function (a, c) {
  5064. this.position.x = a;
  5065. this.position.y = c -
  5066. b.MainContext.instance.stage.stageHeight;
  5067. this.transforms();
  5068. return this
  5069. },
  5070. c.rotate = function (a) {
  5071. this.rotation = a;
  5072. this.transforms();
  5073. return this
  5074. },
  5075. c.resize = function (a, c) {
  5076. this.scale.x = a;
  5077. this.scale.y = c;
  5078. this.transforms();
  5079. return this
  5080. },
  5081. c.setSkew = function (a, c) {
  5082. this.skew.x = a;
  5083. this.skew.y = c;
  5084. this.transforms();
  5085. return this
  5086. };
  5087. return c
  5088. };
  5089. a.prototype.translate = function (a) {
  5090. return "translate(" + a.x + "px, " + a.y + "px) "
  5091. };
  5092. a.prototype.rotate = function (a) {
  5093. return "rotate(" + a + "deg) "
  5094. };
  5095. a.prototype.scale = function (a) {
  5096. return "scale(" + a.x + ", " +
  5097. a.y + ") "
  5098. };
  5099. a.prototype.skew = function (a) {
  5100. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5101. };
  5102. return a
  5103. }
  5104. (b.HashObject);
  5105. b.Browser = d;
  5106. d.prototype.__class__ = "egret.Browser"
  5107. })(egret || (egret = {}));
  5108. (function (b) {
  5109. (function (b) {
  5110. b.getItem = function (b) {
  5111. return null
  5112. };
  5113. b.setItem = function (b, a) {
  5114. return !1
  5115. };
  5116. b.removeItem = function (b) {};
  5117. b.clear = function () {}
  5118. })(b.localStorage || (b.localStorage = {}))
  5119. })(egret || (egret = {}));
  5120. (function (b) {
  5121. var d = function () {
  5122. function e() {}
  5123. e.parse = function (a) {
  5124. a = b.SAXParser.getInstance().parserXML(a);
  5125. if (!a || !a.childNodes)
  5126. return null;
  5127. for (var c = a.childNodes.length, d = !1, l = 0; l < c; l++) {
  5128. var m = a.childNodes[l];
  5129. if (1 == m.nodeType) {
  5130. d = !0;
  5131. break
  5132. }
  5133. }
  5134. return d ? e.parseNode(m) : null
  5135. };
  5136. e.parseNode = function (a) {
  5137. if (!a || 1 != a.nodeType)
  5138. return null;
  5139. var c = {};
  5140. c.localName = a.localName;
  5141. c.name = a.nodeName;
  5142. a.namespaceURI && (c.namespace = a.namespaceURI);
  5143. a.prefix && (c.prefix = a.prefix);
  5144. for (var b = a.attributes, d = b.length, m = 0; m < d; m++) {
  5145. var g =
  5146. b[m],
  5147. f = g.name;
  5148. 0 != f.indexOf("xmlns:") && (c["$" + f] = g.value)
  5149. }
  5150. b = a.childNodes;
  5151. d = b.length;
  5152. for (m = 0; m < d; m++)
  5153. if (g = e.parseNode(b[m]))
  5154. c.children || (c.children = []), g.parent = c, c.children.push(g);
  5155. !c.children && (a = a.textContent.trim()) && (c.text = a);
  5156. return c
  5157. };
  5158. e.findChildren = function (a, c, b) {
  5159. b ? b.length = 0 : b = [];
  5160. e.findByPath(a, c, b);
  5161. return b
  5162. };
  5163. e.findByPath = function (a, c, b) {
  5164. var d = c.indexOf("."),
  5165. m;
  5166. -1 == d ? (m = c, d = !0) : (m = c.substring(0, d), c = c.substring(d + 1), d = !1);
  5167. if (a = a.children)
  5168. for (var g = a.length, f = 0; f < g; f++) {
  5169. var h = a[f];
  5170. h.localName ==
  5171. m && (d ? b.push(h) : e.findByPath(h, c, b))
  5172. }
  5173. };
  5174. e.getAttributes = function (a, c) {
  5175. c ? c.length = 0 : c = [];
  5176. for (var b in a)
  5177. "$" == b.charAt(0) && c.push(b.substring(1));
  5178. return c
  5179. };
  5180. return e
  5181. }
  5182. ();
  5183. b.XML = d;
  5184. d.prototype.__class__ = "egret.XML"
  5185. })(egret || (egret = {}));
  5186. (function (b) {
  5187. var d = function () {
  5188. function a() {}
  5189. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5190. a.BIG_ENDIAN = "BIG_ENDIAN";
  5191. return a
  5192. }
  5193. ();
  5194. b.Endian = d;
  5195. d.prototype.__class__ = "egret.Endian";
  5196. var e = function () {
  5197. function a() {
  5198. this.length = this.position = 0;
  5199. this._mode = "";
  5200. this.maxlength = 0;
  5201. this._endian = d.LITTLE_ENDIAN;
  5202. this.isLittleEndian = !1;
  5203. this._mode = "Typed array";
  5204. this.maxlength = 4;
  5205. this.arraybytes = new ArrayBuffer(this.maxlength);
  5206. this.unalignedarraybytestemp = new ArrayBuffer(16);
  5207. this.endian = a.DEFAULT_ENDIAN
  5208. }
  5209. Object.defineProperty(a.prototype,
  5210. "endian", {
  5211. get : function () {
  5212. return this._endian
  5213. },
  5214. set : function (a) {
  5215. this._endian = a;
  5216. this.isLittleEndian = a == d.LITTLE_ENDIAN
  5217. },
  5218. enumerable : !0,
  5219. configurable : !0
  5220. });
  5221. a.prototype.ensureWriteableSpace = function (a) {
  5222. this.ensureSpace(a + this.position)
  5223. };
  5224. a.prototype.setArrayBuffer = function (a) {
  5225. this.ensureSpace(a.byteLength);
  5226. this.length = a.byteLength;
  5227. a = new Int8Array(a);
  5228. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  5229. this.position = 0
  5230. };
  5231. Object.defineProperty(a.prototype, "bytesAvailable", {
  5232. get : function () {
  5233. return this.length - this.position
  5234. },
  5235. enumerable : !0,
  5236. configurable : !0
  5237. });
  5238. a.prototype.ensureSpace = function (a) {
  5239. if (a > this.maxlength) {
  5240. a = a + 255 & -256;
  5241. var b = new ArrayBuffer(a),
  5242. e = new Uint8Array(this.arraybytes, 0, this.length);
  5243. (new Uint8Array(b, 0, this.length)).set(e);
  5244. this.arraybytes = b;
  5245. this.maxlength = a
  5246. }
  5247. };
  5248. a.prototype.writeByte = function (a) {
  5249. this.ensureWriteableSpace(1);
  5250. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  5251. this.position > this.length && (this.length = this.position)
  5252. };
  5253. a.prototype.readByte = function () {
  5254. if (this.position >= this.length)
  5255. throw "ByteArray out of bounds read. Positon=" +
  5256. this.position + ", Length=" + this.length;
  5257. return (new Int8Array(this.arraybytes))[this.position++]
  5258. };
  5259. a.prototype.readBytes = function (a, b, e) {
  5260. void 0 === b && (b = 0);
  5261. void 0 === e && (e = 0);
  5262. null == e && (e = a.length);
  5263. a.ensureWriteableSpace(b + e);
  5264. var d = new Int8Array(a.arraybytes),
  5265. g = new Int8Array(this.arraybytes);
  5266. d.set(g.subarray(this.position, this.position + e), b);
  5267. this.position += e;
  5268. e + b > a.length && (a.length += e + b - a.length)
  5269. };
  5270. a.prototype.writeUnsignedByte = function (a) {
  5271. this.ensureWriteableSpace(1);
  5272. (new Uint8Array(this.arraybytes))[this.position++] =
  5273. ~~a & 255;
  5274. this.position > this.length && (this.length = this.position)
  5275. };
  5276. a.prototype.readUnsignedByte = function () {
  5277. if (this.position >= this.length)
  5278. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  5279. return (new Uint8Array(this.arraybytes))[this.position++]
  5280. };
  5281. a.prototype.writeUnsignedShort = function (a) {
  5282. this.ensureWriteableSpace(2);
  5283. if (0 == (this.position & 1)) {
  5284. var b = new Uint16Array(this.arraybytes);
  5285. b[this.position >> 1] = ~~a & 65535
  5286. } else
  5287. b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] =
  5288. ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  5289. this.position += 2;
  5290. this.position > this.length && (this.length = this.position)
  5291. };
  5292. a.prototype.readUTFBytes = function (a) {
  5293. var b = "";
  5294. a = this.position + a;
  5295. for (var e = new DataView(this.arraybytes); this.position < a; ) {
  5296. var d = e.getUint8(this.position++);
  5297. if (128 > d) {
  5298. if (0 == d)
  5299. break;
  5300. b += String.fromCharCode(d)
  5301. } else if (224 > d)
  5302. b += String.fromCharCode((d & 63) << 6 | e.getUint8(this.position++) & 127);
  5303. else if (240 > d)
  5304. var g = e.getUint8(this.position++),
  5305. b = b + String.fromCharCode((d & 31) << 12 | (g & 127) << 6 | e.getUint8(this.position++) & 127);
  5306. else
  5307. var g = e.getUint8(this.position++), f = e.getUint8(this.position++), b = b + String.fromCharCode((d & 15) << 18 | (g & 127) << 12 | f << 6 & 127 | e.getUint8(this.position++) & 127)
  5308. }
  5309. return b
  5310. };
  5311. a.prototype.readInt = function () {
  5312. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  5313. this.position += 4;
  5314. return a
  5315. };
  5316. a.prototype.readShort = function () {
  5317. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  5318. this.position += 2;
  5319. return a
  5320. };
  5321. a.prototype.readDouble = function () {
  5322. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  5323. this.position += 8;
  5324. return a
  5325. };
  5326. a.prototype.readUnsignedShort = function () {
  5327. if (this.position > this.length + 2)
  5328. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5329. if (0 == (this.position & 1)) {
  5330. var a = new Uint16Array(this.arraybytes),
  5331. b = this.position >> 1;
  5332. this.position += 2;
  5333. return a[b]
  5334. }
  5335. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  5336. b = new Uint8Array(this.arraybytes,
  5337. this.position, 2);
  5338. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  5339. this.position += 2;
  5340. return a[0]
  5341. };
  5342. a.prototype.writeUnsignedInt = function (a) {
  5343. this.ensureWriteableSpace(4);
  5344. if (0 == (this.position & 3)) {
  5345. var b = new Uint32Array(this.arraybytes);
  5346. b[this.position >> 2] = ~~a & 4294967295
  5347. } else
  5348. 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);
  5349. this.position += 4;
  5350. this.position > this.length &&
  5351. (this.length = this.position)
  5352. };
  5353. a.prototype.readUnsignedInt = function () {
  5354. if (this.position > this.length + 4)
  5355. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5356. if (0 == (this.position & 3)) {
  5357. var a = new Uint32Array(this.arraybytes),
  5358. b = this.position >> 2;
  5359. this.position += 4;
  5360. return a[b]
  5361. }
  5362. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  5363. b = new Uint8Array(this.arraybytes, this.position, 4);
  5364. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5365. this.position += 4;
  5366. return a[0]
  5367. };
  5368. a.prototype.writeFloat =
  5369. function (a) {
  5370. this.ensureWriteableSpace(4);
  5371. if (0 == (this.position & 3)) {
  5372. var b = new Float32Array(this.arraybytes);
  5373. b[this.position >> 2] = a
  5374. } else
  5375. 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);
  5376. this.position += 4;
  5377. this.position > this.length && (this.length = this.position)
  5378. };
  5379. a.prototype.readFloat = function () {
  5380. if (this.position > this.length + 4)
  5381. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  5382. this.length;
  5383. if (0 == (this.position & 3)) {
  5384. var a = new Float32Array(this.arraybytes),
  5385. b = this.position >> 2;
  5386. this.position += 4;
  5387. return a[b]
  5388. }
  5389. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  5390. b = new Uint8Array(this.arraybytes, this.position, 4);
  5391. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5392. this.position += 4;
  5393. return a[0]
  5394. };
  5395. a.DEFAULT_ENDIAN = d.BIG_ENDIAN;
  5396. return a
  5397. }
  5398. ();
  5399. b.ByteArray = e;
  5400. e.prototype.__class__ = "egret.ByteArray"
  5401. })(egret || (egret = {}));
  5402. __extends = this.__extends || function (b, d) {
  5403. function e() {
  5404. this.constructor = b
  5405. }
  5406. for (var a in d)
  5407. d.hasOwnProperty(a) && (b[a] = d[a]);
  5408. e.prototype = d.prototype;
  5409. b.prototype = new e
  5410. };
  5411. (function (b) {
  5412. var d = function (e) {
  5413. function a(a, b, d) {
  5414. e.call(this);
  5415. this._target = null;
  5416. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5417. this._actions = this._steps = this.pluginData = null;
  5418. this.paused = !1;
  5419. this.duration = 0;
  5420. this._prevPos = -1;
  5421. this.position = null;
  5422. this._stepPosition = this._prevPosition = 0;
  5423. this.passive = !1;
  5424. this.initialize(a, b, d)
  5425. }
  5426. __extends(a, e);
  5427. a.get = function (c, b, e, d) {
  5428. void 0 === b && (b = null);
  5429. void 0 === e && (e = null);
  5430. void 0 === d && (d = !1);
  5431. d && a.removeTweens(c);
  5432. return new a(c, b, e)
  5433. };
  5434. a.removeTweens = function (c) {
  5435. if (c.tween_count) {
  5436. for (var b =
  5437. a._tweens, e = b.length - 1; 0 <= e; e--)
  5438. b[e]._target == c && (b[e].paused = !0, b.splice(e, 1));
  5439. c.tween_count = 0
  5440. }
  5441. };
  5442. a.pauseTweens = function (a) {
  5443. if (a.tween_count)
  5444. for (var e = b.Tween._tweens, d = e.length - 1; 0 <= d; d--)
  5445. e[d]._target == a && (e[d].paused = !0)
  5446. };
  5447. a.resumeTweens = function (a) {
  5448. if (a.tween_count)
  5449. for (var e = b.Tween._tweens, d = e.length - 1; 0 <= d; d--)
  5450. e[d]._target == a && (e[d].paused = !1)
  5451. };
  5452. a.tick = function (c, b) {
  5453. void 0 === b && (b = !1);
  5454. for (var e = a._tweens.concat(), d = e.length - 1; 0 <= d; d--) {
  5455. var g = e[d];
  5456. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
  5457. 1 : c)
  5458. }
  5459. };
  5460. a._register = function (c, e) {
  5461. var d = c._target,
  5462. m = a._tweens;
  5463. if (e)
  5464. d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), m.push(c), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5465. else
  5466. for (d && d.tween_count--, d = m.length; d--; )
  5467. if (m[d] == c) {
  5468. m.splice(d, 1);
  5469. break
  5470. }
  5471. };
  5472. a.removeAllTweens = function () {
  5473. for (var c = a._tweens, b = 0, e = c.length; b < e; b++) {
  5474. var d = c[b];
  5475. d.paused = !0;
  5476. d._target.tweenjs_count = 0
  5477. }
  5478. c.length = 0
  5479. };
  5480. a.prototype.initialize = function (c, b, e) {
  5481. this._target = c;
  5482. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  5483. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(c));
  5484. this.pluginData = e || {};
  5485. this._curQueueProps = {};
  5486. this._initQueueProps = {};
  5487. this._steps = [];
  5488. this._actions = [];
  5489. b && b.paused ? this.paused = !0 : a._register(this, !0);
  5490. b && null != b.position && this.setPosition(b.position, a.NONE)
  5491. };
  5492. a.prototype.setPosition = function (a, b) {
  5493. void 0 === b && (b = 1);
  5494. 0 > a && (a = 0);
  5495. var e = a,
  5496. d = !1;
  5497. e >= this.duration && (this.loop ? e %= this.duration : (e = this.duration, d = !0));
  5498. if (e == this._prevPos)
  5499. return d;
  5500. var g = this._prevPos;
  5501. this.position = this._prevPos = e;
  5502. this._prevPosition = a;
  5503. if (this._target)
  5504. if (d)
  5505. this._updateTargetProps(null, 1);
  5506. else if (0 < this._steps.length) {
  5507. for (var f = 0, h = this._steps.length; f < h && !(this._steps[f].t > e); f++);
  5508. f = this._steps[f - 1];
  5509. this._updateTargetProps(f, (this._stepPosition = e - f.t) / f.d)
  5510. }
  5511. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(e, e) : 1 == b && e < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, e, !0)) : this._runActions(g, e));
  5512. d && this.setPaused(!0);
  5513. this.dispatchEventWith("change");
  5514. return d
  5515. };
  5516. a.prototype._runActions = function (a, b, e) {
  5517. void 0 === e && (e = !1);
  5518. var d = a,
  5519. g = b,
  5520. f = -1,
  5521. h = this._actions.length,
  5522. n = 1;
  5523. a > b && (d = b, g = a, f = h, h = n = -1);
  5524. for (; (f += n) != h; ) {
  5525. b = this._actions[f];
  5526. var p = b.t;
  5527. (p == g || p > d && p < g || e && p == a) && b.f.apply(b.o, b.p)
  5528. }
  5529. };
  5530. a.prototype._updateTargetProps = function (c, b) {
  5531. var e,
  5532. d,
  5533. g,
  5534. f;
  5535. if (c || 1 != b) {
  5536. if (this.passive = !!c.v)
  5537. return;
  5538. c.e && (b = c.e(b, 0, 1, 1));
  5539. e = c.p0;
  5540. d = c.p1
  5541. } else
  5542. this.passive = !1, e = d = this._curQueueProps;
  5543. for (var h in this._initQueueProps) {
  5544. null == (g = e[h]) && (e[h] = g = this._initQueueProps[h]);
  5545. null ==
  5546. (f = d[h]) && (d[h] = f = g);
  5547. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f : g : g + (f - g) * b;
  5548. var n = !1;
  5549. if (f = a._plugins[h])
  5550. for (var p = 0, q = f.length; p < q; p++) {
  5551. var r = f[p].tween(this, h, g, e, d, b, !!c && e == d, !c);
  5552. r == a.IGNORE ? n = !0 : g = r
  5553. }
  5554. n || (this._target[h] = g)
  5555. }
  5556. };
  5557. a.prototype.setPaused = function (c) {
  5558. this.paused = c;
  5559. a._register(this, !c);
  5560. return this
  5561. };
  5562. a.prototype._cloneProps = function (a) {
  5563. var b = {},
  5564. e;
  5565. for (e in a)
  5566. b[e] = a[e];
  5567. return b
  5568. };
  5569. a.prototype._addStep = function (a) {
  5570. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5571. return this
  5572. };
  5573. a.prototype._appendQueueProps = function (c) {
  5574. var b,
  5575. e,
  5576. d,
  5577. g,
  5578. f,
  5579. h;
  5580. for (h in c)
  5581. if (void 0 === this._initQueueProps[h]) {
  5582. e = this._target[h];
  5583. if (b = a._plugins[h])
  5584. for (d = 0, g = b.length; d < g; d++)
  5585. e = b[d].init(this, h, e);
  5586. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === e ? null : e
  5587. }
  5588. for (h in c) {
  5589. e = this._curQueueProps[h];
  5590. if (b = a._plugins[h])
  5591. for (f = f || {}, d = 0, g = b.length; d < g; d++)
  5592. b[d].step && b[d].step(this, h, e, c[h], f);
  5593. this._curQueueProps[h] = c[h]
  5594. }
  5595. f && this._appendQueueProps(f);
  5596. return this._curQueueProps
  5597. };
  5598. a.prototype._addAction = function (a) {
  5599. a.t =
  5600. this.duration;
  5601. this._actions.push(a);
  5602. return this
  5603. };
  5604. a.prototype._set = function (a, b) {
  5605. for (var e in a)
  5606. b[e] = a[e]
  5607. };
  5608. a.prototype.wait = function (a, b) {
  5609. if (null == a || 0 >= a)
  5610. return this;
  5611. var e = this._cloneProps(this._curQueueProps);
  5612. return this._addStep({
  5613. d : a,
  5614. p0 : e,
  5615. p1 : e,
  5616. v : b
  5617. })
  5618. };
  5619. a.prototype.to = function (a, b, e) {
  5620. void 0 === e && (e = void 0);
  5621. if (isNaN(b) || 0 > b)
  5622. b = 0;
  5623. return this._addStep({
  5624. d : b || 0,
  5625. p0 : this._cloneProps(this._curQueueProps),
  5626. e : e,
  5627. p1 : this._cloneProps(this._appendQueueProps(a))
  5628. })
  5629. };
  5630. a.prototype.call = function (a, b, e) {
  5631. void 0 === b && (b = void 0);
  5632. void 0 === e && (e = void 0);
  5633. return this._addAction({
  5634. f : a,
  5635. p : e ? e : [],
  5636. o : b ? b : this._target
  5637. })
  5638. };
  5639. a.prototype.set = function (a, b) {
  5640. void 0 === b && (b = null);
  5641. return this._addAction({
  5642. f : this._set,
  5643. o : this,
  5644. p : [a, b ? b : this._target]
  5645. })
  5646. };
  5647. a.prototype.play = function (a) {
  5648. a || (a = this);
  5649. return this.call(a.setPaused, a, [!1])
  5650. };
  5651. a.prototype.pause = function (a) {
  5652. a || (a = this);
  5653. return this.call(a.setPaused, a, [!0])
  5654. };
  5655. a.prototype.tick = function (a) {
  5656. this.paused || this.setPosition(this._prevPosition + a)
  5657. };
  5658. a.NONE = 0;
  5659. a.LOOP = 1;
  5660. a.REVERSE = 2;
  5661. a._tweens = [];
  5662. a.IGNORE = {};
  5663. a._plugins = {};
  5664. a._inited = !1;
  5665. return a
  5666. }
  5667. (b.EventDispatcher);
  5668. b.Tween = d;
  5669. d.prototype.__class__ = "egret.Tween"
  5670. })(egret || (egret = {}));
  5671. (function (b) {
  5672. var d = function () {
  5673. function e() {
  5674. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5675. }
  5676. e.get = function (a) {
  5677. -1 > a && (a = -1);
  5678. 1 < a && (a = 1);
  5679. return function (c) {
  5680. return 0 == a ? c : 0 > a ? c * (c * -a + 1 + a) : c * ((2 - c) * a + (1 - a))
  5681. }
  5682. };
  5683. e.getPowIn = function (a) {
  5684. return function (c) {
  5685. return Math.pow(c, a)
  5686. }
  5687. };
  5688. e.getPowOut = function (a) {
  5689. return function (c) {
  5690. return 1 - Math.pow(1 - c, a)
  5691. }
  5692. };
  5693. e.getPowInOut = function (a) {
  5694. return function (c) {
  5695. return 1 > (c *= 2) ? 0.5 * Math.pow(c, a) : 1 - 0.5 * Math.abs(Math.pow(2 - c, a))
  5696. }
  5697. };
  5698. e.sineIn = function (a) {
  5699. return 1 - Math.cos(a *
  5700. Math.PI / 2)
  5701. };
  5702. e.sineOut = function (a) {
  5703. return Math.sin(a * Math.PI / 2)
  5704. };
  5705. e.sineInOut = function (a) {
  5706. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5707. };
  5708. e.getBackIn = function (a) {
  5709. return function (c) {
  5710. return c * c * ((a + 1) * c - a)
  5711. }
  5712. };
  5713. e.getBackOut = function (a) {
  5714. return function (c) {
  5715. return --c * c * ((a + 1) * c + a) + 1
  5716. }
  5717. };
  5718. e.getBackInOut = function (a) {
  5719. a *= 1.525;
  5720. return function (c) {
  5721. return 1 > (c *= 2) ? 0.5 * c * c * ((a + 1) * c - a) : 0.5 * ((c -= 2) * c * ((a + 1) * c + a) + 2)
  5722. }
  5723. };
  5724. e.circIn = function (a) {
  5725. return - (Math.sqrt(1 - a * a) - 1)
  5726. };
  5727. e.circOut = function (a) {
  5728. return Math.sqrt(1 - --a * a)
  5729. };
  5730. e.circInOut = function (a) {
  5731. return 1 >
  5732. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5733. };
  5734. e.bounceIn = function (a) {
  5735. return 1 - e.bounceOut(1 - a)
  5736. };
  5737. e.bounceOut = function (a) {
  5738. 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
  5739. };
  5740. e.bounceInOut = function (a) {
  5741. return 0.5 > a ? 0.5 * e.bounceIn(2 * a) : 0.5 * e.bounceOut(2 * a - 1) + 0.5
  5742. };
  5743. e.getElasticIn = function (a, c) {
  5744. var b = 2 * Math.PI;
  5745. return function (e) {
  5746. if (0 == e || 1 == e)
  5747. return e;
  5748. var d = c / b * Math.asin(1 / a);
  5749. return - (a * Math.pow(2, 10 *
  5750. (e -= 1)) * Math.sin((e - d) * b / c))
  5751. }
  5752. };
  5753. e.getElasticOut = function (a, c) {
  5754. var b = 2 * Math.PI;
  5755. return function (e) {
  5756. if (0 == e || 1 == e)
  5757. return e;
  5758. var d = c / b * Math.asin(1 / a);
  5759. return a * Math.pow(2, -10 * e) * Math.sin((e - d) * b / c) + 1
  5760. }
  5761. };
  5762. e.getElasticInOut = function (a, c) {
  5763. var b = 2 * Math.PI;
  5764. return function (e) {
  5765. var d = c / b * Math.asin(1 / a);
  5766. return 1 > (e *= 2) ? -0.5 * a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - d) * b / c) : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - d) * b / c) * 0.5 + 1
  5767. }
  5768. };
  5769. e.quadIn = e.getPowIn(2);
  5770. e.quadOut = e.getPowOut(2);
  5771. e.quadInOut = e.getPowInOut(2);
  5772. e.cubicIn = e.getPowIn(3);
  5773. e.cubicOut = e.getPowOut(3);
  5774. e.cubicInOut = e.getPowInOut(3);
  5775. e.quartIn = e.getPowIn(4);
  5776. e.quartOut = e.getPowOut(4);
  5777. e.quartInOut = e.getPowInOut(4);
  5778. e.quintIn = e.getPowIn(5);
  5779. e.quintOut = e.getPowOut(5);
  5780. e.quintInOut = e.getPowInOut(5);
  5781. e.backIn = e.getBackIn(1.7);
  5782. e.backOut = e.getBackOut(1.7);
  5783. e.backInOut = e.getBackInOut(1.7);
  5784. e.elasticIn = e.getElasticIn(1, 0.3);
  5785. e.elasticOut = e.getElasticOut(1, 0.3);
  5786. e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
  5787. return e
  5788. }
  5789. ();
  5790. b.Ease = d;
  5791. d.prototype.__class__ = "egret.Ease"
  5792. })(egret || (egret = {}));
  5793. (function (b) {
  5794. var d = function () {
  5795. function b() {
  5796. this.type = b.EFFECT
  5797. }
  5798. b.prototype.play = function (a) {
  5799. void 0 === a && (a = !1);
  5800. var c = this.audio;
  5801. c && (isNaN(c.duration) || (c.currentTime = 0), c.loop = a, c.play())
  5802. };
  5803. b.prototype.pause = function () {
  5804. var a = this.audio;
  5805. a && a.pause()
  5806. };
  5807. b.prototype.load = function () {
  5808. var a = this.audio;
  5809. a && a.load()
  5810. };
  5811. b.prototype.addEventListener = function (a, c) {
  5812. this.audio && this.audio.addEventListener(a, c, !1)
  5813. };
  5814. b.prototype.removeEventListener = function (a, c) {
  5815. this.audio && this.audio.removeEventListener(a, c, !1)
  5816. };
  5817. b.prototype.setVolume =
  5818. function (a) {
  5819. var c = this.audio;
  5820. c && (c.volume = a)
  5821. };
  5822. b.prototype.getVolume = function () {
  5823. return this.audio ? this.audio.volume : 0
  5824. };
  5825. b.prototype.preload = function (a) {
  5826. this.type = a
  5827. };
  5828. b.prototype._setAudio = function (a) {
  5829. this.audio = a
  5830. };
  5831. b.MUSIC = "music";
  5832. b.EFFECT = "effect";
  5833. return b
  5834. }
  5835. ();
  5836. b.Sound = d;
  5837. d.prototype.__class__ = "egret.Sound"
  5838. })(egret || (egret = {}));
  5839. (function (b) {
  5840. var d = function () {
  5841. function b() {}
  5842. b.isNumber = function (a) {
  5843. return "number" === typeof a && !isNaN(a)
  5844. };
  5845. return b
  5846. }
  5847. ();
  5848. b.NumberUtils = d;
  5849. d.prototype.__class__ = "egret.NumberUtils"
  5850. })(egret || (egret = {}));
  5851. Function.prototype.bind || (Function.prototype.bind = function (b) {
  5852. if ("function" !== typeof this)
  5853. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5854. var d = Array.prototype.slice.call(arguments, 1),
  5855. e = this,
  5856. a = function () {},
  5857. c = function () {
  5858. return e.apply(this instanceof a && b ? this : b, d.concat(Array.prototype.slice.call(arguments)))
  5859. };
  5860. a.prototype = this.prototype;
  5861. c.prototype = new a;
  5862. return c
  5863. });
  5864. var __extends = this.__extends || function (b, d) {
  5865. function e() {
  5866. this.constructor = b
  5867. }
  5868. for (var a in d)
  5869. d.hasOwnProperty(a) && (b[a] = d[a]);
  5870. e.prototype = d.prototype;
  5871. b.prototype = new e
  5872. }, RES;
  5873. (function (b) {
  5874. var d = function (b) {
  5875. function a(a, d, l) {
  5876. void 0 === d && (d = !1);
  5877. void 0 === l && (l = !1);
  5878. b.call(this, a, d, l);
  5879. this.itemsTotal = this.itemsLoaded = 0
  5880. }
  5881. __extends(a, b);
  5882. a.dispatchResourceEvent = function (c, b, e, d, g, f) {
  5883. void 0 === e && (e = "");
  5884. void 0 === d && (d = null);
  5885. void 0 === g && (g = 0);
  5886. void 0 === f && (f = 0);
  5887. var h = egret.Event._getPropertyData(a);
  5888. h.groupName = e;
  5889. h.resItem = d;
  5890. h.itemsLoaded = g;
  5891. h.itemsTotal = f;
  5892. egret.Event._dispatchByTarget(a, c, b, h)
  5893. };
  5894. a.ITEM_LOAD_ERROR = "itemLoadError";
  5895. a.CONFIG_COMPLETE = "configComplete";
  5896. a.GROUP_PROGRESS = "groupProgress";
  5897. a.GROUP_COMPLETE = "groupComplete";
  5898. return a
  5899. }
  5900. (egret.Event);
  5901. b.ResourceEvent = d;
  5902. d.prototype.__class__ = "RES.ResourceEvent"
  5903. })(RES || (RES = {}));
  5904. (function (b) {
  5905. var d = function () {
  5906. function b(a, c, e) {
  5907. this._loaded = !1;
  5908. this.name = a;
  5909. this.url = c;
  5910. this.type = e
  5911. }
  5912. Object.defineProperty(b.prototype, "loaded", {
  5913. get : function () {
  5914. return this.data ? this.data.loaded : this._loaded
  5915. },
  5916. set : function (a) {
  5917. this.data && (this.data.loaded = a);
  5918. this._loaded = a
  5919. },
  5920. enumerable : !0,
  5921. configurable : !0
  5922. });
  5923. b.prototype.toString = function () {
  5924. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5925. };
  5926. b.TYPE_XML = "xml";
  5927. b.TYPE_IMAGE = "image";
  5928. b.TYPE_BIN = "bin";
  5929. b.TYPE_TEXT = "text";
  5930. b.TYPE_JSON =
  5931. "json";
  5932. b.TYPE_SHEET = "sheet";
  5933. b.TYPE_FONT = "font";
  5934. b.TYPE_SOUND = "sound";
  5935. return b
  5936. }
  5937. ();
  5938. b.ResourceItem = d;
  5939. d.prototype.__class__ = "RES.ResourceItem"
  5940. })(RES || (RES = {}));
  5941. (function (b) {
  5942. var d = function () {
  5943. function e() {
  5944. this.keyMap = {};
  5945. this.groupDic = {};
  5946. b.configInstance = this
  5947. }
  5948. e.prototype.getGroupByName = function (a) {
  5949. var c = [];
  5950. if (!this.groupDic[a])
  5951. return c;
  5952. a = this.groupDic[a];
  5953. for (var b = a.length, e = 0; e < b; e++)
  5954. c.push(this.parseResourceItem(a[e]));
  5955. return c
  5956. };
  5957. e.prototype.getRawGroupByName = function (a) {
  5958. return this.groupDic[a] ? this.groupDic[a] : []
  5959. };
  5960. e.prototype.createGroup = function (a, c, b) {
  5961. void 0 === b && (b = !1);
  5962. if (!b && this.groupDic[a] || !c || 0 == c.length)
  5963. return !1;
  5964. b = this.groupDic;
  5965. for (var e = [], d = c.length,
  5966. g = 0; g < d; g++) {
  5967. var f = c[g],
  5968. h = b[f];
  5969. if (h)
  5970. for (var f = h.length, n = 0; n < f; n++) {
  5971. var p = h[n];
  5972. -1 == e.indexOf(p) && e.push(p)
  5973. }
  5974. else (p = this.keyMap[f]) && -1 == e.indexOf(p) && e.push(p)
  5975. }
  5976. if (0 == e.length)
  5977. return !1;
  5978. this.groupDic[a] = e;
  5979. return !0
  5980. };
  5981. e.prototype.parseConfig = function (a, c) {
  5982. if (a) {
  5983. var b = a.resources;
  5984. if (b)
  5985. for (var e = b.length, d = 0; d < e; d++) {
  5986. var g = b[d],
  5987. f = g.url;
  5988. f && -1 == f.indexOf("://") && (g.url = c + f);
  5989. this.addItemToKeyMap(g)
  5990. }
  5991. if (b = a.groups)
  5992. for (e = b.length, d = 0; d < e; d++) {
  5993. for (var f = b[d], h = [], n = f.keys.split(","), p = n.length, q = 0; q < p; q++)
  5994. g = n[q].trim(),
  5995. (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
  5996. this.groupDic[f.name] = h
  5997. }
  5998. }
  5999. };
  6000. e.prototype.addSubkey = function (a, c) {
  6001. var b = this.keyMap[c];
  6002. b && !this.keyMap[a] && (this.keyMap[a] = b)
  6003. };
  6004. e.prototype.addItemToKeyMap = function (a) {
  6005. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  6006. if (a.hasOwnProperty("subkeys")) {
  6007. var c = a.subkeys.split(",");
  6008. a.subkeys = c;
  6009. for (var b = c.length, e = 0; e < b; e++) {
  6010. var d = c[e];
  6011. null == this.keyMap[d] && (this.keyMap[d] = a)
  6012. }
  6013. }
  6014. };
  6015. e.prototype.getName = function (a) {
  6016. return (a = this.keyMap[a]) ? a.name : ""
  6017. };
  6018. e.prototype.getType =
  6019. function (a) {
  6020. return (a = this.keyMap[a]) ? a.type : ""
  6021. };
  6022. e.prototype.getRawResourceItem = function (a) {
  6023. return this.keyMap[a]
  6024. };
  6025. e.prototype.getResourceItem = function (a) {
  6026. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  6027. };
  6028. e.prototype.parseResourceItem = function (a) {
  6029. var c = new b.ResourceItem(a.name, a.url, a.type);
  6030. c.data = a;
  6031. return c
  6032. };
  6033. return e
  6034. }
  6035. ();
  6036. b.ResourceConfig = d;
  6037. d.prototype.__class__ = "RES.ResourceConfig"
  6038. })(RES || (RES = {}));
  6039. __extends = this.__extends || function (b, d) {
  6040. function e() {
  6041. this.constructor = b
  6042. }
  6043. for (var a in d)
  6044. d.hasOwnProperty(a) && (b[a] = d[a]);
  6045. e.prototype = d.prototype;
  6046. b.prototype = new e
  6047. };
  6048. (function (b) {
  6049. var d = function (e) {
  6050. function a() {
  6051. e.call(this);
  6052. this.thread = 2;
  6053. this.loadingCount = 0;
  6054. this.groupTotalDic = {};
  6055. this.numLoadedDic = {};
  6056. this.itemListDic = {};
  6057. this.priorityQueue = {};
  6058. this.lazyLoadList = [];
  6059. this.analyzerDic = {};
  6060. this.queueIndex = 0
  6061. }
  6062. __extends(a, e);
  6063. a.prototype.isGroupInLoading = function (a) {
  6064. return void 0 !== this.itemListDic[a]
  6065. };
  6066. a.prototype.loadGroup = function (a, e, d) {
  6067. void 0 === d && (d = 0);
  6068. if (!this.itemListDic[e] && e)
  6069. if (a && 0 != a.length) {
  6070. this.priorityQueue[d] ? this.priorityQueue[d].push(e) : this.priorityQueue[d] =
  6071. [e];
  6072. this.itemListDic[e] = a;
  6073. d = a.length;
  6074. for (var m = 0; m < d; m++)
  6075. a[m].groupName = e;
  6076. this.groupTotalDic[e] = a.length;
  6077. this.numLoadedDic[e] = 0;
  6078. this.next()
  6079. } else
  6080. egret.Logger.warning('RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4\uff1a"' + e + '"'), a = new b.ResourceEvent(b.ResourceEvent.GROUP_COMPLETE), a.groupName = e, this.dispatchEvent(a)
  6081. };
  6082. a.prototype.loadItem = function (a) {
  6083. this.lazyLoadList.push(a);
  6084. a.groupName = "";
  6085. this.next()
  6086. };
  6087. a.prototype.next = function () {
  6088. for (; this.loadingCount < this.thread; ) {
  6089. var a =
  6090. this.getOneResourceItem();
  6091. if (!a)
  6092. break;
  6093. this.loadingCount++;
  6094. if (a.loaded)
  6095. this.onItemComplete(a);
  6096. else {
  6097. var e = this.analyzerDic[a.type];
  6098. e || (e = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  6099. e.loadFile(a, this.onItemComplete, this)
  6100. }
  6101. }
  6102. };
  6103. a.prototype.getOneResourceItem = function () {
  6104. var a = Number.NEGATIVE_INFINITY,
  6105. b;
  6106. for (b in this.priorityQueue)
  6107. a = Math.max(a, b);
  6108. a = this.priorityQueue[a];
  6109. if (!a || 0 == a.length)
  6110. return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  6111. b = a.length;
  6112. for (var e, d =
  6113. 0; d < b; d++) {
  6114. this.queueIndex >= b && (this.queueIndex = 0);
  6115. e = this.itemListDic[a[this.queueIndex]];
  6116. if (0 < e.length)
  6117. break;
  6118. this.queueIndex++
  6119. }
  6120. return 0 == e.length ? null : e.shift()
  6121. };
  6122. a.prototype.onItemComplete = function (a) {
  6123. this.loadingCount--;
  6124. var e = a.groupName;
  6125. a.loaded || b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, e, a);
  6126. if (e) {
  6127. this.numLoadedDic[e]++;
  6128. var d = this.numLoadedDic[e],
  6129. m = this.groupTotalDic[e];
  6130. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS,
  6131. e, a, d, m);
  6132. d == m && (this.removeGroupName(e), delete this.groupTotalDic[e], delete this.numLoadedDic[e], delete this.itemListDic[e], b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, e))
  6133. } else
  6134. this.callBack.call(this.resInstance, a);
  6135. this.next()
  6136. };
  6137. a.prototype.removeGroupName = function (a) {
  6138. for (var b in this.priorityQueue) {
  6139. for (var e = this.priorityQueue[b], d = e.length, g = 0, f = !1, d = e.length, h = 0; h < d; h++) {
  6140. if (e[h] == a) {
  6141. e.splice(g, 1);
  6142. f = !0;
  6143. break
  6144. }
  6145. g++
  6146. }
  6147. if (f) {
  6148. 0 == e.length && delete this.priorityQueue[b];
  6149. break
  6150. }
  6151. }
  6152. };
  6153. return a
  6154. }
  6155. (egret.EventDispatcher);
  6156. b.ResourceLoader = d;
  6157. d.prototype.__class__ = "RES.ResourceLoader"
  6158. })(RES || (RES = {}));
  6159. __extends = this.__extends || function (b, d) {
  6160. function e() {
  6161. this.constructor = b
  6162. }
  6163. for (var a in d)
  6164. d.hasOwnProperty(a) && (b[a] = d[a]);
  6165. e.prototype = d.prototype;
  6166. b.prototype = new e
  6167. };
  6168. (function (b) {
  6169. var d = function (e) {
  6170. function a() {
  6171. e.call(this);
  6172. this.resourceConfig = b.configInstance
  6173. }
  6174. __extends(a, e);
  6175. a.prototype.addSubkey = function (a, b) {
  6176. this.resourceConfig.addSubkey(a, b)
  6177. };
  6178. a.prototype.loadFile = function (a, b, e) {};
  6179. a.prototype.getRes = function (a) {};
  6180. a.prototype.destroyRes = function (a) {
  6181. return !1
  6182. };
  6183. a.getStringPrefix = function (a) {
  6184. if (!a)
  6185. return "";
  6186. var b = a.indexOf(".");
  6187. return -1 != b ? a.substring(0, b) : ""
  6188. };
  6189. a.getStringTail = function (a) {
  6190. if (!a)
  6191. return "";
  6192. var b = a.indexOf(".");
  6193. return -1 != b ? a.substring(b + 1) : ""
  6194. };
  6195. return a
  6196. }
  6197. (egret.HashObject);
  6198. b.AnalyzerBase = d;
  6199. d.prototype.__class__ = "RES.AnalyzerBase"
  6200. })(RES || (RES = {}));
  6201. __extends = this.__extends || function (b, d) {
  6202. function e() {
  6203. this.constructor = b
  6204. }
  6205. for (var a in d)
  6206. d.hasOwnProperty(a) && (b[a] = d[a]);
  6207. e.prototype = d.prototype;
  6208. b.prototype = new e
  6209. };
  6210. (function (b) {
  6211. var d = function (b) {
  6212. function a() {
  6213. b.call(this);
  6214. this.fileDic = {};
  6215. this.resItemDic = [];
  6216. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  6217. this.recycler = new egret.Recycler
  6218. }
  6219. __extends(a, b);
  6220. a.prototype.loadFile = function (a, b, e) {
  6221. if (this.fileDic[a.name])
  6222. b.call(e, a);
  6223. else {
  6224. var d = this.getLoader();
  6225. this.resItemDic[d.hashCode] = {
  6226. item : a,
  6227. func : b,
  6228. thisObject : e
  6229. };
  6230. d.load(new egret.URLRequest(a.url))
  6231. }
  6232. };
  6233. a.prototype.getLoader = function () {
  6234. var a = this.recycler.pop();
  6235. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  6236. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  6237. a.dataFormat = this._dataFormat;
  6238. return a
  6239. };
  6240. a.prototype.onLoadFinish = function (a) {
  6241. var b = a.target,
  6242. e = this.resItemDic[b.hashCode];
  6243. delete this.resItemDic[b.hashCode];
  6244. this.recycler.push(b);
  6245. var d = e.item,
  6246. g = e.func;
  6247. d.loaded = a.type == egret.Event.COMPLETE;
  6248. d.loaded && this.analyzeData(d, b.data);
  6249. g.call(e.thisObject, d)
  6250. };
  6251. a.prototype.analyzeData = function (a, b) {
  6252. var e = a.name;
  6253. !this.fileDic[e] && b && (this.fileDic[e] = b)
  6254. };
  6255. a.prototype.getRes =
  6256. function (a) {
  6257. return this.fileDic[a]
  6258. };
  6259. a.prototype.hasRes = function (a) {
  6260. return null != this.getRes(a)
  6261. };
  6262. a.prototype.destroyRes = function (a) {
  6263. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  6264. };
  6265. return a
  6266. }
  6267. (b.AnalyzerBase);
  6268. b.BinAnalyzer = d;
  6269. d.prototype.__class__ = "RES.BinAnalyzer"
  6270. })(RES || (RES = {}));
  6271. __extends = this.__extends || function (b, d) {
  6272. function e() {
  6273. this.constructor = b
  6274. }
  6275. for (var a in d)
  6276. d.hasOwnProperty(a) && (b[a] = d[a]);
  6277. e.prototype = d.prototype;
  6278. b.prototype = new e
  6279. };
  6280. (function (b) {
  6281. var d = function (b) {
  6282. function a() {
  6283. b.call(this);
  6284. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  6285. }
  6286. __extends(a, b);
  6287. a.prototype.analyzeData = function (a, b) {
  6288. var e = a.name;
  6289. !this.fileDic[e] && b && (this.fileDic[e] = b, (e = a.data) && e.scale9grid && (e = e.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(e[0]), parseInt(e[1]), parseInt(e[2]), parseInt(e[3]))))
  6290. };
  6291. return a
  6292. }
  6293. (b.BinAnalyzer);
  6294. b.ImageAnalyzer = d;
  6295. d.prototype.__class__ = "RES.ImageAnalyzer"
  6296. })(RES || (RES = {}));
  6297. __extends = this.__extends || function (b, d) {
  6298. function e() {
  6299. this.constructor = b
  6300. }
  6301. for (var a in d)
  6302. d.hasOwnProperty(a) && (b[a] = d[a]);
  6303. e.prototype = d.prototype;
  6304. b.prototype = new e
  6305. };
  6306. (function (b) {
  6307. var d = function (b) {
  6308. function a() {
  6309. b.call(this);
  6310. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6311. }
  6312. __extends(a, b);
  6313. a.prototype.analyzeData = function (a, b) {
  6314. var e = a.name;
  6315. if (!this.fileDic[e] && b)
  6316. try {
  6317. this.fileDic[e] = JSON.parse(b)
  6318. } catch (d) {
  6319. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + "\ndata:" + b)
  6320. }
  6321. };
  6322. return a
  6323. }
  6324. (b.BinAnalyzer);
  6325. b.JsonAnalyzer = d;
  6326. d.prototype.__class__ = "RES.JsonAnalyzer"
  6327. })(RES || (RES = {}));
  6328. __extends = this.__extends || function (b, d) {
  6329. function e() {
  6330. this.constructor = b
  6331. }
  6332. for (var a in d)
  6333. d.hasOwnProperty(a) && (b[a] = d[a]);
  6334. e.prototype = d.prototype;
  6335. b.prototype = new e
  6336. };
  6337. (function (b) {
  6338. var d = function (b) {
  6339. function a() {
  6340. b.call(this);
  6341. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6342. }
  6343. __extends(a, b);
  6344. return a
  6345. }
  6346. (b.BinAnalyzer);
  6347. b.TextAnalyzer = d;
  6348. d.prototype.__class__ = "RES.TextAnalyzer"
  6349. })(RES || (RES = {}));
  6350. __extends = this.__extends || function (b, d) {
  6351. function e() {
  6352. this.constructor = b
  6353. }
  6354. for (var a in d)
  6355. d.hasOwnProperty(a) && (b[a] = d[a]);
  6356. e.prototype = d.prototype;
  6357. b.prototype = new e
  6358. };
  6359. (function (b) {
  6360. var d = function (e) {
  6361. function a() {
  6362. e.call(this);
  6363. this.sheetMap = {};
  6364. this.textureMap = {};
  6365. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6366. }
  6367. __extends(a, e);
  6368. a.prototype.getRes = function (a) {
  6369. var e = this.fileDic[a];
  6370. e || (e = this.textureMap[a]);
  6371. !e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.fileDic[e]) && (a = b.AnalyzerBase.getStringTail(a), e = e.getTexture(a));
  6372. return e
  6373. };
  6374. a.prototype.onLoadFinish = function (a) {
  6375. var b = a.target,
  6376. e = this.resItemDic[b.hashCode];
  6377. delete this.resItemDic[b.hashCode];
  6378. this.recycler.push(b);
  6379. var d =
  6380. e.item,
  6381. g = e.func;
  6382. d.loaded = a.type == egret.Event.COMPLETE;
  6383. d.loaded && this.analyzeData(d, b.data);
  6384. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, g, e.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : g.call(e.thisObject, d)
  6385. };
  6386. a.prototype.analyzeData = function (a, b) {
  6387. var e = a.name;
  6388. if (!this.fileDic[e] && b) {
  6389. var d;
  6390. if ("string" == typeof b) {
  6391. try {
  6392. d = JSON.parse(b)
  6393. } catch (g) {
  6394. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  6395. }
  6396. d && (this.sheetMap[e] =
  6397. d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  6398. } else
  6399. d = this.sheetMap[e], delete this.sheetMap[e], b && (d = this.parseSpriteSheet(b, d, a.data && a.data.subkeys ? "" : e), this.fileDic[e] = d)
  6400. }
  6401. };
  6402. a.prototype.getRelativePath = function (a, b) {
  6403. a = a.split("\\").join("/");
  6404. var e = a.lastIndexOf("/");
  6405. return a = -1 != e ? a.substring(0, e + 1) + b : b
  6406. };
  6407. a.prototype.parseSpriteSheet = function (a, b, e) {
  6408. b = b.frames;
  6409. if (!b)
  6410. return null;
  6411. var d = new egret.SpriteSheet(a),
  6412. g = this.textureMap,
  6413. f;
  6414. for (f in b) {
  6415. var h = b[f];
  6416. a = d.createTexture(f, h.x, h.y, h.w, h.h,
  6417. h.offX, h.offY, h.sourceW, h.sourceH);
  6418. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  6419. null == g[f] && (g[f] = a, e && this.addSubkey(f, e))
  6420. }
  6421. return d
  6422. };
  6423. return a
  6424. }
  6425. (b.BinAnalyzer);
  6426. b.SheetAnalyzer = d;
  6427. d.prototype.__class__ = "RES.SheetAnalyzer"
  6428. })(RES || (RES = {}));
  6429. __extends = this.__extends || function (b, d) {
  6430. function e() {
  6431. this.constructor = b
  6432. }
  6433. for (var a in d)
  6434. d.hasOwnProperty(a) && (b[a] = d[a]);
  6435. e.prototype = d.prototype;
  6436. b.prototype = new e
  6437. };
  6438. (function (b) {
  6439. var d = function (b) {
  6440. function a() {
  6441. b.call(this)
  6442. }
  6443. __extends(a, b);
  6444. a.prototype.analyzeData = function (a, b) {
  6445. var e = a.name;
  6446. if (!this.fileDic[e] && b) {
  6447. var d;
  6448. "string" == typeof b ? (d = b, this.sheetMap[e] = d, a.loaded = !1, a.url = this.getTexturePath(a.url, d)) : (d = this.sheetMap[e], delete this.sheetMap[e], b && (d = new egret.BitmapTextSpriteSheet(b, d), this.fileDic[e] = d))
  6449. }
  6450. };
  6451. a.prototype.getTexturePath = function (a, b) {
  6452. var e = "",
  6453. d = b.split("\n")[2],
  6454. g = d.indexOf('file="');
  6455. -1 != g && (d = d.substring(g + 6), g = d.indexOf('"'), e = d.substring(0,
  6456. g));
  6457. a = a.split("\\").join("/");
  6458. g = a.lastIndexOf("/");
  6459. return a = -1 != g ? a.substring(0, g + 1) + e : e
  6460. };
  6461. return a
  6462. }
  6463. (b.SheetAnalyzer);
  6464. b.FontAnalyzer = d;
  6465. d.prototype.__class__ = "RES.FontAnalyzer"
  6466. })(RES || (RES = {}));
  6467. __extends = this.__extends || function (b, d) {
  6468. function e() {
  6469. this.constructor = b
  6470. }
  6471. for (var a in d)
  6472. d.hasOwnProperty(a) && (b[a] = d[a]);
  6473. e.prototype = d.prototype;
  6474. b.prototype = new e
  6475. };
  6476. (function (b) {
  6477. var d = function (b) {
  6478. function a() {
  6479. b.call(this);
  6480. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  6481. }
  6482. __extends(a, b);
  6483. a.prototype.analyzeData = function (a, b) {
  6484. var e = a.name;
  6485. !this.fileDic[e] && b && (this.fileDic[e] = b, (e = a.data) && e.soundType ? b.preload(e.soundType) : b.preload(egret.Sound.EFFECT))
  6486. };
  6487. return a
  6488. }
  6489. (b.BinAnalyzer);
  6490. b.SoundAnalyzer = d;
  6491. d.prototype.__class__ = "RES.SoundAnalyzer"
  6492. })(RES || (RES = {}));
  6493. __extends = this.__extends || function (b, d) {
  6494. function e() {
  6495. this.constructor = b
  6496. }
  6497. for (var a in d)
  6498. d.hasOwnProperty(a) && (b[a] = d[a]);
  6499. e.prototype = d.prototype;
  6500. b.prototype = new e
  6501. };
  6502. (function (b) {
  6503. var d = function (b) {
  6504. function a() {
  6505. b.call(this);
  6506. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6507. }
  6508. __extends(a, b);
  6509. a.prototype.analyzeData = function (a, b) {
  6510. var e = a.name;
  6511. if (!this.fileDic[e] && b)
  6512. try {
  6513. var d = egret.XML.parse(b);
  6514. this.fileDic[e] = d
  6515. } catch (g) {}
  6516. };
  6517. return a
  6518. }
  6519. (b.BinAnalyzer);
  6520. b.XMLAnalyzer = d;
  6521. d.prototype.__class__ = "RES.XMLAnalyzer"
  6522. })(RES || (RES = {}));
  6523. __extends = this.__extends || function (b, d) {
  6524. function e() {
  6525. this.constructor = b
  6526. }
  6527. for (var a in d)
  6528. d.hasOwnProperty(a) && (b[a] = d[a]);
  6529. e.prototype = d.prototype;
  6530. b.prototype = new e
  6531. };
  6532. (function (b) {
  6533. b.loadConfig = function (a, b, d) {
  6534. void 0 === b && (b = "");
  6535. void 0 === d && (d = "json");
  6536. e.loadConfig(a, b, d)
  6537. };
  6538. b.loadGroup = function (a, b) {
  6539. void 0 === b && (b = 0);
  6540. e.loadGroup(a, b)
  6541. };
  6542. b.isGroupLoaded = function (a) {
  6543. return e.isGroupLoaded(a)
  6544. };
  6545. b.getGroupByName = function (a) {
  6546. return e.getGroupByName(a)
  6547. };
  6548. b.createGroup = function (a, b, d) {
  6549. void 0 === d && (d = !1);
  6550. return e.createGroup(a, b, d)
  6551. };
  6552. b.hasRes = function (a) {
  6553. return e.hasRes(a)
  6554. };
  6555. b.getRes = function (a) {
  6556. return e.getRes(a)
  6557. };
  6558. b.getResAsync = function (a, b, d) {
  6559. e.getResAsync(a, b, d)
  6560. };
  6561. b.getResByUrl =
  6562. function (a, b, d, l) {
  6563. void 0 === l && (l = "");
  6564. e.getResByUrl(a, b, d, l)
  6565. };
  6566. b.destroyRes = function (a) {
  6567. return e.destroyRes(a)
  6568. };
  6569. b.setMaxLoadingThread = function (a) {
  6570. e.setMaxLoadingThread(a)
  6571. };
  6572. b.addEventListener = function (a, b, d, l, m) {
  6573. void 0 === l && (l = !1);
  6574. void 0 === m && (m = 0);
  6575. e.addEventListener(a, b, d, l, m)
  6576. };
  6577. b.removeEventListener = function (a, b, d, l) {
  6578. void 0 === l && (l = !1);
  6579. e.removeEventListener(a, b, d, l)
  6580. };
  6581. var d = function (a) {
  6582. function c() {
  6583. a.call(this);
  6584. this.analyzerDic = {};
  6585. this.configItemList = [];
  6586. this.configComplete = this.callLaterFlag = !1;
  6587. this.loadedGroups =
  6588. [];
  6589. this.groupNameList = [];
  6590. this.asyncDic = {};
  6591. this.init()
  6592. }
  6593. __extends(c, a);
  6594. c.prototype.getAnalyzerByType = function (a) {
  6595. var c = this.analyzerDic[a];
  6596. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  6597. return c
  6598. };
  6599. c.prototype.init = function () {
  6600. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  6601. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer,
  6602. b.ResourceItem.TYPE_IMAGE);
  6603. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  6604. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  6605. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  6606. egret.Injector.hasMapRule(b.AnalyzerBase,
  6607. b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  6608. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  6609. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  6610. this.resConfig = new b.ResourceConfig;
  6611. this.resLoader = new b.ResourceLoader;
  6612. this.resLoader.callBack = this.onResourceItemComp;
  6613. this.resLoader.resInstance = this;
  6614. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  6615. };
  6616. c.prototype.loadConfig = function (a, b, c) {
  6617. void 0 === c && (c = "json");
  6618. this.configItemList.push({
  6619. url : a,
  6620. resourceRoot : b,
  6621. type : c
  6622. });
  6623. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6624. };
  6625. c.prototype.startLoadConfig = function () {
  6626. this.callLaterFlag = !1;
  6627. var a = this.configItemList;
  6628. this.configItemList = [];
  6629. this.loadingConfigList = a;
  6630. for (var e = a.length, d = [], g = 0; g < e; g++) {
  6631. var f =
  6632. a[g],
  6633. f = new b.ResourceItem(f.url, f.url, f.type);
  6634. d.push(f)
  6635. }
  6636. this.resLoader.loadGroup(d, c.GROUP_CONFIG, Number.MAX_VALUE)
  6637. };
  6638. c.prototype.isGroupLoaded = function (a) {
  6639. return -1 != this.loadedGroups.indexOf(a)
  6640. };
  6641. c.prototype.getGroupByName = function (a) {
  6642. return this.resConfig.getGroupByName(a)
  6643. };
  6644. c.prototype.loadGroup = function (a, b) {
  6645. void 0 === b && (b = 0);
  6646. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  6647. if (this.configComplete) {
  6648. var c = this.resConfig.getGroupByName(a);
  6649. this.resLoader.loadGroup(c, a, b)
  6650. } else
  6651. this.groupNameList.push({
  6652. name : a,
  6653. priority : b
  6654. })
  6655. };
  6656. c.prototype.createGroup = function (a, b, c) {
  6657. void 0 === c && (c = !1);
  6658. if (c) {
  6659. var e = this.loadedGroups.indexOf(a);
  6660. -1 != e && this.loadedGroups.splice(e, 1)
  6661. }
  6662. return this.resConfig.createGroup(a, b, c)
  6663. };
  6664. c.prototype.onGroupComp = function (a) {
  6665. if (a.groupName == c.GROUP_CONFIG) {
  6666. a = this.loadingConfigList.length;
  6667. for (var e = 0; e < a; e++) {
  6668. var d = this.loadingConfigList[e],
  6669. g = this.getAnalyzerByType(d.type),
  6670. f = g.getRes(d.url);
  6671. g.destroyRes(d.url);
  6672. this.resConfig.parseConfig(f, d.resourceRoot)
  6673. }
  6674. this.configComplete = !0;
  6675. this.loadingConfigList =
  6676. null;
  6677. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  6678. d = this.groupNameList;
  6679. a = d.length;
  6680. for (e = 0; e < a; e++)
  6681. g = d[e], this.loadGroup(g.name, g.priority);
  6682. this.groupNameList = []
  6683. } else
  6684. this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  6685. };
  6686. c.prototype.hasRes = function (a) {
  6687. var c = this.resConfig.getType(a);
  6688. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a), "" == c) ? !1 : !0
  6689. };
  6690. c.prototype.getRes = function (a) {
  6691. var c = this.resConfig.getType(a);
  6692. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a),
  6693. c = this.resConfig.getType(c), "" == c) ? null : this.getAnalyzerByType(c).getRes(a)
  6694. };
  6695. c.prototype.getResAsync = function (a, c, e) {
  6696. var d = this.resConfig.getType(a),
  6697. f = this.resConfig.getName(a);
  6698. if ("" == d && (f = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(f), "" == d)) {
  6699. c.call(e, null);
  6700. return
  6701. }
  6702. (d = this.getAnalyzerByType(d).getRes(a)) ? c.call(e, d) : (a = {
  6703. key : a,
  6704. compFunc : c,
  6705. thisObject : e
  6706. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6707. };
  6708. c.prototype.getResByUrl =
  6709. function (a, c, e, d) {
  6710. void 0 === d && (d = "");
  6711. if (a) {
  6712. d || (d = this.getTypeByUrl(a));
  6713. var f = this.getAnalyzerByType(d).getRes(a);
  6714. f ? c.call(e, f) : (c = {
  6715. key : a,
  6716. compFunc : c,
  6717. thisObject : e
  6718. }, this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, d), this.resLoader.loadItem(a)))
  6719. } else
  6720. c.call(e, null)
  6721. };
  6722. c.prototype.getTypeByUrl = function (a) {
  6723. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6724. switch (a) {
  6725. case b.ResourceItem.TYPE_XML:
  6726. case b.ResourceItem.TYPE_JSON:
  6727. case b.ResourceItem.TYPE_SHEET:
  6728. break;
  6729. case "png":
  6730. case "jpg":
  6731. case "gif":
  6732. a = b.ResourceItem.TYPE_IMAGE;
  6733. break;
  6734. case "fnt":
  6735. a = b.ResourceItem.TYPE_FONT;
  6736. break;
  6737. case "txt":
  6738. a = b.ResourceItem.TYPE_TEXT;
  6739. break;
  6740. case "mp3":
  6741. case "ogg":
  6742. case "mpeg":
  6743. case "wav":
  6744. case "m4a":
  6745. case "mp4":
  6746. case "aiff":
  6747. case "wma":
  6748. case "mid":
  6749. a = b.ResourceItem.TYPE_SOUND;
  6750. break;
  6751. default:
  6752. a = b.ResourceItem.TYPE_BIN
  6753. }
  6754. return a
  6755. };
  6756. c.prototype.onResourceItemComp = function (a) {
  6757. var b = this.asyncDic[a.name];
  6758. delete this.asyncDic[a.name];
  6759. a = this.getAnalyzerByType(a.type);
  6760. for (var c = b.length, e = 0; e < c; e++) {
  6761. var d =
  6762. b[e],
  6763. h = a.getRes(d.key);
  6764. d.compFunc.call(d.thisObject, h, d.key)
  6765. }
  6766. };
  6767. c.prototype.destroyRes = function (a) {
  6768. var b = this.resConfig.getRawGroupByName(a);
  6769. if (b) {
  6770. var c = this.loadedGroups.indexOf(a);
  6771. -1 != c && this.loadedGroups.splice(c, 1);
  6772. a = b.length;
  6773. for (var e = 0; e < a; e++) {
  6774. c = b[e];
  6775. c.loaded = !1;
  6776. var d = this.getAnalyzerByType(c.type);
  6777. d.destroyRes(c.name)
  6778. }
  6779. return !0
  6780. }
  6781. b = this.resConfig.getType(a);
  6782. if ("" == b)
  6783. return !1;
  6784. c = this.resConfig.getRawResourceItem(a);
  6785. c.loaded = !1;
  6786. d = this.getAnalyzerByType(b);
  6787. return d.destroyRes(a)
  6788. };
  6789. c.prototype.setMaxLoadingThread =
  6790. function (a) {
  6791. 1 > a && (a = 1);
  6792. this.resLoader.thread = a
  6793. };
  6794. c.GROUP_CONFIG = "RES__CONFIG";
  6795. return c
  6796. }
  6797. (egret.EventDispatcher);
  6798. d.prototype.__class__ = "RES.Resource";
  6799. var e = new d
  6800. })(RES || (RES = {}));
  6801. __extends = this.__extends || function (b, d) {
  6802. function e() {
  6803. this.constructor = b
  6804. }
  6805. for (var a in d)
  6806. d.hasOwnProperty(a) && (b[a] = d[a]);
  6807. e.prototype = d.prototype;
  6808. b.prototype = new e
  6809. };
  6810. (function (b) {
  6811. var d = function (e) {
  6812. function a(b) {
  6813. void 0 === b && (b = 60);
  6814. e.call(this);
  6815. this.frameRate = b;
  6816. this._time = 0;
  6817. this._isActivate = !0;
  6818. 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 ||
  6819. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6820. a.requestAnimationFrame || (a.requestAnimationFrame = function (a) {
  6821. return window.setTimeout(a, 1E3 / b)
  6822. });
  6823. a.cancelAnimationFrame || (a.cancelAnimationFrame = function (a) {
  6824. return window.clearTimeout(a)
  6825. });
  6826. a.instance = this;
  6827. this.registerListener()
  6828. }
  6829. __extends(a, e);
  6830. a.prototype.enterFrame = function () {
  6831. var c = a.instance,
  6832. e = a._thisObject,
  6833. d = a._callback,
  6834. m = b.getTimer(),
  6835. g = m -
  6836. c._time;
  6837. c._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6838. d.call(e, g);
  6839. c._time = m
  6840. };
  6841. a.prototype.executeMainLoop = function (b, e) {
  6842. a._callback = b;
  6843. a._thisObject = e;
  6844. this.enterFrame()
  6845. };
  6846. a.prototype.reset = function () {
  6847. var c = a.instance;
  6848. c._requestAnimationId && (c._time = b.getTimer(), a.cancelAnimationFrame.call(window, c._requestAnimationId), c.enterFrame())
  6849. };
  6850. a.prototype.registerListener = function () {
  6851. var c = this,
  6852. e = function () {
  6853. c._isActivate && (c._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6854. },
  6855. d = function () {
  6856. c._isActivate || (c._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6857. },
  6858. m = function () {
  6859. document[g] ? e() : d()
  6860. };
  6861. window.addEventListener("focus", d, !1);
  6862. window.addEventListener("blur", e, !1);
  6863. var g,
  6864. f;
  6865. "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 ?
  6866. (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6867. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", d, !1), window.addEventListener("pagehide", e, !1));
  6868. g && f && document.addEventListener(f, m, !1)
  6869. };
  6870. return a
  6871. }
  6872. (b.DeviceContext);
  6873. b.HTML5DeviceContext = d;
  6874. d.prototype.__class__ = "egret.HTML5DeviceContext"
  6875. })(egret || (egret = {}));
  6876. var egret_html5_localStorage;
  6877. (function (b) {
  6878. b.getItem = function (b) {
  6879. return window.localStorage.getItem(b)
  6880. };
  6881. b.setItem = function (b, e) {
  6882. try {
  6883. return window.localStorage.setItem(b, e),
  6884. !0
  6885. } catch (a) {
  6886. return console.log("egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key=" + b + "&value=" + e),
  6887. !1
  6888. }
  6889. };
  6890. b.removeItem = function (b) {
  6891. window.localStorage.removeItem(b)
  6892. };
  6893. b.clear = function () {
  6894. window.localStorage.clear()
  6895. };
  6896. b.init = function () {
  6897. for (var d in b)
  6898. egret.localStorage[d] = b[d]
  6899. }
  6900. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6901. egret_html5_localStorage.init();
  6902. __extends = this.__extends || function (b, d) {
  6903. function e() {
  6904. this.constructor = b
  6905. }
  6906. for (var a in d)
  6907. d.hasOwnProperty(a) && (b[a] = d[a]);
  6908. e.prototype = d.prototype;
  6909. b.prototype = new e
  6910. };
  6911. (function (b) {
  6912. var d = function (e) {
  6913. function a(a) {
  6914. e.call(this);
  6915. this.globalAlpha = 1;
  6916. this.canvas = a || this.createCanvas();
  6917. this.canvasContext = this.canvas.getContext("2d");
  6918. this._cacheCanvas = document.createElement("canvas");
  6919. this._cacheCanvas.width = this.canvas.width;
  6920. this._cacheCanvas.height = this.canvas.height;
  6921. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  6922. this._cacheCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6923. this._cacheCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6924. this._cacheCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6925. this._cacheCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6926. this.onResize();
  6927. var d = this.canvasContext.setTransform,
  6928. l = this;
  6929. this._cacheCanvasContext.setTransform = function (a, b, c, e, n, p) {
  6930. l._matrixA = a;
  6931. l._matrixB = b;
  6932. l._matrixC = c;
  6933. l._matrixD = e;
  6934. l._matrixTx = n;
  6935. l._matrixTy = p;
  6936. d.call(l._cacheCanvasContext, a, b, c, e, n, p)
  6937. };
  6938. this._matrixA = 1;
  6939. this._matrixC = this._matrixB = 0;
  6940. this._matrixD = 1;
  6941. this._transformTy =
  6942. this._transformTx = this._matrixTy = this._matrixTx = 0;
  6943. this.initBlendMode()
  6944. }
  6945. __extends(a, e);
  6946. a.prototype.createCanvas = function () {
  6947. var a = b.Browser.getInstance().$("#egretCanvas");
  6948. if (!a) {
  6949. var e = document.getElementById(b.StageDelegate.canvas_div_name),
  6950. a = b.Browser.getInstance().$new("canvas");
  6951. a.id = "egretCanvas";
  6952. e.appendChild(a)
  6953. }
  6954. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  6955. return a
  6956. };
  6957. a.prototype.onResize = function () {
  6958. if (this.canvas) {
  6959. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6960. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6961. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6962. this.canvas.style.width = a.style.width;
  6963. this.canvas.style.height = a.style.height;
  6964. this._cacheCanvas.width = this.canvas.width;
  6965. this._cacheCanvas.height = this.canvas.height
  6966. }
  6967. };
  6968. a.prototype.clearScreen = function () {
  6969. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), e = 0, d = a.length; e < d; e++) {
  6970. var m = a[e];
  6971. this.clearRect(m.x, m.y, m.width, m.height)
  6972. }
  6973. a = b.MainContext.instance.stage;
  6974. this._cacheCanvasContext.clearRect(0,
  6975. 0, a.stageWidth, a.stageHeight);
  6976. this.renderCost = 0
  6977. };
  6978. a.prototype.clearRect = function (a, b, e, d) {
  6979. this.canvasContext.clearRect(a, b, e, d)
  6980. };
  6981. a.prototype.drawImage = function (a, d, l, m, g, f, h, n, p, q) {
  6982. void 0 === q && (q = void 0);
  6983. var r = b.MainContext.instance.rendererContext.texture_scale_factor;
  6984. d /= r;
  6985. l /= r;
  6986. m /= r;
  6987. g /= r;
  6988. r = a._bitmapData;
  6989. f += this._transformTx;
  6990. h += this._transformTy;
  6991. var s = b.getTimer();
  6992. void 0 === q ? this._cacheCanvasContext.drawImage(r, d, l, m, g, f, h, n, p) : this.drawRepeatImage(a, d, l, m, g, f, h, n, p, q);
  6993. e.prototype.drawImage.call(this,
  6994. a, d, l, m, g, f, h, n, p, q);
  6995. this.renderCost += b.getTimer() - s
  6996. };
  6997. a.prototype.drawRepeatImage = function (a, b, e, d, g, f, h, n, p, q) {
  6998. if (void 0 === a.pattern) {
  6999. var r = a._bitmapData,
  7000. s = r;
  7001. if (r.width != d || r.height != g)
  7002. s = document.createElement("canvas"), s.width = d, s.height = g, s.getContext("2d").drawImage(r, b, e, d, g, 0, 0, d, g);
  7003. b = this._cacheCanvasContext.createPattern(s, q);
  7004. a.pattern = b
  7005. }
  7006. this._cacheCanvasContext.fillStyle = a.pattern;
  7007. this._cacheCanvasContext.translate(f, h);
  7008. this._cacheCanvasContext.fillRect(0, 0, n, p);
  7009. this._cacheCanvasContext.translate(-f,
  7010. -h)
  7011. };
  7012. a.prototype.setTransform = function (a) {
  7013. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this._cacheCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  7014. };
  7015. a.prototype.setAlpha = function (a, e) {
  7016. a != this.globalAlpha &&
  7017. (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  7018. e ? (this.blendValue = this.blendModes[e], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  7019. };
  7020. a.prototype.initBlendMode = function () {
  7021. this.blendModes = {};
  7022. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  7023. this.blendModes[b.BlendMode.ADD] = "lighter"
  7024. };
  7025. a.prototype.setupFont = function (a,
  7026. b) {
  7027. void 0 === b && (b = null);
  7028. b = b || {};
  7029. var e = null == b.size ? a._size : b.size,
  7030. d = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  7031. g = this._cacheCanvasContext,
  7032. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  7033. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  7034. g.font = f + (e + "px " + d);
  7035. g.textAlign = "left";
  7036. g.textBaseline = "middle"
  7037. };
  7038. a.prototype.measureText = function (a) {
  7039. return this._cacheCanvasContext.measureText(a).width
  7040. };
  7041. a.prototype.drawText = function (a, d, l, m, g, f) {
  7042. void 0 === f && (f = null);
  7043. this.setupFont(a, f);
  7044. f = f || {};
  7045. var h;
  7046. h = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  7047. var n;
  7048. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  7049. var p;
  7050. p = null != f.stroke ? f.stroke : a._stroke;
  7051. var q = this._cacheCanvasContext;
  7052. q.fillStyle = h;
  7053. q.strokeStyle = n;
  7054. p && (q.lineWidth = 2 * p, q.strokeText(d, l + this._transformTx, m + this._transformTy, g || 65535));
  7055. q.fillText(d, l + this._transformTx, m + this._transformTy, g || 65535);
  7056. e.prototype.drawText.call(this, a, d, l, m, g, f)
  7057. };
  7058. a.prototype.strokeRect = function (a, b, e, d, g) {
  7059. this._cacheCanvasContext.strokeStyle =
  7060. g;
  7061. this._cacheCanvasContext.strokeRect(a, b, e, d)
  7062. };
  7063. a.prototype.pushMask = function (a) {
  7064. this._cacheCanvasContext.save();
  7065. this._cacheCanvasContext.beginPath();
  7066. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  7067. this._cacheCanvasContext.clip();
  7068. this._cacheCanvasContext.closePath()
  7069. };
  7070. a.prototype.popMask = function () {
  7071. this._cacheCanvasContext.restore();
  7072. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  7073. };
  7074. a.prototype.onRenderStart = function () {
  7075. this._cacheCanvasContext.save()
  7076. };
  7077. a.prototype.onRenderFinish =
  7078. function () {
  7079. this._cacheCanvasContext.restore();
  7080. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  7081. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), e = 0, d = a.length; e < d; e++) {
  7082. var m = a[e];
  7083. this.canvasContext.drawImage(this._cacheCanvas, m.x, m.y, m.width, m.height, m.x, m.y, m.width, m.height)
  7084. }
  7085. };
  7086. return a
  7087. }
  7088. (b.RendererContext);
  7089. b.HTML5CanvasRenderer = d;
  7090. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  7091. })(egret || (egret = {}));
  7092. var egret_h5_graphics;
  7093. (function (b) {
  7094. b.beginFill = function (b, a) {
  7095. void 0 === a && (a = 1);
  7096. var c = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  7097. this.fillStyleColor = c;
  7098. this.commandQueue.push(new d(this._setStyle, this, [c]))
  7099. };
  7100. b.drawRect = function (b, a, c, k) {
  7101. this.commandQueue.push(new d(function (a, b, c, e) {
  7102. var d = this.renderContext;
  7103. this.canvasContext.beginPath();
  7104. this.canvasContext.rect(d._transformTx + a, d._transformTy + b, c, e);
  7105. this.canvasContext.closePath()
  7106. }, this, [b, a, c, k]));
  7107. this._fill()
  7108. };
  7109. b.drawCircle = function (b, a, c) {
  7110. this.commandQueue.push(new d(function (a,
  7111. b, c) {
  7112. var e = this.renderContext;
  7113. this.canvasContext.beginPath();
  7114. this.canvasContext.arc(e._transformTx + a, e._transformTy + b, c, 0, 2 * Math.PI);
  7115. this.canvasContext.closePath()
  7116. }, this, [b, a, c]));
  7117. this._fill()
  7118. };
  7119. b.drawRoundRect = function (b, a, c, k, l, m) {
  7120. this.commandQueue.push(new d(function (a, b, c, e, d, k) {
  7121. var l = this.renderContext;
  7122. a = l._transformTx + a;
  7123. b = l._transformTy + b;
  7124. d /= 2;
  7125. k = k ? k / 2 : d;
  7126. c = a + c;
  7127. e = b + e;
  7128. l = e - k;
  7129. this.canvasContext.beginPath();
  7130. this.canvasContext.moveTo(c, l);
  7131. this.canvasContext.quadraticCurveTo(c, e, c - d, e);
  7132. this.canvasContext.lineTo(a +
  7133. d, e);
  7134. this.canvasContext.quadraticCurveTo(a, e, a, e - k);
  7135. this.canvasContext.lineTo(a, b + k);
  7136. this.canvasContext.quadraticCurveTo(a, b, a + d, b);
  7137. this.canvasContext.lineTo(c - d, b);
  7138. this.canvasContext.quadraticCurveTo(c, b, c, b + k);
  7139. this.canvasContext.lineTo(c, l);
  7140. this.canvasContext.closePath()
  7141. }, this, [b, a, c, k, l, m]));
  7142. this._fill()
  7143. };
  7144. b.drawEllipse = function (b, a, c, k) {
  7145. this.commandQueue.push(new d(function (a, b, c, e) {
  7146. var d = this.renderContext;
  7147. this.canvasContext.save();
  7148. a = d._transformTx + a;
  7149. b = d._transformTy + b;
  7150. var d = c > e ? c : e,
  7151. k = c / d;
  7152. e /=
  7153. d;
  7154. this.canvasContext.scale(k, e);
  7155. this.canvasContext.beginPath();
  7156. this.canvasContext.moveTo((a + c) / k, b / e);
  7157. this.canvasContext.arc(a / k, b / e, d, 0, 2 * Math.PI);
  7158. this.canvasContext.closePath();
  7159. this.canvasContext.restore();
  7160. this.canvasContext.stroke()
  7161. }, this, [b, a, c, k]));
  7162. this._fill()
  7163. };
  7164. b.lineStyle = function (b, a, c, k, l, m, g, f) {
  7165. void 0 === b && (b = NaN);
  7166. void 0 === a && (a = 0);
  7167. void 0 === c && (c = 1);
  7168. void 0 === k && (k = !1);
  7169. void 0 === l && (l = "normal");
  7170. void 0 === m && (m = null);
  7171. void 0 === g && (g = null);
  7172. void 0 === f && (f = 3);
  7173. this.strokeStyleColor && (this.createEndLineCommand(),
  7174. this.commandQueue.push(this.endLineCommand));
  7175. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + c + ")";
  7176. this.commandQueue.push(new d(function (a, b) {
  7177. this.canvasContext.lineWidth = a;
  7178. this.canvasContext.strokeStyle = b;
  7179. this.canvasContext.beginPath()
  7180. }, this, [b, a]));
  7181. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  7182. this.moveTo(this.lineX, this.lineY)
  7183. };
  7184. b.lineTo = function (b, a) {
  7185. this.commandQueue.push(new d(function (a, b) {
  7186. var e = this.renderContext;
  7187. this.canvasContext.lineTo(e._transformTx +
  7188. a, e._transformTy + b)
  7189. }, this, [b, a]));
  7190. this.lineX = b;
  7191. this.lineY = a
  7192. };
  7193. b.curveTo = function (b, a, c, k) {
  7194. this.commandQueue.push(new d(function (a, b, c, e) {
  7195. var d = this.renderContext;
  7196. this.canvasContext.quadraticCurveTo(d._transformTx + a, d._transformTy + b, d._transformTx + c, d._transformTy + e)
  7197. }, this, [b, a, c, k]));
  7198. this.lineX = c;
  7199. this.lineY = k
  7200. };
  7201. b.moveTo = function (b, a) {
  7202. this.commandQueue.push(new d(function (a, b) {
  7203. var e = this.renderContext;
  7204. this.canvasContext.moveTo(e._transformTx + a, e._transformTy + b)
  7205. }, this, [b, a]))
  7206. };
  7207. b.clear = function () {
  7208. this.lineY =
  7209. this.lineX = this.commandQueue.length = 0;
  7210. this.fillStyleColor = this.strokeStyleColor = null
  7211. };
  7212. b.createEndFillCommand = function () {
  7213. this.endFillCommand || (this.endFillCommand = new d(function () {
  7214. this.canvasContext.fill();
  7215. this.canvasContext.closePath()
  7216. }, this, null))
  7217. };
  7218. b.endFill = function () {
  7219. null != this.fillStyleColor && this._fill();
  7220. this.fillStyleColor = null
  7221. };
  7222. b._fill = function () {
  7223. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  7224. };
  7225. b.createEndLineCommand = function () {
  7226. this.endLineCommand ||
  7227. (this.endLineCommand = new d(function () {
  7228. this.canvasContext.stroke();
  7229. this.canvasContext.closePath()
  7230. }, this, null))
  7231. };
  7232. b._draw = function (b) {
  7233. var a = this.commandQueue.length;
  7234. if (0 != a) {
  7235. this.renderContext = b;
  7236. b = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  7237. b.save();
  7238. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  7239. for (var c = 0; c < a; c++) {
  7240. var d = this.commandQueue[c];
  7241. d.method.apply(d.thisObject, d.args)
  7242. }
  7243. b.restore()
  7244. }
  7245. };
  7246. var d = function () {
  7247. return function (b, a, c) {
  7248. this.method = b;
  7249. this.thisObject = a;
  7250. this.args = c
  7251. }
  7252. }
  7253. ();
  7254. d.prototype.__class__ = "egret_h5_graphics.Command";
  7255. b._setStyle = function (b) {
  7256. this.canvasContext.fillStyle = b;
  7257. this.canvasContext.beginPath()
  7258. };
  7259. b.init = function () {
  7260. for (var e in b)
  7261. egret.Graphics.prototype[e] = b[e];
  7262. egret.RendererContext.createRendererContext = function (a) {
  7263. return new egret.HTML5CanvasRenderer(a)
  7264. }
  7265. }
  7266. })(egret_h5_graphics || (egret_h5_graphics = {}));
  7267. egret_h5_graphics.init();
  7268. __extends = this.__extends || function (b, d) {
  7269. function e() {
  7270. this.constructor = b
  7271. }
  7272. for (var a in d)
  7273. d.hasOwnProperty(a) && (b[a] = d[a]);
  7274. e.prototype = d.prototype;
  7275. b.prototype = new e
  7276. };
  7277. (function (b) {
  7278. var d = function (e) {
  7279. function a(a) {
  7280. e.call(this);
  7281. this.size = 2E3;
  7282. this.vertSize = 5;
  7283. this.contextLost = !1;
  7284. this.glContextId = 0;
  7285. this.currentBlendMode = "";
  7286. this.currentBaseTexture = null;
  7287. this.currentBatchSize = 0;
  7288. this.maskList = [];
  7289. this.maskDataFreeList = [];
  7290. this.canvasContext = document.createElement("canvas").getContext("2d");
  7291. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  7292. this.canvas = a || this.createCanvas();
  7293. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7294. this.canvas.addEventListener("webglcontextrestored",
  7295. this.handleContextRestored.bind(this), !1);
  7296. this.onResize();
  7297. this.projectionX = this.canvas.width / 2;
  7298. this.projectionY = -this.canvas.height / 2;
  7299. a = 6 * this.size;
  7300. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7301. this.indices = new Uint16Array(a);
  7302. for (var d = 0, l = 0; d < a; d += 6, l += 4)
  7303. this.indices[d + 0] = l + 0, this.indices[d + 1] = l + 1, this.indices[d + 2] = l + 2, this.indices[d + 3] = l + 0, this.indices[d + 4] = l + 2, this.indices[d + 5] = l + 3;
  7304. this.initWebGL();
  7305. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7306. this.worldTransform = new b.Matrix;
  7307. this.initBlendMode();
  7308. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  7309. b.TextField.prototype._draw = function (a) {
  7310. this.getDirty() && (this.cacheAsBitmap = !0);
  7311. b.DisplayObject.prototype._draw.call(this, a)
  7312. }
  7313. }
  7314. __extends(a, e);
  7315. a.prototype.createCanvas = function () {
  7316. var a = b.Browser.getInstance().$("#egretCanvas");
  7317. if (!a) {
  7318. var e = document.getElementById(b.StageDelegate.canvas_div_name),
  7319. a = b.Browser.getInstance().$new("canvas");
  7320. a.id = "egretCanvas";
  7321. e.appendChild(a)
  7322. }
  7323. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  7324. this.onResize, this);
  7325. return a
  7326. };
  7327. a.prototype.onResize = function () {
  7328. if (this.canvas) {
  7329. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7330. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  7331. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  7332. this.canvas.style.width = a.style.width;
  7333. this.canvas.style.height = a.style.height;
  7334. this.projectionX = this.canvas.width / 2;
  7335. this.projectionY = -this.canvas.height / 2
  7336. }
  7337. };
  7338. a.prototype.handleContextLost = function () {
  7339. this.contextLost = !0
  7340. };
  7341. a.prototype.handleContextRestored =
  7342. function () {
  7343. this.initWebGL();
  7344. this.shaderManager.setContext(this.gl);
  7345. this.contextLost = !1
  7346. };
  7347. a.prototype.initWebGL = function () {
  7348. for (var a = {
  7349. stencil : !0
  7350. }, b, e = ["experimental-webgl", "webgl"], d = 0; d < e.length; d++) {
  7351. try {
  7352. b = this.canvas.getContext(e[d], a)
  7353. } catch (g) {}
  7354. if (b)
  7355. break
  7356. }
  7357. if (!b)
  7358. throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  7359. this.setContext(b)
  7360. };
  7361. a.prototype.setContext = function (a) {
  7362. this.gl = a;
  7363. a.id = this.glContextId++;
  7364. this.vertexBuffer = a.createBuffer();
  7365. this.indexBuffer = a.createBuffer();
  7366. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  7367. this.indexBuffer);
  7368. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7369. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7370. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7371. a.disable(a.DEPTH_TEST);
  7372. a.disable(a.CULL_FACE);
  7373. a.enable(a.BLEND);
  7374. a.colorMask(!0, !0, !0, !0)
  7375. };
  7376. a.prototype.initBlendMode = function () {
  7377. this.blendModesWebGL = {};
  7378. this.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  7379. this.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  7380. };
  7381. a.prototype.start =
  7382. function () {
  7383. if (!this.contextLost) {
  7384. var a = this.gl;
  7385. a.activeTexture(a.TEXTURE0);
  7386. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7387. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7388. var b;
  7389. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  7390. this.shaderManager.activateShader(b);
  7391. b.syncUniforms();
  7392. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7393. var e = 4 * this.vertSize;
  7394. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, e, 0);
  7395. a.vertexAttribPointer(b.aTextureCoord,
  7396. 2, a.FLOAT, !1, e, 8);
  7397. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, e, 16)
  7398. }
  7399. };
  7400. a.prototype.clearScreen = function () {
  7401. var a = this.gl;
  7402. a.colorMask(!0, !0, !0, !0);
  7403. for (var e = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, m = e.length; d < m; d++) {
  7404. var g = e[d];
  7405. a.viewport(g.x, g.y, g.width, g.height);
  7406. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7407. a.clearColor(0, 0, 0, 0);
  7408. a.clear(a.COLOR_BUFFER_BIT)
  7409. }
  7410. e = b.MainContext.instance.stage;
  7411. a.viewport(0, 0, e.stageWidth, e.stageHeight);
  7412. this.renderCost = 0
  7413. };
  7414. a.prototype.setBlendMode = function (a) {
  7415. a ||
  7416. (a = b.BlendMode.NORMAL);
  7417. if (this.currentBlendMode != a) {
  7418. var e = this.blendModesWebGL[a];
  7419. e && (this._draw(), this.gl.blendFunc(e[0], e[1]), this.currentBlendMode = a)
  7420. }
  7421. };
  7422. a.prototype.drawRepeatImage = function (a, b, e, d, g, f, h, n, p, q) {
  7423. for (; f < n; f += d)
  7424. for (q = h; q < p; q += g) {
  7425. var r = Math.min(d, n - f),
  7426. s = Math.min(g, p - q);
  7427. this.drawImage(a, b, e, r, s, f, q, r, s)
  7428. }
  7429. };
  7430. a.prototype.drawImage = function (a, e, d, m, g, f, h, n, p, q) {
  7431. void 0 === q && (q = void 0);
  7432. if (!this.contextLost)
  7433. if (void 0 !== q)
  7434. this.drawRepeatImage(a, e, d, m, g, f, h, n, p, q);
  7435. else {
  7436. q = b.MainContext.instance.rendererContext.texture_scale_factor;
  7437. e /= q;
  7438. d /= q;
  7439. m /= q;
  7440. g /= q;
  7441. this.createWebGLTexture(a);
  7442. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1)
  7443. this._draw(), this.currentBaseTexture = a.webGLTexture;
  7444. var r = this.worldTransform,
  7445. s = r.a,
  7446. t = r.b,
  7447. u = r.c,
  7448. v = r.d,
  7449. x = r.tx,
  7450. y = r.ty;
  7451. 0 == f && 0 == h || r.append(1, 0, 0, 1, f, h);
  7452. 1 == m / n && 1 == g / p || r.append(n / m, 0, 0, p / g, 0, 0);
  7453. f = r.a;
  7454. h = r.b;
  7455. n = r.c;
  7456. p = r.d;
  7457. q = r.tx;
  7458. var w = r.ty;
  7459. r.a = s;
  7460. r.b = t;
  7461. r.c = u;
  7462. r.d = v;
  7463. r.tx = x;
  7464. r.ty = y;
  7465. s = a._sourceWidth;
  7466. t = a._sourceHeight;
  7467. a = m;
  7468. r = g;
  7469. e /= s;
  7470. d /= t;
  7471. m /= s;
  7472. g /= t;
  7473. s = this.vertices;
  7474. t = 4 * this.currentBatchSize *
  7475. this.vertSize;
  7476. u = this.worldAlpha;
  7477. s[t++] = q;
  7478. s[t++] = w;
  7479. s[t++] = e;
  7480. s[t++] = d;
  7481. s[t++] = u;
  7482. s[t++] = f * a + q;
  7483. s[t++] = h * a + w;
  7484. s[t++] = m + e;
  7485. s[t++] = d;
  7486. s[t++] = u;
  7487. s[t++] = f * a + n * r + q;
  7488. s[t++] = p * r + h * a + w;
  7489. s[t++] = m + e;
  7490. s[t++] = g + d;
  7491. s[t++] = u;
  7492. s[t++] = n * r + q;
  7493. s[t++] = p * r + w;
  7494. s[t++] = e;
  7495. s[t++] = g + d;
  7496. s[t++] = u;
  7497. this.currentBatchSize++
  7498. }
  7499. };
  7500. a.prototype._draw = function () {
  7501. if (0 != this.currentBatchSize && !this.contextLost) {
  7502. var a = b.getTimer();
  7503. this.start();
  7504. var e = this.gl;
  7505. e.bindTexture(e.TEXTURE_2D, this.currentBaseTexture);
  7506. var d = this.vertices.subarray(0, 4 * this.currentBatchSize *
  7507. this.vertSize);
  7508. e.bufferSubData(e.ARRAY_BUFFER, 0, d);
  7509. e.drawElements(e.TRIANGLES, 6 * this.currentBatchSize, e.UNSIGNED_SHORT, 0);
  7510. this.currentBatchSize = 0;
  7511. this.renderCost += b.getTimer() - a;
  7512. b.Profiler.getInstance().onDrawImage()
  7513. }
  7514. };
  7515. a.prototype.setTransform = function (a) {
  7516. var b = this.worldTransform;
  7517. b.a = a.a;
  7518. b.b = a.b;
  7519. b.c = a.c;
  7520. b.d = a.d;
  7521. b.tx = a.tx;
  7522. b.ty = a.ty
  7523. };
  7524. a.prototype.setAlpha = function (a, b) {
  7525. this.worldAlpha = a;
  7526. this.setBlendMode(b)
  7527. };
  7528. a.prototype.createWebGLTexture = function (a) {
  7529. if (!a.webGLTexture) {
  7530. var b = this.gl;
  7531. a.webGLTexture =
  7532. b.createTexture();
  7533. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  7534. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7535. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  7536. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7537. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7538. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7539. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7540. b.bindTexture(b.TEXTURE_2D, null)
  7541. }
  7542. };
  7543. a.prototype.pushMask = function (a) {
  7544. this._draw();
  7545. var b = this.gl;
  7546. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  7547. var e = this.maskDataFreeList.pop();
  7548. e ? (e.x = a.x, e.y = a.y, e.w = a.width, e.h = a.height) : e = {
  7549. x : a.x,
  7550. y : a.y,
  7551. w : a.width,
  7552. h : a.height
  7553. };
  7554. this.maskList.push(e);
  7555. b.colorMask(!1, !1, !1, !1);
  7556. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  7557. this.renderGraphics(e);
  7558. b.colorMask(!0, !0, !0, !0);
  7559. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  7560. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  7561. };
  7562. a.prototype.popMask = function () {
  7563. this._draw();
  7564. var a = this.gl,
  7565. b = this.maskList.pop();
  7566. 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));
  7567. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  7568. };
  7569. a.prototype.setGlobalColorTransform = function (a) {
  7570. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7571. a = a.concat();
  7572. var b = this.shaderManager.colorTransformShader;
  7573. b.uniforms.colorAdd.value.w = a.splice(19,
  7574. 1)[0] / 255;
  7575. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7576. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7577. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7578. b.uniforms.matrix.value = a
  7579. }
  7580. };
  7581. a.prototype.setupFont = function (a, b) {
  7582. var e = this.canvasContext,
  7583. d = a.italic ? "italic " : "normal ",
  7584. d = d + (a.bold ? "bold " : "normal "),
  7585. d = d + (a.size + "px " + a.fontFamily);
  7586. e.font = d;
  7587. e.textAlign = "left";
  7588. e.textBaseline = "middle"
  7589. };
  7590. a.prototype.measureText = function (a) {
  7591. return this.canvasContext.measureText(a).width
  7592. };
  7593. a.prototype.renderGraphics =
  7594. function (a) {
  7595. var b = this.gl,
  7596. e = this.shaderManager.primitiveShader;
  7597. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7598. this.updateGraphics(a);
  7599. this.shaderManager.activateShader(e);
  7600. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7601. b.uniformMatrix3fv(e.translationMatrix, !1, this.worldTransform.toArray(!0));
  7602. b.uniform2f(e.projectionVector, this.projectionX, -this.projectionY);
  7603. b.uniform2f(e.offsetVector, 0, 0);
  7604. b.uniform3fv(e.tintColor, [1, 1, 1]);
  7605. b.uniform1f(e.alpha, this.worldAlpha);
  7606. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7607. b.vertexAttribPointer(e.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7608. b.vertexAttribPointer(e.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7609. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7610. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7611. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7612. };
  7613. a.prototype.updateGraphics =
  7614. function (a) {
  7615. var b = this.gl;
  7616. this.buildRectangle(a);
  7617. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7618. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7619. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7620. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7621. };
  7622. a.prototype.buildRectangle = function (a) {
  7623. var b = a.x,
  7624. e = a.y,
  7625. d = a.w;
  7626. a = a.h;
  7627. var g = this.graphicsPoints,
  7628. f = this.graphicsIndices,
  7629. h = g.length / 6;
  7630. g.push(b, e);
  7631. g.push(0, 0, 0, 1);
  7632. g.push(b + d, e);
  7633. g.push(0, 0, 0, 1);
  7634. g.push(b, e + a);
  7635. g.push(0, 0, 0, 1);
  7636. g.push(b + d, e + a);
  7637. g.push(0, 0, 0, 1);
  7638. f.push(h, h, h + 1, h + 2, h + 3, h + 3)
  7639. };
  7640. return a
  7641. }
  7642. (b.RendererContext);
  7643. b.WebGLRenderer = d;
  7644. d.prototype.__class__ = "egret.WebGLRenderer"
  7645. })(egret || (egret = {}));
  7646. (function (b) {
  7647. var d = function () {
  7648. function b() {}
  7649. b.compileProgram = function (a, c, d) {
  7650. d = b.compileFragmentShader(a, d);
  7651. c = b.compileVertexShader(a, c);
  7652. var l = a.createProgram();
  7653. a.attachShader(l, c);
  7654. a.attachShader(l, d);
  7655. a.linkProgram(l);
  7656. a.getProgramParameter(l, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  7657. return l
  7658. };
  7659. b.compileFragmentShader = function (a, c) {
  7660. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  7661. };
  7662. b.compileVertexShader = function (a, c) {
  7663. return b._compileShader(a, c, a.VERTEX_SHADER)
  7664. };
  7665. b._compileShader =
  7666. function (a, b, e) {
  7667. e = a.createShader(e);
  7668. a.shaderSource(e, b);
  7669. a.compileShader(e);
  7670. return a.getShaderParameter(e, a.COMPILE_STATUS) ? e : (console.log(a.getShaderInfoLog(e)), null)
  7671. };
  7672. b.checkCanUseWebGL = function () {
  7673. if (void 0 == b.canUseWebGL)
  7674. try {
  7675. var a = document.createElement("canvas");
  7676. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7677. } catch (c) {
  7678. b.canUseWebGL = !1
  7679. }
  7680. return b.canUseWebGL
  7681. };
  7682. return b
  7683. }
  7684. ();
  7685. b.WebGLUtils = d;
  7686. d.prototype.__class__ = "egret.WebGLUtils"
  7687. })(egret || (egret = {}));
  7688. __extends = this.__extends || function (b, d) {
  7689. function e() {
  7690. this.constructor = b
  7691. }
  7692. for (var a in d)
  7693. d.hasOwnProperty(a) && (b[a] = d[a]);
  7694. e.prototype = d.prototype;
  7695. b.prototype = new e
  7696. };
  7697. (function (b) {
  7698. var d = function () {
  7699. function b(a) {
  7700. this.maxAttibs = 10;
  7701. this.attribState = [];
  7702. this.tempAttribState = [];
  7703. for (var c = 0; c < this.maxAttibs; c++)
  7704. this.attribState[c] = !1;
  7705. this.setContext(a)
  7706. }
  7707. b.prototype.setContext = function (b) {
  7708. this.gl = b;
  7709. this.primitiveShader = new c(b);
  7710. this.defaultShader = new e(b);
  7711. this.colorTransformShader = new a(b);
  7712. this.activateShader(this.defaultShader)
  7713. };
  7714. b.prototype.activateShader = function (a) {
  7715. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  7716. a)
  7717. };
  7718. b.prototype.setAttribs = function (a) {
  7719. var b,
  7720. c;
  7721. c = this.tempAttribState.length;
  7722. for (b = 0; b < c; b++)
  7723. this.tempAttribState[b] = !1;
  7724. c = a.length;
  7725. for (b = 0; b < c; b++)
  7726. this.tempAttribState[a[b]] = !0;
  7727. a = this.gl;
  7728. c = this.attribState.length;
  7729. for (b = 0; b < c; b++)
  7730. this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7731. };
  7732. return b
  7733. }
  7734. ();
  7735. b.WebGLShaderManager = d;
  7736. d.prototype.__class__ = "egret.WebGLShaderManager";
  7737. var e = function () {
  7738. function a(b) {
  7739. this.defaultVertexSrc =
  7740. "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}";
  7741. this.program = null;
  7742. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7743. this.gl = b;
  7744. this.init()
  7745. }
  7746. a.prototype.init = function () {
  7747. var a = this.gl,
  7748. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7749. a.useProgram(c);
  7750. this.uSampler = a.getUniformLocation(c, "uSampler");
  7751. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7752. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7753. this.dimensions = a.getUniformLocation(c, "dimensions");
  7754. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7755. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  7756. this.colorAttribute =
  7757. a.getAttribLocation(c, "aColor");
  7758. -1 === this.colorAttribute && (this.colorAttribute = 2);
  7759. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7760. for (var e in this.uniforms)
  7761. this.uniforms[e].uniformLocation = a.getUniformLocation(c, e);
  7762. this.initUniforms();
  7763. this.program = c
  7764. };
  7765. a.prototype.initUniforms = function () {
  7766. if (this.uniforms) {
  7767. var a = this.gl,
  7768. b,
  7769. c;
  7770. for (c in this.uniforms) {
  7771. b = this.uniforms[c];
  7772. var e = b.type;
  7773. "mat2" === e || "mat3" === e || "mat4" === e ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === e ? b.glFunc = a.uniformMatrix2fv :
  7774. "mat3" === e ? b.glFunc = a.uniformMatrix3fv : "mat4" === e && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + e], b.glValueLength = "2f" === e || "2i" === e ? 2 : "3f" === e || "3i" === e ? 3 : "4f" === e || "4i" === e ? 4 : 1)
  7775. }
  7776. }
  7777. };
  7778. a.prototype.syncUniforms = function () {
  7779. if (this.uniforms) {
  7780. var a,
  7781. b = this.gl,
  7782. c;
  7783. for (c in this.uniforms)
  7784. 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,
  7785. 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)
  7786. }
  7787. };
  7788. return a
  7789. }
  7790. ();
  7791. b.EgretShader = e;
  7792. e.prototype.__class__ = "egret.EgretShader";
  7793. var a = function (a) {
  7794. function b(c) {
  7795. a.call(this, c);
  7796. 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}";
  7797. this.uniforms = {
  7798. matrix : {
  7799. type : "mat4",
  7800. value : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7801. },
  7802. colorAdd : {
  7803. type : "4f",
  7804. value : {
  7805. x : 0,
  7806. y : 0,
  7807. z : 0,
  7808. w : 0
  7809. }
  7810. }
  7811. };
  7812. this.init()
  7813. }
  7814. __extends(b, a);
  7815. return b
  7816. }
  7817. (e);
  7818. b.ColorTransformShader = a;
  7819. a.prototype.__class__ = "egret.ColorTransformShader";
  7820. var c = function () {
  7821. function a(b) {
  7822. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  7823. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7824. 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}";
  7825. this.gl = b;
  7826. this.init()
  7827. }
  7828. a.prototype.init = function () {
  7829. var a = this.gl,
  7830. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7831. a.useProgram(c);
  7832. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7833. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7834. this.tintColor = a.getUniformLocation(c, "tint");
  7835. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7836. this.colorAttribute = a.getAttribLocation(c, "aColor");
  7837. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7838. this.translationMatrix = a.getUniformLocation(c,
  7839. "translationMatrix");
  7840. this.alpha = a.getUniformLocation(c, "alpha");
  7841. this.program = c
  7842. };
  7843. return a
  7844. }
  7845. ();
  7846. b.PrimitiveShader = c;
  7847. c.prototype.__class__ = "egret.PrimitiveShader"
  7848. })(egret || (egret = {}));
  7849. __extends = this.__extends || function (b, d) {
  7850. function e() {
  7851. this.constructor = b
  7852. }
  7853. for (var a in d)
  7854. d.hasOwnProperty(a) && (b[a] = d[a]);
  7855. e.prototype = d.prototype;
  7856. b.prototype = new e
  7857. };
  7858. (function (b) {
  7859. var d = function (e) {
  7860. function a() {
  7861. e.call(this)
  7862. }
  7863. __extends(a, e);
  7864. a.prototype.proceed = function (a) {
  7865. function e() {
  7866. if (4 == m.readyState)
  7867. if (m.status != a._status && (a._status = m.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, m.status)), 400 <= m.status || 0 == m.status)
  7868. b.IOErrorEvent.dispatchIOErrorEvent(a);
  7869. else {
  7870. switch (a.dataFormat) {
  7871. case b.URLLoaderDataFormat.TEXT:
  7872. a.data = m.responseText;
  7873. break;
  7874. case b.URLLoaderDataFormat.VARIABLES:
  7875. a.data = new b.URLVariables(m.responseText);
  7876. break;
  7877. case b.URLLoaderDataFormat.BINARY:
  7878. a.data =
  7879. m.response;
  7880. break;
  7881. default:
  7882. a.data = m.responseText
  7883. }
  7884. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7885. }
  7886. }
  7887. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE)
  7888. this.loadTexture(a);
  7889. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND)
  7890. this.loadSound(a);
  7891. else {
  7892. var d = a._request,
  7893. m = this.getXHR();
  7894. m.onreadystatechange = e;
  7895. var g = b.NetContext._getUrl(d);
  7896. m.open(d.method, g, !0);
  7897. this.setResponseType(m, a.dataFormat);
  7898. d.method != b.URLRequestMethod.GET && d.data ? d.data instanceof b.URLVariables ? (m.setRequestHeader("Content-Type",
  7899. "application/x-www-form-urlencoded"), m.send(d.data.toString())) : (m.setRequestHeader("Content-Type", "multipart/form-data"), m.send(d.data)) : m.send()
  7900. }
  7901. };
  7902. a.prototype.loadSound = function (a) {
  7903. function e(g) {
  7904. window.clearTimeout(m.__timeoutId);
  7905. m.removeEventListener("canplaythrough", e, !1);
  7906. m.removeEventListener("error", d, !1);
  7907. g = new b.Sound;
  7908. g._setAudio(m);
  7909. a.data = g;
  7910. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7911. }
  7912. function d(g) {
  7913. window.clearTimeout(m.__timeoutId);
  7914. m.removeEventListener("canplaythrough",
  7915. e, !1);
  7916. m.removeEventListener("error", d, !1);
  7917. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7918. }
  7919. var m = new Audio(a._request.url);
  7920. m.__timeoutId = window.setTimeout(e, 100);
  7921. m.addEventListener("canplaythrough", e, !1);
  7922. m.addEventListener("error", d, !1);
  7923. m.load()
  7924. };
  7925. a.prototype.getXHR = function () {
  7926. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7927. };
  7928. a.prototype.setResponseType = function (a, e) {
  7929. switch (e) {
  7930. case b.URLLoaderDataFormat.TEXT:
  7931. case b.URLLoaderDataFormat.VARIABLES:
  7932. a.responseType = b.URLLoaderDataFormat.TEXT;
  7933. break;
  7934. case b.URLLoaderDataFormat.BINARY:
  7935. a.responseType = "arraybuffer";
  7936. break;
  7937. default:
  7938. a.responseType = e
  7939. }
  7940. };
  7941. a.prototype.loadTexture = function (a) {
  7942. var e = a._request,
  7943. d = new Image;
  7944. d.onload = function (e) {
  7945. d.onerror = null;
  7946. d.onload = null;
  7947. e = new b.Texture;
  7948. e._setBitmapData(d);
  7949. a.data = e;
  7950. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7951. };
  7952. d.onerror = function (e) {
  7953. d.onerror = null;
  7954. d.onload = null;
  7955. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7956. };
  7957. d.src = e.url
  7958. };
  7959. return a
  7960. }
  7961. (b.NetContext);
  7962. b.HTML5NetContext = d;
  7963. d.prototype.__class__ = "egret.HTML5NetContext"
  7964. })(egret ||
  7965. (egret = {}));
  7966. __extends = this.__extends || function (b, d) {
  7967. function e() {
  7968. this.constructor = b
  7969. }
  7970. for (var a in d)
  7971. d.hasOwnProperty(a) && (b[a] = d[a]);
  7972. e.prototype = d.prototype;
  7973. b.prototype = new e
  7974. };
  7975. (function (b) {
  7976. var d = function (e) {
  7977. function a() {
  7978. e.call(this);
  7979. this._isTouchDown = !1;
  7980. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7981. }
  7982. __extends(a, e);
  7983. a.prototype.prevent = function (a) {
  7984. a.stopPropagation();
  7985. !0 != a.isScroll && a.preventDefault()
  7986. };
  7987. a.prototype.run = function () {
  7988. var a = this;
  7989. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function (b) {
  7990. a._onTouchBegin(b);
  7991. a.prevent(b)
  7992. }, !1), this.rootDiv.addEventListener("MSPointerMove", function (b) {
  7993. a._onTouchMove(b);
  7994. a.prevent(b)
  7995. },
  7996. !1), this.rootDiv.addEventListener("MSPointerUp", function (b) {
  7997. a._onTouchEnd(b);
  7998. a.prevent(b)
  7999. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  8000. window.addEventListener("mousedown", function (b) {
  8001. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  8002. });
  8003. window.addEventListener("mouseup", function (b) {
  8004. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  8005. a._isTouchDown = !1
  8006. })
  8007. };
  8008. a.prototype.addMouseListener = function () {
  8009. var a = this;
  8010. this.rootDiv.addEventListener("mousedown", function (b) {
  8011. a._onTouchBegin(b)
  8012. });
  8013. this.rootDiv.addEventListener("mousemove", function (b) {
  8014. a._onTouchMove(b)
  8015. });
  8016. this.rootDiv.addEventListener("mouseup", function (b) {
  8017. a._onTouchEnd(b)
  8018. })
  8019. };
  8020. a.prototype.addTouchListener = function () {
  8021. var a = this;
  8022. this.rootDiv.addEventListener("touchstart", function (b) {
  8023. for (var e = b.changedTouches.length, d = 0; d < e; d++)
  8024. a._onTouchBegin(b.changedTouches[d]);
  8025. a.prevent(b)
  8026. }, !1);
  8027. this.rootDiv.addEventListener("touchmove",
  8028. function (b) {
  8029. for (var e = b.changedTouches.length, d = 0; d < e; d++)
  8030. a._onTouchMove(b.changedTouches[d]);
  8031. a.prevent(b)
  8032. }, !1);
  8033. this.rootDiv.addEventListener("touchend", function (b) {
  8034. for (var e = b.changedTouches.length, d = 0; d < e; d++)
  8035. a._onTouchEnd(b.changedTouches[d]);
  8036. a.prevent(b)
  8037. }, !1);
  8038. this.rootDiv.addEventListener("touchcancel", function (b) {
  8039. for (var e = b.changedTouches.length, d = 0; d < e; d++)
  8040. a._onTouchEnd(b.changedTouches[d]);
  8041. a.prevent(b)
  8042. }, !1)
  8043. };
  8044. a.prototype.inOutOfCanvas = function (a) {
  8045. var e = this.getLocation(this.rootDiv, a);
  8046. a = e.x;
  8047. var e = e.y,
  8048. d = b.MainContext.instance.stage;
  8049. return 0 > a || 0 > e || a > d.stageWidth || e > d.stageHeight ? !0 : !1
  8050. };
  8051. a.prototype.dispatchLeaveStageEvent = function () {
  8052. this.touchingIdentifiers.length = 0;
  8053. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  8054. };
  8055. a.prototype._onTouchBegin = function (a) {
  8056. var b = this.getLocation(this.rootDiv, a),
  8057. e = -1;
  8058. a.hasOwnProperty("identifier") && (e = a.identifier);
  8059. this.onTouchBegan(b.x, b.y, e)
  8060. };
  8061. a.prototype._onTouchMove = function (a) {
  8062. var b = this.getLocation(this.rootDiv, a),
  8063. e = -1;
  8064. a.hasOwnProperty("identifier") &&
  8065. (e = a.identifier);
  8066. this.onTouchMove(b.x, b.y, e)
  8067. };
  8068. a.prototype._onTouchEnd = function (a) {
  8069. var b = this.getLocation(this.rootDiv, a),
  8070. e = -1;
  8071. a.hasOwnProperty("identifier") && (e = a.identifier);
  8072. this.onTouchEnd(b.x, b.y, e)
  8073. };
  8074. a.prototype.getLocation = function (a, e) {
  8075. var d = document.documentElement,
  8076. m = window,
  8077. g,
  8078. f;
  8079. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  8080. g += m.pageXOffset - d.clientLeft;
  8081. f += m.pageYOffset - d.clientTop;
  8082. null != e.pageX ? (d = e.pageX, m = e.pageY) : (g -= document.body.scrollLeft,
  8083. f -= document.body.scrollTop, d = e.clientX, m = e.clientY);
  8084. var h = b.Point.identity;
  8085. h.x = (d - g) / b.StageDelegate.getInstance().getScaleX();
  8086. h.y = (m - f) / b.StageDelegate.getInstance().getScaleY();
  8087. return h
  8088. };
  8089. return a
  8090. }
  8091. (b.TouchContext);
  8092. b.HTML5TouchContext = d;
  8093. d.prototype.__class__ = "egret.HTML5TouchContext"
  8094. })(egret || (egret = {}));
  8095. __extends = this.__extends || function (b, d) {
  8096. function e() {
  8097. this.constructor = b
  8098. }
  8099. for (var a in d)
  8100. d.hasOwnProperty(a) && (b[a] = d[a]);
  8101. e.prototype = d.prototype;
  8102. b.prototype = new e
  8103. };
  8104. (function (b) {
  8105. var d = function (e) {
  8106. function a() {
  8107. e.call(this);
  8108. this._hasListeners = !1;
  8109. this._inputType = "";
  8110. this._isShow = !1;
  8111. this.textValue = "";
  8112. this._height = this._width = 0;
  8113. this._styleInfoes = {};
  8114. var a = b.StageDelegate.getInstance().getScaleX(),
  8115. d = b.StageDelegate.getInstance().getScaleY(),
  8116. l = b.Browser.getInstance().$new("div");
  8117. l.position.x = 0;
  8118. l.position.y = 0;
  8119. l.scale.x = a;
  8120. l.scale.y = d;
  8121. l.transforms();
  8122. l.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  8123. this.div = l;
  8124. d = b.MainContext.instance.stage;
  8125. a = d.stageWidth;
  8126. d = d.stageHeight;
  8127. l = new b.Shape;
  8128. l.width = a;
  8129. l.height = d;
  8130. l.touchEnabled = !0;
  8131. this._shape = l;
  8132. this.getStageDelegateDiv().appendChild(this.div)
  8133. }
  8134. __extends(a, e);
  8135. a.prototype.getStageDelegateDiv = function () {
  8136. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8137. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8138. return a
  8139. };
  8140. a.prototype._setMultiline = function (a) {
  8141. e.prototype._setMultiline.call(this, a);
  8142. this.createInput()
  8143. };
  8144. a.prototype.callHandler =
  8145. function (a) {
  8146. a.stopPropagation()
  8147. };
  8148. a.prototype._add = function () {
  8149. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8150. };
  8151. a.prototype._remove = function () {
  8152. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8153. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8154. };
  8155. a.prototype._addListeners = function () {
  8156. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  8157. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8158. };
  8159. a.prototype._removeListeners = function () {
  8160. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  8161. };
  8162. a.prototype.createInput = function () {
  8163. var a = this._multiline ? "textarea" : "input";
  8164. this._inputType != a && (this._inputType =
  8165. a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign",
  8166. "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8167. };
  8168. a.prototype._open = function (a, b, e, d) {};
  8169. a.prototype._setScale = function (a, d) {
  8170. e.prototype._setScale.call(this, a, d);
  8171. var l = b.StageDelegate.getInstance().getScaleX(),
  8172. m = b.StageDelegate.getInstance().getScaleY();
  8173. this.div.scale.x = l * a;
  8174. this.div.scale.y = m * d;
  8175. this.div.transforms()
  8176. };
  8177. a.prototype.changePosition = function (a, e) {
  8178. var d = b.StageDelegate.getInstance().getScaleX(),
  8179. m = b.StageDelegate.getInstance().getScaleY();
  8180. this.div.position.x =
  8181. a * d;
  8182. this.div.position.y = e * m;
  8183. this.div.transforms()
  8184. };
  8185. a.prototype.setStyles = function () {
  8186. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  8187. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  8188. this.setElementStyle("textAlign", this._textAlign);
  8189. this.setElementStyle("fontSize", this._size + "px");
  8190. this.setElementStyle("color", "#000000");
  8191. this.setElementStyle("width", this._width + "px");
  8192. this.setElementStyle("height", this._height + "px");
  8193. this.setElementStyle("border", "1px solid red");
  8194. this.setElementStyle("display",
  8195. "block")
  8196. };
  8197. a.prototype._show = function () {
  8198. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8199. this._isShow = !0;
  8200. var a = this._getText();
  8201. this.inputElement.value = a;
  8202. var e = this;
  8203. this.inputElement.oninput = function () {
  8204. e.textValue = e.inputElement.value;
  8205. e.dispatchEvent(new b.Event("updateText"))
  8206. };
  8207. this.setStyles();
  8208. this.inputElement.focus();
  8209. this.inputElement.selectionStart = a.length;
  8210. this.inputElement.selectionEnd = a.length;
  8211. this._shape && null == this._shape.parent &&
  8212. b.MainContext.instance.stage.addChild(this._shape)
  8213. };
  8214. a.prototype._hide = function () {
  8215. if (null != this.inputElement) {
  8216. this._isShow = !1;
  8217. this.inputElement.oninput = function () {};
  8218. this.setElementStyle("border", "none");
  8219. this.setElementStyle("display", "none");
  8220. this.inputElement.value = "";
  8221. this.setElementStyle("width", "0px");
  8222. window.scrollTo(0, 0);
  8223. var a = this;
  8224. b.setTimeout(function () {
  8225. a.inputElement.blur();
  8226. window.scrollTo(0, 0)
  8227. }, this, 50);
  8228. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8229. }
  8230. };
  8231. a.prototype._getText =
  8232. function () {
  8233. this.textValue || (this.textValue = "");
  8234. return this.textValue
  8235. };
  8236. a.prototype._setText = function (a) {
  8237. this.textValue = a;
  8238. this.resetText()
  8239. };
  8240. a.prototype.resetText = function () {
  8241. this.inputElement && (this.inputElement.value = this.textValue)
  8242. };
  8243. a.prototype._setWidth = function (a) {
  8244. this._width = a
  8245. };
  8246. a.prototype._setHeight = function (a) {
  8247. this._height = a
  8248. };
  8249. a.prototype.setElementStyle = function (a, b) {
  8250. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8251. };
  8252. return a
  8253. }
  8254. (b.StageText);
  8255. b.HTML5StageText =
  8256. d;
  8257. d.prototype.__class__ = "egret.HTML5StageText"
  8258. })(egret || (egret = {}));
  8259. egret.StageText.create = function () {
  8260. return new egret.HTML5StageText
  8261. };
  8262. /*ih5game.setShare({
  8263. title : "\u5b57\u724c\u7ffb\u7ffb\u7ffb\uff0c\u73a9\u4e86\u5b83\uff0c\u5988\u5988\u518d\u4e5f\u4e0d\u7528\u62c5\u5fc3\u6211\u7684\u56fd\u5b66\u4e86",
  8264. desc : "\u8bb0\u4f4f\u987a\u5e8f\uff0c\u731c\u4e2d\u5b83\uff0c\u4f60\u4f1a\u770b\u5230\u4e0d\u4e00\u6837\u7684\u56fd\u5b66"
  8265. });*/
  8266. var GloabData = function () {
  8267. function t() {}
  8268. return t.CONST_WIDTH = 640,
  8269. t.CONST_HEIGHT = 960,
  8270. t.nTouchDiff = 0,
  8271. t.arraySay = null,
  8272. t.arrayPlayWord = null,
  8273. t.arrayMoreGame = null,
  8274. t.REQ_URL = "http://www.onekes.com/plate_wx/",
  8275. t.arrayBanner = null,
  8276. t
  8277. }
  8278. ();
  8279. GloabData.prototype.__class__ = "GloabData";
  8280. var Helper = function () {
  8281. function t() {}
  8282. return t.createBitMap = function (t, e, a) {
  8283. var r = new egret.Bitmap;
  8284. return r.texture = RES.getRes(t),
  8285. r.x = e,
  8286. r.y = a,
  8287. r
  8288. },
  8289. t.createText = function (t, e, a, r) {
  8290. var o = new egret.TextField;
  8291. return o.text = t,
  8292. o.textAlign = "center",
  8293. o.size = r,
  8294. o.width = 120,
  8295. o.x = e,
  8296. o.y = a,
  8297. o
  8298. },
  8299. t.createBtn = function (t, e, a, r, o) {
  8300. var i = new egret.Sprite,
  8301. n = new egret.Bitmap;
  8302. return n.texture = RES.getRes(t),
  8303. i.addChild(n),
  8304. i.touchEnabled = !0,
  8305. i.x = e,
  8306. i.y = a,
  8307. i.addEventListener(egret.TouchEvent.TOUCH_TAP, r, o),
  8308. i
  8309. },
  8310. t.changeLayer = function (t) {
  8311. var e = egret.MainContext.instance.stage;
  8312. e.removeChildren(),
  8313. e.addChild(t)
  8314. },
  8315. t.isInArray = function (t, e) {
  8316. for (var a = 0; a < e.length; ++a)
  8317. if (e[a] == t)
  8318. return !0;
  8319. return !1
  8320. },
  8321. t.createBannner = function () {
  8322. return e
  8323. },
  8324. t.getPlatfrom = function () {
  8325. var t = navigator.platform;
  8326. return "Linux" == t.substr(0, 5) ? "Android" : "iPod" == t.substr(0, 4) || "iPhone" == t.substr(0, 6) || "iPad" == t.substr(0, 4) ? "IOS" : "Win32" == t.substr(0, 5) ? "Win32" : "unknow"
  8327. },
  8328. t
  8329. }
  8330. ();
  8331. Helper.prototype.__class__ = "Helper";
  8332. var NetWork = function () {
  8333. function t() {
  8334. this.urlloader = null,
  8335. this.urlloader = new egret.URLLoader
  8336. }
  8337. return t.getInstance = function () {
  8338. return null == this.mInstance && (this.mInstance = new t),
  8339. this.mInstance
  8340. },
  8341. t.prototype.reqState = function () {},
  8342. t.prototype.reqAds = function () {},
  8343. t.mInstance = null,
  8344. t
  8345. }
  8346. ();
  8347. NetWork.prototype.__class__ = "NetWork";
  8348. var __extends = this.__extends || function (t, e) {
  8349. function a() {
  8350. this.constructor = t
  8351. }
  8352. for (var r in e)
  8353. e.hasOwnProperty(r) && (t[r] = e[r]);
  8354. a.prototype = e.prototype,
  8355. t.prototype = new a
  8356. }, Card = function (t) {
  8357. function e(e, a) {
  8358. t.call(this),
  8359. this.nChangeCount = 0,
  8360. this.bmCardBg = new egret.Bitmap,
  8361. this.bmCardBg.texture = RES.getRes("pic_16"),
  8362. this.addChild(this.bmCardBg),
  8363. this.txtWord = new egret.TextField,
  8364. this.txtWord.text = a,
  8365. this.txtWord.textColor = 9315107,
  8366. this.txtWord.textAlign = "center",
  8367. this.txtWord.size = 50,
  8368. this.txtWord.width = 120,
  8369. this.txtWord.anchorX = .5,
  8370. this.txtWord.anchorY = .5,
  8371. this.txtWord.x = this.bmCardBg.width / 2,
  8372. this.txtWord.y = this.bmCardBg.height / 2,
  8373. this.addChild(this.txtWord),
  8374. this.txtError = new egret.TextField,
  8375. this.txtError.text = "X",
  8376. this.txtError.textColor = 16711680,
  8377. this.txtError.textAlign = "center",
  8378. this.txtError.size = 90,
  8379. this.txtError.width = 120,
  8380. this.txtError.anchorX = .5,
  8381. this.txtError.anchorY = .5,
  8382. this.txtError.x = this.bmCardBg.width / 2,
  8383. this.txtError.y = this.bmCardBg.height / 2,
  8384. this.txtError.visible = !1,
  8385. this.addChild(this.txtError)
  8386. }
  8387. return __extends(e, t),
  8388. e.prototype.showWord = function () {
  8389. this.bmCardBg.texture = RES.getRes("pic_16"),
  8390. this.txtWord.visible = !0
  8391. },
  8392. e.prototype.hideWord = function () {
  8393. this.bmCardBg.texture = RES.getRes("pic_19"),
  8394. this.txtWord.visible = !1
  8395. },
  8396. e.prototype.showError = function () {
  8397. this.showWord(),
  8398. this.txtError.visible = !0
  8399. },
  8400. e.prototype.addChangeCount = function () {
  8401. this.nChangeCount++
  8402. },
  8403. e.prototype.getChangeCount = function () {
  8404. return this.nChangeCount
  8405. },
  8406. e
  8407. }
  8408. (egret.Sprite);
  8409. Card.prototype.__class__ = "Card";
  8410. var UIGameData = function () {
  8411. function t() {
  8412. this.nScore = 0,
  8413. this.nState = 1,
  8414. this.nCardCount = 5,
  8415. this.nWordEnd = this.nWordStart = 0,
  8416. this.calcWordStarAndEnd()
  8417. }
  8418. return t.prototype.getScore = function () {
  8419. return this.nScore
  8420. },
  8421. t.prototype.getState = function () {
  8422. return this.nState
  8423. },
  8424. t.prototype.getMaxState = function () {
  8425. return this.arrayWord.length
  8426. },
  8427. t.prototype.addScore = function (t) {
  8428. this.nScore += t
  8429. },
  8430. t.prototype.addState = function (t) {
  8431. this.nState += t,
  8432. 0 >= this.nCardCount && (this.nCardCount = 3)
  8433. },
  8434. t.prototype.getLookTime = function () {
  8435. return 0
  8436. },
  8437. t.prototype.getChangeTime = function () {
  8438. var t = 400 - 100 * Math.log(this.nState);
  8439. return console.log("============= " + t),
  8440. 50 >= t && (t = 50),
  8441. t
  8442. },
  8443. t.prototype.getCardCount = function () {
  8444. return this.nState <= this.arrayWord.length ? this.arrayWord[this.nState - 1].length : 3
  8445. },
  8446. t.prototype.getChangeCount = function () {
  8447. return 5 + Math.round(this.nState / 3)
  8448. },
  8449. t.prototype.calcWordStarAndEnd = function () {
  8450. this.arrayWord = GloabData.arrayPlayWord
  8451. },
  8452. t.prototype.getWord = function (t) {
  8453. return this.nState <= this.arrayWord.length ? this.arrayWord[this.nState - 1].charAt(t - 1) : t.toString()
  8454. },
  8455. t.prototype.getWords = function () {
  8456. return this.nState <= this.arrayWord.length ? this.arrayWord[this.nState - 1] : ""
  8457. },
  8458. t.prototype.getWordAllState = function () {
  8459. return ""
  8460. },
  8461. t
  8462. }
  8463. ();
  8464. UIGameData.prototype.__class__ = "UIGameData";
  8465. var __extends = this.__extends || function (t, e) {
  8466. function a() {
  8467. this.constructor = t
  8468. }
  8469. for (var r in e)
  8470. e.hasOwnProperty(r) && (t[r] = e[r]);
  8471. a.prototype = e.prototype,
  8472. t.prototype = new a
  8473. }, UIGameFail = function (t) {
  8474. function e(e, a, r) {
  8475. t.call(this),
  8476. this.addChild(Helper.createBitMap("bgImage", 0, 0));
  8477. var o = Helper.createBitMap("fail_bg", GloabData.CONST_WIDTH / 2, 400);
  8478. o.anchorX = .5,
  8479. o.anchorY = .5,
  8480. this.addChild(o),
  8481. this.addChild(Helper.createBtn("pic_32", 258, 600, this.contiunHander, this)),
  8482. this.addChild(Helper.createBtn("more_game", 415, 600, this.touchHanderMore, this)),
  8483. this.addChild(Helper.createBtn("share", 100, 600, this.shareHandler, this)),
  8484. this.addChild(Helper.createText(e.toString(), 370, 300, 30)),
  8485. o = Helper.createText("\u4f60\u73a9\u5230\u3010" + r + "\u3011\u6298\u621f\u4e86 ", 120, 3 * GloabData.CONST_HEIGHT / 4 - 300, 30),
  8486. o.width = 400,
  8487. this.addChild(o),
  8488. o = Helper.createText("\u83b7\u5f97\u4e86" + e + "\u5206 ", 120, 3 * GloabData.CONST_HEIGHT / 4 - 265, 30),
  8489. o.width = 400,
  8490. this.addChild(o),
  8491. o = Helper.createText("\u53f7\u79f0\u3010" + this.getSayWord(e) + "\u3011 ", 120, 3 * GloabData.CONST_HEIGHT / 4 - 230, 30),
  8492. o.width = 400,
  8493. this.addChild(o),
  8494. o = Helper.createText("\u5f00\u5fc3\u4e0d\uff1f ", 120, 3 * GloabData.CONST_HEIGHT / 4 - 195, 30),
  8495. o.width = 400,
  8496. this.addChild(o),
  8497. function (t, e, a, r) {
  8498. var o = "";
  8499. o = 0 == e ? "\u5b57\u724c\u7ffb\u7ffb\u7ffb\uff0c\u73a9\u4e86\u5b83\uff0c\u5988\u5988\u518d\u4e5f\u4e0d\u7528\u62c5\u5fc3\u6211\u7684\u56fd\u5b66\u4e86\uff01" : e >= 1 && 20 >= e ? "\u6211\u7ffb\u5230\u4e86\u3010" + r + "\u3011\uff0c\u83b7\u5f97\u4e86" + e + "\u5206 \u53f7\u79f0\u3010" + a + "\u3011\uff0c\u8d76\u7d27\u6765\u5e2e\u6211\u554a" : e >= 21 && 100 >= e ? "\u6211\u7ffb\u5230\u4e86\u3010" + r + "\u3011\uff0c\u83b7\u5f97\u4e86" + e + "\u5206 \u53f7\u79f0\u3010" + a + "\u3011\uff0c\u53ef\u4ee5\u8f7b\u677e\u85d0\u89c6\u4f60\u4eec\u5566" : "\u6211\u7ffb\u5230\u4e86\u3010" + r + "\u3011\uff0c\u83b7\u5f97\u4e86" + e + "\u5206 \u53f7\u79f0\u3010" + a + "\u3011\uff0c\u85d0\u89c6\u56fd\u5b66\u5927\u5e08";
  8500. /*
  8501. "字牌翻翻翻,玩了它,妈妈再也不用担心我的国学了!" : e >= 1 && 20 >= e ? "我翻到了【" + r + "】,获得了" + e + "分 号称【" + a + "】,赶紧来帮我啊 赏给你辣条!" : e >= 21 && 100 >= e ? "我翻到了【" + r + "】,获得了" + e + "分 号称【" + a + "】,可以轻松藐视你们啦 哈哈哈哈" : "我翻到了【" + r + "】,获得了" + e + "分 号称【" + a + "】,藐视国学大师 哈哈哈哈哈!不服来战";
  8502. */
  8503. window.myPlayScore = e;
  8504. // updateShare(e,o);
  8505. }
  8506. (a, e, this.getSayWord(e), r)
  8507. }
  8508. return __extends(e, t),
  8509. e.prototype.contiunHander = function () {
  8510. Helper.changeLayer(new UIGame)
  8511. },
  8512. e.prototype.getSayWord = function (t) {
  8513. for (var e = Math.round(3 * Math.random()), a = 0; a < GloabData.arraySay.length; ++a)
  8514. if (t >= GloabData.arraySay[a].score_down && t <= GloabData.arraySay[a].score_up)
  8515. return GloabData.arraySay[a].content[e];
  8516. return GloabData.arraySay[GloabData.arraySay.length - 1].content[e]
  8517. },
  8518. e.prototype.touchHanderMore = function () {
  8519. Play68.goHome();
  8520. },
  8521. e.prototype.shareHandler = function () {
  8522. play68_submitScore(window.myPlayScore);
  8523. },
  8524. e.prototype.weixinShare = function () {},
  8525. e
  8526. }
  8527. (egret.Sprite);
  8528. UIGameFail.prototype.__class__ = "UIGameFail";
  8529. var __extends = this.__extends || function (t, e) {
  8530. function a() {
  8531. this.constructor = t
  8532. }
  8533. for (var r in e)
  8534. e.hasOwnProperty(r) && (t[r] = e[r]);
  8535. a.prototype = e.prototype,
  8536. t.prototype = new a
  8537. }, UIGameShow = function (t) {
  8538. function e() {
  8539. t.call(this),
  8540. this.arrayWord = [],
  8541. this.addChild(Helper.createBitMap("bgImage", 0, 0)),
  8542. this.addChild(Helper.createBitMap("pic_05", 0, 0)),
  8543. this.txtScore = Helper.createText("0", 525, 35, 30),
  8544. this.txtScore.anchorX = .5,
  8545. this.txtScore.anchorY = .5,
  8546. this.addChild(this.txtScore),
  8547. this.txtState = Helper.createText("0", 190, 35, 30),
  8548. this.txtState.anchorX = .5,
  8549. this.txtState.anchorY = .5,
  8550. this.addChild(this.txtState),
  8551. this.txtWordTip = Helper.createText("", GloabData.CONST_WIDTH / 2, 100, 40),
  8552. this.txtWordTip.anchorX = .5,
  8553. this.txtWordTip.anchorY = .5,
  8554. this.txtWordTip.width = 500,
  8555. this.addChild(this.txtWordTip)
  8556. }
  8557. return __extends(e, t),
  8558. e.prototype.showScore = function (t) {
  8559. egret.Tween.get(this.txtScore, {
  8560. loop : !1
  8561. }).to({
  8562. scaleX : 1.5,
  8563. scaleY : 1.5
  8564. }, 200).to({
  8565. scaleX : 1,
  8566. scaleY : 1
  8567. }, 200),
  8568. this.txtScore.text = (10 * t).toString(),
  8569. egret.Tween.get(this.txtState, {
  8570. loop : !1
  8571. }).to({
  8572. scaleX : 1.5,
  8573. scaleY : 1.5
  8574. }, 200).to({
  8575. scaleX : 1,
  8576. scaleY : 1
  8577. }, 200),
  8578. this.txtState.text = t.toString()
  8579. },
  8580. e.prototype.showState = function () {},
  8581. e.prototype.showWordTip = function (t) {
  8582. this.removeWords(),
  8583. this.txtWordTip.text = t
  8584. },
  8585. e.prototype.showWordRight = function (t, e, a, r, o) {
  8586. return t = Helper.createText(a, t, e, 40),
  8587. t.textColor = 9315107,
  8588. t.anchorX = .5,
  8589. t.anchorY = .5,
  8590. egret.Tween.get(t, {
  8591. loop : !1
  8592. }).to({
  8593. x : GloabData.CONST_WIDTH / 2 + 40 * (r - o / 2 - .5),
  8594. y : 100
  8595. }, 500),
  8596. this.arrayWord.push(t),
  8597. t
  8598. },
  8599. e.prototype.removeWords = function () {
  8600. for (var t = 0; t < this.arrayWord.length; t++)
  8601. this.arrayWord[t]._parent.removeChild(this.arrayWord[t]);
  8602. this.arrayWord = []
  8603. },
  8604. e
  8605. }
  8606. (egret.Sprite);
  8607. UIGameShow.prototype.__class__ = "UIGameShow";
  8608. var __extends = this.__extends || function (t, e) {
  8609. function a() {
  8610. this.constructor = t
  8611. }
  8612. for (var r in e)
  8613. e.hasOwnProperty(r) && (t[r] = e[r]);
  8614. a.prototype = e.prototype,
  8615. t.prototype = new a
  8616. }, UIGame = function (t) {
  8617. function e() {
  8618. t.call(this),
  8619. this.clsGameData = new UIGameData,
  8620. this.clsGameShow = new UIGameShow,
  8621. this.addChild(this.clsGameShow),
  8622. this.initData(),
  8623. this.initView(),
  8624. 1 == this.clsGameData.getState() ? this.createTip() : this.startTimeGame(),
  8625. this.touchEnabled = !0,
  8626. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.touchHander, this),
  8627. this.uiTime = Helper.createText("", 130, 480, 30),
  8628. share(0, 0, " ", "")
  8629. }
  8630. return __extends(e, t),
  8631. e.prototype.initData = function () {
  8632. this.arrayLastY = [],
  8633. this.arrayCard = [],
  8634. this.arrayAction = [],
  8635. this.nCurRight = 1,
  8636. this.bCanTouch = !1
  8637. },
  8638. e.prototype.initView = function () {
  8639. this.clsGameShow.showWordTip(this.clsGameData.getWords()),
  8640. this.createCard()
  8641. },
  8642. e.prototype.initStartGame = function () {
  8643. this.startTimeGame(),
  8644. this.uiReady = Helper.createBitMap("", 200, 160),
  8645. this.addChild(this.uiReady),
  8646. this.setChildIndex(this.uiReady, 1e3),
  8647. this.showReadAction()
  8648. },
  8649. e.prototype.createCard = function () {
  8650. this.clsGameData.getCardCount();
  8651. for (var t = 1; t <= this.clsGameData.getCardCount(); ++t) {
  8652. var e = new Card(t, this.clsGameData.getWord(t));
  8653. e.y = GloabData.CONST_HEIGHT / 2,
  8654. e.x = GloabData.CONST_WIDTH / 2 + 150 * (t - (this.clsGameData.getCardCount() / 2 + .5)) - 50,
  8655. this.addChild(e),
  8656. this.arrayCard.push(e)
  8657. }
  8658. },
  8659. e.prototype.startTimeGame = function () {
  8660. this.arrayCard.length && egret.Tween.get(this.arrayCard[0], {
  8661. loop : !1
  8662. }).wait(this.clsGameData.getLookTime() + 2100).call(this.handerGameStart, this)
  8663. },
  8664. e.prototype.changgeCard = function () {
  8665. this.arrayHavePosX = [],
  8666. this.arrayHavePosY = [];
  8667. for (var t = 0; t < this.arrayCard.length; t++) {
  8668. var e = this.clsGameData.getChangeTime(),
  8669. a = [],
  8670. r = [];
  8671. a[0] = this.arrayCard[t].x,
  8672. r[0] = this.arrayCard[t].y;
  8673. var o = egret.Tween.get(this.arrayCard[t], {
  8674. loop : !1
  8675. });
  8676. o.to({
  8677. x : a[0],
  8678. y : r[0]
  8679. }, e, egret.Ease.circInOut);
  8680. for (var i = 1; i < this.clsGameData.getChangeCount(); i++) {
  8681. var n = this.randDirecX(a[i - 1], r[i - 1], t, i);
  8682. a[i] = n[0],
  8683. r[i] = n[1],
  8684. o.to({
  8685. x : a[i],
  8686. y : r[i]
  8687. }, e, egret.Ease.circInOut)
  8688. }
  8689. o.call(this.handerCanTouch, this),
  8690. this.arrayHavePosX.push(a),
  8691. this.arrayHavePosY.push(r)
  8692. }
  8693. },
  8694. e.prototype.moveCard = function () {},
  8695. e.prototype.randDirecX = function (t, e, a, r) {
  8696. Math.random(),
  8697. Math.round(3 * Math.random() + .5);
  8698. var o = 200 - 400 * Math.random(),
  8699. i = 200 - 400 * Math.random();
  8700. return this.clsGameData.getState(),
  8701. t + o > 0 && 550 > t + o && this.isHavePos(t + o, e + i, r) && e + i > 250 && 700 > e + i ? [t + o, e + i] : this.randDirecX(t, e, a, r)
  8702. },
  8703. e.prototype.isHavePos = function (t, e, a) {
  8704. for (var r = 0; r < this.arrayHavePosX.length; r++)
  8705. if (t >= this.arrayHavePosX[r][a] && t <= this.arrayHavePosX[r][a] + 120 && e >= this.arrayHavePosY[r][a] && e <= this.arrayHavePosY[r][a] + 120 || t + 120 >= this.arrayHavePosX[r][a] && t + 120 <= this.arrayHavePosX[r][a] + 120 && e + 120 >= this.arrayHavePosY[r][a] && e + 120 <= this.arrayHavePosY[r][a] + 120 || t + 120 >= this.arrayHavePosX[r][a] && t + 120 <= this.arrayHavePosX[r][a] + 120 && e >= this.arrayHavePosY[r][a] && e <= this.arrayHavePosY[r][a] + 120 || t >= this.arrayHavePosX[r][a] && t <= this.arrayHavePosX[r][a] + 120 && e + 120 >= this.arrayHavePosY[r][a] && e + 120 <= this.arrayHavePosY[r][a] + 120)
  8706. return !1;
  8707. return !0
  8708. },
  8709. e.prototype.getLastPos = function () {
  8710. for (var t = Math.round(2 * Math.random()); Helper.isInArray(t, this.arrayLastY); )
  8711. t = Math.round(2 * Math.random());
  8712. return this.arrayLastY.push(t),
  8713. GloabData.CONST_HEIGHT / 2 - 120 * (t - 1) - 50
  8714. },
  8715. e.prototype.touchHander = function (t) {
  8716. this.bCanTouch && (t = this.isTouch(t.localX, t.localY), t < this.nCurRight || (this.nCurRight == t ? (this.nCurRight++, this.dealRight(t)) : this.dealError(t), this.nCurRight == this.clsGameData.getCardCount() + 1 && (this.bCanTouch = !1, egret.Tween.get(this.uiTime, {
  8717. loop : !1
  8718. }).wait(600).call(this.enterNextState, this))))
  8719. },
  8720. e.prototype.isTouch = function (t, e) {
  8721. for (var a = 0, r = 0; r < this.arrayCard.length; r++) {
  8722. var o = this.arrayCard[r].x - GloabData.nTouchDiff,
  8723. i = this.arrayCard[r].y - GloabData.nTouchDiff,
  8724. n = this.arrayCard[r].width + 2 * GloabData.nTouchDiff,
  8725. s = this.arrayCard[r].height + 2 * GloabData.nTouchDiff;
  8726. if (t >= o && o + n >= t && e >= i && i + s >= e) {
  8727. a = r + 1;
  8728. break
  8729. }
  8730. }
  8731. return a
  8732. },
  8733. e.prototype.handerCanTouch = function () {
  8734. this.bCanTouch = !0
  8735. },
  8736. e.prototype.handerGameStart = function () {
  8737. this.hideAllCard(),
  8738. this.changgeCard()
  8739. },
  8740. e.prototype.hideAllCard = function () {
  8741. for (var t = 0; t < this.arrayCard.length; ++t)
  8742. this.arrayCard[t].hideWord()
  8743. },
  8744. e.prototype.hideCard = function (t) {
  8745. t.hideWord()
  8746. },
  8747. e.prototype.cleanCards = function () {
  8748. for (var t = 0; t < this.arrayCard.length; t++)
  8749. this.removeChild(this.arrayCard[t])
  8750. },
  8751. e.prototype.dealRight = function (t) {
  8752. this.arrayCard[t - 1]._touchEnabled = !1,
  8753. this.arrayCard[t - 1].showWord(),
  8754. this.addChild(this.clsGameShow.showWordRight(this.arrayCard[t - 1].x, this.arrayCard[t - 1].y, this.clsGameData.getWord(t), t, this.clsGameData.getCardCount())),
  8755. this.clsGameData.addScore(1),
  8756. this.clsGameShow.showScore(this.clsGameData.getScore())
  8757. },
  8758. e.prototype.dealError = function (t) {
  8759. this.bCanTouch = !1;
  8760. for (var e = 0; e < this.arrayCard.length; ++e)
  8761. this.arrayCard[e].showWord();
  8762. this.arrayCard[t - 1].showError(),
  8763. this.dealFail()
  8764. },
  8765. e.prototype.enterNextState = function () {
  8766. NetWork.getInstance().reqState(this.clsGameData.getState()),
  8767. this.clsGameData.getState() >= this.clsGameData.getMaxState() && this.openFail(),
  8768. this.cleanCards(),
  8769. this.clsGameData.addState(1),
  8770. this.clsGameShow.showState(this.clsGameData.getState()),
  8771. this.initData(),
  8772. this.initView(),
  8773. this.initStartGame()
  8774. },
  8775. e.prototype.dealFail = function () {
  8776. this.bCanTouch = !1,
  8777. egret.Tween.get(this.uiTime, {
  8778. loop : !1
  8779. }).wait(1e3).call(this.openFail, this)
  8780. },
  8781. e.prototype.openFail = function () {
  8782. Helper.changeLayer(new UIGameFail(this.clsGameData.getScore(), this.clsGameData.getState(), this.clsGameData.getWords()))
  8783. },
  8784. e.prototype.showReadAction = function () {
  8785. this.nReadWord = 3,
  8786. egret.Tween.get(this.uiTime, {
  8787. loop : !1
  8788. }).wait(this.clsGameData.getLookTime()).call(this.playReadAction, this)
  8789. },
  8790. e.prototype.playReadAction = function () {
  8791. this.createReadyUI(this.nReadWord),
  8792. egret.Tween.get(this.uiReady, {
  8793. loop : !1
  8794. }).to({
  8795. scaleX : 0,
  8796. scaleY : 0,
  8797. alpha : 0
  8798. }, 700, egret.Ease.quintIn).call(this.playeReadyHandler, this)
  8799. },
  8800. e.prototype.playeReadyHandler = function () {
  8801. 0 < --this.nReadWord && this.playReadAction()
  8802. },
  8803. e.prototype.createReadyUI = function () {
  8804. this.uiReady.texture = RES.getRes("ready_" + this.nReadWord),
  8805. this.uiReady.x = GloabData.CONST_WIDTH / 2,
  8806. this.uiReady.y = 320,
  8807. this.uiReady.anchorX = .5,
  8808. this.uiReady.anchorY = .5,
  8809. this.uiReady.alpha = 1,
  8810. this.uiReady.scaleX = 1,
  8811. this.uiReady.scaleY = 1
  8812. },
  8813. e.prototype.createTip = function () {
  8814. this.spTipLayer = new egret.Sprite,
  8815. this.addChild(this.spTipLayer),
  8816. this.spTipLayer.touchEnabled = !0;
  8817. var t = Helper.createBitMap("black", 0, 0),
  8818. e = new egret.Rectangle(2, 2, 2, 2);
  8819. t.scale9Grid = e,
  8820. t.width = GloabData.CONST_WIDTH,
  8821. t.height = GloabData.CONST_HEIGHT,
  8822. this.spTipLayer.addChild(t),
  8823. this.spTipLayer.addEventListener(egret.TouchEvent.TOUCH_TAP, this.tipLayerHandler, this),
  8824. t = Helper.createText("\u8bf7\u5728\u5b57\u724c", 20, 230, 40),
  8825. t.width = 160,
  8826. this.spTipLayer.addChild(t),
  8827. t = Helper.createText("\u6253\u4e71", 230, 250, 50),
  8828. t.width = 100,
  8829. t.textColor = 16711680,
  8830. t.rotation = -15,
  8831. t.anchorX = .5,
  8832. t.anchorY = .5,
  8833. this.spTipLayer.addChild(t),
  8834. t = Helper.createText("\u540e\uff0c\u6309", 280, 230, 40),
  8835. t.width = 120,
  8836. this.spTipLayer.addChild(t),
  8837. t = Helper.createText("\u987a\u5e8f", 450, 250, 50),
  8838. t.width = 100,
  8839. t.textColor = 16711680,
  8840. t.rotation = -15,
  8841. t.anchorX = .5,
  8842. t.anchorY = .5,
  8843. this.spTipLayer.addChild(t),
  8844. t = Helper.createText("\u7ffb\u5f00\u3002", 500, 230, 40),
  8845. t.width = 120,
  8846. this.spTipLayer.addChild(t),
  8847. t = Helper.createText("\u6e38\u620f\u7684\u5173\u952e\u662f\u76ef\u4f4f\u5b57\u724c\u3002\u4e00\u822c\u4eba\u6211\u4e0d\u544a\u8bc9\u4ed6\uff01", 20, 320, 30),
  8848. t.width = 610,
  8849. this.spTipLayer.addChild(t),
  8850. t = Helper.createText("\u70b9\u51fb\u6311\u6218", GloabData.CONST_WIDTH / 2, 850, 30),
  8851. t.anchorX = .5,
  8852. t.anchorY = .5,
  8853. t.width = 500,
  8854. this.spTipLayer.addChild(t),
  8855. egret.Tween.get(t, {
  8856. loop : !0
  8857. }).to({
  8858. scaleX : 1.2,
  8859. scaleY : 1.2
  8860. }, 1e3).to({
  8861. scaleX : 1,
  8862. scaleY : 1
  8863. }, 1e3)
  8864. },
  8865. e.prototype.tipLayerHandler = function () {
  8866. this.removeChild(this.spTipLayer),
  8867. this.initStartGame()
  8868. },
  8869. e
  8870. }
  8871. (egret.Sprite);
  8872. UIGame.prototype.__class__ = "UIGame";
  8873. var __extends = this.__extends || function (t, e) {
  8874. function a() {
  8875. this.constructor = t
  8876. }
  8877. for (var r in e)
  8878. e.hasOwnProperty(r) && (t[r] = e[r]);
  8879. a.prototype = e.prototype,
  8880. t.prototype = new a
  8881. }, UILoading = function (t) {
  8882. function e() {
  8883. t.call(this),
  8884. this.createView()
  8885. }
  8886. return __extends(e, t),
  8887. e.prototype.createView = function () {
  8888. this.textField = new egret.TextField,
  8889. this.addChild(this.textField),
  8890. this.textField.x = GloabData.CONST_WIDTH / 2,
  8891. this.textField.y = GloabData.CONST_HEIGHT / 2,
  8892. this.textField.anchorX = .5,
  8893. this.textField.anchorY = .5,
  8894. this.textField.width = 480,
  8895. this.textField.height = 100,
  8896. this.textField.textAlign = "center"
  8897. },
  8898. e.prototype.setProgress = function (t, e) {
  8899. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + t + "/" + e
  8900. },
  8901. e
  8902. }
  8903. (egret.Sprite);
  8904. UILoading.prototype.__class__ = "UILoading";
  8905. var __extends = this.__extends || function (t, e) {
  8906. function a() {
  8907. this.constructor = t
  8908. }
  8909. for (var r in e)
  8910. e.hasOwnProperty(r) && (t[r] = e[r]);
  8911. a.prototype = e.prototype,
  8912. t.prototype = new a
  8913. }, UIMain = function (t) {
  8914. function e() {
  8915. t.call(this),
  8916. this.addChild(Helper.createBitMap("bgImage", 0, 0));
  8917. var e = Helper.createBitMap("title", GloabData.CONST_WIDTH / 2, 300);
  8918. e.anchorX = .5,
  8919. e.anchorY = .5,
  8920. this.addChild(e),
  8921. e = Helper.createText("\u70b9\u51fb\u8fdb\u5165", GloabData.CONST_WIDTH / 2, 740, 50),
  8922. e.anchorX = .5,
  8923. e.anchorY = .5,
  8924. e.width = 500,
  8925. this.addChild(e),
  8926. egret.Tween.get(e, {
  8927. loop : !0
  8928. }).to({
  8929. scaleX : 1.2,
  8930. scaleY : 1.2
  8931. }, 1e3).to({
  8932. scaleX : 1,
  8933. scaleY : 1
  8934. }, 1e3),
  8935. this.touchEnabled = !0,
  8936. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.touchHander, this),
  8937. e = Helper.createText("\u0036\u0038\u5fae\u6e38\u620f", GloabData.CONST_WIDTH / 2, 840, 20),
  8938. e.anchorX = .5,
  8939. e.anchorY = .5,
  8940. e.width = 1e3,
  8941. this.addChild(e),
  8942. share(0, 0, " ", "")
  8943. }
  8944. return __extends(e, t),
  8945. e.prototype.touchHander = function () {
  8946. Helper.changeLayer(new UIGame)
  8947. },
  8948. e
  8949. }
  8950. (egret.Sprite);
  8951. UIMain.prototype.__class__ = "UIMain";
  8952. var __extends = this.__extends || function (t, e) {
  8953. function a() {
  8954. this.constructor = t
  8955. }
  8956. for (var r in e)
  8957. e.hasOwnProperty(r) && (t[r] = e[r]);
  8958. a.prototype = e.prototype,
  8959. t.prototype = new a
  8960. }, Main = function (t) {
  8961. function e() {
  8962. t.call(this),
  8963. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.startGame, this)
  8964. }
  8965. return __extends(e, t),
  8966. e.prototype.startGame = function () {
  8967. this.clsLoadingView = new UILoading,
  8968. this.stage.addChild(this.clsLoadingView),
  8969. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this),
  8970. RES.loadConfig("resource/resource.json", "resource/")
  8971. },
  8972. e.prototype.onConfigComplete = function () {
  8973. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this),
  8974. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this),
  8975. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this),
  8976. RES.loadGroup("preload")
  8977. },
  8978. e.prototype.onResourceLoadComplete = function (t) {
  8979. "preload" == t.groupName && (this.stage.removeChild(this.clsLoadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.getResAsync("config", this.onStart, this))
  8980. },
  8981. e.prototype.onResourceProgress = function (t) {
  8982. "preload" == t.groupName && this.clsLoadingView.setProgress(t.itemsLoaded, t.itemsTotal)
  8983. },
  8984. e.prototype.onStart = function (t) {
  8985. GloabData.arraySay = t[0].comment,
  8986. GloabData.arrayPlayWord = t[0].play_content,
  8987. GloabData.arrayMoreGame = t[0].more_game,
  8988. Helper.changeLayer(new UIMain)
  8989. },
  8990. e
  8991. }
  8992. (egret.DisplayObjectContainer);
  8993. Main.prototype.__class__ = "Main";