game-min.js 264 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537
  1. var egret;
  2. (function(b) {
  3. var c = function() {
  4. function b() {
  5. this._hashCode = b.hashCount++
  6. }
  7. Object.defineProperty(b.prototype, "hashCode", {
  8. get: function() {
  9. return this._hashCode
  10. },
  11. enumerable: !0,
  12. configurable: !0
  13. });
  14. b.hashCount = 1;
  15. return b
  16. }();
  17. b.HashObject = c;
  18. c.prototype.__class__ = "egret.HashObject"
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends || function(b, c) {
  21. function e() {
  22. this.constructor = b
  23. }
  24. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  25. e.prototype = c.prototype;
  26. b.prototype = new e
  27. };
  28. (function(b) {
  29. var c = function(b) {
  30. function a(d) {
  31. void 0 === d && (d = 300);
  32. b.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > d && (d = 1);
  36. this.autoDisposeTime = d;
  37. this.frameCount = 0
  38. }
  39. __extends(a, b);
  40. a.prototype._checkFrame = function() {
  41. this.frameCount--;
  42. 0 >= this.frameCount && this.dispose()
  43. };
  44. Object.defineProperty(a.prototype, "length", {
  45. get: function() {
  46. return this._length
  47. },
  48. enumerable: !0,
  49. configurable: !0
  50. });
  51. a.prototype.push = function(d) {
  52. var h = this.objectPool; - 1 == h.indexOf(d) && (h.push(d), this._length++, 0 == this.frameCount && (this.frameCount =
  53. this.autoDisposeTime, a._callBackList.push(this)))
  54. };
  55. a.prototype.pop = function() {
  56. if (0 == this._length) return null;
  57. this._length--;
  58. return this.objectPool.pop()
  59. };
  60. a.prototype.dispose = function() {
  61. 0 < this._length && (this.objectPool = [], this._length = 0);
  62. this.frameCount = 0;
  63. var d = a._callBackList,
  64. h = d.indexOf(this); - 1 != h && d.splice(h, 1)
  65. };
  66. a._callBackList = [];
  67. return a
  68. }(b.HashObject);
  69. b.Recycler = c;
  70. c.prototype.__class__ = "egret.Recycler"
  71. })(egret || (egret = {}));
  72. (function(b) {
  73. b.__START_TIME;
  74. b.getTimer = function() {
  75. return Date.now() - b.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(b) {
  79. b.__callLaterFunctionList = [];
  80. b.__callLaterThisList = [];
  81. b.__callLaterArgsList = [];
  82. b.callLater = function(c, e) {
  83. for (var a = [], d = 2; d < arguments.length; d++) a[d - 2] = arguments[d];
  84. b.__callLaterFunctionList.push(c);
  85. b.__callLaterThisList.push(e);
  86. b.__callLaterArgsList.push(a)
  87. };
  88. b.__callAsyncFunctionList = [];
  89. b.__callAsyncThisList = [];
  90. b.__callAsyncArgsList = [];
  91. b.__callAsync = function(c, e) {
  92. for (var a = [], d = 2; d < arguments.length; d++) a[d - 2] = arguments[d];
  93. b.__callAsyncFunctionList.push(c);
  94. b.__callAsyncThisList.push(e);
  95. b.__callAsyncArgsList.push(a)
  96. }
  97. })(egret || (egret = {}));
  98. var egret_dom;
  99. (function(b) {
  100. function c() {
  101. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], d = 0; d < a.length; d++)
  102. if (a[d] + "ransform" in b) return a[d];
  103. return a[0]
  104. }
  105. b.header = "";
  106. b.getHeader = c;
  107. b.getTrans = function(e) {
  108. "" == b.header && (b.header = c());
  109. return b.header + e.substring(1, e.length)
  110. }
  111. })(egret_dom || (egret_dom = {}));
  112. __extends = this.__extends || function(b, c) {
  113. function e() {
  114. this.constructor = b
  115. }
  116. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  117. e.prototype = c.prototype;
  118. b.prototype = new e
  119. };
  120. (function(b) {
  121. var c = function(e) {
  122. function a(d, a, g) {
  123. void 0 === a && (a = !1);
  124. void 0 === g && (g = !1);
  125. e.call(this);
  126. this._eventPhase = 2;
  127. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  128. this.isNew = !0;
  129. this._type = d;
  130. this._bubbles = a;
  131. this._cancelable = g
  132. }
  133. __extends(a, e);
  134. Object.defineProperty(a.prototype, "type", {
  135. get: function() {
  136. return this._type
  137. },
  138. enumerable: !0,
  139. configurable: !0
  140. });
  141. Object.defineProperty(a.prototype, "bubbles", {
  142. get: function() {
  143. return this._bubbles
  144. },
  145. enumerable: !0,
  146. configurable: !0
  147. });
  148. Object.defineProperty(a.prototype, "cancelable", {
  149. get: function() {
  150. return this._cancelable
  151. },
  152. enumerable: !0,
  153. configurable: !0
  154. });
  155. Object.defineProperty(a.prototype, "eventPhase", {
  156. get: function() {
  157. return this._eventPhase
  158. },
  159. enumerable: !0,
  160. configurable: !0
  161. });
  162. Object.defineProperty(a.prototype, "currentTarget", {
  163. get: function() {
  164. return this._currentTarget
  165. },
  166. enumerable: !0,
  167. configurable: !0
  168. });
  169. Object.defineProperty(a.prototype, "target", {
  170. get: function() {
  171. return this._target
  172. },
  173. enumerable: !0,
  174. configurable: !0
  175. });
  176. a.prototype.isDefaultPrevented =
  177. function() {
  178. return this._isDefaultPrevented
  179. };
  180. a.prototype.preventDefault = function() {
  181. this._cancelable && (this._isDefaultPrevented = !0)
  182. };
  183. a.prototype.stopPropagation = function() {
  184. this._bubbles && (this._isPropagationStopped = !0)
  185. };
  186. a.prototype.stopImmediatePropagation = function() {
  187. this._bubbles && (this._isPropagationImmediateStopped = !0)
  188. };
  189. a.prototype._reset = function() {
  190. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  191. null, this._eventPhase = 2)
  192. };
  193. a._dispatchByTarget = function(d, a, g, e, c, f) {
  194. void 0 === c && (c = !1);
  195. void 0 === f && (f = !1);
  196. var l = d.eventRecycler;
  197. l || (l = d.eventRecycler = new b.Recycler);
  198. var n = l.pop();
  199. n ? n._type = g : n = new d(g);
  200. n._bubbles = c;
  201. n._cancelable = f;
  202. if (e)
  203. for (var p in e) n[p] = e[p], null !== n[p] && (e[p] = null);
  204. d = a.dispatchEvent(n);
  205. l.push(n);
  206. return d
  207. };
  208. a._getPropertyData = function(d) {
  209. var a = d._props;
  210. a || (a = d._props = {});
  211. return a
  212. };
  213. a.dispatchEvent = function(d, h, g, b) {
  214. void 0 === g && (g = !1);
  215. var e = a._getPropertyData(a);
  216. b && (e.data = b);
  217. a._dispatchByTarget(a,
  218. d, h, e, g)
  219. };
  220. a.ADDED_TO_STAGE = "addedToStage";
  221. a.REMOVED_FROM_STAGE = "removedFromStage";
  222. a.ADDED = "added";
  223. a.REMOVED = "removed";
  224. a.COMPLETE = "complete";
  225. a.ENTER_FRAME = "enterFrame";
  226. a.RENDER = "render";
  227. a.FINISH_RENDER = "finishRender";
  228. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  229. a.LEAVE_STAGE = "leaveStage";
  230. a.RESIZE = "resize";
  231. a.CHANGE = "change";
  232. a.ACTIVATE = "activate";
  233. a.DEACTIVATE = "deactivate";
  234. a.CLOSE = "close";
  235. a.CONNECT = "connect";
  236. return a
  237. }(b.HashObject);
  238. b.Event = c;
  239. c.prototype.__class__ = "egret.Event"
  240. })(egret || (egret = {}));
  241. __extends = this.__extends || function(b, c) {
  242. function e() {
  243. this.constructor = b
  244. }
  245. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  246. e.prototype = c.prototype;
  247. b.prototype = new e
  248. };
  249. (function(b) {
  250. var c = function(b) {
  251. function a(d, a, g) {
  252. void 0 === a && (a = !1);
  253. void 0 === g && (g = !1);
  254. b.call(this, d, a, g);
  255. this._status = 0
  256. }
  257. __extends(a, b);
  258. Object.defineProperty(a.prototype, "status", {
  259. get: function() {
  260. return this._status
  261. },
  262. enumerable: !0,
  263. configurable: !0
  264. });
  265. a.dispatchHTTPStatusEvent = function(d, h) {
  266. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  267. a.httpStatusEvent._status = h;
  268. d.dispatchEvent(a.httpStatusEvent)
  269. };
  270. a.HTTP_STATUS = "httpStatus";
  271. a.httpStatusEvent = null;
  272. return a
  273. }(b.Event);
  274. b.HTTPStatusEvent =
  275. c;
  276. c.prototype.__class__ = "egret.HTTPStatusEvent"
  277. })(egret || (egret = {}));
  278. __extends = this.__extends || function(b, c) {
  279. function e() {
  280. this.constructor = b
  281. }
  282. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  283. e.prototype = c.prototype;
  284. b.prototype = new e
  285. };
  286. (function(b) {
  287. var c = function(e) {
  288. function a(d, a, g) {
  289. void 0 === a && (a = !1);
  290. void 0 === g && (g = !1);
  291. e.call(this, d, a, g)
  292. }
  293. __extends(a, e);
  294. a.dispatchIOErrorEvent = function(d) {
  295. b.Event._dispatchByTarget(a, d, a.IO_ERROR)
  296. };
  297. a.IO_ERROR = "ioError";
  298. return a
  299. }(b.Event);
  300. b.IOErrorEvent = c;
  301. c.prototype.__class__ = "egret.IOErrorEvent"
  302. })(egret || (egret = {}));
  303. __extends = this.__extends || function(b, c) {
  304. function e() {
  305. this.constructor = b
  306. }
  307. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  308. e.prototype = c.prototype;
  309. b.prototype = new e
  310. };
  311. (function(b) {
  312. var c = function(e) {
  313. function a(d, a, g, b, c, f, l, n, p, q) {
  314. void 0 === a && (a = !0);
  315. void 0 === g && (g = !0);
  316. void 0 === b && (b = 0);
  317. void 0 === c && (c = 0);
  318. void 0 === f && (f = 0);
  319. void 0 === l && (l = !1);
  320. void 0 === n && (n = !1);
  321. void 0 === q && (q = !1);
  322. e.call(this, d, a, g);
  323. this._stageY = this._stageX = 0;
  324. this.touchPointID = b;
  325. this._stageX = c;
  326. this._stageY = f;
  327. this.ctrlKey = l;
  328. this.altKey = n;
  329. this.touchDown = q
  330. }
  331. __extends(a, e);
  332. Object.defineProperty(a.prototype, "stageX", {
  333. get: function() {
  334. return this._stageX
  335. },
  336. enumerable: !0,
  337. configurable: !0
  338. });
  339. Object.defineProperty(a.prototype,
  340. "stageY", {
  341. get: function() {
  342. return this._stageY
  343. },
  344. enumerable: !0,
  345. configurable: !0
  346. });
  347. Object.defineProperty(a.prototype, "localX", {
  348. get: function() {
  349. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  350. },
  351. enumerable: !0,
  352. configurable: !0
  353. });
  354. Object.defineProperty(a.prototype, "localY", {
  355. get: function() {
  356. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  357. },
  358. enumerable: !0,
  359. configurable: !0
  360. });
  361. a.dispatchTouchEvent = function(d, h, g, e, c, f, l, n, p) {
  362. void 0 === g && (g = 0);
  363. void 0 === e && (e = 0);
  364. void 0 === c && (c = 0);
  365. void 0 === f && (f = !1);
  366. void 0 === l && (l = !1);
  367. void 0 === n && (n = !1);
  368. void 0 === p && (p = !1);
  369. var q = b.Event._getPropertyData(a);
  370. q.touchPointID = g;
  371. q._stageX = e;
  372. q._stageY = c;
  373. q.ctrlKey = f;
  374. q.altKey = l;
  375. q.shiftKey = n;
  376. q.touchDown = p;
  377. b.Event._dispatchByTarget(a, d, h, q, !0, !0)
  378. };
  379. a.TOUCH_TAP = "touchTap";
  380. a.TOUCH_MOVE = "touchMove";
  381. a.TOUCH_BEGIN = "touchBegin";
  382. a.TOUCH_END = "touchEnd";
  383. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  384. a.TOUCH_ROLL_OUT = "touchRollOut";
  385. a.TOUCH_ROLL_OVER = "touchRollOver";
  386. a.TOUCH_OUT =
  387. "touchOut";
  388. a.TOUCH_OVER = "touchOver";
  389. return a
  390. }(b.Event);
  391. b.TouchEvent = c;
  392. c.prototype.__class__ = "egret.TouchEvent"
  393. })(egret || (egret = {}));
  394. __extends = this.__extends || function(b, c) {
  395. function e() {
  396. this.constructor = b
  397. }
  398. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  399. e.prototype = c.prototype;
  400. b.prototype = new e
  401. };
  402. (function(b) {
  403. var c = function(e) {
  404. function a(d, a, g) {
  405. void 0 === a && (a = !1);
  406. void 0 === g && (g = !1);
  407. e.call(this, d, a, g)
  408. }
  409. __extends(a, e);
  410. a.dispatchTimerEvent = function(d, h) {
  411. b.Event._dispatchByTarget(a, d, h)
  412. };
  413. a.TIMER = "timer";
  414. a.TIMER_COMPLETE = "timerComplete";
  415. return a
  416. }(b.Event);
  417. b.TimerEvent = c;
  418. c.prototype.__class__ = "egret.TimerEvent"
  419. })(egret || (egret = {}));
  420. __extends = this.__extends || function(b, c) {
  421. function e() {
  422. this.constructor = b
  423. }
  424. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  425. e.prototype = c.prototype;
  426. b.prototype = new e
  427. };
  428. (function(b) {
  429. var c = function(e) {
  430. function a(d, a, g, b, c) {
  431. void 0 === a && (a = !1);
  432. void 0 === g && (g = !1);
  433. void 0 === b && (b = 0);
  434. void 0 === c && (c = 0);
  435. e.call(this, d, a, g);
  436. this.bytesLoaded = b;
  437. this.bytesTotal = c
  438. }
  439. __extends(a, e);
  440. a.dispatchProgressEvent = function(d, h, g, e) {
  441. void 0 === g && (g = 0);
  442. void 0 === e && (e = 0);
  443. b.Event._dispatchByTarget(a, d, h, {
  444. bytesLoaded: g,
  445. bytesTotal: e
  446. })
  447. };
  448. a.PROGRESS = "progress";
  449. a.SOCKET_DATA = "socketData";
  450. return a
  451. }(b.Event);
  452. b.ProgressEvent = c;
  453. c.prototype.__class__ = "egret.ProgressEvent"
  454. })(egret || (egret = {}));
  455. (function(b) {
  456. var c = function() {
  457. function b() {}
  458. b.CAPTURING_PHASE = 1;
  459. b.AT_TARGET = 2;
  460. b.BUBBLING_PHASE = 3;
  461. return b
  462. }();
  463. b.EventPhase = c;
  464. c.prototype.__class__ = "egret.EventPhase"
  465. })(egret || (egret = {}));
  466. __extends = this.__extends || function(b, c) {
  467. function e() {
  468. this.constructor = b
  469. }
  470. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  471. e.prototype = c.prototype;
  472. b.prototype = new e
  473. };
  474. (function(b) {
  475. var c = function(e) {
  476. function a(d) {
  477. void 0 === d && (d = null);
  478. e.call(this);
  479. this._eventTarget = d ? d : this
  480. }
  481. __extends(a, e);
  482. a.prototype.addEventListener = function(d, a, g, e, c) {
  483. void 0 === e && (e = !1);
  484. void 0 === c && (c = 0);
  485. "undefined" === typeof e && (e = !1);
  486. "undefined" === typeof c && (c = 0);
  487. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  488. e ? (this._captureEventsMap || (this._captureEventsMap = {}), e = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), e = this._eventsMap);
  489. var f = e[d];
  490. f || (f = e[d] = []);
  491. this._insertEventBin(f, a, g, c)
  492. };
  493. a.prototype._insertEventBin = function(d, a, b, e, c) {
  494. void 0 === c && (c = void 0);
  495. for (var f = -1, l = d.length, n = 0; n < l; n++) {
  496. var p = d[n];
  497. if (p.listener === a && p.thisObject === b && p.display === c) return !1; - 1 == f && p.priority < e && (f = n)
  498. }
  499. a = {
  500. listener: a,
  501. thisObject: b,
  502. priority: e
  503. };
  504. c && (a.display = c); - 1 != f ? d.splice(f, 0, a) : d.push(a);
  505. return !0
  506. };
  507. a.prototype.removeEventListener = function(d, a, b, e) {
  508. void 0 === e && (e = !1);
  509. if (e = e ? this._captureEventsMap : this._eventsMap) {
  510. var c = e[d];
  511. c && (this._removeEventBin(c,
  512. a, b), 0 == c.length && delete e[d])
  513. }
  514. };
  515. a.prototype._removeEventBin = function(d, a, b, e) {
  516. void 0 === e && (e = void 0);
  517. for (var c = d.length, f = 0; f < c; f++) {
  518. var l = d[f];
  519. if (l.listener === a && l.thisObject === b && l.display === e) return d.splice(f, 1), !0
  520. }
  521. return !1
  522. };
  523. a.prototype.hasEventListener = function(d) {
  524. return this._eventsMap && this._eventsMap[d] || this._captureEventsMap && this._captureEventsMap[d]
  525. };
  526. a.prototype.willTrigger = function(d) {
  527. return this.hasEventListener(d)
  528. };
  529. a.prototype.dispatchEvent = function(d) {
  530. d._reset();
  531. d._target = this._eventTarget;
  532. d._currentTarget = this._eventTarget;
  533. return this._notifyListener(d)
  534. };
  535. a.prototype._notifyListener = function(d) {
  536. var a = 1 == d._eventPhase ? this._captureEventsMap : this._eventsMap;
  537. if (!a) return !0;
  538. a = a[d._type];
  539. if (!a) return !0;
  540. var b = a.length;
  541. if (0 == b) return !0;
  542. for (var a = a.concat(), e = 0; e < b; e++) {
  543. var c = a[e];
  544. c.listener.call(c.thisObject, d);
  545. if (d._isPropagationImmediateStopped) break
  546. }
  547. return !d._isDefaultPrevented
  548. };
  549. a.prototype.dispatchEventWith = function(d, a, g) {
  550. void 0 === a && (a = !1);
  551. b.Event.dispatchEvent(this, d, a, g)
  552. };
  553. return a
  554. }(b.HashObject);
  555. b.EventDispatcher = c;
  556. c.prototype.__class__ = "egret.EventDispatcher"
  557. })(egret || (egret = {}));
  558. __extends = this.__extends || function(b, c) {
  559. function e() {
  560. this.constructor = b
  561. }
  562. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  563. e.prototype = c.prototype;
  564. b.prototype = new e
  565. };
  566. (function(b) {
  567. var c = function(e) {
  568. function a() {
  569. e.call(this);
  570. this.reuseEvent = new b.Event("")
  571. }
  572. __extends(a, e);
  573. a.prototype.run = function() {
  574. b.Ticker.getInstance().run();
  575. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  576. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  577. this.touchContext.run()
  578. };
  579. a.prototype.renderLoop = function(d) {
  580. if (0 < b.__callLaterFunctionList.length) {
  581. var h = b.__callLaterFunctionList;
  582. b.__callLaterFunctionList = [];
  583. var g = b.__callLaterThisList;
  584. b.__callLaterThisList = [];
  585. var e = b.__callLaterArgsList;
  586. b.__callLaterArgsList = []
  587. }
  588. d = this.stage;
  589. var c = a.cachedEvent;
  590. c._type = b.Event.RENDER;
  591. this.dispatchEvent(c);
  592. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  593. h && this.doCallLaterList(h, g, e);
  594. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  595. h = this.rendererContext;
  596. h.onRenderStart();
  597. h.clearScreen();
  598. d._updateTransform();
  599. c._type = b.Event.FINISH_UPDATE_TRANSFORM;
  600. this.dispatchEvent(c);
  601. d._draw(h);
  602. c._type = b.Event.FINISH_RENDER;
  603. this.dispatchEvent(c);
  604. h.onRenderFinish()
  605. };
  606. a.prototype.broadcastEnterFrame = function(d) {
  607. d = this.reuseEvent;
  608. d._type = b.Event.ENTER_FRAME;
  609. this.dispatchEvent(d);
  610. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), g = a.length, e = 0; e < g; e++) {
  611. var c = a[e];
  612. d._target = c.display;
  613. d._currentTarget = c.display;
  614. c.listener.call(c.thisObject, d)
  615. }
  616. a = b.Recycler._callBackList;
  617. for (e = a.length - 1; 0 <= e; e--) a[e]._checkFrame()
  618. };
  619. a.prototype.broadcastRender = function() {
  620. var d = this.reuseEvent;
  621. d._type = b.Event.RENDER;
  622. for (var a = b.DisplayObject._renderCallBackList.concat(),
  623. g = a.length, e = 0; e < g; e++) {
  624. var c = a[e],
  625. f = c.display;
  626. d._target = f;
  627. d._currentTarget = f;
  628. c.listener.call(c.thisObject, d)
  629. }
  630. };
  631. a.prototype.doCallLaterList = function(d, a, b) {
  632. for (var e = d.length, c = 0; c < e; c++) {
  633. var f = d[c];
  634. null != f && f.apply(a[c], b[c])
  635. }
  636. };
  637. a.prototype.doCallAsyncList = function() {
  638. var d = b.__callAsyncFunctionList.concat(),
  639. a = b.__callAsyncThisList.concat(),
  640. g = b.__callAsyncArgsList.concat();
  641. b.__callAsyncFunctionList.length = 0;
  642. b.__callAsyncThisList.length = 0;
  643. for (var e = b.__callAsyncArgsList.length = 0; e < d.length; e++) {
  644. var c =
  645. d[e];
  646. null != c && c.apply(a[e], g[e])
  647. }
  648. };
  649. a.DEVICE_PC = "web";
  650. a.DEVICE_MOBILE = "native";
  651. a.RUNTIME_HTML5 = "runtime_html5";
  652. a.RUNTIME_NATIVE = "runtime_native";
  653. a.cachedEvent = new b.Event("");
  654. return a
  655. }(b.EventDispatcher);
  656. b.MainContext = c;
  657. c.prototype.__class__ = "egret.MainContext"
  658. })(egret || (egret = {}));
  659. var testDeviceType = function() {
  660. if (!this.navigator) return !0;
  661. var b = navigator.userAgent.toLowerCase();
  662. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  663. },
  664. testRuntimeType = function() {
  665. return this.navigator ? !0 : !1
  666. };
  667. egret.MainContext.instance = new egret.MainContext;
  668. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  669. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  670. delete testDeviceType;
  671. delete testRuntimeType;
  672. (function(b) {
  673. var c = function() {
  674. function e() {
  675. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  676. this._maxDeltaTime = 500;
  677. this._totalDeltaTime = 0
  678. }
  679. e.getInstance = function() {
  680. null == e.instance && (e.instance = new e);
  681. return e.instance
  682. };
  683. e.prototype.run = function() {
  684. b.Ticker.getInstance().register(this.update, this);
  685. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, b.MainContext.instance.stage.addChild(this._txt));
  686. var a = b.MainContext.instance;
  687. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  688. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  689. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  690. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  691. };
  692. e.prototype.onEnterFrame = function(a) {
  693. this._lastTime = b.getTimer()
  694. };
  695. e.prototype.onStartRender = function(a) {
  696. a = b.getTimer();
  697. this._logicPerformanceCost = a - this._lastTime;
  698. this._lastTime = a
  699. };
  700. e.prototype.onFinishUpdateTransform =
  701. function(a) {
  702. a = b.getTimer();
  703. this._updateTransformPerformanceCost = a - this._lastTime;
  704. this._lastTime = a
  705. };
  706. e.prototype.onFinishRender = function(a) {
  707. a = b.getTimer();
  708. this._renderPerformanceCost = a - this._lastTime;
  709. this._lastTime = a
  710. };
  711. e.prototype.update = function(a) {
  712. this._tick++;
  713. this._totalDeltaTime += a;
  714. if (this._totalDeltaTime >= this._maxDeltaTime) {
  715. a = (this._preDrawCount - 1).toString();
  716. var d = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  717. "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  718. this._txt.text = "draw:" + a + "\ncost:" + d + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  719. this._tick = this._totalDeltaTime = 0
  720. }
  721. this._preDrawCount = 0
  722. };
  723. e.prototype.onDrawImage = function() {
  724. this._preDrawCount++
  725. };
  726. return e
  727. }();
  728. b.Profiler = c;
  729. c.prototype.__class__ = "egret.Profiler"
  730. })(egret || (egret = {}));
  731. __extends = this.__extends || function(b, c) {
  732. function e() {
  733. this.constructor = b
  734. }
  735. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  736. e.prototype = c.prototype;
  737. b.prototype = new e
  738. };
  739. (function(b) {
  740. var c = function(e) {
  741. function a() {
  742. e.apply(this, arguments);
  743. this._timeScale = 1;
  744. this._paused = !1;
  745. this.callBackList = []
  746. }
  747. __extends(a, e);
  748. a.prototype.run = function() {
  749. b.__START_TIME = (new Date).getTime();
  750. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  751. };
  752. a.prototype.update = function(d) {
  753. var a = this.callBackList.concat(),
  754. b = a.length;
  755. d *= this._timeScale;
  756. d *= this._timeScale;
  757. for (var e = 0; e < b; e++) {
  758. var c = a[e];
  759. c.listener.call(c.thisObject, d)
  760. }
  761. };
  762. a.prototype.register = function(d, a, b) {
  763. void 0 === b &&
  764. (b = 0);
  765. this._insertEventBin(this.callBackList, d, a, b)
  766. };
  767. a.prototype.unregister = function(d, a) {
  768. this._removeEventBin(this.callBackList, d, a)
  769. };
  770. a.prototype.setTimeout = function(d, a, g) {
  771. for (var e = [], c = 3; c < arguments.length; c++) e[c - 3] = arguments[c];
  772. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  773. b.setTimeout.apply(null, [d, a, g].concat(e))
  774. };
  775. a.prototype.setTimeScale = function(d) {
  776. this._timeScale = d
  777. };
  778. a.prototype.getTimeScale = function() {
  779. return this._timeScale
  780. };
  781. a.prototype.pause = function() {
  782. this._paused = !0
  783. };
  784. a.prototype.resume = function() {
  785. this._paused = !1
  786. };
  787. a.getInstance = function() {
  788. null == a.instance && (a.instance = new a);
  789. return a.instance
  790. };
  791. return a
  792. }(b.EventDispatcher);
  793. b.Ticker = c;
  794. c.prototype.__class__ = "egret.Ticker"
  795. })(egret || (egret = {}));
  796. (function(b) {
  797. var c = function() {
  798. function b() {}
  799. b.LEFT = "left";
  800. b.RIGHT = "right";
  801. b.CENTER = "center";
  802. b.JUSTIFY = "justify";
  803. b.CONTENT_JUSTIFY = "contentJustify";
  804. return b
  805. }();
  806. b.HorizontalAlign = c;
  807. c.prototype.__class__ = "egret.HorizontalAlign"
  808. })(egret || (egret = {}));
  809. (function(b) {
  810. var c = function() {
  811. function b() {}
  812. b.TOP = "top";
  813. b.BOTTOM = "bottom";
  814. b.MIDDLE = "middle";
  815. b.JUSTIFY = "justify";
  816. b.CONTENT_JUSTIFY = "contentJustify";
  817. return b
  818. }();
  819. b.VerticalAlign = c;
  820. c.prototype.__class__ = "egret.VerticalAlign"
  821. })(egret || (egret = {}));
  822. __extends = this.__extends || function(b, c) {
  823. function e() {
  824. this.constructor = b
  825. }
  826. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  827. e.prototype = c.prototype;
  828. b.prototype = new e
  829. };
  830. (function(b) {
  831. var c = function(e) {
  832. function a(d, a) {
  833. void 0 === a && (a = 0);
  834. e.call(this);
  835. this._currentCount = 0;
  836. this.delay = d;
  837. this.repeatCount = a
  838. }
  839. __extends(a, e);
  840. a.prototype.currentCount = function() {
  841. return this._currentCount
  842. };
  843. Object.defineProperty(a.prototype, "running", {
  844. get: function() {
  845. return this._running
  846. },
  847. enumerable: !0,
  848. configurable: !0
  849. });
  850. a.prototype.reset = function() {
  851. this.stop();
  852. this._currentCount = 0
  853. };
  854. a.prototype.start = function() {
  855. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount =
  856. 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  857. };
  858. a.prototype.stop = function() {
  859. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  860. };
  861. a.prototype.onEnterFrame = function(d) {
  862. d = b.getTimer();
  863. d - this.lastTime > this.delay && (this.lastTime = d, 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)))
  864. };
  865. return a
  866. }(b.EventDispatcher);
  867. b.Timer = c;
  868. c.prototype.__class__ = "egret.Timer"
  869. })(egret || (egret = {}));
  870. (function(b) {
  871. function c(b) {
  872. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  873. if (b.hasOwnProperty("__class__")) return b.__class__;
  874. var a = b.constructor.toString(),
  875. d = a.indexOf("("),
  876. a = a.substring(9, d);
  877. Object.defineProperty(b, "__class__", {
  878. value: a,
  879. enumerable: !1,
  880. writable: !0
  881. });
  882. return a
  883. }
  884. b.getQualifiedClassName = c;
  885. b.getQualifiedSuperclassName = function(b) {
  886. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  887. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  888. var a = Object.getPrototypeOf(b);
  889. if (null == a) return null;
  890. a = c(a.constructor);
  891. if (!a) return null;
  892. Object.defineProperty(b, "__superclass__", {
  893. value: a,
  894. enumerable: !1,
  895. writable: !0
  896. });
  897. return a
  898. }
  899. })(egret || (egret = {}));
  900. (function(b) {
  901. var c = {};
  902. b.getDefinitionByName = function(b) {
  903. if (!b) return null;
  904. var a = c[b];
  905. if (a) return a;
  906. for (var d = b.split("."), h = d.length, a = __global, g = 0; g < h; g++)
  907. if (a = a[d[g]], !a) return null;
  908. return c[b] = a
  909. }
  910. })(egret || (egret = {}));
  911. var __global = __global || this;
  912. (function(b) {
  913. function c(d) {
  914. for (var a in e) {
  915. var b = e[a];
  916. b.delay -= d;
  917. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete e[a])
  918. }
  919. }
  920. var e = {},
  921. a = 0;
  922. b.setTimeout = function(d, h, g) {
  923. for (var m = [], k = 3; k < arguments.length; k++) m[k - 3] = arguments[k];
  924. m = {
  925. listener: d,
  926. thisObject: h,
  927. delay: g,
  928. params: m
  929. };
  930. 0 == a && b.Ticker.getInstance().register(c, null);
  931. a++;
  932. e[a] = m;
  933. return a
  934. };
  935. b.clearTimeout = function(d) {
  936. delete e[d]
  937. }
  938. })(egret || (egret = {}));
  939. (function(b) {
  940. b.hasDefinition = function(c) {
  941. return b.getDefinitionByName(c) ? !0 : !1
  942. }
  943. })(egret || (egret = {}));
  944. (function(b) {
  945. b.toColorString = function(b) {
  946. if (isNaN(b) || 0 > b) b = 0;
  947. 16777215 < b && (b = 16777215);
  948. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  949. return "#" + b
  950. }
  951. })(egret || (egret = {}));
  952. __extends = this.__extends || function(b, c) {
  953. function e() {
  954. this.constructor = b
  955. }
  956. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  957. e.prototype = c.prototype;
  958. b.prototype = new e
  959. };
  960. (function(b) {
  961. var c = function(e) {
  962. function a(d, a, b, c, k, f) {
  963. void 0 === d && (d = 1);
  964. void 0 === a && (a = 0);
  965. void 0 === b && (b = 0);
  966. void 0 === c && (c = 1);
  967. void 0 === k && (k = 0);
  968. void 0 === f && (f = 0);
  969. e.call(this);
  970. this.a = d;
  971. this.b = a;
  972. this.c = b;
  973. this.d = c;
  974. this.tx = k;
  975. this.ty = f
  976. }
  977. __extends(a, e);
  978. a.prototype.prepend = function(d, a, b, e, c, f) {
  979. var l = this.tx;
  980. if (1 != d || 0 != a || 0 != b || 1 != e) {
  981. var n = this.a,
  982. p = this.c;
  983. this.a = n * d + this.b * b;
  984. this.b = n * a + this.b * e;
  985. this.c = p * d + this.d * b;
  986. this.d = p * a + this.d * e
  987. }
  988. this.tx = l * d + this.ty * b + c;
  989. this.ty = l * a + this.ty * e + f;
  990. return this
  991. };
  992. a.prototype.append =
  993. function(d, a, b, e, c, f) {
  994. var l = this.a,
  995. n = this.b,
  996. p = this.c,
  997. q = this.d;
  998. if (1 != d || 0 != a || 0 != b || 1 != e) this.a = d * l + a * p, this.b = d * n + a * q, this.c = b * l + e * p, this.d = b * n + e * q;
  999. this.tx = c * l + f * p + this.tx;
  1000. this.ty = c * n + f * q + this.ty;
  1001. return this
  1002. };
  1003. a.prototype.prependTransform = function(d, a, g, e, c, f, l, n, p) {
  1004. if (c % 360) {
  1005. var q = b.NumberUtils.cos(c);
  1006. c = b.NumberUtils.sin(c)
  1007. } else q = 1, c = 0;
  1008. if (n || p) this.tx -= n, this.ty -= p;
  1009. f || l ? (this.prepend(q * g, c * g, -c * e, q * e, 0, 0), this.prepend(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f),
  1010. d, a)) : this.prepend(q * g, c * g, -c * e, q * e, d, a);
  1011. return this
  1012. };
  1013. a.prototype.appendTransform = function(d, a, g, e, c, f, l, n, p) {
  1014. if (c % 360) {
  1015. var q = b.NumberUtils.cos(c);
  1016. c = b.NumberUtils.sin(c)
  1017. } else q = 1, c = 0;
  1018. f || l ? (this.append(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), d, a), this.append(q * g, c * g, -c * e, q * e, 0, 0)) : this.append(q * g, c * g, -c * e, q * e, d, a);
  1019. if (n || p) this.tx -= n * this.a + p * this.c, this.ty -= n * this.b + p * this.d;
  1020. return this
  1021. };
  1022. a.prototype.rotate = function(d) {
  1023. var a = Math.cos(d);
  1024. d = Math.sin(d);
  1025. var b =
  1026. this.a,
  1027. e = this.c,
  1028. c = this.tx;
  1029. this.a = b * a - this.b * d;
  1030. this.b = b * d + this.b * a;
  1031. this.c = e * a - this.d * d;
  1032. this.d = e * d + this.d * a;
  1033. this.tx = c * a - this.ty * d;
  1034. this.ty = c * d + this.ty * a;
  1035. return this
  1036. };
  1037. a.prototype.skew = function(d, a) {
  1038. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(d), b.NumberUtils.cos(d), 0, 0);
  1039. return this
  1040. };
  1041. a.prototype.scale = function(d, a) {
  1042. this.a *= d;
  1043. this.d *= a;
  1044. this.c *= d;
  1045. this.b *= a;
  1046. this.tx *= d;
  1047. this.ty *= a;
  1048. return this
  1049. };
  1050. a.prototype.translate = function(d, a) {
  1051. this.tx += d;
  1052. this.ty += a;
  1053. return this
  1054. };
  1055. a.prototype.identity =
  1056. function() {
  1057. this.a = this.d = 1;
  1058. this.b = this.c = this.tx = this.ty = 0;
  1059. return this
  1060. };
  1061. a.prototype.identityMatrix = function(d) {
  1062. this.a = d.a;
  1063. this.b = d.b;
  1064. this.c = d.c;
  1065. this.d = d.d;
  1066. this.tx = d.tx;
  1067. this.ty = d.ty;
  1068. return this
  1069. };
  1070. a.prototype.invert = function() {
  1071. var d = this.a,
  1072. a = this.b,
  1073. b = this.c,
  1074. e = this.d,
  1075. c = this.tx,
  1076. f = d * e - a * b;
  1077. this.a = e / f;
  1078. this.b = -a / f;
  1079. this.c = -b / f;
  1080. this.d = d / f;
  1081. this.tx = (b * this.ty - e * c) / f;
  1082. this.ty = -(d * this.ty - a * c) / f;
  1083. return this
  1084. };
  1085. a.transformCoords = function(d, a, g) {
  1086. var e = b.Point.identity;
  1087. e.x = d.a * a + d.c * g + d.tx;
  1088. e.y = d.d * g + d.b * a + d.ty;
  1089. return e
  1090. };
  1091. a.prototype.toArray = function(d) {
  1092. this.array || (this.array = new Float32Array(9));
  1093. d ? (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);
  1094. this.array[8] = 1;
  1095. return this.array
  1096. };
  1097. a.identity = new a;
  1098. a.DEG_TO_RAD = Math.PI / 180;
  1099. return a
  1100. }(b.HashObject);
  1101. b.Matrix = c;
  1102. c.prototype.__class__ = "egret.Matrix"
  1103. })(egret || (egret = {}));
  1104. __extends = this.__extends || function(b, c) {
  1105. function e() {
  1106. this.constructor = b
  1107. }
  1108. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1109. e.prototype = c.prototype;
  1110. b.prototype = new e
  1111. };
  1112. (function(b) {
  1113. var c = function(b) {
  1114. function a(d, a) {
  1115. void 0 === d && (d = 0);
  1116. void 0 === a && (a = 0);
  1117. b.call(this);
  1118. this.x = d;
  1119. this.y = a
  1120. }
  1121. __extends(a, b);
  1122. a.prototype.clone = function() {
  1123. return new a(this.x, this.y)
  1124. };
  1125. a.prototype.equals = function(d) {
  1126. return this.x == d.x && this.y == d.y
  1127. };
  1128. a.distance = function(d, a) {
  1129. return Math.sqrt((d.x - a.x) * (d.x - a.x) + (d.y - a.y) * (d.y - a.y))
  1130. };
  1131. a.identity = new a(0, 0);
  1132. return a
  1133. }(b.HashObject);
  1134. b.Point = c;
  1135. c.prototype.__class__ = "egret.Point"
  1136. })(egret || (egret = {}));
  1137. __extends = this.__extends || function(b, c) {
  1138. function e() {
  1139. this.constructor = b
  1140. }
  1141. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1142. e.prototype = c.prototype;
  1143. b.prototype = new e
  1144. };
  1145. (function(b) {
  1146. var c = function(b) {
  1147. function a(d, a, g, c) {
  1148. void 0 === d && (d = 0);
  1149. void 0 === a && (a = 0);
  1150. void 0 === g && (g = 0);
  1151. void 0 === c && (c = 0);
  1152. b.call(this);
  1153. this.x = d;
  1154. this.y = a;
  1155. this.width = g;
  1156. this.height = c
  1157. }
  1158. __extends(a, b);
  1159. Object.defineProperty(a.prototype, "right", {
  1160. get: function() {
  1161. return this.x + this.width
  1162. },
  1163. set: function(d) {
  1164. this.width = d - this.x
  1165. },
  1166. enumerable: !0,
  1167. configurable: !0
  1168. });
  1169. Object.defineProperty(a.prototype, "bottom", {
  1170. get: function() {
  1171. return this.y + this.height
  1172. },
  1173. set: function(d) {
  1174. this.height = d - this.y
  1175. },
  1176. enumerable: !0,
  1177. configurable: !0
  1178. });
  1179. a.prototype.initialize = function(d, a, b, e) {
  1180. this.x = d;
  1181. this.y = a;
  1182. this.width = b;
  1183. this.height = e;
  1184. return this
  1185. };
  1186. a.prototype.contains = function(d, a) {
  1187. return this.x <= d && this.x + this.width >= d && this.y <= a && this.y + this.height >= a
  1188. };
  1189. a.prototype.intersects = function(d) {
  1190. var a = d.right,
  1191. b = d.bottom,
  1192. e = this.right,
  1193. c = this.bottom;
  1194. return this.contains(d.x, d.y) || this.contains(d.x, b) || this.contains(a, d.y) || this.contains(a, b) || d.contains(this.x, this.y) || d.contains(this.x, c) || d.contains(e, this.y) || d.contains(e, c) ? !0 : !1
  1195. };
  1196. a.prototype.clone =
  1197. function() {
  1198. return new a(this.x, this.y, this.width, this.height)
  1199. };
  1200. a.prototype.containsPoint = function(d) {
  1201. return this.x < d.x && this.x + this.width > d.x && this.y < d.y && this.y + this.height > d.y ? !0 : !1
  1202. };
  1203. a.identity = new a(0, 0, 0, 0);
  1204. return a
  1205. }(b.HashObject);
  1206. b.Rectangle = c;
  1207. c.prototype.__class__ = "egret.Rectangle"
  1208. })(egret || (egret = {}));
  1209. (function(b) {
  1210. var c = function() {
  1211. function e() {}
  1212. e.fatal = function(a, d) {
  1213. void 0 === d && (d = null);
  1214. b.Logger.traceToConsole("Fatal", a, d);
  1215. throw Error(b.Logger.getTraceCode("Fatal", a, d));
  1216. };
  1217. e.info = function(a, d) {
  1218. void 0 === d && (d = null);
  1219. b.Logger.traceToConsole("Info", a, d)
  1220. };
  1221. e.warning = function(a, d) {
  1222. void 0 === d && (d = null);
  1223. b.Logger.traceToConsole("Warning", a, d)
  1224. };
  1225. e.traceToConsole = function(a, d, h) {
  1226. console.log(b.Logger.getTraceCode(a, d, h))
  1227. };
  1228. e.getTraceCode = function(a, d, h) {
  1229. return "[" + a + "]" + d + ":" + (null == h ? "" : h)
  1230. };
  1231. return e
  1232. }();
  1233. b.Logger =
  1234. c;
  1235. c.prototype.__class__ = "egret.Logger"
  1236. })(egret || (egret = {}));
  1237. __extends = this.__extends || function(b, c) {
  1238. function e() {
  1239. this.constructor = b
  1240. }
  1241. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1242. e.prototype = c.prototype;
  1243. b.prototype = new e
  1244. };
  1245. (function(b) {
  1246. var c = function(e) {
  1247. function a() {
  1248. e.call(this);
  1249. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1250. this._xmlDict = {};
  1251. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1252. }
  1253. __extends(a, e);
  1254. a.getInstance = function() {
  1255. a._instance || (a._instance = new a);
  1256. return a._instance
  1257. };
  1258. a.prototype.parserXML = function(d) {
  1259. for (var a = 0;
  1260. "\n" == d.charAt(a) || "\t" == d.charAt(a) || "\r" == d.charAt(a) || " " == d.charAt(a);) a++;
  1261. 0 != a && (d = d.substring(a, d.length));
  1262. this._isSupportDOMParser ?
  1263. a = this._parser.parseFromString(d, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(d));
  1264. null == a && b.Logger.info("xml not found!");
  1265. return a
  1266. };
  1267. a._instance = null;
  1268. return a
  1269. }(b.HashObject);
  1270. b.SAXParser = c;
  1271. c.prototype.__class__ = "egret.SAXParser"
  1272. })(egret || (egret = {}));
  1273. __extends = this.__extends || function(b, c) {
  1274. function e() {
  1275. this.constructor = b
  1276. }
  1277. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1278. e.prototype = c.prototype;
  1279. b.prototype = new e
  1280. };
  1281. (function(b) {
  1282. var c = function(d) {
  1283. function h() {
  1284. d.call(this);
  1285. this._designHeight = this._designWidth = 0;
  1286. this._scaleY = this._scaleX = 1;
  1287. this._stageHeight = this._stageWidth = this._offSetY = 0
  1288. }
  1289. __extends(h, d);
  1290. h.getInstance = function() {
  1291. null == h.instance && (a.initialize(), h.instance = new h);
  1292. return h.instance
  1293. };
  1294. h.prototype.setDesignSize = function(d, a, h) {
  1295. this._designWidth = d;
  1296. this._designHeight = a;
  1297. h && (b.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1298. this._setResolutionPolicy(h))
  1299. };
  1300. h.prototype._setResolutionPolicy = function(d) {
  1301. this._resolutionPolicy = d;
  1302. d.init(this);
  1303. d._apply(this, this._designWidth, this._designHeight)
  1304. };
  1305. h.prototype.getScaleX = function() {
  1306. return this._scaleX
  1307. };
  1308. h.prototype.getScaleY = function() {
  1309. return this._scaleY
  1310. };
  1311. h.prototype.getOffSetY = function() {
  1312. return this._offSetY
  1313. };
  1314. h.canvas_name = "egretCanvas";
  1315. h.canvas_div_name = "gameDiv";
  1316. return h
  1317. }(b.HashObject);
  1318. b.StageDelegate = c;
  1319. c.prototype.__class__ = "egret.StageDelegate";
  1320. var e = function() {
  1321. function d(a,
  1322. h) {
  1323. this._containerStrategy = a;
  1324. this._contentStrategy = h
  1325. }
  1326. d.prototype.init = function(d) {
  1327. this._containerStrategy.init(d);
  1328. this._contentStrategy.init(d)
  1329. };
  1330. d.prototype._apply = function(d, a, h) {
  1331. this._containerStrategy._apply(d, a, h);
  1332. this._contentStrategy._apply(d, a, h)
  1333. };
  1334. return d
  1335. }();
  1336. b.ResolutionPolicy = e;
  1337. e.prototype.__class__ = "egret.ResolutionPolicy";
  1338. var a = function() {
  1339. function a() {}
  1340. a.initialize = function() {
  1341. a.EQUAL_TO_FRAME = new d
  1342. };
  1343. a.prototype.init = function(d) {};
  1344. a.prototype._apply = function(d, a, h) {};
  1345. a.prototype._setupContainer =
  1346. function() {
  1347. var d = document.body,
  1348. a;
  1349. d && (a = d.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")
  1350. };
  1351. return a
  1352. }();
  1353. b.ContainerStrategy = a;
  1354. a.prototype.__class__ = "egret.ContainerStrategy";
  1355. var d = function(d) {
  1356. function a() {
  1357. d.apply(this, arguments)
  1358. }
  1359. __extends(a, d);
  1360. a.prototype._apply = function(d) {
  1361. this._setupContainer()
  1362. };
  1363. return a
  1364. }(a);
  1365. b.EqualToFrame = d;
  1366. d.prototype.__class__ = "egret.EqualToFrame";
  1367. e = function() {
  1368. function d() {}
  1369. d.prototype.init = function(d) {};
  1370. d.prototype._apply = function(d, a, h) {};
  1371. d.prototype.setEgretSize = function(d, a, h, g, e, p) {
  1372. void 0 === p && (p = 0);
  1373. b.StageDelegate.getInstance()._stageWidth = Math.round(d);
  1374. b.StageDelegate.getInstance()._stageHeight =
  1375. Math.round(a);
  1376. d = document.getElementById(c.canvas_div_name);
  1377. d.style.width = h + "px";
  1378. d.style.height = g + "px";
  1379. d.style.top = p + "px"
  1380. };
  1381. d.prototype._getClientWidth = function() {
  1382. return document.documentElement.clientWidth
  1383. };
  1384. d.prototype._getClientHeight = function() {
  1385. return document.documentElement.clientHeight
  1386. };
  1387. return d
  1388. }();
  1389. b.ContentStrategy = e;
  1390. e.prototype.__class__ = "egret.ContentStrategy";
  1391. var h = function(d) {
  1392. function a(h) {
  1393. void 0 === h && (h = 0);
  1394. d.call(this);
  1395. this.minWidth = h
  1396. }
  1397. __extends(a, d);
  1398. a.prototype._apply = function(d, a, h) {
  1399. a =
  1400. this._getClientWidth();
  1401. var b = this._getClientHeight(),
  1402. g = b / h,
  1403. e = a / g,
  1404. c = 1;
  1405. 0 != this.minWidth && (c = Math.min(1, e / this.minWidth));
  1406. this.setEgretSize(e / c, h, a, b * c);
  1407. d._scaleX = g * c;
  1408. d._scaleY = g * c
  1409. };
  1410. return a
  1411. }(e);
  1412. b.FixedHeight = h;
  1413. h.prototype.__class__ = "egret.FixedHeight";
  1414. h = function(d) {
  1415. function a(h) {
  1416. void 0 === h && (h = 0);
  1417. d.call(this);
  1418. this.minHeight = h
  1419. }
  1420. __extends(a, d);
  1421. a.prototype._apply = function(d, a, h) {
  1422. h = this._getClientWidth();
  1423. var b = this._getClientHeight(),
  1424. g = h / a,
  1425. e = b / g,
  1426. c = 1;
  1427. 0 != this.minHeight && (c = Math.min(1, e / this.minHeight));
  1428. this.setEgretSize(a,
  1429. e / c, h * c, b, h * (1 - c) / 2);
  1430. d._scaleX = g * c;
  1431. d._scaleY = g * c
  1432. };
  1433. return a
  1434. }(e);
  1435. b.FixedWidth = h;
  1436. h.prototype.__class__ = "egret.FixedWidth";
  1437. h = function(d) {
  1438. function a(h, b) {
  1439. d.call(this);
  1440. this.width = h;
  1441. this.height = b
  1442. }
  1443. __extends(a, d);
  1444. a.prototype._apply = function(d, a, h) {
  1445. h = this.width;
  1446. var b = this.height,
  1447. g = h / a;
  1448. this.setEgretSize(a, b / g, h, b);
  1449. d._scaleX = g;
  1450. d._scaleY = g
  1451. };
  1452. return a
  1453. }(e);
  1454. b.FixedSize = h;
  1455. h.prototype.__class__ = "egret.FixedSize";
  1456. h = function(d) {
  1457. function a() {
  1458. d.call(this)
  1459. }
  1460. __extends(a, d);
  1461. a.prototype._apply = function(d, a, h) {
  1462. this.setEgretSize(a,
  1463. h, a, h, Math.floor((a - a) / 2));
  1464. d._scaleX = 1;
  1465. d._scaleY = 1
  1466. };
  1467. return a
  1468. }(e);
  1469. b.NoScale = h;
  1470. h.prototype.__class__ = "egret.NoScale";
  1471. h = function(d) {
  1472. function a() {
  1473. d.call(this)
  1474. }
  1475. __extends(a, d);
  1476. a.prototype._apply = function(d, a, h) {
  1477. var b = this._getClientWidth(),
  1478. g = this._getClientHeight(),
  1479. c = b,
  1480. e = g,
  1481. m = c / a < e / h ? c / a : e / h,
  1482. c = a * m,
  1483. e = h * m,
  1484. b = Math.floor((b - c) / 2);
  1485. d._offSetY = Math.floor((g - e) / 2);
  1486. this.setEgretSize(a, h / 1, 1 * c, e, b, d._offSetY);
  1487. d._scaleX = 1 * m;
  1488. d._scaleY = 1 * m
  1489. };
  1490. return a
  1491. }(e);
  1492. b.ShowAll = h;
  1493. h.prototype.__class__ = "egret.ShowAll";
  1494. e = function(d) {
  1495. function a() {
  1496. d.call(this)
  1497. }
  1498. __extends(a, d);
  1499. a.prototype._apply = function(d, a, h) {
  1500. var b = this._getClientWidth(),
  1501. g = this._getClientHeight(),
  1502. b = b / a,
  1503. g = g / h;
  1504. this.setEgretSize(a, h, a * b, h * g);
  1505. d._scaleX = b;
  1506. d._scaleY = g
  1507. };
  1508. return a
  1509. }(e);
  1510. b.FullScreen = e;
  1511. e.prototype.__class__ = "egret.FullScreen"
  1512. })(egret || (egret = {}));
  1513. __extends = this.__extends || function(b, c) {
  1514. function e() {
  1515. this.constructor = b
  1516. }
  1517. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1518. e.prototype = c.prototype;
  1519. b.prototype = new e
  1520. };
  1521. (function(b) {
  1522. var c = function(c) {
  1523. function a() {
  1524. c.call(this);
  1525. this._originalData = {};
  1526. this._drawAreaList = []
  1527. }
  1528. __extends(a, c);
  1529. a.getInstance = function() {
  1530. null == a.instance && (a.instance = new a);
  1531. return a.instance
  1532. };
  1533. a.prototype.addDrawArea = function(d) {
  1534. this._drawAreaList.push(d)
  1535. };
  1536. a.prototype.clearDrawArea = function() {
  1537. this._drawAreaList = []
  1538. };
  1539. a.prototype.drawImage = function(d, a, g, c, e, f, l, n, p, q, r) {
  1540. void 0 === r && (r = void 0);
  1541. l = l || 0;
  1542. n = n || 0;
  1543. var t = a._texture_to_render;
  1544. if (null != t && 0 != f && 0 != e && 0 != p && 0 != q) {
  1545. var s = b.MainContext.instance.rendererContext.texture_scale_factor;
  1546. e /= s;
  1547. f /= s;
  1548. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1549. s = b.DisplayObject.getTransformBounds(a._getSize(b.Rectangle.identity), a._worldTransform);
  1550. a._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1551. s = this._originalData;
  1552. s.sourceX = g;
  1553. s.sourceY = c;
  1554. s.sourceWidth = e;
  1555. s.sourceHeight = f;
  1556. s.destX = l;
  1557. s.destY = n;
  1558. s.destWidth = p;
  1559. s.destHeight = q;
  1560. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1561. if (!this.ignoreRender(a, u[v], s.destX, s.destY)) {
  1562. d.drawImage(t, g, c, e, f, l, n, p, q, r);
  1563. break
  1564. }
  1565. } else d.drawImage(t, g, c, e, f, l, n, p, q, r)
  1566. }
  1567. };
  1568. a.prototype.ignoreRender = function(d, a, b, c) {
  1569. var e = d._worldBounds;
  1570. b *= d._worldTransform.a;
  1571. c *= d._worldTransform.d;
  1572. return e.x + e.width + b <= a.x || e.x + b >= a.x + a.width || e.y + e.height + c <= a.y || e.y + c >= a.y + a.height ? !0 : !1
  1573. };
  1574. a.prototype.getDrawAreaList = function() {
  1575. var d;
  1576. 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,
  1577. this.onResize, this)), d = this._defaultDrawAreaList) : d = this._drawAreaList;
  1578. return d
  1579. };
  1580. a.prototype.onResize = function() {
  1581. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1582. this._defaultDrawAreaList = null
  1583. };
  1584. return a
  1585. }(b.HashObject);
  1586. b.RenderFilter = c;
  1587. c.prototype.__class__ = "egret.RenderFilter"
  1588. })(egret || (egret = {}));
  1589. (function(b) {
  1590. var c = function() {
  1591. function c() {}
  1592. c.mapClass = function(a, d, h) {
  1593. void 0 === h && (h = "");
  1594. a = this.getKey(a) + "#" + h;
  1595. this.mapClassDic[a] = d
  1596. };
  1597. c.getKey = function(a) {
  1598. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1599. };
  1600. c.mapValue = function(a, d, h) {
  1601. void 0 === h && (h = "");
  1602. a = this.getKey(a) + "#" + h;
  1603. this.mapValueDic[a] = d
  1604. };
  1605. c.hasMapRule = function(a, d) {
  1606. void 0 === d && (d = "");
  1607. var h = this.getKey(a) + "#" + d;
  1608. return this.mapValueDic[h] || this.mapClassDic[h] ? !0 : !1
  1609. };
  1610. c.getInstance = function(a, d) {
  1611. void 0 === d && (d = "");
  1612. var h = this.getKey(a) + "#" +
  1613. d;
  1614. if (this.mapValueDic[h]) return this.mapValueDic[h];
  1615. var b = this.mapClassDic[h];
  1616. if (b) return b = new b, this.mapValueDic[h] = b, delete this.mapClassDic[h], b;
  1617. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + h + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1618. };
  1619. c.mapClassDic = {};
  1620. c.mapValueDic = {};
  1621. return c
  1622. }();
  1623. b.Injector = c;
  1624. c.prototype.__class__ = "egret.Injector"
  1625. })(egret ||
  1626. (egret = {}));
  1627. (function(b) {
  1628. var c = function() {
  1629. function b() {}
  1630. b.NORMAL = "normal";
  1631. b.ADD = "add";
  1632. return b
  1633. }();
  1634. b.BlendMode = c;
  1635. c.prototype.__class__ = "egret.BlendMode"
  1636. })(egret || (egret = {}));
  1637. __extends = this.__extends || function(b, c) {
  1638. function e() {
  1639. this.constructor = b
  1640. }
  1641. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1642. e.prototype = c.prototype;
  1643. b.prototype = new e
  1644. };
  1645. (function(b) {
  1646. var c = function(c) {
  1647. function a() {
  1648. c.call(this);
  1649. this.__hack_local_matrix = null;
  1650. this._sizeDirty = this._normalDirty = !0;
  1651. this._parent = this._texture_to_render = null;
  1652. this._y = this._x = 0;
  1653. this._scaleY = this._scaleX = 1;
  1654. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1655. this._visible = !0;
  1656. this._rotation = 0;
  1657. this._alpha = 1;
  1658. this._skewY = this._skewX = 0;
  1659. this._touchEnabled = !1;
  1660. this._scrollRect = this.blendMode = null;
  1661. this._hasHeightSet = this._hasWidthSet = !1;
  1662. this._worldBounds = this.mask = null;
  1663. this.worldAlpha =
  1664. 1;
  1665. this._rectH = this._rectW = 0;
  1666. this._stage = null;
  1667. this._cacheDirty = this._cacheAsBitmap = !1;
  1668. this._colorTransform = null;
  1669. this._worldTransform = new b.Matrix;
  1670. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1671. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1672. }
  1673. __extends(a, c);
  1674. a.prototype._setDirty = function() {
  1675. this._normalDirty = !0
  1676. };
  1677. a.prototype.getDirty = function() {
  1678. return this._normalDirty || this._sizeDirty
  1679. };
  1680. a.prototype._setParentSizeDirty = function() {
  1681. var d = this._parent;
  1682. !d || d._hasWidthSet || d._hasHeightSet || d._setSizeDirty()
  1683. };
  1684. a.prototype._setSizeDirty =
  1685. function() {
  1686. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1687. };
  1688. a.prototype._clearDirty = function() {
  1689. this._normalDirty = !1
  1690. };
  1691. a.prototype._clearSizeDirty = function() {
  1692. this._sizeDirty = !1
  1693. };
  1694. Object.defineProperty(a.prototype, "parent", {
  1695. get: function() {
  1696. return this._parent
  1697. },
  1698. enumerable: !0,
  1699. configurable: !0
  1700. });
  1701. a.prototype._parentChanged = function(d) {
  1702. this._parent = d
  1703. };
  1704. Object.defineProperty(a.prototype, "x", {
  1705. get: function() {
  1706. return this._x
  1707. },
  1708. set: function(d) {
  1709. this._setX(d)
  1710. },
  1711. enumerable: !0,
  1712. configurable: !0
  1713. });
  1714. a.prototype._setX = function(d) {
  1715. b.NumberUtils.isNumber(d) && this._x != d && (this._x = d, this._setDirty(), this._setParentSizeDirty())
  1716. };
  1717. Object.defineProperty(a.prototype, "y", {
  1718. get: function() {
  1719. return this._y
  1720. },
  1721. set: function(d) {
  1722. this._setY(d)
  1723. },
  1724. enumerable: !0,
  1725. configurable: !0
  1726. });
  1727. a.prototype._setY = function(d) {
  1728. b.NumberUtils.isNumber(d) && this._y != d && (this._y = d, this._setDirty(), this._setParentSizeDirty())
  1729. };
  1730. Object.defineProperty(a.prototype, "scaleX", {
  1731. get: function() {
  1732. return this._scaleX
  1733. },
  1734. set: function(d) {
  1735. b.NumberUtils.isNumber(d) &&
  1736. this._scaleX != d && (this._scaleX = d, this._setDirty(), this._setParentSizeDirty())
  1737. },
  1738. enumerable: !0,
  1739. configurable: !0
  1740. });
  1741. Object.defineProperty(a.prototype, "scaleY", {
  1742. get: function() {
  1743. return this._scaleY
  1744. },
  1745. set: function(d) {
  1746. b.NumberUtils.isNumber(d) && this._scaleY != d && (this._scaleY = d, this._setDirty(), this._setParentSizeDirty())
  1747. },
  1748. enumerable: !0,
  1749. configurable: !0
  1750. });
  1751. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1752. get: function() {
  1753. return this._anchorOffsetX
  1754. },
  1755. set: function(d) {
  1756. b.NumberUtils.isNumber(d) && this._anchorOffsetX !=
  1757. d && (this._anchorOffsetX = d, this._setDirty(), this._setParentSizeDirty())
  1758. },
  1759. enumerable: !0,
  1760. configurable: !0
  1761. });
  1762. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1763. get: function() {
  1764. return this._anchorOffsetY
  1765. },
  1766. set: function(d) {
  1767. b.NumberUtils.isNumber(d) && this._anchorOffsetY != d && (this._anchorOffsetY = d, this._setDirty(), this._setParentSizeDirty())
  1768. },
  1769. enumerable: !0,
  1770. configurable: !0
  1771. });
  1772. Object.defineProperty(a.prototype, "anchorX", {
  1773. get: function() {
  1774. return this._anchorX
  1775. },
  1776. set: function(d) {
  1777. this._setAnchorX(d)
  1778. },
  1779. enumerable: !0,
  1780. configurable: !0
  1781. });
  1782. a.prototype._setAnchorX = function(d) {
  1783. b.NumberUtils.isNumber(d) && this._anchorX != d && (this._anchorX = d, this._setDirty(), this._setParentSizeDirty())
  1784. };
  1785. Object.defineProperty(a.prototype, "anchorY", {
  1786. get: function() {
  1787. return this._anchorY
  1788. },
  1789. set: function(d) {
  1790. this._setAnchorY(d)
  1791. },
  1792. enumerable: !0,
  1793. configurable: !0
  1794. });
  1795. a.prototype._setAnchorY = function(d) {
  1796. b.NumberUtils.isNumber(d) && this._anchorY != d && (this._anchorY = d, this._setDirty(), this._setParentSizeDirty())
  1797. };
  1798. Object.defineProperty(a.prototype, "visible", {
  1799. get: function() {
  1800. return this._visible
  1801. },
  1802. set: function(d) {
  1803. this._setVisible(d)
  1804. },
  1805. enumerable: !0,
  1806. configurable: !0
  1807. });
  1808. a.prototype._setVisible = function(d) {
  1809. this._visible != d && (this._visible = d, this._setSizeDirty())
  1810. };
  1811. Object.defineProperty(a.prototype, "rotation", {
  1812. get: function() {
  1813. return this._rotation
  1814. },
  1815. set: function(d) {
  1816. b.NumberUtils.isNumber(d) && this._rotation != d && (this._rotation = d, this._setSizeDirty())
  1817. },
  1818. enumerable: !0,
  1819. configurable: !0
  1820. });
  1821. Object.defineProperty(a.prototype, "alpha", {
  1822. get: function() {
  1823. return this._alpha
  1824. },
  1825. set: function(d) {
  1826. b.NumberUtils.isNumber(d) &&
  1827. this._alpha != d && (this._alpha = d, this._setDirty(), this._setCacheDirty())
  1828. },
  1829. enumerable: !0,
  1830. configurable: !0
  1831. });
  1832. Object.defineProperty(a.prototype, "skewX", {
  1833. get: function() {
  1834. return this._skewX
  1835. },
  1836. set: function(d) {
  1837. b.NumberUtils.isNumber(d) && this._skewX != d && (this._skewX = d, this._setSizeDirty())
  1838. },
  1839. enumerable: !0,
  1840. configurable: !0
  1841. });
  1842. Object.defineProperty(a.prototype, "skewY", {
  1843. get: function() {
  1844. return this._skewY
  1845. },
  1846. set: function(d) {
  1847. b.NumberUtils.isNumber(d) && this._skewY != d && (this._skewY = d, this._setSizeDirty())
  1848. },
  1849. enumerable: !0,
  1850. configurable: !0
  1851. });
  1852. Object.defineProperty(a.prototype, "touchEnabled", {
  1853. get: function() {
  1854. return this._touchEnabled
  1855. },
  1856. set: function(d) {
  1857. this._setTouchEnabled(d)
  1858. },
  1859. enumerable: !0,
  1860. configurable: !0
  1861. });
  1862. a.prototype._setTouchEnabled = function(d) {
  1863. this._touchEnabled = d
  1864. };
  1865. Object.defineProperty(a.prototype, "scrollRect", {
  1866. get: function() {
  1867. return this._scrollRect
  1868. },
  1869. set: function(d) {
  1870. this._setScrollRect(d)
  1871. },
  1872. enumerable: !0,
  1873. configurable: !0
  1874. });
  1875. a.prototype._setScrollRect = function(d) {
  1876. this._scrollRect = d;
  1877. this._setSizeDirty()
  1878. };
  1879. Object.defineProperty(a.prototype,
  1880. "measuredWidth", {
  1881. get: function() {
  1882. return this._measureBounds().width
  1883. },
  1884. enumerable: !0,
  1885. configurable: !0
  1886. });
  1887. Object.defineProperty(a.prototype, "measuredHeight", {
  1888. get: function() {
  1889. return this._measureBounds().height
  1890. },
  1891. enumerable: !0,
  1892. configurable: !0
  1893. });
  1894. Object.defineProperty(a.prototype, "explicitWidth", {
  1895. get: function() {
  1896. return this._explicitWidth
  1897. },
  1898. enumerable: !0,
  1899. configurable: !0
  1900. });
  1901. Object.defineProperty(a.prototype, "explicitHeight", {
  1902. get: function() {
  1903. return this._explicitHeight
  1904. },
  1905. enumerable: !0,
  1906. configurable: !0
  1907. });
  1908. Object.defineProperty(a.prototype,
  1909. "width", {
  1910. get: function() {
  1911. return this._getSize(b.Rectangle.identity).width
  1912. },
  1913. set: function(d) {
  1914. this._setWidth(d)
  1915. },
  1916. enumerable: !0,
  1917. configurable: !0
  1918. });
  1919. Object.defineProperty(a.prototype, "height", {
  1920. get: function() {
  1921. return this._getSize(b.Rectangle.identity).height
  1922. },
  1923. set: function(d) {
  1924. this._setHeight(d)
  1925. },
  1926. enumerable: !0,
  1927. configurable: !0
  1928. });
  1929. a.prototype._setWidth = function(d) {
  1930. this._setSizeDirty();
  1931. this._setCacheDirty();
  1932. this._explicitWidth = d;
  1933. this._hasWidthSet = b.NumberUtils.isNumber(d)
  1934. };
  1935. a.prototype._setHeight = function(d) {
  1936. this._setSizeDirty();
  1937. this._setCacheDirty();
  1938. this._explicitHeight = d;
  1939. this._hasHeightSet = b.NumberUtils.isNumber(d)
  1940. };
  1941. a.prototype._draw = function(d) {
  1942. if (this._visible && !this.drawCacheTexture(d)) {
  1943. this._colorTransform && d.setGlobalColorTransform(this._colorTransform.matrix);
  1944. d.setAlpha(this.worldAlpha, this.blendMode);
  1945. d.setTransform(this._worldTransform);
  1946. var a = this.mask || this._scrollRect;
  1947. a && d.pushMask(a);
  1948. this._render(d);
  1949. a && d.popMask();
  1950. this._colorTransform && d.setGlobalColorTransform(null)
  1951. }
  1952. this.destroyCacheBounds()
  1953. };
  1954. a.prototype.drawCacheTexture =
  1955. function(d) {
  1956. if (!1 == this._cacheAsBitmap) return !1;
  1957. 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)) this._cacheDirty = !this._makeBitmapCache();
  1958. if (null == this._texture_to_render) return !1;
  1959. var a = this._texture_to_render,
  1960. g = a._offsetX,
  1961. c = a._offsetY,
  1962. e = a._textureWidth,
  1963. a = a._textureHeight;
  1964. this._updateTransform();
  1965. d.setAlpha(this.worldAlpha, this.blendMode);
  1966. d.setTransform(this._worldTransform);
  1967. var f = b.MainContext.instance.rendererContext.texture_scale_factor;
  1968. b.RenderFilter.getInstance().drawImage(d, this, 0, 0, e * f, a * f, g, c, e, a);
  1969. return !0
  1970. };
  1971. a.prototype._updateTransform = function() {
  1972. this._calculateWorldTransform()
  1973. };
  1974. a.prototype._calculateWorldTransform = function() {
  1975. var d = this._worldTransform,
  1976. a = this._parent;
  1977. d.identityMatrix(a._worldTransform);
  1978. this._getMatrix(d);
  1979. var b = this._scrollRect;
  1980. b && d.append(1, 0, 0, 1, -b.x, -b.y);
  1981. this.worldAlpha = a.worldAlpha * this._alpha
  1982. };
  1983. a.prototype._render = function(d) {};
  1984. a.prototype.getBounds =
  1985. function(d, a) {
  1986. void 0 === a && (a = !0);
  1987. var g = this._measureBounds(),
  1988. c = this._hasWidthSet ? this._explicitWidth : g.width,
  1989. e = this._hasHeightSet ? this._explicitHeight : g.height;
  1990. this._rectW = g.width;
  1991. this._rectH = g.height;
  1992. this._clearSizeDirty();
  1993. var f = g.x,
  1994. g = g.y,
  1995. l = 0,
  1996. n = 0;
  1997. a && (0 != this._anchorX || 0 != this._anchorY ? (l = c * this._anchorX, n = e * this._anchorY) : (l = this._anchorOffsetX, n = this._anchorOffsetY));
  1998. this._cacheBounds.initialize(f - l, g - n, c, e);
  1999. c = this._cacheBounds;
  2000. d || (d = new b.Rectangle);
  2001. return d.initialize(c.x, c.y, c.width, c.height)
  2002. };
  2003. a.prototype.destroyCacheBounds = function() {
  2004. this._cacheBounds.x = 0;
  2005. this._cacheBounds.y = 0;
  2006. this._cacheBounds.width = 0;
  2007. this._cacheBounds.height = 0
  2008. };
  2009. a.prototype._getConcatenatedMatrix = function() {
  2010. for (var d = a.identityMatrixForGetConcatenated.identity(), h = this; null != h;) {
  2011. if (0 != h._anchorX || 0 != h._anchorY) {
  2012. var g = h._getSize(b.Rectangle.identity);
  2013. d.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, g.width * h._anchorX, g.height * h._anchorY)
  2014. } else d.prependTransform(h._x, h._y, h._scaleX, h._scaleY,
  2015. h._rotation, h._skewX, h._skewY, h._anchorOffsetX, h._anchorOffsetY);
  2016. h._scrollRect && d.prepend(1, 0, 0, 1, -h._scrollRect.x, -h._scrollRect.y);
  2017. h = h._parent
  2018. }
  2019. return d
  2020. };
  2021. a.prototype.localToGlobal = function(d, a, g) {
  2022. void 0 === d && (d = 0);
  2023. void 0 === a && (a = 0);
  2024. var c = this._getConcatenatedMatrix();
  2025. c.append(1, 0, 0, 1, d, a);
  2026. g || (g = new b.Point);
  2027. g.x = c.tx;
  2028. g.y = c.ty;
  2029. return g
  2030. };
  2031. a.prototype.globalToLocal = function(d, a, g) {
  2032. void 0 === d && (d = 0);
  2033. void 0 === a && (a = 0);
  2034. var c = this._getConcatenatedMatrix();
  2035. c.invert();
  2036. c.append(1, 0, 0, 1, d, a);
  2037. g || (g = new b.Point);
  2038. g.x = c.tx;
  2039. g.y = c.ty;
  2040. return g
  2041. };
  2042. a.prototype.hitTest = function(d, a, g) {
  2043. void 0 === g && (g = !1);
  2044. if (!this._visible || !g && !this._touchEnabled) return null;
  2045. g = this._getSize(b.Rectangle.identity);
  2046. return 0 <= d && d < g.width && 0 <= a && a < g.height ? this.mask || this._scrollRect ? this._scrollRect && d > this._scrollRect.x && a > this._scrollRect.y && d < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= d && d < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ?
  2047. this : null : this : null
  2048. };
  2049. a.prototype.hitTestPoint = function(d, a, g) {
  2050. d = this.globalToLocal(d, a);
  2051. return g ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), g = this._hitTestPointTexture, g.drawToTexture(this), 0 != g.getPixel32(d.x - this._hitTestPointTexture._offsetX, d.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(d.x, d.y, !0)
  2052. };
  2053. a.prototype._getMatrix = function(d) {
  2054. d || (d = b.Matrix.identity.identity());
  2055. var a, g;
  2056. g = this._getOffsetPoint();
  2057. a = g.x;
  2058. g = g.y;
  2059. var c = this.__hack_local_matrix;
  2060. c ? (d.append(c.a, c.b, c.c, c.d, c.tx, c.ty), d.append(1, 0, 0, 1, -a, -g)) : d.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, g);
  2061. return d
  2062. };
  2063. a.prototype._getSize = function(d) {
  2064. return this._hasHeightSet && this._hasWidthSet ? d.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(d)
  2065. };
  2066. a.prototype._measureSize = function(d) {
  2067. this._sizeDirty ? (d = this._measureBounds(), this._rectW = d.width, this._rectH = d.height, this._clearSizeDirty()) : (d.width = this._rectW,
  2068. d.height = this._rectH);
  2069. d.x = 0;
  2070. d.y = 0;
  2071. return d
  2072. };
  2073. a.prototype._measureBounds = function() {
  2074. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2075. };
  2076. a.prototype._getOffsetPoint = function() {
  2077. var d = this._anchorOffsetX,
  2078. a = this._anchorOffsetY;
  2079. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity), d = this._anchorX * a.width, a = this._anchorY * a.height;
  2080. var g = b.Point.identity;
  2081. g.x = d;
  2082. g.y = a;
  2083. return g
  2084. };
  2085. a.prototype._onAddToStage = function() {
  2086. this._stage = b.MainContext.instance.stage;
  2087. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2088. };
  2089. a.prototype._onRemoveFromStage = function() {
  2090. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2091. };
  2092. Object.defineProperty(a.prototype, "stage", {
  2093. get: function() {
  2094. return this._stage
  2095. },
  2096. enumerable: !0,
  2097. configurable: !0
  2098. });
  2099. a.prototype.addEventListener = function(d, h, g, m, k) {
  2100. void 0 === m && (m = !1);
  2101. void 0 === k && (k = 0);
  2102. c.prototype.addEventListener.call(this, d, h, g, m, k);
  2103. ((m = d == b.Event.ENTER_FRAME) || d == b.Event.RENDER) && this._insertEventBin(m ? a._enterFrameCallBackList : a._renderCallBackList, h, g, k, this)
  2104. };
  2105. a.prototype.removeEventListener =
  2106. function(d, h, g, m) {
  2107. void 0 === m && (m = !1);
  2108. c.prototype.removeEventListener.call(this, d, h, g, m);
  2109. ((m = d == b.Event.ENTER_FRAME) || d == b.Event.RENDER) && this._removeEventBin(m ? a._enterFrameCallBackList : a._renderCallBackList, h, g, this)
  2110. };
  2111. a.prototype.dispatchEvent = function(d) {
  2112. if (!d._bubbles) return c.prototype.dispatchEvent.call(this, d);
  2113. for (var a = [], b = this; b;) a.push(b), b = b._parent;
  2114. d._reset();
  2115. this._dispatchPropagationEvent(d, a);
  2116. return !d._isDefaultPrevented
  2117. };
  2118. a.prototype._dispatchPropagationEvent = function(d, a, b) {
  2119. b = a.length;
  2120. for (var c = 1, e = b - 1; 0 <= e; e--) {
  2121. var f = a[e];
  2122. d._currentTarget = f;
  2123. d._target = this;
  2124. d._eventPhase = c;
  2125. f._notifyListener(d);
  2126. if (d._isPropagationStopped || d._isPropagationImmediateStopped) return
  2127. }
  2128. f = a[0];
  2129. d._currentTarget = f;
  2130. d._target = this;
  2131. d._eventPhase = 2;
  2132. f._notifyListener(d);
  2133. if (!d._isPropagationStopped && !d._isPropagationImmediateStopped)
  2134. for (c = 3, e = 1; e < b && (f = a[e], d._currentTarget = f, d._target = this, d._eventPhase = c, f._notifyListener(d), !d._isPropagationStopped && !d._isPropagationImmediateStopped); e++);
  2135. };
  2136. a.prototype.willTrigger =
  2137. function(d) {
  2138. for (var a = this; a;) {
  2139. if (a.hasEventListener(d)) return !0;
  2140. a = a._parent
  2141. }
  2142. return !1
  2143. };
  2144. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2145. get: function() {
  2146. return this._cacheAsBitmap
  2147. },
  2148. set: function(d) {
  2149. (this._cacheAsBitmap = d) ? b.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2150. },
  2151. enumerable: !0,
  2152. configurable: !0
  2153. });
  2154. a.prototype._makeBitmapCache = function() {
  2155. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2156. var d = this.renderTexture.drawToTexture(this);
  2157. this._texture_to_render = d ? this.renderTexture :
  2158. null;
  2159. return d
  2160. };
  2161. a.prototype._setCacheDirty = function(d) {
  2162. void 0 === d && (d = !0);
  2163. this._cacheDirty = d
  2164. };
  2165. a.getTransformBounds = function(d, a) {
  2166. var b = d.x,
  2167. c = d.y,
  2168. e = d.width,
  2169. f = d.height;
  2170. (b || c) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2171. var l = e * a.a,
  2172. e = e * a.b,
  2173. n = f * a.c,
  2174. f = f * a.d,
  2175. p = a.tx,
  2176. q = a.ty,
  2177. r = p,
  2178. t = p,
  2179. s = q,
  2180. u = q;
  2181. (b = l + p) < r ? r = b : b > t && (t = b);
  2182. (b = l + n + p) < r ? r = b : b > t && (t = b);
  2183. (b = n + p) < r ? r = b : b > t && (t = b);
  2184. (c = e + q) < s ? s = c : c > u && (u = c);
  2185. (c = e + f + q) < s ? s = c : c > u && (u = c);
  2186. (c = f + q) < s ? s = c : c > u && (u = c);
  2187. return d.initialize(r, s, t - r, u - s)
  2188. };
  2189. Object.defineProperty(a.prototype, "colorTransform", {
  2190. get: function() {
  2191. return this._colorTransform
  2192. },
  2193. set: function(d) {
  2194. this._colorTransform = d
  2195. },
  2196. enumerable: !0,
  2197. configurable: !0
  2198. });
  2199. a.identityMatrixForGetConcatenated = new b.Matrix;
  2200. a._enterFrameCallBackList = [];
  2201. a._renderCallBackList = [];
  2202. return a
  2203. }(b.EventDispatcher);
  2204. b.DisplayObject = c;
  2205. c.prototype.__class__ = "egret.DisplayObject";
  2206. c = function() {
  2207. function b() {
  2208. this.matrix = null
  2209. }
  2210. b.prototype.updateColor = function(a, d, b, g, c, e, f, l) {};
  2211. return b
  2212. }();
  2213. b.ColorTransform = c;
  2214. c.prototype.__class__ = "egret.ColorTransform"
  2215. })(egret || (egret = {}));
  2216. __extends = this.__extends || function(b, c) {
  2217. function e() {
  2218. this.constructor = b
  2219. }
  2220. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2221. e.prototype = c.prototype;
  2222. b.prototype = new e
  2223. };
  2224. (function(b) {
  2225. var c = function(c) {
  2226. function a() {
  2227. c.call(this);
  2228. this._touchChildren = !0;
  2229. this._children = []
  2230. }
  2231. __extends(a, c);
  2232. Object.defineProperty(a.prototype, "touchChildren", {
  2233. get: function() {
  2234. return this._touchChildren
  2235. },
  2236. set: function(d) {
  2237. this._touchChildren = d
  2238. },
  2239. enumerable: !0,
  2240. configurable: !0
  2241. });
  2242. Object.defineProperty(a.prototype, "numChildren", {
  2243. get: function() {
  2244. return this._children.length
  2245. },
  2246. enumerable: !0,
  2247. configurable: !0
  2248. });
  2249. a.prototype.setChildIndex = function(d, a) {
  2250. this.doSetChildIndex(d, a)
  2251. };
  2252. a.prototype.doSetChildIndex = function(d,
  2253. a) {
  2254. var g = this._children.indexOf(d);
  2255. 0 > g && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2256. this._children.splice(g, 1);
  2257. 0 > a || this._children.length <= a ? this._children.push(d) : this._children.splice(a, 0, d)
  2258. };
  2259. a.prototype.addChild = function(d) {
  2260. var a = this._children.length;
  2261. d._parent == this && a--;
  2262. return this._doAddChild(d, a)
  2263. };
  2264. a.prototype.addChildAt = function(d, a) {
  2265. return this._doAddChild(d, a)
  2266. };
  2267. a.prototype._doAddChild = function(d, h, g) {
  2268. void 0 === g && (g = !0);
  2269. if (d == this) return d;
  2270. if (0 > h || h > this._children.length) return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2271. d;
  2272. var c = d._parent;
  2273. if (c == this) return this.doSetChildIndex(d, h), d;
  2274. c && (h = c._children.indexOf(d), 0 <= h && c._doRemoveChild(h));
  2275. this._children.splice(h, 0, d);
  2276. d._parentChanged(this);
  2277. g && d.dispatchEventWith(b.Event.ADDED, !0);
  2278. if (this._stage)
  2279. for (d._onAddToStage(), h = a.__EVENT__ADD_TO_STAGE_LIST; 0 < h.length;) h.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2280. d._setDirty();
  2281. this._setSizeDirty();
  2282. return d
  2283. };
  2284. a.prototype.removeChild = function(d) {
  2285. d = this._children.indexOf(d);
  2286. if (0 <= d) return this._doRemoveChild(d);
  2287. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2288. return null
  2289. };
  2290. a.prototype.removeChildAt = function(d) {
  2291. if (0 <= d && d < this._children.length) return this._doRemoveChild(d);
  2292. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2293. return null
  2294. };
  2295. a.prototype._doRemoveChild = function(d, h) {
  2296. void 0 === h && (h = !0);
  2297. var g = this._children,
  2298. c = g[d];
  2299. h && c.dispatchEventWith(b.Event.REMOVED, !0);
  2300. if (this._stage) {
  2301. c._onRemoveFromStage();
  2302. for (var e = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < e.length;) {
  2303. var f = e.shift();
  2304. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2305. f._stage = null
  2306. }
  2307. }
  2308. c._parentChanged(null);
  2309. g.splice(d, 1);
  2310. this._setSizeDirty();
  2311. return c
  2312. };
  2313. a.prototype.getChildAt = function(d) {
  2314. if (0 <= d && d < this._children.length) return this._children[d];
  2315. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2316. return null
  2317. };
  2318. a.prototype.contains = function(d) {
  2319. for (; d;) {
  2320. if (d == this) return !0;
  2321. d = d._parent
  2322. }
  2323. return !1
  2324. };
  2325. a.prototype.swapChildrenAt = function(d, a) {
  2326. 0 <= d && d < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(d, a) : b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2327. };
  2328. a.prototype.swapChildren = function(d, a) {
  2329. var g = this._children.indexOf(d),
  2330. c = this._children.indexOf(a); - 1 == g || -1 == c ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(g, c)
  2331. };
  2332. a.prototype._swapChildrenAt = function(d, a) {
  2333. if (d != a) {
  2334. var b = this._children,
  2335. c = b[d];
  2336. b[d] = b[a];
  2337. b[a] = c
  2338. }
  2339. };
  2340. a.prototype.getChildIndex = function(d) {
  2341. return this._children.indexOf(d)
  2342. };
  2343. a.prototype.removeChildren = function() {
  2344. for (var d = this._children.length - 1; 0 <= d; d--) this._doRemoveChild(d)
  2345. };
  2346. a.prototype._updateTransform =
  2347. function() {
  2348. if (this._visible) {
  2349. c.prototype._updateTransform.call(this);
  2350. for (var d = 0, a = this._children.length; d < a; d++) this._children[d]._updateTransform()
  2351. }
  2352. };
  2353. a.prototype._render = function(d) {
  2354. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._draw(d)
  2355. };
  2356. a.prototype._measureBounds = function() {
  2357. for (var d = 0, a = 0, g = 0, c = 0, e = this._children.length, f = 0; f < e; f++) {
  2358. var l = this._children[f];
  2359. if (l._visible) {
  2360. var n = l.getBounds(b.Rectangle.identity, !1),
  2361. p = n.x,
  2362. q = n.y,
  2363. r = n.width,
  2364. n = n.height,
  2365. l = l._getMatrix(),
  2366. l = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p,
  2367. q, r, n), l),
  2368. p = l.x,
  2369. q = l.y,
  2370. r = l.width + l.x,
  2371. l = l.height + l.y;
  2372. if (p < d || 0 == f) d = p;
  2373. if (r > a || 0 == f) a = r;
  2374. if (q < g || 0 == f) g = q;
  2375. if (l > c || 0 == f) c = l
  2376. }
  2377. }
  2378. return b.Rectangle.identity.initialize(d, g, a - d, c - g)
  2379. };
  2380. a.prototype.hitTest = function(d, a, g) {
  2381. void 0 === g && (g = !1);
  2382. var m;
  2383. if (!this._visible) return null;
  2384. if (this._scrollRect) {
  2385. if (d < this._scrollRect.x || a < this._scrollRect.y || d > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2386. } else if (this.mask && (this.mask.x > d || d > this.mask.x + this.mask.width || this.mask.y >
  2387. a || a > this.mask.y + this.mask.height)) return null;
  2388. for (var k = this._children, f = this._touchChildren, l = k.length - 1; 0 <= l; l--) {
  2389. var n = k[l],
  2390. p = n._getMatrix(),
  2391. q = n._scrollRect;
  2392. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2393. p.invert();
  2394. p = b.Matrix.transformCoords(p, d, a);
  2395. if (n = n.hitTest(p.x, p.y, !0)) {
  2396. if (!f) return this;
  2397. if (n._touchEnabled && f) return n;
  2398. m = this
  2399. }
  2400. }
  2401. return m ? m : this._texture_to_render || this.graphics ? c.prototype.hitTest.call(this, d, a, g) : null
  2402. };
  2403. a.prototype._onAddToStage = function() {
  2404. c.prototype._onAddToStage.call(this);
  2405. for (var d = this._children.length,
  2406. a = 0; a < d; a++) this._children[a]._onAddToStage()
  2407. };
  2408. a.prototype._onRemoveFromStage = function() {
  2409. c.prototype._onRemoveFromStage.call(this);
  2410. for (var d = this._children.length, a = 0; a < d; a++) this._children[a]._onRemoveFromStage()
  2411. };
  2412. a.prototype.getChildByName = function(d) {
  2413. for (var a = this._children, b = a.length, c, e = 0; e < b; e++)
  2414. if (c = a[e], c.name == d) return c;
  2415. return null
  2416. };
  2417. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2418. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2419. return a
  2420. }(b.DisplayObject);
  2421. b.DisplayObjectContainer = c;
  2422. c.prototype.__class__ = "egret.DisplayObjectContainer"
  2423. })(egret ||
  2424. (egret = {}));
  2425. __extends = this.__extends || function(b, c) {
  2426. function e() {
  2427. this.constructor = b
  2428. }
  2429. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2430. e.prototype = c.prototype;
  2431. b.prototype = new e
  2432. };
  2433. (function(b) {
  2434. var c = function(c) {
  2435. function a(d, a) {
  2436. void 0 === d && (d = 480);
  2437. void 0 === a && (a = 800);
  2438. c.call(this);
  2439. this.touchEnabled = !0;
  2440. this._stage = this;
  2441. this._stageWidth = d;
  2442. this._stageHeight = a
  2443. }
  2444. __extends(a, c);
  2445. a.prototype.invalidate = function() {
  2446. a._invalidateRenderFlag = !0
  2447. };
  2448. Object.defineProperty(a.prototype, "scaleMode", {
  2449. get: function() {
  2450. return this._scaleMode
  2451. },
  2452. set: function(d) {
  2453. this._scaleMode != d && (this._scaleMode = d, this.setResolutionPolicy())
  2454. },
  2455. enumerable: !0,
  2456. configurable: !0
  2457. });
  2458. a.prototype.changeSize = function() {
  2459. this.setResolutionPolicy();
  2460. this.dispatchEventWith(b.Event.RESIZE)
  2461. };
  2462. a.prototype.setResolutionPolicy = function() {
  2463. var d = {};
  2464. d[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2465. d[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2466. d[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2467. d[b.StageScaleMode.EXACT_FIT] = new b.FullScreen;
  2468. d = d[this._scaleMode];
  2469. if (!d) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2470. var a = new b.EqualToFrame,
  2471. d = new b.ResolutionPolicy(a, d);
  2472. b.StageDelegate.getInstance()._setResolutionPolicy(d);
  2473. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2474. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2475. };
  2476. Object.defineProperty(a.prototype, "stageWidth", {
  2477. get: function() {
  2478. return this._stageWidth
  2479. },
  2480. enumerable: !0,
  2481. configurable: !0
  2482. });
  2483. Object.defineProperty(a.prototype, "stageHeight", {
  2484. get: function() {
  2485. return this._stageHeight
  2486. },
  2487. enumerable: !0,
  2488. configurable: !0
  2489. });
  2490. a.prototype.hitTest = function(d, a, g) {
  2491. if (!this._touchEnabled) return null;
  2492. var c;
  2493. if (!this._touchChildren) return this;
  2494. g = this._children;
  2495. for (var e = g.length - 1; 0 <= e; e--) {
  2496. c = g[e];
  2497. var f = c._getMatrix(),
  2498. l = c._scrollRect;
  2499. l && f.append(1, 0, 0, 1, -l.x, -l.y);
  2500. f.invert();
  2501. f = b.Matrix.transformCoords(f, d, a);
  2502. if ((c = c.hitTest(f.x, f.y, !0)) && c._touchEnabled) return c
  2503. }
  2504. return this
  2505. };
  2506. a.prototype.getBounds = function(d) {
  2507. d || (d = new b.Rectangle);
  2508. return d.initialize(0, 0, this._stageWidth, this._stageHeight)
  2509. };
  2510. a.prototype._updateTransform = function() {
  2511. for (var d = 0, a = this._children.length; d < a; d++) this._children[d]._updateTransform()
  2512. };
  2513. Object.defineProperty(a.prototype, "focus", {
  2514. get: function() {
  2515. return null
  2516. },
  2517. enumerable: !0,
  2518. configurable: !0
  2519. });
  2520. a._invalidateRenderFlag = !1;
  2521. return a
  2522. }(b.DisplayObjectContainer);
  2523. b.Stage = c;
  2524. c.prototype.__class__ = "egret.Stage"
  2525. })(egret || (egret = {}));
  2526. (function(b) {
  2527. var c = function() {
  2528. function b() {}
  2529. b.NO_BORDER = "noBorder";
  2530. b.NO_SCALE = "noScale";
  2531. b.SHOW_ALL = "showAll";
  2532. b.EXACT_FIT = "exactFit";
  2533. return b
  2534. }();
  2535. b.StageScaleMode = c;
  2536. c.prototype.__class__ = "egret.StageScaleMode"
  2537. })(egret || (egret = {}));
  2538. __extends = this.__extends || function(b, c) {
  2539. function e() {
  2540. this.constructor = b
  2541. }
  2542. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2543. e.prototype = c.prototype;
  2544. b.prototype = new e
  2545. };
  2546. (function(b) {
  2547. var c = function(c) {
  2548. function a(d) {
  2549. void 0 === d && (d = null);
  2550. c.call(this);
  2551. this._lastTouchPosition = new b.Point(0, 0);
  2552. this._lastTouchTime = 0;
  2553. this._lastTouchEvent = null;
  2554. this._velocitys = [];
  2555. this._content = null;
  2556. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2557. this._scrollTop = this._scrollLeft = 0;
  2558. this._vCanScroll = this._hCanScroll = !1;
  2559. this.touchEnabled = !0;
  2560. d && this.setContent(d)
  2561. }
  2562. __extends(a, c);
  2563. a.prototype.setContent = function(d) {
  2564. this._content !== d && (this.removeContent(), d && (this._content = d, c.prototype.addChild.call(this,
  2565. d), this._addEvents()))
  2566. };
  2567. a.prototype.removeContent = function() {
  2568. this._content && (this._removeEvents(), c.prototype.removeChildAt.call(this, 0));
  2569. this._content = null
  2570. };
  2571. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2572. get: function() {
  2573. return this._verticalScrollPolicy
  2574. },
  2575. set: function(d) {
  2576. d != this._verticalScrollPolicy && (this._verticalScrollPolicy = d)
  2577. },
  2578. enumerable: !0,
  2579. configurable: !0
  2580. });
  2581. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2582. get: function() {
  2583. return this._horizontalScrollPolicy
  2584. },
  2585. set: function(d) {
  2586. d !=
  2587. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = d)
  2588. },
  2589. enumerable: !0,
  2590. configurable: !0
  2591. });
  2592. Object.defineProperty(a.prototype, "scrollLeft", {
  2593. get: function() {
  2594. return this._scrollLeft
  2595. },
  2596. set: function(d) {
  2597. d != this._scrollLeft && (this._scrollLeft = d, this._validatePosition(!1, !0), this._updateContentPosition())
  2598. },
  2599. enumerable: !0,
  2600. configurable: !0
  2601. });
  2602. Object.defineProperty(a.prototype, "scrollTop", {
  2603. get: function() {
  2604. return this._scrollTop
  2605. },
  2606. set: function(d) {
  2607. d != this._scrollTop && (this._scrollTop = d, this._validatePosition(!0, !1), this._updateContentPosition())
  2608. },
  2609. enumerable: !0,
  2610. configurable: !0
  2611. });
  2612. a.prototype.setScrollPosition = function(d, a, b) {
  2613. void 0 === b && (b = !1);
  2614. if (!b || 0 != d || 0 != a)
  2615. if (b || this._scrollTop != d || this._scrollLeft != a) {
  2616. if (b) {
  2617. b = this._isOnTheEdge(!0);
  2618. var c = this._isOnTheEdge(!1);
  2619. this._scrollTop += b ? d / 2 : d;
  2620. this._scrollLeft += c ? a / 2 : a
  2621. } else this._scrollTop = d, this._scrollLeft = a;
  2622. this._validatePosition(!0, !0);
  2623. this._updateContentPosition()
  2624. }
  2625. };
  2626. a.prototype._isOnTheEdge = function(d) {
  2627. void 0 === d && (d = !0);
  2628. var a = this._scrollTop,
  2629. b = this._scrollLeft;
  2630. return d ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2631. };
  2632. a.prototype._validatePosition = function(d, a) {
  2633. void 0 === d && (d = !1);
  2634. void 0 === a && (a = !1);
  2635. if (d) {
  2636. var b = this.height,
  2637. c = this._getContentHeight();
  2638. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2639. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : c / 2)
  2640. }
  2641. a && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : c / 2))
  2642. };
  2643. a.prototype._setWidth = function(d) {
  2644. this._explicitWidth !=
  2645. d && (c.prototype._setWidth.call(this, d), this._updateContentPosition())
  2646. };
  2647. a.prototype._setHeight = function(d) {
  2648. this._explicitHeight != d && (c.prototype._setHeight.call(this, d), this._updateContentPosition())
  2649. };
  2650. a.prototype._updateContentPosition = function() {
  2651. var d = this.getBounds(b.Rectangle.identity);
  2652. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, d.width, d.height);
  2653. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2654. };
  2655. a.prototype._checkScrollPolicy = function() {
  2656. var d = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2657. this._getContentWidth(), this.width);
  2658. this._hCanScroll = d;
  2659. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2660. this._vCanScroll = a;
  2661. return d || a
  2662. };
  2663. a.prototype.__checkScrollPolicy = function(d, a, b) {
  2664. return "on" == d ? !0 : "off" == d ? !1 : a > b
  2665. };
  2666. a.prototype._addEvents = function() {
  2667. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2668. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2669. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2670. this, !0)
  2671. };
  2672. a.prototype._removeEvents = function() {
  2673. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2674. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2675. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2676. };
  2677. a.prototype._onTouchBegin = function(d) {
  2678. !d._isDefaultPrevented && this._checkScrollPolicy() && (b.Tween.removeTweens(this), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END,
  2679. this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(d), d.preventDefault())
  2680. };
  2681. a.prototype._onTouchBeginCapture = function(d) {
  2682. var h = this._checkScrollPolicy();
  2683. if (h) {
  2684. for (var c = d.target; c != this;) {
  2685. if (c instanceof a && (h = c._checkScrollPolicy())) return;
  2686. c = c.parent
  2687. }
  2688. d.stopPropagation();
  2689. this.delayTouchBeginEvent = this.cloneTouchEvent(d);
  2690. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100,
  2691. 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2692. this.touchBeginTimer.start();
  2693. this._onTouchBegin(d)
  2694. }
  2695. };
  2696. a.prototype._onTouchEndCapture = function(d) {
  2697. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2698. };
  2699. a.prototype._onTouchBeginTimer = function() {
  2700. this.touchBeginTimer.stop();
  2701. var d = this.delayTouchBeginEvent;
  2702. this.delayTouchBeginEvent = null;
  2703. this.dispatchPropagationEvent(d)
  2704. };
  2705. a.prototype.dispatchPropagationEvent = function(d) {
  2706. for (var a = [], b = d._target; b;) a.push(b),
  2707. b = b.parent;
  2708. for (var c = this._content, e = 1;; e += 2) {
  2709. b = a[e];
  2710. if (!b || b === c) break;
  2711. a.unshift(b)
  2712. }
  2713. this._dispatchPropagationEvent(d, a)
  2714. };
  2715. a.prototype._dispatchPropagationEvent = function(d, a, b) {
  2716. for (var c = a.length, e = 0; e < c; e++) {
  2717. var f = a[e];
  2718. d._currentTarget = f;
  2719. d._target = this;
  2720. d._eventPhase = e < b ? 1 : e == b ? 2 : 3;
  2721. f._notifyListener(d);
  2722. if (d._isPropagationStopped || d._isPropagationImmediateStopped) break
  2723. }
  2724. };
  2725. a.prototype._onTouchMove = function(d) {
  2726. if (this._lastTouchPosition.x != d.stageX || this._lastTouchPosition.y != d.stageY) {
  2727. this.delayTouchBeginEvent &&
  2728. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2729. this.touchChildren = !1;
  2730. var a = this._getPointChange(d);
  2731. this.setScrollPosition(a.y, a.x, !0);
  2732. this._calcVelocitys(d);
  2733. this._logTouchEvent(d)
  2734. }
  2735. };
  2736. a.prototype._onTouchEnd = function(d) {
  2737. this.touchChildren = !0;
  2738. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2739. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2740. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE,
  2741. this._onTouchEnd, this);
  2742. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2743. this._moveAfterTouchEnd()
  2744. };
  2745. a.prototype._onEnterFrame = function(d) {
  2746. d = b.getTimer();
  2747. 100 < d - this._lastTouchTime && 300 > d - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2748. };
  2749. a.prototype._logTouchEvent = function(d) {
  2750. this._lastTouchPosition.x = d.stageX;
  2751. this._lastTouchPosition.y = d.stageY;
  2752. this._lastTouchEvent = this.cloneTouchEvent(d);
  2753. this._lastTouchTime = b.getTimer()
  2754. };
  2755. a.prototype._getPointChange = function(d) {
  2756. return {
  2757. x: !1 ===
  2758. this._hCanScroll ? 0 : this._lastTouchPosition.x - d.stageX,
  2759. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - d.stageY
  2760. }
  2761. };
  2762. a.prototype._calcVelocitys = function(d) {
  2763. var a = b.getTimer();
  2764. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  2765. else {
  2766. var c = this._getPointChange(d),
  2767. a = a - this._lastTouchTime;
  2768. c.x /= a;
  2769. c.y /= a;
  2770. this._velocitys.push(c);
  2771. 5 < this._velocitys.length && this._velocitys.shift();
  2772. this._lastTouchPosition.x = d.stageX;
  2773. this._lastTouchPosition.y = d.stageY
  2774. }
  2775. };
  2776. a.prototype._getContentWidth = function() {
  2777. return this._content.explicitWidth ||
  2778. this._content.width
  2779. };
  2780. a.prototype._getContentHeight = function() {
  2781. return this._content.explicitHeight || this._content.height
  2782. };
  2783. a.prototype.getMaxScrollLeft = function() {
  2784. var d = this._getContentWidth() - this.width;
  2785. return Math.max(0, d)
  2786. };
  2787. a.prototype.getMaxScrollTop = function() {
  2788. var d = this._getContentHeight() - this.height;
  2789. return Math.max(0, d)
  2790. };
  2791. a.prototype._moveAfterTouchEnd = function() {
  2792. if (0 != this._velocitys.length) {
  2793. for (var d = 0, b = 0, c = 0, e = 0; e < this._velocitys.length; e++) var k = this._velocitys[e],
  2794. f = a.weight[e],
  2795. d = d + k.x * f,
  2796. b = b + k.y * f,
  2797. c = c + f;
  2798. this._velocitys.length = 0;
  2799. d /= c;
  2800. b /= c;
  2801. k = Math.abs(d);
  2802. c = Math.abs(b);
  2803. f = this.getMaxScrollLeft();
  2804. e = this.getMaxScrollTop();
  2805. d = 0.02 < k ? this.getAnimationDatas(d, this._scrollLeft, f) : {
  2806. position: this._scrollLeft,
  2807. duration: 1
  2808. };
  2809. b = 0.02 < c ? this.getAnimationDatas(b, this._scrollTop, e) : {
  2810. position: this._scrollTop,
  2811. duration: 1
  2812. };
  2813. this.setScrollLeft(d.position, d.duration);
  2814. this.setScrollTop(b.position, b.duration)
  2815. }
  2816. };
  2817. a.prototype.setScrollTop = function(d, a) {
  2818. void 0 === a && (a = 0);
  2819. var c = Math.min(this.getMaxScrollTop(), Math.max(d,
  2820. 0));
  2821. if (0 == a) return this.scrollTop = c, null;
  2822. var e = b.Tween.get(this).to({
  2823. scrollTop: d
  2824. }, a, b.Ease.quartOut);
  2825. c != d && e.to({
  2826. scrollTop: c
  2827. }, 300, b.Ease.quintOut)
  2828. };
  2829. a.prototype.setScrollLeft = function(d, a) {
  2830. void 0 === a && (a = 0);
  2831. var c = Math.min(this.getMaxScrollLeft(), Math.max(d, 0));
  2832. if (0 == a) return this.scrollLeft = c, null;
  2833. var e = b.Tween.get(this).to({
  2834. scrollLeft: d
  2835. }, a, b.Ease.quartOut);
  2836. c != d && e.to({
  2837. scrollLeft: c
  2838. }, 300, b.Ease.quintOut)
  2839. };
  2840. a.prototype.getAnimationDatas = function(d, a, b) {
  2841. var c = Math.abs(d),
  2842. e = 0,
  2843. f = a + 500 * d;
  2844. if (0 > f || f > b)
  2845. for (f =
  2846. a; Infinity != Math.abs(d) && 0.02 < Math.abs(d);) f += d, d = 0 > f || f > b ? 0.998 * d * 0.95 : 0.998 * d, e++;
  2847. else e = 500 * -Math.log(0.02 / c);
  2848. return {
  2849. position: Math.min(b + 50, Math.max(f, -50)),
  2850. duration: e
  2851. }
  2852. };
  2853. a.prototype.cloneTouchEvent = function(d) {
  2854. var a = new b.TouchEvent(d._type, d._bubbles, d.cancelable);
  2855. a.touchPointID = d.touchPointID;
  2856. a._stageX = d._stageX;
  2857. a._stageY = d._stageY;
  2858. a.ctrlKey = d.ctrlKey;
  2859. a.altKey = d.altKey;
  2860. a.shiftKey = d.shiftKey;
  2861. a.touchDown = d.touchDown;
  2862. a._isDefaultPrevented = !1;
  2863. a._target = d._target;
  2864. return a
  2865. };
  2866. a.prototype.throwNotSupportedError =
  2867. function() {
  2868. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  2869. };
  2870. a.prototype.addChild = function(d) {
  2871. this.throwNotSupportedError();
  2872. return null
  2873. };
  2874. a.prototype.addChildAt = function(d, a) {
  2875. this.throwNotSupportedError();
  2876. return null
  2877. };
  2878. a.prototype.removeChild = function(d) {
  2879. this.throwNotSupportedError();
  2880. return null
  2881. };
  2882. a.prototype.removeChildAt = function(d) {
  2883. this.throwNotSupportedError();
  2884. return null
  2885. };
  2886. a.prototype.setChildIndex = function(d, a) {
  2887. this.throwNotSupportedError()
  2888. };
  2889. a.prototype.swapChildren = function(d,
  2890. a) {
  2891. this.throwNotSupportedError()
  2892. };
  2893. a.prototype.swapChildrenAt = function(d, a) {
  2894. this.throwNotSupportedError()
  2895. };
  2896. a.prototype.hitTest = function(d, a, g) {
  2897. void 0 === g && (g = !1);
  2898. var m = c.prototype.hitTest.call(this, d, a, g);
  2899. return m ? m : b.DisplayObject.prototype.hitTest.call(this, d, a, g)
  2900. };
  2901. a.weight = [1, 1.33, 1.66, 2, 2.33];
  2902. return a
  2903. }(b.DisplayObjectContainer);
  2904. b.ScrollView = c;
  2905. c.prototype.__class__ = "egret.ScrollView"
  2906. })(egret || (egret = {}));
  2907. (function(b) {
  2908. var c = function() {
  2909. function b() {}
  2910. b.REPEAT = "repeat";
  2911. b.SCALE = "scale";
  2912. return b
  2913. }();
  2914. b.BitmapFillMode = c;
  2915. c.prototype.__class__ = "egret.BitmapFillMode"
  2916. })(egret || (egret = {}));
  2917. __extends = this.__extends || function(b, c) {
  2918. function e() {
  2919. this.constructor = b
  2920. }
  2921. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2922. e.prototype = c.prototype;
  2923. b.prototype = new e
  2924. };
  2925. (function(b) {
  2926. var c = function(c) {
  2927. function a(d) {
  2928. c.call(this);
  2929. this.debug = !1;
  2930. this.debugColor = 16711680;
  2931. this.scale9Grid = null;
  2932. this.fillMode = "scale";
  2933. d && (this._texture = d, this._setSizeDirty())
  2934. }
  2935. __extends(a, c);
  2936. Object.defineProperty(a.prototype, "texture", {
  2937. get: function() {
  2938. return this._texture
  2939. },
  2940. set: function(d) {
  2941. d != this._texture && (this._setSizeDirty(), this._texture = d)
  2942. },
  2943. enumerable: !0,
  2944. configurable: !0
  2945. });
  2946. a.prototype._render = function(d) {
  2947. var b = this._texture;
  2948. b ? (this._texture_to_render = b, a._drawBitmap(d, this._hasWidthSet ? this._explicitWidth :
  2949. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2950. };
  2951. a._drawBitmap = function(d, b, c, e) {
  2952. var k = e._texture_to_render;
  2953. if (k) {
  2954. var f = k._textureWidth,
  2955. l = k._textureHeight;
  2956. if ("scale" == e.fillMode) {
  2957. var n = e.scale9Grid || k.scale9Grid;
  2958. if (n && f - n.width < b && l - n.height < c) a.drawScale9GridImage(d, e, n, b, c);
  2959. else {
  2960. var n = k._offsetX,
  2961. p = k._offsetY,
  2962. q = k._bitmapWidth || f,
  2963. r = k._bitmapHeight || l;
  2964. b /= f;
  2965. n = Math.round(n * b);
  2966. b = Math.round(q * b);
  2967. c /= l;
  2968. p = Math.round(p * c);
  2969. c = Math.round(r * c);
  2970. a.renderFilter.drawImage(d,
  2971. e, k._bitmapX, k._bitmapY, q, r, n, p, b, c)
  2972. }
  2973. } else a.drawRepeatImage(d, e, b, c, e.fillMode)
  2974. }
  2975. };
  2976. a.drawRepeatImage = function(d, a, c, e, k) {
  2977. var f = a._texture_to_render;
  2978. if (f) {
  2979. var l = f._textureWidth,
  2980. n = f._textureHeight,
  2981. p = f._bitmapX,
  2982. q = f._bitmapY,
  2983. l = f._bitmapWidth || l,
  2984. n = f._bitmapHeight || n,
  2985. r = f._offsetX,
  2986. f = f._offsetY;
  2987. b.RenderFilter.getInstance().drawImage(d, a, p, q, l, n, r, f, c, e, k)
  2988. }
  2989. };
  2990. a.drawScale9GridImage = function(d, a, c, e, k) {
  2991. var f = a._texture_to_render;
  2992. if (f && c) {
  2993. var l = b.RenderFilter.getInstance(),
  2994. n = f._textureWidth,
  2995. p = f._textureHeight,
  2996. q = f._bitmapX,
  2997. r = f._bitmapY,
  2998. t = f._bitmapWidth || n,
  2999. s = f._bitmapHeight || p,
  3000. u = f._offsetX,
  3001. v = f._offsetY,
  3002. f = b.MainContext.instance.rendererContext.texture_scale_factor;
  3003. c = b.Rectangle.identity.initialize(c.x - Math.round(u), c.y - Math.round(u), c.width, c.height);
  3004. u = Math.round(u);
  3005. v = Math.round(v);
  3006. e -= n - t;
  3007. k -= p - s;
  3008. c.y == c.bottom && (c.bottom < s ? c.bottom++ : c.y--);
  3009. c.x == c.right && (c.right < t ? c.right++ : c.x--);
  3010. var n = q + c.x,
  3011. p = q + c.right,
  3012. x = t - c.right,
  3013. y = r + c.y,
  3014. w = r + c.bottom,
  3015. z = s - c.bottom,
  3016. A = u + c.x,
  3017. B = v + c.y,
  3018. s = k - (s - c.bottom),
  3019. t = e - (t - c.right);
  3020. l.drawImage(d,
  3021. a, q / f, r / f, c.x, c.y, u, v, c.x, c.y);
  3022. l.drawImage(d, a, n / f, r / f, c.width, c.y, A, v, t - c.x, c.y);
  3023. l.drawImage(d, a, p / f, r / f, x, c.y, u + t, v, e - t, c.y);
  3024. l.drawImage(d, a, q / f, y / f, c.x, c.height, u, B, c.x, s - c.y);
  3025. l.drawImage(d, a, n / f, y / f, c.width, c.height, A, B, t - c.x, s - c.y);
  3026. l.drawImage(d, a, p / f, y / f, x, c.height, u + t, B, e - t, s - c.y);
  3027. l.drawImage(d, a, q / f, w / f, c.x, z, u, v + s, c.x, k - s);
  3028. l.drawImage(d, a, n / f, w / f, c.width, z, A, v + s, t - c.x, k - s);
  3029. l.drawImage(d, a, p / f, w / f, x, z, u + t, v + s, e - t, k - s)
  3030. }
  3031. };
  3032. a.prototype._measureBounds = function() {
  3033. var d = this._texture;
  3034. return d ? b.Rectangle.identity.initialize(d._offsetX,
  3035. d._offsetY, d._textureWidth, d._textureHeight) : c.prototype._measureBounds.call(this)
  3036. };
  3037. a.debug = !1;
  3038. a.renderFilter = b.RenderFilter.getInstance();
  3039. return a
  3040. }(b.DisplayObject);
  3041. b.Bitmap = c;
  3042. c.prototype.__class__ = "egret.Bitmap"
  3043. })(egret || (egret = {}));
  3044. __extends = this.__extends || function(b, c) {
  3045. function e() {
  3046. this.constructor = b
  3047. }
  3048. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3049. e.prototype = c.prototype;
  3050. b.prototype = new e
  3051. };
  3052. (function(b) {
  3053. var c = function(c) {
  3054. function a() {
  3055. c.call(this);
  3056. this._text = "";
  3057. this._textChanged = !1;
  3058. this._spriteSheet = null;
  3059. this._spriteSheetChanged = !1;
  3060. this._bitmapPool = []
  3061. }
  3062. __extends(a, c);
  3063. Object.defineProperty(a.prototype, "text", {
  3064. get: function() {
  3065. return this._text
  3066. },
  3067. set: function(d) {
  3068. this._textChanged = !0;
  3069. this._text = d;
  3070. this._setSizeDirty()
  3071. },
  3072. enumerable: !0,
  3073. configurable: !0
  3074. });
  3075. Object.defineProperty(a.prototype, "spriteSheet", {
  3076. get: function() {
  3077. return this._spriteSheet
  3078. },
  3079. set: function(d) {
  3080. this._spriteSheet != d && (this._spriteSheet =
  3081. d, this._spriteSheetChanged = !0, this._setSizeDirty())
  3082. },
  3083. enumerable: !0,
  3084. configurable: !0
  3085. });
  3086. a.prototype._updateTransform = function() {
  3087. this.visible && ((this._textChanged || this._spriteSheetChanged) && this._renderText(), c.prototype._updateTransform.call(this))
  3088. };
  3089. a.prototype._renderText = function(d) {
  3090. var a = d = 0;
  3091. (this._textChanged || this._spriteSheetChanged) && this.removeChildren();
  3092. for (var c = 0, e = this.text.length; c < e; c++) {
  3093. var k = this.text.charAt(c),
  3094. f = this.spriteSheet.getTexture(k);
  3095. if (null == f) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" +
  3096. k);
  3097. else {
  3098. var k = f._offsetX,
  3099. l = f._offsetY,
  3100. n = f._textureWidth;
  3101. if (this._textChanged || this._spriteSheetChanged) {
  3102. var p = this._bitmapPool[c];
  3103. p || (p = new b.Bitmap, this._bitmapPool.push(p));
  3104. p.texture = f;
  3105. this.addChild(p);
  3106. p.x = d
  3107. }
  3108. d += n + k;
  3109. l + f._textureHeight > a && (a = l + f._textureHeight)
  3110. }
  3111. }
  3112. this._spriteSheetChanged = this._textChanged = !1;
  3113. return b.Rectangle.identity.initialize(0, 0, d, a)
  3114. };
  3115. a.prototype._measureBounds = function() {
  3116. return this._renderText(!0)
  3117. };
  3118. return a
  3119. }(b.DisplayObjectContainer);
  3120. b.BitmapText = c;
  3121. c.prototype.__class__ = "egret.BitmapText"
  3122. })(egret ||
  3123. (egret = {}));
  3124. (function(b) {
  3125. var c = function() {
  3126. function b() {
  3127. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3128. this.commandQueue = []
  3129. }
  3130. b.prototype.beginFill = function(a, d) {};
  3131. b.prototype._setStyle = function(a) {};
  3132. b.prototype.drawRect = function(a, d, b, c) {
  3133. this.checkRect(a, d, b, c)
  3134. };
  3135. b.prototype.drawCircle = function(a, d, b) {
  3136. this.checkRect(a - b, d - b, 2 * b, 2 * b)
  3137. };
  3138. b.prototype.drawRoundRect = function(a, d, b, c, e, k) {
  3139. this.checkRect(a, d, b, c)
  3140. };
  3141. b.prototype.drawEllipse = function(a, d, b, c) {
  3142. this.checkRect(a - b, d - c, 2 * b, 2 * c)
  3143. };
  3144. b.prototype.lineStyle =
  3145. function(a, d, b, c, e, k, f, l) {};
  3146. b.prototype.lineTo = function(a, d) {
  3147. this.checkPoint(a, d)
  3148. };
  3149. b.prototype.curveTo = function(a, d, b, c) {
  3150. this.checkPoint(a, d);
  3151. this.checkPoint(b, c)
  3152. };
  3153. b.prototype.moveTo = function(a, d) {
  3154. this.checkPoint(a, d)
  3155. };
  3156. b.prototype.clear = function() {
  3157. this._maxY = this._maxX = this._minY = this._minX = 0
  3158. };
  3159. b.prototype.endFill = function() {};
  3160. b.prototype._draw = function(a) {};
  3161. b.prototype.checkRect = function(a, d, b, c) {
  3162. this._minX = Math.min(this._minX, a);
  3163. this._minY = Math.min(this._minY, d);
  3164. this._maxX = Math.max(this._maxX, a +
  3165. b);
  3166. this._maxY = Math.max(this._maxY, d + c)
  3167. };
  3168. b.prototype.checkPoint = function(a, d) {
  3169. this._minX = Math.min(this._minX, a);
  3170. this._minY = Math.min(this._minY, d);
  3171. this._maxX = Math.max(this._maxX, a);
  3172. this._maxY = Math.max(this._maxY, d);
  3173. this._lastX = a;
  3174. this._lastY = d
  3175. };
  3176. return b
  3177. }();
  3178. b.Graphics = c;
  3179. c.prototype.__class__ = "egret.Graphics";
  3180. (function() {
  3181. return function(b, a, d) {
  3182. this.method = b;
  3183. this.thisObject = a;
  3184. this.args = d
  3185. }
  3186. })().prototype.__class__ = "egret.Command"
  3187. })(egret || (egret = {}));
  3188. __extends = this.__extends || function(b, c) {
  3189. function e() {
  3190. this.constructor = b
  3191. }
  3192. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3193. e.prototype = c.prototype;
  3194. b.prototype = new e
  3195. };
  3196. (function(b) {
  3197. var c = function(c) {
  3198. function a() {
  3199. c.call(this)
  3200. }
  3201. __extends(a, c);
  3202. Object.defineProperty(a.prototype, "graphics", {
  3203. get: function() {
  3204. this._graphics || (this._graphics = new b.Graphics);
  3205. return this._graphics
  3206. },
  3207. enumerable: !0,
  3208. configurable: !0
  3209. });
  3210. a.prototype._render = function(d) {
  3211. this._graphics && this._graphics._draw(d)
  3212. };
  3213. return a
  3214. }(b.DisplayObject);
  3215. b.Shape = c;
  3216. c.prototype.__class__ = "egret.Shape"
  3217. })(egret || (egret = {}));
  3218. __extends = this.__extends || function(b, c) {
  3219. function e() {
  3220. this.constructor = b
  3221. }
  3222. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3223. e.prototype = c.prototype;
  3224. b.prototype = new e
  3225. };
  3226. (function(b) {
  3227. var c = function(c) {
  3228. function a() {
  3229. c.call(this)
  3230. }
  3231. __extends(a, c);
  3232. Object.defineProperty(a.prototype, "graphics", {
  3233. get: function() {
  3234. this._graphics || (this._graphics = new b.Graphics);
  3235. return this._graphics
  3236. },
  3237. enumerable: !0,
  3238. configurable: !0
  3239. });
  3240. a.prototype._render = function(d) {
  3241. this._graphics && this._graphics._draw(d);
  3242. c.prototype._render.call(this, d)
  3243. };
  3244. return a
  3245. }(b.DisplayObjectContainer);
  3246. b.Sprite = c;
  3247. c.prototype.__class__ = "egret.Sprite"
  3248. })(egret || (egret = {}));
  3249. __extends = this.__extends || function(b, c) {
  3250. function e() {
  3251. this.constructor = b
  3252. }
  3253. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3254. e.prototype = c.prototype;
  3255. b.prototype = new e
  3256. };
  3257. (function(b) {
  3258. var c = function(c) {
  3259. function a() {
  3260. c.call(this);
  3261. this._inputEnabled = !1;
  3262. this._text = this._type = "";
  3263. this._displayAsPassword = !1;
  3264. this._fontFamily = a.default_fontFamily;
  3265. this._size = 30;
  3266. this._textColorString = "#FFFFFF";
  3267. this._textColor = 16777215;
  3268. this._strokeColorString = "#000000";
  3269. this._stroke = this._strokeColor = 0;
  3270. this._textAlign = "left";
  3271. this._verticalAlign = "top";
  3272. this._maxChars = 0;
  3273. this._scrollV = -1;
  3274. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3275. this._isFlow = this._multiline = !1;
  3276. this._textArr = [];
  3277. this._isArrayChanged = !1;
  3278. this._textMaxHeight = this._textMaxWidth = 0;
  3279. this._linesArr = []
  3280. }
  3281. __extends(a, c);
  3282. a.prototype.isInput = function() {
  3283. return this._type == b.TextFieldType.INPUT
  3284. };
  3285. a.prototype._setTouchEnabled = function(d) {
  3286. c.prototype._setTouchEnabled.call(this, d);
  3287. this.isInput() && (this._inputEnabled = !0)
  3288. };
  3289. Object.defineProperty(a.prototype, "type", {
  3290. get: function() {
  3291. return this._type
  3292. },
  3293. set: function(d) {
  3294. this._setType(d)
  3295. },
  3296. enumerable: !0,
  3297. configurable: !0
  3298. });
  3299. a.prototype._setType = function(d) {
  3300. this._type != d && (this._type = d, this._type == b.TextFieldType.INPUT ?
  3301. (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))
  3302. };
  3303. Object.defineProperty(a.prototype, "text", {
  3304. get: function() {
  3305. return this._getText()
  3306. },
  3307. set: function(d) {
  3308. this._setText(d)
  3309. },
  3310. enumerable: !0,
  3311. configurable: !0
  3312. });
  3313. a.prototype._getText = function() {
  3314. return this._type ==
  3315. b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3316. };
  3317. a.prototype._setSizeDirty = function() {
  3318. c.prototype._setSizeDirty.call(this);
  3319. this._isArrayChanged = !0
  3320. };
  3321. a.prototype._setTextDirty = function() {
  3322. this._setSizeDirty()
  3323. };
  3324. a.prototype._setBaseText = function(d) {
  3325. null == d && (d = "");
  3326. this._isFlow = !1;
  3327. if (this._text != d || this._displayAsPassword) this._setTextDirty(), this._text = d, d = "", d = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3328. text: d
  3329. }])
  3330. };
  3331. a.prototype._setText = function(d) {
  3332. null ==
  3333. d && (d = "");
  3334. this._setBaseText(d);
  3335. this._inputUtils && this._inputUtils._setText(this._text)
  3336. };
  3337. Object.defineProperty(a.prototype, "displayAsPassword", {
  3338. get: function() {
  3339. return this._displayAsPassword
  3340. },
  3341. set: function(d) {
  3342. this._setDisplayAsPassword(d)
  3343. },
  3344. enumerable: !0,
  3345. configurable: !0
  3346. });
  3347. a.prototype._setDisplayAsPassword = function(d) {
  3348. this._displayAsPassword != d && (this._displayAsPassword = d, this._setText(this._text))
  3349. };
  3350. Object.defineProperty(a.prototype, "fontFamily", {
  3351. get: function() {
  3352. return this._fontFamily
  3353. },
  3354. set: function(d) {
  3355. this._setFontFamily(d)
  3356. },
  3357. enumerable: !0,
  3358. configurable: !0
  3359. });
  3360. a.prototype._setFontFamily = function(d) {
  3361. this._fontFamily != d && (this._setTextDirty(), this._fontFamily = d)
  3362. };
  3363. Object.defineProperty(a.prototype, "size", {
  3364. get: function() {
  3365. return this._size
  3366. },
  3367. set: function(d) {
  3368. this._setSize(d)
  3369. },
  3370. enumerable: !0,
  3371. configurable: !0
  3372. });
  3373. a.prototype._setSize = function(d) {
  3374. this._size != d && (this._setTextDirty(), this._size = d)
  3375. };
  3376. Object.defineProperty(a.prototype, "italic", {
  3377. get: function() {
  3378. return this._italic
  3379. },
  3380. set: function(d) {
  3381. this._setItalic(d)
  3382. },
  3383. enumerable: !0,
  3384. configurable: !0
  3385. });
  3386. a.prototype._setItalic = function(d) {
  3387. this._italic != d && (this._setTextDirty(), this._italic = d)
  3388. };
  3389. Object.defineProperty(a.prototype, "bold", {
  3390. get: function() {
  3391. return this._bold
  3392. },
  3393. set: function(d) {
  3394. this._setBold(d)
  3395. },
  3396. enumerable: !0,
  3397. configurable: !0
  3398. });
  3399. a.prototype._setBold = function(d) {
  3400. this._bold != d && (this._setTextDirty(), this._bold = d)
  3401. };
  3402. Object.defineProperty(a.prototype, "textColor", {
  3403. get: function() {
  3404. return this._textColor
  3405. },
  3406. set: function(d) {
  3407. this._setTextColor(d)
  3408. },
  3409. enumerable: !0,
  3410. configurable: !0
  3411. });
  3412. a.prototype._setTextColor =
  3413. function(d) {
  3414. this._textColor != d && (this._setTextDirty(), this._textColor = d, this._textColorString = b.toColorString(d))
  3415. };
  3416. Object.defineProperty(a.prototype, "strokeColor", {
  3417. get: function() {
  3418. return this._strokeColor
  3419. },
  3420. set: function(d) {
  3421. this._setStrokeColor(d)
  3422. },
  3423. enumerable: !0,
  3424. configurable: !0
  3425. });
  3426. a.prototype._setStrokeColor = function(d) {
  3427. this._strokeColor != d && (this._setTextDirty(), this._strokeColor = d, this._strokeColorString = b.toColorString(d))
  3428. };
  3429. Object.defineProperty(a.prototype, "stroke", {
  3430. get: function() {
  3431. return this._stroke
  3432. },
  3433. set: function(d) {
  3434. this._setStroke(d)
  3435. },
  3436. enumerable: !0,
  3437. configurable: !0
  3438. });
  3439. a.prototype._setStroke = function(d) {
  3440. this._stroke != d && (this._setTextDirty(), this._stroke = d)
  3441. };
  3442. Object.defineProperty(a.prototype, "textAlign", {
  3443. get: function() {
  3444. return this._textAlign
  3445. },
  3446. set: function(d) {
  3447. this._setTextAlign(d)
  3448. },
  3449. enumerable: !0,
  3450. configurable: !0
  3451. });
  3452. a.prototype._setTextAlign = function(d) {
  3453. this._textAlign != d && (this._setTextDirty(), this._textAlign = d)
  3454. };
  3455. Object.defineProperty(a.prototype, "verticalAlign", {
  3456. get: function() {
  3457. return this._verticalAlign
  3458. },
  3459. set: function(d) {
  3460. this._setVerticalAlign(d)
  3461. },
  3462. enumerable: !0,
  3463. configurable: !0
  3464. });
  3465. a.prototype._setVerticalAlign = function(d) {
  3466. this._verticalAlign != d && (this._setTextDirty(), this._verticalAlign = d)
  3467. };
  3468. Object.defineProperty(a.prototype, "maxChars", {
  3469. get: function() {
  3470. return this._maxChars
  3471. },
  3472. set: function(d) {
  3473. this._setMaxChars(d)
  3474. },
  3475. enumerable: !0,
  3476. configurable: !0
  3477. });
  3478. a.prototype._setMaxChars = function(d) {
  3479. this._maxChars != d && (this._maxChars = d)
  3480. };
  3481. Object.defineProperty(a.prototype, "scrollV", {
  3482. set: function(d) {
  3483. this._scrollV = d;
  3484. this._setDirty()
  3485. },
  3486. enumerable: !0,
  3487. configurable: !0
  3488. });
  3489. Object.defineProperty(a.prototype, "maxScrollV", {
  3490. get: function() {
  3491. return this._maxScrollV
  3492. },
  3493. enumerable: !0,
  3494. configurable: !0
  3495. });
  3496. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3497. get: function() {
  3498. return 0
  3499. },
  3500. enumerable: !0,
  3501. configurable: !0
  3502. });
  3503. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3504. get: function() {
  3505. return 0
  3506. },
  3507. enumerable: !0,
  3508. configurable: !0
  3509. });
  3510. Object.defineProperty(a.prototype, "caretIndex", {
  3511. get: function() {
  3512. return 0
  3513. },
  3514. enumerable: !0,
  3515. configurable: !0
  3516. });
  3517. a.prototype._setSelection =
  3518. function(d, a) {};
  3519. Object.defineProperty(a.prototype, "lineSpacing", {
  3520. get: function() {
  3521. return this._lineSpacing
  3522. },
  3523. set: function(d) {
  3524. this._setLineSpacing(d)
  3525. },
  3526. enumerable: !0,
  3527. configurable: !0
  3528. });
  3529. a.prototype._setLineSpacing = function(d) {
  3530. this._lineSpacing != d && (this._setTextDirty(), this._lineSpacing = d)
  3531. };
  3532. a.prototype._getLineHeight = function() {
  3533. return this._lineSpacing + this._size
  3534. };
  3535. Object.defineProperty(a.prototype, "numLines", {
  3536. get: function() {
  3537. return this._numLines
  3538. },
  3539. enumerable: !0,
  3540. configurable: !0
  3541. });
  3542. Object.defineProperty(a.prototype,
  3543. "multiline", {
  3544. get: function() {
  3545. return this._multiline
  3546. },
  3547. set: function(d) {
  3548. this._setMultiline(d)
  3549. },
  3550. enumerable: !0,
  3551. configurable: !0
  3552. });
  3553. a.prototype._setMultiline = function(d) {
  3554. this._multiline = d;
  3555. this._setDirty()
  3556. };
  3557. a.prototype.setFocus = function() {
  3558. b.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3559. };
  3560. a.prototype._onRemoveFromStage = function() {
  3561. c.prototype._onRemoveFromStage.call(this);
  3562. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3563. };
  3564. a.prototype._onAddToStage = function() {
  3565. c.prototype._onAddToStage.call(this);
  3566. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3567. };
  3568. a.prototype._updateBaseTransform = function() {
  3569. c.prototype._updateTransform.call(this)
  3570. };
  3571. a.prototype._updateTransform = function() {
  3572. this._type == b.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3573. };
  3574. a.prototype._render = function(d) {
  3575. this.drawText(d);
  3576. this._clearDirty()
  3577. };
  3578. a.prototype._measureBounds = function() {
  3579. return this.measureText()
  3580. };
  3581. Object.defineProperty(a.prototype, "textFlow", {
  3582. get: function() {
  3583. return this._textArr
  3584. },
  3585. set: function(d) {
  3586. this._isFlow = !0;
  3587. var a = "";
  3588. null == d && (d = []);
  3589. for (var b = 0; b < d.length; b++) a += d[b].text;
  3590. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(d))
  3591. },
  3592. enumerable: !0,
  3593. configurable: !0
  3594. });
  3595. a.prototype.changeToPassText = function(d) {
  3596. if (this._displayAsPassword) {
  3597. for (var a = "", b = 0, c = d.length; b < c; b++) switch (d.charAt(b)) {
  3598. case "\n":
  3599. a += "\n";
  3600. break;
  3601. case "\r":
  3602. break;
  3603. default:
  3604. a += "*"
  3605. }
  3606. return a
  3607. }
  3608. return d
  3609. };
  3610. a.prototype.setMiddleStyle =
  3611. function(d) {
  3612. this._isArrayChanged = !0;
  3613. this._textArr = d;
  3614. this._setSizeDirty()
  3615. };
  3616. Object.defineProperty(a.prototype, "textWidth", {
  3617. get: function() {
  3618. return this._textMaxWidth
  3619. },
  3620. enumerable: !0,
  3621. configurable: !0
  3622. });
  3623. Object.defineProperty(a.prototype, "textHeight", {
  3624. get: function() {
  3625. return this._textMaxHeight
  3626. },
  3627. enumerable: !0,
  3628. configurable: !0
  3629. });
  3630. a.prototype.appendText = function(d) {
  3631. this.appendElement({
  3632. text: d
  3633. })
  3634. };
  3635. a.prototype.appendElement = function(d) {
  3636. this._textArr.push(d);
  3637. this.setMiddleStyle(this._textArr)
  3638. };
  3639. a.prototype._getLinesArr =
  3640. function() {
  3641. if (!this._isArrayChanged) return this._linesArr;
  3642. this._isArrayChanged = !1;
  3643. var d = this._textArr,
  3644. a = b.MainContext.instance.rendererContext;
  3645. this._linesArr = [];
  3646. this._textMaxWidth = this._textMaxHeight = 0;
  3647. if (this._hasWidthSet && 0 == this._explicitWidth) return console.warn("\u6587\u672c\u5bbd\u5ea6\u88ab\u8bbe\u7f6e\u4e3a0"), this._numLines = 0, [{
  3648. width: 0,
  3649. height: 0,
  3650. elements: []
  3651. }];
  3652. var c = this._linesArr,
  3653. e = 0,
  3654. k = 0,
  3655. f = 0,
  3656. l;
  3657. this._isFlow || a.setupFont(this);
  3658. for (var n = 0; n < d.length; n++) {
  3659. var p = d[n];
  3660. p.style = p.style || {};
  3661. for (var q =
  3662. p.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  3663. null == c[f] && (l = {
  3664. width: 0,
  3665. height: 0,
  3666. elements: []
  3667. }, c[f] = l, k = e = 0);
  3668. k = this._type == b.TextFieldType.INPUT ? this._size : Math.max(k, p.style.size || this._size);
  3669. if ("" != q[r]) {
  3670. this._isFlow && a.setupFont(this, p.style);
  3671. var t = a.measureText(q[r]);
  3672. if (this._hasWidthSet)
  3673. if (e + t <= this._explicitWidth) l.elements.push({
  3674. width: t,
  3675. text: q[r],
  3676. style: p.style
  3677. }), e += t;
  3678. else {
  3679. for (var s = 0, u = 0, v = q[r]; s < v.length; s++) {
  3680. t = a.measureText(v.charAt(s));
  3681. if (e + t > this._explicitWidth) break;
  3682. u += t;
  3683. e += t
  3684. }
  3685. 0 < s && (l.elements.push({
  3686. width: u,
  3687. text: v.substring(0, s),
  3688. style: p.style
  3689. }), q[r] = v.substring(s));
  3690. r--
  3691. } else e += t, l.elements.push({
  3692. width: t,
  3693. text: q[r],
  3694. style: p.style
  3695. })
  3696. }
  3697. if (r < q.length - 1) {
  3698. l.width = e;
  3699. l.height = k;
  3700. this._textMaxWidth = Math.max(this._textMaxWidth, e);
  3701. this._textMaxHeight += k;
  3702. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = c.length, c;
  3703. f++
  3704. }
  3705. }
  3706. n == d.length - 1 && l && (l.width = e, l.height = k, this._textMaxWidth = Math.max(this._textMaxWidth, e), this._textMaxHeight += k)
  3707. }
  3708. this._numLines = c.length;
  3709. return c
  3710. };
  3711. a.prototype.measureText = function() {
  3712. return this._getLinesArr() ? b.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) * this._lineSpacing) : b.Rectangle.identity.initialize(0, 0, 0, 0)
  3713. };
  3714. a.prototype.drawText = function(d) {
  3715. var a = this._getLinesArr();
  3716. if (a) {
  3717. this._isFlow || d.setupFont(this);
  3718. var c = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3719. e = this._textMaxHeight + (this._numLines -
  3720. 1) * this._lineSpacing,
  3721. k = 0,
  3722. f = 0;
  3723. if (this._hasHeightSet)
  3724. if (e < this._explicitHeight) {
  3725. var l = 0;
  3726. this._verticalAlign == b.VerticalAlign.MIDDLE ? l = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (l = 1);
  3727. k += l * (this._explicitHeight - e)
  3728. } else e > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3729. k = Math.round(k);
  3730. e = 0;
  3731. this._textAlign == b.HorizontalAlign.CENTER ? e = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (e = 1);
  3732. for (l = 0; f < this._numLines; f++) {
  3733. var n = a[f],
  3734. p = n.height,
  3735. k = k + p / 2;
  3736. if (0 != f && this._hasHeightSet &&
  3737. k > this._explicitHeight) break;
  3738. for (var l = Math.round((c - n.width) * e), q = 0; q < n.elements.length; q++) {
  3739. var r = n.elements[q],
  3740. t = r.style.size || this._size;
  3741. this._type == b.TextFieldType.INPUT ? d.drawText(this, r.text, l, k + (p - t) / 2, r.width) : (this._isFlow && d.setupFont(this, r.style), d.drawText(this, r.text, l, k + (p - t) / 2, r.width, r.style));
  3742. l += r.width
  3743. }
  3744. k += p / 2 + this._lineSpacing
  3745. }
  3746. }
  3747. };
  3748. a.default_fontFamily = "Arial";
  3749. return a
  3750. }(b.DisplayObject);
  3751. b.TextField = c;
  3752. c.prototype.__class__ = "egret.TextField"
  3753. })(egret || (egret = {}));
  3754. (function(b) {
  3755. var c = function() {
  3756. function b() {
  3757. this.resutlArr = []
  3758. }
  3759. b.prototype.parser = function(a) {
  3760. this.stackArray = [];
  3761. this.resutlArr = [];
  3762. for (var d = 0, b = a.length; d < b;) {
  3763. var c = a.indexOf("<", d);
  3764. 0 > c ? (this.addToResultArr(a.substring(d)), d = b) : (this.addToResultArr(a.substring(d, c)), d = a.indexOf(">", c), "/" == a.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(a.substring(c + 1, d)), d += 1)
  3765. }
  3766. return this.resutlArr
  3767. };
  3768. b.prototype.addToResultArr = function(a) {
  3769. if ("" != a) {
  3770. var d = [];
  3771. d.push(["&lt;", "<"]);
  3772. d.push(["&gt;", ">"]);
  3773. d.push(["&amp;",
  3774. "&"
  3775. ]);
  3776. d.push(["&quot;", '"']);
  3777. d.push(["&apos;;", "'"]);
  3778. for (var b = 0; b < d.length; b++) a.replace(new RegExp(d[b][0], "g"), d[b][1]);
  3779. 0 < this.stackArray.length ? this.resutlArr.push({
  3780. text: a,
  3781. style: this.stackArray[this.stackArray.length - 1]
  3782. }) : this.resutlArr.push({
  3783. text: a
  3784. })
  3785. }
  3786. };
  3787. b.prototype.changeStringToObject = function(a) {
  3788. var d = {};
  3789. a = a.replace(/( )+/g, " ").split(" ");
  3790. for (var b = 0; b < a.length; b++) this.addProperty(d, a[b]);
  3791. return d
  3792. };
  3793. b.prototype.addProperty = function(a, d) {
  3794. var b = d.replace(/( )*=( )*/g, "=").split("=");
  3795. b[1] && (b[1] =
  3796. b[1].replace(/(\"|\')/g, ""));
  3797. switch (b[0].toLowerCase()) {
  3798. case "color":
  3799. a.textColor = parseInt(b[1]);
  3800. break;
  3801. case "b":
  3802. a.bold = "true" == (b[1] || "true");
  3803. break;
  3804. case "i":
  3805. a.italic = "true" == (b[1] || "true");
  3806. break;
  3807. case "size":
  3808. a.size = parseInt(b[1]);
  3809. break;
  3810. case "fontFamily":
  3811. a.fontFamily = b[1]
  3812. }
  3813. };
  3814. b.prototype.addToArray = function(a) {
  3815. a = this.changeStringToObject(a);
  3816. if (0 != this.stackArray.length) {
  3817. var d = this.stackArray[this.stackArray.length - 1],
  3818. b;
  3819. for (b in d) null == a[b] && (a[b] = d[b])
  3820. }
  3821. this.stackArray.push(a)
  3822. };
  3823. return b
  3824. }();
  3825. b.HtmlTextParser =
  3826. c;
  3827. c.prototype.__class__ = "egret.HtmlTextParser"
  3828. })(egret || (egret = {}));
  3829. (function(b) {
  3830. var c = function() {
  3831. function b() {}
  3832. b.DYNAMIC = "dynamic";
  3833. b.INPUT = "input";
  3834. return b
  3835. }();
  3836. b.TextFieldType = c;
  3837. c.prototype.__class__ = "egret.TextFieldType"
  3838. })(egret || (egret = {}));
  3839. __extends = this.__extends || function(b, c) {
  3840. function e() {
  3841. this.constructor = b
  3842. }
  3843. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3844. e.prototype = c.prototype;
  3845. b.prototype = new e
  3846. };
  3847. (function(b) {
  3848. var c = function(c) {
  3849. function a(d) {
  3850. c.call(this);
  3851. var a = d.bitmapData;
  3852. this.bitmapData = a;
  3853. this._textureMap = {};
  3854. this._sourceWidth = a.width;
  3855. this._sourceHeight = a.height;
  3856. this._bitmapX = d._bitmapX - d._offsetX;
  3857. this._bitmapY = d._bitmapY - d._offsetY
  3858. }
  3859. __extends(a, c);
  3860. a.prototype.getTexture = function(d) {
  3861. return this._textureMap[d]
  3862. };
  3863. a.prototype.createTexture = function(d, a, c, e, k, f, l, n, p) {
  3864. void 0 === f && (f = 0);
  3865. void 0 === l && (l = 0);
  3866. "undefined" === typeof n && (n = f + e);
  3867. "undefined" === typeof p && (p = l + k);
  3868. var q = new b.Texture,
  3869. r = b.MainContext.instance.rendererContext.texture_scale_factor;
  3870. q._bitmapData = this.bitmapData;
  3871. q._bitmapX = this._bitmapX + a;
  3872. q._bitmapY = this._bitmapY + c;
  3873. q._bitmapWidth = e * r;
  3874. q._bitmapHeight = k * r;
  3875. q._offsetX = f;
  3876. q._offsetY = l;
  3877. q._textureWidth = n * r;
  3878. q._textureHeight = p * r;
  3879. q._sourceWidth = this._sourceWidth;
  3880. q._sourceHeight = this._sourceHeight;
  3881. return this._textureMap[d] = q
  3882. };
  3883. return a
  3884. }(b.HashObject);
  3885. b.SpriteSheet = c;
  3886. c.prototype.__class__ = "egret.SpriteSheet"
  3887. })(egret || (egret = {}));
  3888. __extends = this.__extends || function(b, c) {
  3889. function e() {
  3890. this.constructor = b
  3891. }
  3892. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3893. e.prototype = c.prototype;
  3894. b.prototype = new e
  3895. };
  3896. (function(b) {
  3897. var c = function(c) {
  3898. function a() {
  3899. c.call(this);
  3900. this._isFocus = !1;
  3901. this._isFirst = this._isFirst = !0
  3902. }
  3903. __extends(a, c);
  3904. a.prototype.init = function(d) {
  3905. this._text = d;
  3906. this.stageText = b.StageText.create();
  3907. d = this._text.localToGlobal();
  3908. this.stageText._open(d.x, d.y, this._text._explicitWidth, this._text._explicitHeight)
  3909. };
  3910. a.prototype._addStageText = function() {
  3911. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3912. this.stageText._add();
  3913. this.stageText._addListeners();
  3914. this.stageText.addEventListener("blur", this.onBlurHandler,
  3915. this);
  3916. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3917. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3918. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3919. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3920. };
  3921. a.prototype._removeStageText = function() {
  3922. this.stageText._remove();
  3923. this.stageText._removeListeners();
  3924. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3925. this.stageText.removeEventListener("blur",
  3926. this.onBlurHandler, this);
  3927. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3928. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3929. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3930. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3931. };
  3932. a.prototype._getText = function() {
  3933. return this.stageText._getText()
  3934. };
  3935. a.prototype._setText = function(d) {
  3936. this.stageText._setText(d)
  3937. };
  3938. a.prototype.onFocusHandler =
  3939. function(d) {
  3940. this.hideText()
  3941. };
  3942. a.prototype.onBlurHandler = function(d) {
  3943. this.showText()
  3944. };
  3945. a.prototype.onMouseDownHandler = function(d) {
  3946. d.stopPropagation();
  3947. this._text._visible && this.stageText._show()
  3948. };
  3949. a.prototype.onStageDownHandler = function(d) {
  3950. this.stageText._hide();
  3951. this.showText()
  3952. };
  3953. a.prototype.showText = function() {
  3954. this._isFocus && (this._isFocus = !1, this.resetText())
  3955. };
  3956. a.prototype.hideText = function() {
  3957. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  3958. };
  3959. a.prototype.updateTextHandler = function(d) {
  3960. this.resetText();
  3961. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  3962. };
  3963. a.prototype.resetText = function() {
  3964. this._text._setBaseText(this.stageText._getText())
  3965. };
  3966. a.prototype._updateTransform = function() {
  3967. var d = this._text._worldTransform.a,
  3968. a = this._text._worldTransform.b,
  3969. c = this._text._worldTransform.c,
  3970. e = this._text._worldTransform.d,
  3971. k = this._text._worldTransform.tx,
  3972. f = this._text._worldTransform.ty;
  3973. this._text._updateBaseTransform();
  3974. var l = this._text._worldTransform;
  3975. if (this._isFirst || d != l.a || a != l.b || c != l.c || e != l.d || k != l.tx || f !=
  3976. l.ty) {
  3977. this._isFirst = !1;
  3978. d = this._text.localToGlobal();
  3979. this.stageText.changePosition(d.x, d.y);
  3980. var n = this;
  3981. b.callLater(function() {
  3982. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  3983. }, this)
  3984. }
  3985. };
  3986. a.prototype._updateProperties = function() {
  3987. var a = this._text._stage;
  3988. if (null == a) this.stageText._setVisible(!1);
  3989. else {
  3990. for (var c = this._text, e = c._visible; e;) {
  3991. c = c.parent;
  3992. if (c == a) break;
  3993. e = c._visible
  3994. }
  3995. this.stageText._setVisible(e)
  3996. }
  3997. this.stageText._setMultiline(this._text._multiline);
  3998. this.stageText._setMaxChars(this._text._maxChars);
  3999. this.stageText._setSize(this._text._size);
  4000. this.stageText._setTextColor(this._text._textColorString);
  4001. this.stageText._setTextFontFamily(this._text._fontFamily);
  4002. this.stageText._setBold(this._text._bold);
  4003. this.stageText._setItalic(this._text._italic);
  4004. this.stageText._setTextAlign(this._text._textAlign);
  4005. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4006. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4007. this.stageText._setTextType(this._text._displayAsPassword ?
  4008. "password" : "text");
  4009. this.stageText._setText(this._text._text);
  4010. this.stageText._resetStageText();
  4011. this._updateTransform()
  4012. };
  4013. return a
  4014. }(b.HashObject);
  4015. b.InputController = c;
  4016. c.prototype.__class__ = "egret.InputController"
  4017. })(egret || (egret = {}));
  4018. __extends = this.__extends || function(b, c) {
  4019. function e() {
  4020. this.constructor = b
  4021. }
  4022. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4023. e.prototype = c.prototype;
  4024. b.prototype = new e
  4025. };
  4026. (function(b) {
  4027. var c = function(b) {
  4028. function a(a, c) {
  4029. b.call(this, a);
  4030. this.charList = this.parseConfig(c)
  4031. }
  4032. __extends(a, b);
  4033. a.prototype.getTexture = function(a) {
  4034. var b = this._textureMap[a];
  4035. if (!b) {
  4036. b = this.charList[a];
  4037. if (!b) return null;
  4038. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  4039. this._textureMap[a] = b
  4040. }
  4041. return b
  4042. };
  4043. a.prototype.parseConfig = function(a) {
  4044. a = a.split("\r\n").join("\n");
  4045. a = a.split("\n");
  4046. for (var b = this.getConfigByKey(a[3], "count"), c = {}, e = 4; e < 4 + b; e++) {
  4047. var k = a[e],
  4048. f = String.fromCharCode(this.getConfigByKey(k,
  4049. "id")),
  4050. l = {};
  4051. c[f] = l;
  4052. l.x = this.getConfigByKey(k, "x");
  4053. l.y = this.getConfigByKey(k, "y");
  4054. l.width = this.getConfigByKey(k, "width");
  4055. l.height = this.getConfigByKey(k, "height");
  4056. l.offsetX = this.getConfigByKey(k, "xoffset");
  4057. l.offsetY = this.getConfigByKey(k, "yoffset")
  4058. }
  4059. return c
  4060. };
  4061. a.prototype.getConfigByKey = function(a, b) {
  4062. for (var c = a.split(" "), e = 0, k = c.length; e < k; e++) {
  4063. var f = c[e];
  4064. if (b == f.substring(0, b.length)) return c = f.substring(b.length + 1), parseInt(c)
  4065. }
  4066. return 0
  4067. };
  4068. return a
  4069. }(b.SpriteSheet);
  4070. b.BitmapTextSpriteSheet = c;
  4071. c.prototype.__class__ =
  4072. "egret.BitmapTextSpriteSheet"
  4073. })(egret || (egret = {}));
  4074. __extends = this.__extends || function(b, c) {
  4075. function e() {
  4076. this.constructor = b
  4077. }
  4078. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4079. e.prototype = c.prototype;
  4080. b.prototype = new e
  4081. };
  4082. (function(b) {
  4083. var c = function(a) {
  4084. function d(d, c) {
  4085. a.call(this);
  4086. this.frameRate = 60;
  4087. d 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 = d) : this.delegate = new e(d, c);
  4088. this.delegate.setMovieClip(this)
  4089. }
  4090. __extends(d, a);
  4091. d.prototype.gotoAndPlay = function(a) {
  4092. this.delegate.gotoAndPlay(a)
  4093. };
  4094. d.prototype.gotoAndStop = function(a) {
  4095. this.delegate.gotoAndStop(a)
  4096. };
  4097. d.prototype.stop =
  4098. function() {
  4099. this.delegate.stop()
  4100. };
  4101. d.prototype.dispose = function() {
  4102. this.delegate.dispose()
  4103. };
  4104. d.prototype.release = function() {
  4105. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4106. this.dispose()
  4107. };
  4108. d.prototype.getCurrentFrameIndex = function() {
  4109. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4110. return this.delegate._currentFrameIndex
  4111. };
  4112. d.prototype.getTotalFrame = function() {
  4113. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4114. return this.delegate._totalFrame
  4115. };
  4116. d.prototype.setInterval = function(a) {
  4117. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4118. this.frameRate = 60 / a
  4119. };
  4120. d.prototype.getIsPlaying = function() {
  4121. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4122. return this.delegate.isPlaying
  4123. };
  4124. return d
  4125. }(b.DisplayObjectContainer);
  4126. b.MovieClip = c;
  4127. c.prototype.__class__ = "egret.MovieClip";
  4128. var e = function() {
  4129. function a(a, c) {
  4130. this.data = a;
  4131. this._currentFrameIndex = this._passTime =
  4132. this._totalFrame = 0;
  4133. this._isPlaying = !1;
  4134. this._frameData = a;
  4135. this._spriteSheet = new b.SpriteSheet(c)
  4136. }
  4137. a.prototype.setMovieClip = function(a) {
  4138. this.movieClip = a;
  4139. this.bitmap = new b.Bitmap;
  4140. this.movieClip.addChild(this.bitmap)
  4141. };
  4142. a.prototype.gotoAndPlay = function(a) {
  4143. this.checkHasFrame(a);
  4144. this._isPlaying = !0;
  4145. this._currentFrameIndex = 0;
  4146. this._currentFrameName = a;
  4147. this._totalFrame = this._frameData.frames[a].totalFrame;
  4148. this.playNextFrame();
  4149. this._passTime = 0;
  4150. b.Ticker.getInstance().register(this.update, this)
  4151. };
  4152. a.prototype.gotoAndStop =
  4153. function(a) {
  4154. this.checkHasFrame(a);
  4155. this.stop();
  4156. this._currentFrameIndex = this._passTime = 0;
  4157. this._currentFrameName = a;
  4158. this._totalFrame = this._frameData.frames[a].totalFrame;
  4159. this.playNextFrame()
  4160. };
  4161. a.prototype.stop = function() {
  4162. this._isPlaying = !1;
  4163. b.Ticker.getInstance().unregister(this.update, this)
  4164. };
  4165. a.prototype.dispose = function() {};
  4166. a.prototype.checkHasFrame = function(a) {
  4167. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  4168. };
  4169. a.prototype.update = function(a) {
  4170. for (var b =
  4171. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  4172. this._passTime += a
  4173. };
  4174. a.prototype.playNextFrame = function(a) {
  4175. void 0 === a && (a = !0);
  4176. var c = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4177. if (a) {
  4178. a = this.getTexture(c.res);
  4179. var e = this.bitmap;
  4180. e.x = c.x;
  4181. e.y = c.y;
  4182. e.texture = a
  4183. }
  4184. null != c.action && this.movieClip.dispatchEventWith(c.action);
  4185. this._currentFrameIndex++;
  4186. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4187. 0, c.action != b.Event.COMPLETE && this.movieClip.dispatchEventWith(b.Event.COMPLETE))
  4188. };
  4189. a.prototype.getTexture = function(a) {
  4190. var b = this._frameData.res[a],
  4191. c = this._spriteSheet.getTexture(a);
  4192. c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4193. return c
  4194. };
  4195. return a
  4196. }();
  4197. b.DefaultMovieClipDelegate = e;
  4198. e.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4199. })(egret || (egret = {}));
  4200. __extends = this.__extends || function(b, c) {
  4201. function e() {
  4202. this.constructor = b
  4203. }
  4204. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4205. e.prototype = c.prototype;
  4206. b.prototype = new e
  4207. };
  4208. (function(b) {
  4209. var c = function(b) {
  4210. function a() {
  4211. b.call(this);
  4212. this._scaleY = this._scaleX = 1;
  4213. this._size = 30;
  4214. this._color = "#FFFFFF";
  4215. this._fontFamily = "Arial";
  4216. this._italic = this._bold = !1;
  4217. this._textAlign = "left";
  4218. this._multiline = this._visible = !1;
  4219. this._maxChars = 0
  4220. }
  4221. __extends(a, b);
  4222. a.prototype._getText = function() {
  4223. return null
  4224. };
  4225. a.prototype._setText = function(a) {};
  4226. a.prototype._setTextType = function(a) {};
  4227. a.prototype._getTextType = function() {
  4228. return null
  4229. };
  4230. a.prototype._open = function(a, b, c, e) {};
  4231. a.prototype._show = function() {};
  4232. a.prototype._add =
  4233. function() {};
  4234. a.prototype._remove = function() {};
  4235. a.prototype._hide = function() {};
  4236. a.prototype._addListeners = function() {};
  4237. a.prototype._removeListeners = function() {};
  4238. a.prototype._setScale = function(a, b) {
  4239. this._scaleX = a;
  4240. this._scaleY = b
  4241. };
  4242. a.prototype.changePosition = function(a, b) {};
  4243. a.prototype._setSize = function(a) {
  4244. this._size = a
  4245. };
  4246. a.prototype._setTextColor = function(a) {
  4247. this._color = a
  4248. };
  4249. a.prototype._setTextFontFamily = function(a) {
  4250. this._fontFamily = a
  4251. };
  4252. a.prototype._setBold = function(a) {
  4253. this._bold = a
  4254. };
  4255. a.prototype._setItalic =
  4256. function(a) {
  4257. this._italic = a
  4258. };
  4259. a.prototype._setTextAlign = function(a) {
  4260. this._textAlign = a
  4261. };
  4262. a.prototype._setVisible = function(a) {
  4263. this._visible = a
  4264. };
  4265. a.prototype._setWidth = function(a) {};
  4266. a.prototype._setHeight = function(a) {};
  4267. a.prototype._setMultiline = function(a) {
  4268. this._multiline = a
  4269. };
  4270. a.prototype._setMaxChars = function(a) {
  4271. this._maxChars = a
  4272. };
  4273. a.prototype._resetStageText = function() {};
  4274. a.create = function() {
  4275. return null
  4276. };
  4277. return a
  4278. }(b.EventDispatcher);
  4279. b.StageText = c;
  4280. c.prototype.__class__ = "egret.StageText"
  4281. })(egret || (egret = {}));
  4282. (function(b) {
  4283. var c = function() {
  4284. function b() {}
  4285. b.GET = "get";
  4286. b.POST = "post";
  4287. return b
  4288. }();
  4289. b.URLRequestMethod = c;
  4290. c.prototype.__class__ = "egret.URLRequestMethod"
  4291. })(egret || (egret = {}));
  4292. (function(b) {
  4293. var c = function() {
  4294. function b() {}
  4295. b.BINARY = "binary";
  4296. b.TEXT = "text";
  4297. b.VARIABLES = "variables";
  4298. b.TEXTURE = "texture";
  4299. b.SOUND = "sound";
  4300. return b
  4301. }();
  4302. b.URLLoaderDataFormat = c;
  4303. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  4304. })(egret || (egret = {}));
  4305. __extends = this.__extends || function(b, c) {
  4306. function e() {
  4307. this.constructor = b
  4308. }
  4309. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4310. e.prototype = c.prototype;
  4311. b.prototype = new e
  4312. };
  4313. (function(b) {
  4314. var c = function(b) {
  4315. function a(a) {
  4316. void 0 === a && (a = null);
  4317. b.call(this);
  4318. null !== a && this.decode(a)
  4319. }
  4320. __extends(a, b);
  4321. a.prototype.decode = function(a) {
  4322. this.variables || (this.variables = {});
  4323. a = a.split("+").join(" ");
  4324. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  4325. };
  4326. a.prototype.toString = function() {
  4327. if (!this.variables) return "";
  4328. var a = this.variables,
  4329. b = "",
  4330. c = !0,
  4331. e;
  4332. for (e in a) c ? c = !1 : b += "&", b += e + "=" + a[e];
  4333. return b
  4334. };
  4335. return a
  4336. }(b.HashObject);
  4337. b.URLVariables =
  4338. c;
  4339. c.prototype.__class__ = "egret.URLVariables"
  4340. })(egret || (egret = {}));
  4341. (function(b) {
  4342. var c = function() {
  4343. return function(b, a) {
  4344. this.name = b;
  4345. this.value = a
  4346. }
  4347. }();
  4348. b.URLRequestHeader = c;
  4349. c.prototype.__class__ = "egret.URLRequestHeader"
  4350. })(egret || (egret = {}));
  4351. __extends = this.__extends || function(b, c) {
  4352. function e() {
  4353. this.constructor = b
  4354. }
  4355. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4356. e.prototype = c.prototype;
  4357. b.prototype = new e
  4358. };
  4359. (function(b) {
  4360. var c = function(c) {
  4361. function a(a) {
  4362. void 0 === a && (a = null);
  4363. c.call(this);
  4364. this.method = b.URLRequestMethod.GET;
  4365. this.url = a
  4366. }
  4367. __extends(a, c);
  4368. return a
  4369. }(b.HashObject);
  4370. b.URLRequest = c;
  4371. c.prototype.__class__ = "egret.URLRequest"
  4372. })(egret || (egret = {}));
  4373. __extends = this.__extends || function(b, c) {
  4374. function e() {
  4375. this.constructor = b
  4376. }
  4377. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4378. e.prototype = c.prototype;
  4379. b.prototype = new e
  4380. };
  4381. (function(b) {
  4382. var c = function(c) {
  4383. function a(a) {
  4384. void 0 === a && (a = null);
  4385. c.call(this);
  4386. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  4387. this._status = -1;
  4388. a && this.load(a)
  4389. }
  4390. __extends(a, c);
  4391. a.prototype.load = function(a) {
  4392. this._request = a;
  4393. this.data = null;
  4394. b.MainContext.instance.netContext.proceed(this)
  4395. };
  4396. return a
  4397. }(b.EventDispatcher);
  4398. b.URLLoader = c;
  4399. c.prototype.__class__ = "egret.URLLoader"
  4400. })(egret || (egret = {}));
  4401. __extends = this.__extends || function(b, c) {
  4402. function e() {
  4403. this.constructor = b
  4404. }
  4405. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4406. e.prototype = c.prototype;
  4407. b.prototype = new e
  4408. };
  4409. (function(b) {
  4410. var c = function(c) {
  4411. function a() {
  4412. c.call(this);
  4413. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4414. }
  4415. __extends(a, c);
  4416. Object.defineProperty(a.prototype, "textureWidth", {
  4417. get: function() {
  4418. return this._textureWidth
  4419. },
  4420. enumerable: !0,
  4421. configurable: !0
  4422. });
  4423. Object.defineProperty(a.prototype, "textureHeight", {
  4424. get: function() {
  4425. return this._textureHeight
  4426. },
  4427. enumerable: !0,
  4428. configurable: !0
  4429. });
  4430. Object.defineProperty(a.prototype, "bitmapData", {
  4431. get: function() {
  4432. return this._bitmapData
  4433. },
  4434. enumerable: !0,
  4435. configurable: !0
  4436. });
  4437. a.prototype._setBitmapData = function(a) {
  4438. var c = b.MainContext.instance.rendererContext.texture_scale_factor;
  4439. this._bitmapData = a;
  4440. this._sourceWidth = a.width;
  4441. this._sourceHeight = a.height;
  4442. this._textureWidth = this._sourceWidth * c;
  4443. this._textureHeight = this._sourceHeight * c;
  4444. this._bitmapWidth = this._textureWidth;
  4445. this._bitmapHeight = this._textureHeight;
  4446. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4447. };
  4448. a.prototype.getPixel32 = function(a, b) {
  4449. return this._bitmapData.getContext("2d").getImageData(a,
  4450. b, 1, 1).data
  4451. };
  4452. return a
  4453. }(b.HashObject);
  4454. b.Texture = c;
  4455. c.prototype.__class__ = "egret.Texture"
  4456. })(egret || (egret = {}));
  4457. __extends = this.__extends || function(b, c) {
  4458. function e() {
  4459. this.constructor = b
  4460. }
  4461. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4462. e.prototype = c.prototype;
  4463. b.prototype = new e
  4464. };
  4465. (function(b) {
  4466. var c = function(c) {
  4467. function a() {
  4468. c.call(this);
  4469. this._bitmapData = document.createElement("canvas");
  4470. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  4471. }
  4472. __extends(a, c);
  4473. a.prototype.drawToTexture = function(d) {
  4474. var c = this._bitmapData,
  4475. e = d.getBounds(b.Rectangle.identity);
  4476. if (0 == e.width || 0 == e.height) return b.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4477. e.width = Math.floor(e.width);
  4478. e.height = Math.floor(e.height);
  4479. c.width = e.width;
  4480. c.height = e.height;
  4481. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e.width, this.renderContext._cacheCanvas.height = e.height);
  4482. a.identityRectangle.width = e.width;
  4483. a.identityRectangle.height = e.height;
  4484. d._worldTransform.identity();
  4485. d.worldAlpha = 1;
  4486. if (d instanceof b.DisplayObjectContainer) {
  4487. var c = d._anchorOffsetX,
  4488. m = d._anchorOffsetY;
  4489. if (0 != d._anchorX || 0 != d._anchorY) c = d._anchorX * e.width, m = d._anchorY * e.height;
  4490. this._offsetX = e.x + c;
  4491. this._offsetY = e.y +
  4492. m;
  4493. d._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4494. e = d._children;
  4495. c = 0;
  4496. for (m = e.length; c < m; c++) e[c]._updateTransform()
  4497. }
  4498. e = b.RenderFilter.getInstance();
  4499. c = e._drawAreaList.concat();
  4500. e._drawAreaList.length = 0;
  4501. this.renderContext.clearScreen();
  4502. this.renderContext.onRenderStart();
  4503. this.webGLTexture = null;
  4504. (m = d.mask || d._scrollRect) && this.renderContext.pushMask(m);
  4505. d._render(this.renderContext);
  4506. m && this.renderContext.popMask();
  4507. e.addDrawArea(a.identityRectangle);
  4508. this.renderContext.onRenderFinish();
  4509. e._drawAreaList =
  4510. c;
  4511. this._textureWidth = this._bitmapData.width;
  4512. this._textureHeight = this._bitmapData.height;
  4513. this._sourceWidth = this._textureWidth;
  4514. this._sourceHeight = this._textureHeight;
  4515. return !0
  4516. };
  4517. a.identityRectangle = new b.Rectangle;
  4518. return a
  4519. }(b.Texture);
  4520. b.RenderTexture = c;
  4521. c.prototype.__class__ = "egret.RenderTexture"
  4522. })(egret || (egret = {}));
  4523. __extends = this.__extends || function(b, c) {
  4524. function e() {
  4525. this.constructor = b
  4526. }
  4527. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4528. e.prototype = c.prototype;
  4529. b.prototype = new e
  4530. };
  4531. (function(b) {
  4532. var c = function(c) {
  4533. function a() {
  4534. c.call(this);
  4535. this.renderCost = 0;
  4536. this.texture_scale_factor = 1;
  4537. this.profiler = b.Profiler.getInstance()
  4538. }
  4539. __extends(a, c);
  4540. a.prototype.clearScreen = function() {};
  4541. a.prototype.clearRect = function(a, b, c, e) {};
  4542. a.prototype.drawImage = function(a, b, c, e, k, f, l, n, p, q) {
  4543. this.profiler.onDrawImage()
  4544. };
  4545. a.prototype.setTransform = function(a) {};
  4546. a.prototype.setAlpha = function(a, b) {};
  4547. a.prototype.setupFont = function(a, b) {};
  4548. a.prototype.measureText = function(a) {
  4549. return 0
  4550. };
  4551. a.prototype.drawText = function(a,
  4552. b, c, e, k, f) {
  4553. this.profiler.onDrawImage()
  4554. };
  4555. a.prototype.strokeRect = function(a, b, c, e, k) {};
  4556. a.prototype.pushMask = function(a) {};
  4557. a.prototype.popMask = function() {};
  4558. a.prototype.onRenderStart = function() {};
  4559. a.prototype.onRenderFinish = function() {};
  4560. a.prototype.setGlobalColorTransform = function(a) {};
  4561. a.createRendererContext = function(a) {
  4562. return null
  4563. };
  4564. a.imageSmoothingEnabled = !0;
  4565. return a
  4566. }(b.HashObject);
  4567. b.RendererContext = c;
  4568. c.prototype.__class__ = "egret.RendererContext"
  4569. })(egret || (egret = {}));
  4570. (function(b) {
  4571. var c = function() {
  4572. function b() {}
  4573. b.MOUSE = "mouse";
  4574. b.TOUCH = "touch";
  4575. b.mode = "touch";
  4576. return b
  4577. }();
  4578. b.InteractionMode = c;
  4579. c.prototype.__class__ = "egret.InteractionMode"
  4580. })(egret || (egret = {}));
  4581. __extends = this.__extends || function(b, c) {
  4582. function e() {
  4583. this.constructor = b
  4584. }
  4585. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4586. e.prototype = c.prototype;
  4587. b.prototype = new e
  4588. };
  4589. (function(b) {
  4590. var c = function(c) {
  4591. function a() {
  4592. c.call(this);
  4593. this._currentTouchTarget = {};
  4594. this.maxTouches = 2;
  4595. this.touchDownTarget = {};
  4596. this.touchingIdentifiers = [];
  4597. this.lastTouchY = this.lastTouchX = -1
  4598. }
  4599. __extends(a, c);
  4600. a.prototype.run = function() {};
  4601. a.prototype.getTouchData = function(a, b, c) {
  4602. var e = this._currentTouchTarget[a];
  4603. null == e && (e = {}, this._currentTouchTarget[a] = e);
  4604. e.stageX = b;
  4605. e.stageY = c;
  4606. e.identifier = a;
  4607. return e
  4608. };
  4609. a.prototype.dispatchEvent = function(a, c) {
  4610. b.TouchEvent.dispatchTouchEvent(c.target, a, c.identifier, c.stageX,
  4611. c.stageY, !1, !1, !1, !0 == this.touchDownTarget[c.identifier])
  4612. };
  4613. a.prototype.onTouchBegan = function(a, c, e) {
  4614. if (this.touchingIdentifiers.length != this.maxTouches) {
  4615. var m = b.MainContext.instance.stage.hitTest(a, c);
  4616. m && (a = this.getTouchData(e, a, c), this.touchDownTarget[e] = !0, a.target = m, a.beginTarget = m, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  4617. this.touchingIdentifiers.push(e)
  4618. }
  4619. };
  4620. a.prototype.onTouchMove = function(a, c, e) {
  4621. if (-1 != this.touchingIdentifiers.indexOf(e) && (a != this.lastTouchX || c != this.lastTouchY)) {
  4622. this.lastTouchX =
  4623. a;
  4624. this.lastTouchY = c;
  4625. var m = b.MainContext.instance.stage.hitTest(a, c);
  4626. m && (a = this.getTouchData(e, a, c), a.target = m, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  4627. }
  4628. };
  4629. a.prototype.onTouchEnd = function(a, c, e) {
  4630. var m = this.touchingIdentifiers.indexOf(e); - 1 != m && (this.touchingIdentifiers.splice(m, 1), m = b.MainContext.instance.stage.hitTest(a, c)) && (a = this.getTouchData(e, a, c), delete this.touchDownTarget[e], e = a.beginTarget, a.target = m, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), e == m ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  4631. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4632. };
  4633. return a
  4634. }(b.HashObject);
  4635. b.TouchContext = c;
  4636. c.prototype.__class__ = "egret.TouchContext"
  4637. })(egret || (egret = {}));
  4638. __extends = this.__extends || function(b, c) {
  4639. function e() {
  4640. this.constructor = b
  4641. }
  4642. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4643. e.prototype = c.prototype;
  4644. b.prototype = new e
  4645. };
  4646. (function(b) {
  4647. var c = function(c) {
  4648. function a() {
  4649. c.call(this)
  4650. }
  4651. __extends(a, c);
  4652. a.prototype.proceed = function(a) {};
  4653. a._getUrl = function(a) {
  4654. var c = a.url; - 1 == c.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (c = c + "?" + a.data.toString());
  4655. return c
  4656. };
  4657. a.prototype.getChangeList = function() {
  4658. return []
  4659. };
  4660. return a
  4661. }(b.HashObject);
  4662. b.NetContext = c;
  4663. c.prototype.__class__ = "egret.NetContext"
  4664. })(egret || (egret = {}));
  4665. __extends = this.__extends || function(b, c) {
  4666. function e() {
  4667. this.constructor = b
  4668. }
  4669. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4670. e.prototype = c.prototype;
  4671. b.prototype = new e
  4672. };
  4673. (function(b) {
  4674. var c = function(b) {
  4675. function a() {
  4676. b.call(this);
  4677. this.frameRate = 60
  4678. }
  4679. __extends(a, b);
  4680. a.prototype.executeMainLoop = function(a, b) {};
  4681. return a
  4682. }(b.HashObject);
  4683. b.DeviceContext = c;
  4684. c.prototype.__class__ = "egret.DeviceContext"
  4685. })(egret || (egret = {}));
  4686. (function(b) {
  4687. var c = function() {
  4688. function b() {}
  4689. b.call = function(a, d) {};
  4690. b.addCallback = function(a, d) {};
  4691. return b
  4692. }();
  4693. b.ExternalInterface = c;
  4694. c.prototype.__class__ = "egret.ExternalInterface"
  4695. })(egret || (egret = {}));
  4696. __extends = this.__extends || function(b, c) {
  4697. function e() {
  4698. this.constructor = b
  4699. }
  4700. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4701. e.prototype = c.prototype;
  4702. b.prototype = new e
  4703. };
  4704. (function(b) {
  4705. var c = function(c) {
  4706. function a() {
  4707. c.call(this);
  4708. this.ua = navigator.userAgent.toLowerCase();
  4709. this.trans = this._getTrans()
  4710. }
  4711. __extends(a, c);
  4712. a.getInstance = function() {
  4713. null == a.instance && (a.instance = new a);
  4714. return a.instance
  4715. };
  4716. Object.defineProperty(a.prototype, "isMobile", {
  4717. get: function() {
  4718. 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 ");
  4719. return b.MainContext.deviceType ==
  4720. b.MainContext.DEVICE_MOBILE
  4721. },
  4722. enumerable: !0,
  4723. configurable: !0
  4724. });
  4725. a.prototype._getHeader = function(a) {
  4726. if ("transform" in a) return "";
  4727. for (var b = ["webkit", "ms", "Moz", "O"], c = 0; c < b.length; c++)
  4728. if (b[c] + "Transform" in a) return b[c];
  4729. return ""
  4730. };
  4731. a.prototype._getTrans = function() {
  4732. var a = document.createElement("div").style,
  4733. a = this._getHeader(a);
  4734. return "" == a ? "transform" : a + "Transform"
  4735. };
  4736. a.prototype.$new = function(a) {
  4737. return this.$(document.createElement(a))
  4738. };
  4739. a.prototype.$ = function(d) {
  4740. var c = document;
  4741. if (d = d instanceof HTMLElement ?
  4742. d : c.querySelector(d)) d.find = d.find || this.$, d.hasClass = d.hasClass || function(a) {
  4743. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4744. }, d.addClass = d.addClass || function(a) {
  4745. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4746. return this
  4747. }, d.removeClass = d.removeClass || function(a) {
  4748. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4749. return this
  4750. }, d.remove = d.remove || function() {}, d.appendTo = d.appendTo || function(a) {
  4751. a.appendChild(this);
  4752. return this
  4753. }, d.prependTo = d.prependTo ||
  4754. function(a) {
  4755. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4756. return this
  4757. }, d.transforms = d.transforms || function() {
  4758. 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);
  4759. return this
  4760. }, d.position = d.position || {
  4761. x: 0,
  4762. y: 0
  4763. }, d.rotation = d.rotation || 0, d.scale = d.scale || {
  4764. x: 1,
  4765. y: 1
  4766. }, d.skew = d.skew || {
  4767. x: 0,
  4768. y: 0
  4769. }, d.translates = function(a, d) {
  4770. this.position.x = a;
  4771. this.position.y = d -
  4772. b.MainContext.instance.stage.stageHeight;
  4773. this.transforms();
  4774. return this
  4775. }, d.rotate = function(a) {
  4776. this.rotation = a;
  4777. this.transforms();
  4778. return this
  4779. }, d.resize = function(a, d) {
  4780. this.scale.x = a;
  4781. this.scale.y = d;
  4782. this.transforms();
  4783. return this
  4784. }, d.setSkew = function(a, d) {
  4785. this.skew.x = a;
  4786. this.skew.y = d;
  4787. this.transforms();
  4788. return this
  4789. };
  4790. return d
  4791. };
  4792. a.prototype.translate = function(a) {
  4793. return "translate(" + a.x + "px, " + a.y + "px) "
  4794. };
  4795. a.prototype.rotate = function(a) {
  4796. return "rotate(" + a + "deg) "
  4797. };
  4798. a.prototype.scale = function(a) {
  4799. return "scale(" + a.x + ", " +
  4800. a.y + ") "
  4801. };
  4802. a.prototype.skew = function(a) {
  4803. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4804. };
  4805. return a
  4806. }(b.HashObject);
  4807. b.Browser = c;
  4808. c.prototype.__class__ = "egret.Browser"
  4809. })(egret || (egret = {}));
  4810. (function(b) {
  4811. (function(b) {
  4812. b.getItem = function(b) {
  4813. return null
  4814. };
  4815. b.setItem = function(b, a) {
  4816. return !1
  4817. };
  4818. b.removeItem = function(b) {};
  4819. b.clear = function() {}
  4820. })(b.localStorage || (b.localStorage = {}))
  4821. })(egret || (egret = {}));
  4822. (function(b) {
  4823. var c = function() {
  4824. function c() {}
  4825. c.parse = function(a) {
  4826. a = b.SAXParser.getInstance().parserXML(a);
  4827. if (!a || !a.childNodes) return null;
  4828. for (var d = a.childNodes.length, h = !1, g = 0; g < d; g++) {
  4829. var m = a.childNodes[g];
  4830. if (1 == m.nodeType) {
  4831. h = !0;
  4832. break
  4833. }
  4834. }
  4835. return h ? c.parseNode(m) : null
  4836. };
  4837. c.parseNode = function(a) {
  4838. if (!a || 1 != a.nodeType) return null;
  4839. var d = {};
  4840. d.localName = a.localName;
  4841. d.name = a.nodeName;
  4842. a.namespaceURI && (d.namespace = a.namespaceURI);
  4843. a.prefix && (d.prefix = a.prefix);
  4844. for (var b = a.attributes, g = b.length, m = 0; m < g; m++) {
  4845. var k =
  4846. b[m],
  4847. f = k.name;
  4848. 0 != f.indexOf("xmlns:") && (d["$" + f] = k.value)
  4849. }
  4850. b = a.childNodes;
  4851. g = b.length;
  4852. for (m = 0; m < g; m++)
  4853. if (k = c.parseNode(b[m])) d.children || (d.children = []), k.parent = d, d.children.push(k);!d.children && (a = a.textContent.trim()) && (d.text = a);
  4854. return d
  4855. };
  4856. c.findChildren = function(a, d, b) {
  4857. b ? b.length = 0 : b = [];
  4858. c.findByPath(a, d, b);
  4859. return b
  4860. };
  4861. c.findByPath = function(a, d, b) {
  4862. var g = d.indexOf("."),
  4863. m; - 1 == g ? (m = d, g = !0) : (m = d.substring(0, g), d = d.substring(g + 1), g = !1);
  4864. if (a = a.children)
  4865. for (var k = a.length, f = 0; f < k; f++) {
  4866. var l = a[f];
  4867. l.localName ==
  4868. m && (g ? b.push(l) : c.findByPath(l, d, b))
  4869. }
  4870. };
  4871. c.getAttributes = function(a, d) {
  4872. d ? d.length = 0 : d = [];
  4873. for (var b in a) "$" == b.charAt(0) && d.push(b.substring(1));
  4874. return d
  4875. };
  4876. return c
  4877. }();
  4878. b.XML = c;
  4879. c.prototype.__class__ = "egret.XML"
  4880. })(egret || (egret = {}));
  4881. (function(b) {
  4882. var c = function() {
  4883. function a() {}
  4884. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  4885. a.BIG_ENDIAN = "BIG_ENDIAN";
  4886. return a
  4887. }();
  4888. b.Endian = c;
  4889. c.prototype.__class__ = "egret.Endian";
  4890. var e = function() {
  4891. function a() {
  4892. this.length = this.position = 0;
  4893. this._mode = "";
  4894. this.maxlength = 0;
  4895. this._endian = c.LITTLE_ENDIAN;
  4896. this.isLittleEndian = !1;
  4897. this._mode = "Typed array";
  4898. this.maxlength = 4;
  4899. this.arraybytes = new ArrayBuffer(this.maxlength);
  4900. this.unalignedarraybytestemp = new ArrayBuffer(16);
  4901. this.endian = a.DEFAULT_ENDIAN
  4902. }
  4903. Object.defineProperty(a.prototype,
  4904. "endian", {
  4905. get: function() {
  4906. return this._endian
  4907. },
  4908. set: function(a) {
  4909. this._endian = a;
  4910. this.isLittleEndian = a == c.LITTLE_ENDIAN
  4911. },
  4912. enumerable: !0,
  4913. configurable: !0
  4914. });
  4915. a.prototype.ensureWriteableSpace = function(a) {
  4916. this.ensureSpace(a + this.position)
  4917. };
  4918. a.prototype.setArrayBuffer = function(a) {
  4919. this.ensureSpace(a.byteLength);
  4920. this.length = a.byteLength;
  4921. a = new Int8Array(a);
  4922. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  4923. this.position = 0
  4924. };
  4925. Object.defineProperty(a.prototype, "bytesAvailable", {
  4926. get: function() {
  4927. return this.length - this.position
  4928. },
  4929. enumerable: !0,
  4930. configurable: !0
  4931. });
  4932. a.prototype.ensureSpace = function(a) {
  4933. if (a > this.maxlength) {
  4934. a = a + 255 & -256;
  4935. var b = new ArrayBuffer(a),
  4936. c = new Uint8Array(this.arraybytes, 0, this.length);
  4937. (new Uint8Array(b, 0, this.length)).set(c);
  4938. this.arraybytes = b;
  4939. this.maxlength = a
  4940. }
  4941. };
  4942. a.prototype.writeByte = function(a) {
  4943. this.ensureWriteableSpace(1);
  4944. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  4945. this.position > this.length && (this.length = this.position)
  4946. };
  4947. a.prototype.readByte = function() {
  4948. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  4949. this.position + ", Length=" + this.length;
  4950. return (new Int8Array(this.arraybytes))[this.position++]
  4951. };
  4952. a.prototype.readBytes = function(a, b, c) {
  4953. void 0 === b && (b = 0);
  4954. void 0 === c && (c = 0);
  4955. null == c && (c = a.length);
  4956. a.ensureWriteableSpace(b + c);
  4957. var e = new Int8Array(a.arraybytes),
  4958. k = new Int8Array(this.arraybytes);
  4959. e.set(k.subarray(this.position, this.position + c), b);
  4960. this.position += c;
  4961. c + b > a.length && (a.length += c + b - a.length)
  4962. };
  4963. a.prototype.writeUnsignedByte = function(a) {
  4964. this.ensureWriteableSpace(1);
  4965. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  4966. this.position > this.length && (this.length = this.position)
  4967. };
  4968. a.prototype.readUnsignedByte = function() {
  4969. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  4970. return (new Uint8Array(this.arraybytes))[this.position++]
  4971. };
  4972. a.prototype.writeUnsignedShort = function(a) {
  4973. this.ensureWriteableSpace(2);
  4974. if (0 == (this.position & 1)) {
  4975. var b = new Uint16Array(this.arraybytes);
  4976. b[this.position >> 1] = ~~a & 65535
  4977. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  4978. this.position += 2;
  4979. this.position > this.length && (this.length = this.position)
  4980. };
  4981. a.prototype.readUTFBytes = function(a) {
  4982. var b = "";
  4983. a = this.position + a;
  4984. for (var c = new DataView(this.arraybytes); this.position < a;) {
  4985. var e = c.getUint8(this.position++);
  4986. if (128 > e) {
  4987. if (0 == e) break;
  4988. b += String.fromCharCode(e)
  4989. } else if (224 > e) b += String.fromCharCode((e & 63) << 6 | c.getUint8(this.position++) & 127);
  4990. else if (240 > e) var k = c.getUint8(this.position++),
  4991. b = b + String.fromCharCode((e & 31) << 12 | (k & 127) << 6 | c.getUint8(this.position++) & 127);
  4992. else var k = c.getUint8(this.position++),
  4993. f = c.getUint8(this.position++),
  4994. b = b + String.fromCharCode((e & 15) << 18 | (k & 127) << 12 | f << 6 & 127 | c.getUint8(this.position++) & 127)
  4995. }
  4996. return b
  4997. };
  4998. a.prototype.readInt = function() {
  4999. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  5000. this.position += 4;
  5001. return a
  5002. };
  5003. a.prototype.readShort = function() {
  5004. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  5005. this.position += 2;
  5006. return a
  5007. };
  5008. a.prototype.readDouble = function() {
  5009. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  5010. this.position += 8;
  5011. return a
  5012. };
  5013. a.prototype.readUnsignedShort = function() {
  5014. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5015. if (0 == (this.position & 1)) {
  5016. var a = new Uint16Array(this.arraybytes),
  5017. b = this.position >> 1;
  5018. this.position += 2;
  5019. return a[b]
  5020. }
  5021. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  5022. b = new Uint8Array(this.arraybytes,
  5023. this.position, 2);
  5024. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  5025. this.position += 2;
  5026. return a[0]
  5027. };
  5028. a.prototype.writeUnsignedInt = function(a) {
  5029. this.ensureWriteableSpace(4);
  5030. if (0 == (this.position & 3)) {
  5031. var b = new Uint32Array(this.arraybytes);
  5032. b[this.position >> 2] = ~~a & 4294967295
  5033. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  5034. this.position += 4;
  5035. this.position > this.length &&
  5036. (this.length = this.position)
  5037. };
  5038. a.prototype.readUnsignedInt = function() {
  5039. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5040. if (0 == (this.position & 3)) {
  5041. var a = new Uint32Array(this.arraybytes),
  5042. b = this.position >> 2;
  5043. this.position += 4;
  5044. return a[b]
  5045. }
  5046. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  5047. b = new Uint8Array(this.arraybytes, this.position, 4);
  5048. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5049. this.position += 4;
  5050. return a[0]
  5051. };
  5052. a.prototype.writeFloat =
  5053. function(a) {
  5054. this.ensureWriteableSpace(4);
  5055. if (0 == (this.position & 3)) {
  5056. var b = new Float32Array(this.arraybytes);
  5057. b[this.position >> 2] = a
  5058. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  5059. this.position += 4;
  5060. this.position > this.length && (this.length = this.position)
  5061. };
  5062. a.prototype.readFloat = function() {
  5063. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  5064. this.length;
  5065. if (0 == (this.position & 3)) {
  5066. var a = new Float32Array(this.arraybytes),
  5067. b = this.position >> 2;
  5068. this.position += 4;
  5069. return a[b]
  5070. }
  5071. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  5072. b = new Uint8Array(this.arraybytes, this.position, 4);
  5073. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5074. this.position += 4;
  5075. return a[0]
  5076. };
  5077. a.DEFAULT_ENDIAN = c.BIG_ENDIAN;
  5078. return a
  5079. }();
  5080. b.ByteArray = e;
  5081. e.prototype.__class__ = "egret.ByteArray"
  5082. })(egret || (egret = {}));
  5083. __extends = this.__extends || function(b, c) {
  5084. function e() {
  5085. this.constructor = b
  5086. }
  5087. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5088. e.prototype = c.prototype;
  5089. b.prototype = new e
  5090. };
  5091. (function(b) {
  5092. var c = function(c) {
  5093. function a(a, b, g) {
  5094. c.call(this);
  5095. this._target = null;
  5096. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5097. this._actions = this._steps = this.pluginData = null;
  5098. this.paused = !1;
  5099. this.duration = 0;
  5100. this._prevPos = -1;
  5101. this.position = null;
  5102. this._stepPosition = this._prevPosition = 0;
  5103. this.passive = !1;
  5104. this.initialize(a, b, g)
  5105. }
  5106. __extends(a, c);
  5107. a.get = function(d, b, c, e) {
  5108. void 0 === b && (b = null);
  5109. void 0 === c && (c = null);
  5110. void 0 === e && (e = !1);
  5111. e && a.removeTweens(d);
  5112. return new a(d, b, c)
  5113. };
  5114. a.removeTweens = function(d) {
  5115. if (d.tween_count) {
  5116. for (var b =
  5117. a._tweens, c = b.length - 1; 0 <= c; c--) b[c]._target == d && (b[c].paused = !0, b.splice(c, 1));
  5118. d.tween_count = 0
  5119. }
  5120. };
  5121. a.pauseTweens = function(a) {
  5122. if (a.tween_count)
  5123. for (var c = b.Tween._tweens, e = c.length - 1; 0 <= e; e--) c[e]._target == a && (c[e].paused = !0)
  5124. };
  5125. a.resumeTweens = function(a) {
  5126. if (a.tween_count)
  5127. for (var c = b.Tween._tweens, e = c.length - 1; 0 <= e; e--) c[e]._target == a && (c[e].paused = !1)
  5128. };
  5129. a.tick = function(d, b) {
  5130. void 0 === b && (b = !1);
  5131. for (var c = a._tweens.concat(), e = c.length - 1; 0 <= e; e--) {
  5132. var k = c[e];
  5133. b && !k.ignoreGlobalPause || k.paused || k.tick(k._useTicks ?
  5134. 1 : d)
  5135. }
  5136. };
  5137. a._register = function(d, c) {
  5138. var e = d._target,
  5139. m = a._tweens;
  5140. if (c) e && (e.tween_count = e.tween_count ? e.tween_count + 1 : 1), m.push(d), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5141. else
  5142. for (e && e.tween_count--, e = m.length; e--;)
  5143. if (m[e] == d) {
  5144. m.splice(e, 1);
  5145. break
  5146. }
  5147. };
  5148. a.removeAllTweens = function() {
  5149. for (var d = a._tweens, b = 0, c = d.length; b < c; b++) {
  5150. var e = d[b];
  5151. e.paused = !0;
  5152. e._target.tweenjs_count = 0
  5153. }
  5154. d.length = 0
  5155. };
  5156. a.prototype.initialize = function(d, b, c) {
  5157. this._target = d;
  5158. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  5159. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(d));
  5160. this.pluginData = c || {};
  5161. this._curQueueProps = {};
  5162. this._initQueueProps = {};
  5163. this._steps = [];
  5164. this._actions = [];
  5165. b && b.paused ? this.paused = !0 : a._register(this, !0);
  5166. b && null != b.position && this.setPosition(b.position, a.NONE)
  5167. };
  5168. a.prototype.setPosition = function(a, b) {
  5169. void 0 === b && (b = 1);
  5170. 0 > a && (a = 0);
  5171. var c = a,
  5172. e = !1;
  5173. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, e = !0));
  5174. if (c == this._prevPos) return e;
  5175. var k = this._prevPos;
  5176. this.position = this._prevPos = c;
  5177. this._prevPosition = a;
  5178. if (this._target)
  5179. if (e) this._updateTargetProps(null, 1);
  5180. else if (0 < this._steps.length) {
  5181. for (var f = 0, l = this._steps.length; f < l && !(this._steps[f].t > c); f++);
  5182. f = this._steps[f - 1];
  5183. this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
  5184. }
  5185. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < k ? (k != this.duration && this._runActions(k, this.duration), this._runActions(0, c, !0)) : this._runActions(k, c));
  5186. e && this.setPaused(!0);
  5187. this.dispatchEventWith("change");
  5188. return e
  5189. };
  5190. a.prototype._runActions = function(a, b, c) {
  5191. void 0 === c && (c = !1);
  5192. var e = a,
  5193. k = b,
  5194. f = -1,
  5195. l = this._actions.length,
  5196. n = 1;
  5197. a > b && (e = b, k = a, f = l, l = n = -1);
  5198. for (;
  5199. (f += n) != l;) {
  5200. b = this._actions[f];
  5201. var p = b.t;
  5202. (p == k || p > e && p < k || c && p == a) && b.f.apply(b.o, b.p)
  5203. }
  5204. };
  5205. a.prototype._updateTargetProps = function(d, b) {
  5206. var c, e, k, f;
  5207. if (d || 1 != b) {
  5208. if (this.passive = !!d.v) return;
  5209. d.e && (b = d.e(b, 0, 1, 1));
  5210. c = d.p0;
  5211. e = d.p1
  5212. } else this.passive = !1, c = e = this._curQueueProps;
  5213. for (var l in this._initQueueProps) {
  5214. null == (k = c[l]) && (c[l] = k = this._initQueueProps[l]);
  5215. null ==
  5216. (f = e[l]) && (e[l] = f = k);
  5217. k = k == f || 0 == b || 1 == b || "number" != typeof k ? 1 == b ? f : k : k + (f - k) * b;
  5218. var n = !1;
  5219. if (f = a._plugins[l])
  5220. for (var p = 0, q = f.length; p < q; p++) {
  5221. var r = f[p].tween(this, l, k, c, e, b, !!d && c == e, !d);
  5222. r == a.IGNORE ? n = !0 : k = r
  5223. }
  5224. n || (this._target[l] = k)
  5225. }
  5226. };
  5227. a.prototype.setPaused = function(d) {
  5228. this.paused = d;
  5229. a._register(this, !d);
  5230. return this
  5231. };
  5232. a.prototype._cloneProps = function(a) {
  5233. var b = {},
  5234. c;
  5235. for (c in a) b[c] = a[c];
  5236. return b
  5237. };
  5238. a.prototype._addStep = function(a) {
  5239. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5240. return this
  5241. };
  5242. a.prototype._appendQueueProps = function(d) {
  5243. var b, c, e, k, f, l;
  5244. for (l in d)
  5245. if (void 0 === this._initQueueProps[l]) {
  5246. c = this._target[l];
  5247. if (b = a._plugins[l])
  5248. for (e = 0, k = b.length; e < k; e++) c = b[e].init(this, l, c);
  5249. this._initQueueProps[l] = this._curQueueProps[l] = void 0 === c ? null : c
  5250. }
  5251. for (l in d) {
  5252. c = this._curQueueProps[l];
  5253. if (b = a._plugins[l])
  5254. for (f = f || {}, e = 0, k = b.length; e < k; e++) b[e].step && b[e].step(this, l, c, d[l], f);
  5255. this._curQueueProps[l] = d[l]
  5256. }
  5257. f && this._appendQueueProps(f);
  5258. return this._curQueueProps
  5259. };
  5260. a.prototype._addAction = function(a) {
  5261. a.t =
  5262. this.duration;
  5263. this._actions.push(a);
  5264. return this
  5265. };
  5266. a.prototype._set = function(a, b) {
  5267. for (var c in a) b[c] = a[c]
  5268. };
  5269. a.prototype.wait = function(a, b) {
  5270. if (null == a || 0 >= a) return this;
  5271. var c = this._cloneProps(this._curQueueProps);
  5272. return this._addStep({
  5273. d: a,
  5274. p0: c,
  5275. p1: c,
  5276. v: b
  5277. })
  5278. };
  5279. a.prototype.to = function(a, b, c) {
  5280. void 0 === c && (c = void 0);
  5281. if (isNaN(b) || 0 > b) b = 0;
  5282. return this._addStep({
  5283. d: b || 0,
  5284. p0: this._cloneProps(this._curQueueProps),
  5285. e: c,
  5286. p1: this._cloneProps(this._appendQueueProps(a))
  5287. })
  5288. };
  5289. a.prototype.call = function(a, b, c) {
  5290. void 0 === b && (b = void 0);
  5291. void 0 === c && (c = void 0);
  5292. return this._addAction({
  5293. f: a,
  5294. p: c ? c : [],
  5295. o: b ? b : this._target
  5296. })
  5297. };
  5298. a.prototype.set = function(a, b) {
  5299. void 0 === b && (b = null);
  5300. return this._addAction({
  5301. f: this._set,
  5302. o: this,
  5303. p: [a, b ? b : this._target]
  5304. })
  5305. };
  5306. a.prototype.play = function(a) {
  5307. a || (a = this);
  5308. return this.call(a.setPaused, a, [!1])
  5309. };
  5310. a.prototype.pause = function(a) {
  5311. a || (a = this);
  5312. return this.call(a.setPaused, a, [!0])
  5313. };
  5314. a.prototype.tick = function(a) {
  5315. this.paused || this.setPosition(this._prevPosition + a)
  5316. };
  5317. a.NONE = 0;
  5318. a.LOOP = 1;
  5319. a.REVERSE = 2;
  5320. a._tweens = [];
  5321. a.IGNORE = {};
  5322. a._plugins = {};
  5323. a._inited = !1;
  5324. return a
  5325. }(b.EventDispatcher);
  5326. b.Tween = c;
  5327. c.prototype.__class__ = "egret.Tween"
  5328. })(egret || (egret = {}));
  5329. (function(b) {
  5330. var c = function() {
  5331. function c() {
  5332. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5333. }
  5334. c.get = function(a) {
  5335. -1 > a && (a = -1);
  5336. 1 < a && (a = 1);
  5337. return function(d) {
  5338. return 0 == a ? d : 0 > a ? d * (d * -a + 1 + a) : d * ((2 - d) * a + (1 - a))
  5339. }
  5340. };
  5341. c.getPowIn = function(a) {
  5342. return function(d) {
  5343. return Math.pow(d, a)
  5344. }
  5345. };
  5346. c.getPowOut = function(a) {
  5347. return function(d) {
  5348. return 1 - Math.pow(1 - d, a)
  5349. }
  5350. };
  5351. c.getPowInOut = function(a) {
  5352. return function(d) {
  5353. return 1 > (d *= 2) ? 0.5 * Math.pow(d, a) : 1 - 0.5 * Math.abs(Math.pow(2 - d, a))
  5354. }
  5355. };
  5356. c.sineIn = function(a) {
  5357. return 1 - Math.cos(a *
  5358. Math.PI / 2)
  5359. };
  5360. c.sineOut = function(a) {
  5361. return Math.sin(a * Math.PI / 2)
  5362. };
  5363. c.sineInOut = function(a) {
  5364. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5365. };
  5366. c.getBackIn = function(a) {
  5367. return function(d) {
  5368. return d * d * ((a + 1) * d - a)
  5369. }
  5370. };
  5371. c.getBackOut = function(a) {
  5372. return function(d) {
  5373. return --d * d * ((a + 1) * d + a) + 1
  5374. }
  5375. };
  5376. c.getBackInOut = function(a) {
  5377. a *= 1.525;
  5378. return function(d) {
  5379. return 1 > (d *= 2) ? 0.5 * d * d * ((a + 1) * d - a) : 0.5 * ((d -= 2) * d * ((a + 1) * d + a) + 2)
  5380. }
  5381. };
  5382. c.circIn = function(a) {
  5383. return -(Math.sqrt(1 - a * a) - 1)
  5384. };
  5385. c.circOut = function(a) {
  5386. return Math.sqrt(1 - --a * a)
  5387. };
  5388. c.circInOut = function(a) {
  5389. return 1 >
  5390. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5391. };
  5392. c.bounceIn = function(a) {
  5393. return 1 - c.bounceOut(1 - a)
  5394. };
  5395. c.bounceOut = function(a) {
  5396. 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
  5397. };
  5398. c.bounceInOut = function(a) {
  5399. return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
  5400. };
  5401. c.getElasticIn = function(a, d) {
  5402. var b = 2 * Math.PI;
  5403. return function(c) {
  5404. if (0 == c || 1 == c) return c;
  5405. var e = d / b * Math.asin(1 / a);
  5406. return -(a * Math.pow(2, 10 *
  5407. (c -= 1)) * Math.sin((c - e) * b / d))
  5408. }
  5409. };
  5410. c.getElasticOut = function(a, d) {
  5411. var b = 2 * Math.PI;
  5412. return function(c) {
  5413. if (0 == c || 1 == c) return c;
  5414. var e = d / b * Math.asin(1 / a);
  5415. return a * Math.pow(2, -10 * c) * Math.sin((c - e) * b / d) + 1
  5416. }
  5417. };
  5418. c.getElasticInOut = function(a, d) {
  5419. var b = 2 * Math.PI;
  5420. return function(c) {
  5421. var e = d / b * Math.asin(1 / a);
  5422. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - e) * b / d) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - e) * b / d) * 0.5 + 1
  5423. }
  5424. };
  5425. c.quadIn = c.getPowIn(2);
  5426. c.quadOut = c.getPowOut(2);
  5427. c.quadInOut = c.getPowInOut(2);
  5428. c.cubicIn = c.getPowIn(3);
  5429. c.cubicOut = c.getPowOut(3);
  5430. c.cubicInOut = c.getPowInOut(3);
  5431. c.quartIn = c.getPowIn(4);
  5432. c.quartOut = c.getPowOut(4);
  5433. c.quartInOut = c.getPowInOut(4);
  5434. c.quintIn = c.getPowIn(5);
  5435. c.quintOut = c.getPowOut(5);
  5436. c.quintInOut = c.getPowInOut(5);
  5437. c.backIn = c.getBackIn(1.7);
  5438. c.backOut = c.getBackOut(1.7);
  5439. c.backInOut = c.getBackInOut(1.7);
  5440. c.elasticIn = c.getElasticIn(1, 0.3);
  5441. c.elasticOut = c.getElasticOut(1, 0.3);
  5442. c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
  5443. return c
  5444. }();
  5445. b.Ease = c;
  5446. c.prototype.__class__ = "egret.Ease"
  5447. })(egret || (egret = {}));
  5448. (function(b) {
  5449. var c = function() {
  5450. function b() {
  5451. this.type = b.EFFECT
  5452. }
  5453. b.prototype.play = function(a) {
  5454. void 0 === a && (a = !1);
  5455. var d = this.audio;
  5456. d && (isNaN(d.duration) || (d.currentTime = 0), d.loop = a, d.play())
  5457. };
  5458. b.prototype.pause = function() {
  5459. var a = this.audio;
  5460. a && a.pause()
  5461. };
  5462. b.prototype.load = function() {
  5463. var a = this.audio;
  5464. a && a.load()
  5465. };
  5466. b.prototype.addEventListener = function(a, d) {
  5467. this.audio && this.audio.addEventListener(a, d, !1)
  5468. };
  5469. b.prototype.removeEventListener = function(a, d) {
  5470. this.audio && this.audio.removeEventListener(a, d, !1)
  5471. };
  5472. b.prototype.setVolume =
  5473. function(a) {
  5474. var d = this.audio;
  5475. d && (d.volume = a)
  5476. };
  5477. b.prototype.getVolume = function() {
  5478. return this.audio ? this.audio.volume : 0
  5479. };
  5480. b.prototype.preload = function(a) {
  5481. this.type = a
  5482. };
  5483. b.prototype._setAudio = function(a) {
  5484. this.audio = a
  5485. };
  5486. b.MUSIC = "music";
  5487. b.EFFECT = "effect";
  5488. return b
  5489. }();
  5490. b.Sound = c;
  5491. c.prototype.__class__ = "egret.Sound"
  5492. })(egret || (egret = {}));
  5493. (function(b) {
  5494. var c = function() {
  5495. function b() {}
  5496. b.isNumber = function(a) {
  5497. return "number" === typeof a && !isNaN(a)
  5498. };
  5499. b.sin = function(a) {
  5500. a = Math.round(a);
  5501. a %= 360;
  5502. 0 > a && (a += 360);
  5503. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  5504. };
  5505. b.cos = function(a) {
  5506. a = Math.round(a);
  5507. a %= 360;
  5508. 0 > a && (a += 360);
  5509. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  5510. };
  5511. return b
  5512. }();
  5513. b.NumberUtils = c;
  5514. c.prototype.__class__ = "egret.NumberUtils"
  5515. })(egret ||
  5516. (egret = {}));
  5517. for (var egret_sin_map = {}, egret_cos_map = {}, i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD), egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  5518. Function.prototype.bind || (Function.prototype.bind = function(b) {
  5519. if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5520. var c = Array.prototype.slice.call(arguments, 1),
  5521. e = this,
  5522. a = function() {},
  5523. d = function() {
  5524. return e.apply(this instanceof a && b ? this : b, c.concat(Array.prototype.slice.call(arguments)))
  5525. };
  5526. a.prototype = this.prototype;
  5527. d.prototype = new a;
  5528. return d
  5529. });
  5530. var __extends = this.__extends || function(b, c) {
  5531. function e() {
  5532. this.constructor = b
  5533. }
  5534. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5535. e.prototype = c.prototype;
  5536. b.prototype = new e
  5537. },
  5538. RES;
  5539. (function(b) {
  5540. var c = function(b) {
  5541. function a(a, c, g) {
  5542. void 0 === c && (c = !1);
  5543. void 0 === g && (g = !1);
  5544. b.call(this, a, c, g);
  5545. this.itemsTotal = this.itemsLoaded = 0
  5546. }
  5547. __extends(a, b);
  5548. a.dispatchResourceEvent = function(d, b, c, e, k, f) {
  5549. void 0 === c && (c = "");
  5550. void 0 === e && (e = null);
  5551. void 0 === k && (k = 0);
  5552. void 0 === f && (f = 0);
  5553. var l = egret.Event._getPropertyData(a);
  5554. l.groupName = c;
  5555. l.resItem = e;
  5556. l.itemsLoaded = k;
  5557. l.itemsTotal = f;
  5558. egret.Event._dispatchByTarget(a, d, b, l)
  5559. };
  5560. a.ITEM_LOAD_ERROR = "itemLoadError";
  5561. a.CONFIG_COMPLETE = "configComplete";
  5562. a.CONFIG_LOAD_ERROR =
  5563. "configLoadError";
  5564. a.GROUP_PROGRESS = "groupProgress";
  5565. a.GROUP_COMPLETE = "groupComplete";
  5566. a.GROUP_LOAD_ERROR = "groupLoadError";
  5567. return a
  5568. }(egret.Event);
  5569. b.ResourceEvent = c;
  5570. c.prototype.__class__ = "RES.ResourceEvent"
  5571. })(RES || (RES = {}));
  5572. (function(b) {
  5573. var c = function() {
  5574. function b(a, d, c) {
  5575. this._loaded = !1;
  5576. this.name = a;
  5577. this.url = d;
  5578. this.type = c
  5579. }
  5580. Object.defineProperty(b.prototype, "loaded", {
  5581. get: function() {
  5582. return this.data ? this.data.loaded : this._loaded
  5583. },
  5584. set: function(a) {
  5585. this.data && (this.data.loaded = a);
  5586. this._loaded = a
  5587. },
  5588. enumerable: !0,
  5589. configurable: !0
  5590. });
  5591. b.prototype.toString = function() {
  5592. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5593. };
  5594. b.TYPE_XML = "xml";
  5595. b.TYPE_IMAGE = "image";
  5596. b.TYPE_BIN = "bin";
  5597. b.TYPE_TEXT = "text";
  5598. b.TYPE_JSON =
  5599. "json";
  5600. b.TYPE_SHEET = "sheet";
  5601. b.TYPE_FONT = "font";
  5602. b.TYPE_SOUND = "sound";
  5603. return b
  5604. }();
  5605. b.ResourceItem = c;
  5606. c.prototype.__class__ = "RES.ResourceItem"
  5607. })(RES || (RES = {}));
  5608. (function(b) {
  5609. var c = function() {
  5610. function c() {
  5611. this.keyMap = {};
  5612. this.groupDic = {};
  5613. b.configInstance = this
  5614. }
  5615. c.prototype.getGroupByName = function(a) {
  5616. var d = [];
  5617. if (!this.groupDic[a]) return d;
  5618. a = this.groupDic[a];
  5619. for (var b = a.length, c = 0; c < b; c++) d.push(this.parseResourceItem(a[c]));
  5620. return d
  5621. };
  5622. c.prototype.getRawGroupByName = function(a) {
  5623. return this.groupDic[a] ? this.groupDic[a] : []
  5624. };
  5625. c.prototype.createGroup = function(a, d, b) {
  5626. void 0 === b && (b = !1);
  5627. if (!b && this.groupDic[a] || !d || 0 == d.length) return !1;
  5628. b = this.groupDic;
  5629. for (var c = [], e = d.length,
  5630. k = 0; k < e; k++) {
  5631. var f = d[k],
  5632. l = b[f];
  5633. if (l)
  5634. for (var f = l.length, n = 0; n < f; n++) {
  5635. var p = l[n]; - 1 == c.indexOf(p) && c.push(p)
  5636. } else(p = this.keyMap[f]) && -1 == c.indexOf(p) && c.push(p)
  5637. }
  5638. if (0 == c.length) return !1;
  5639. this.groupDic[a] = c;
  5640. return !0
  5641. };
  5642. c.prototype.parseConfig = function(a, d) {
  5643. if (a) {
  5644. var b = a.resources;
  5645. if (b)
  5646. for (var c = b.length, e = 0; e < c; e++) {
  5647. var k = b[e],
  5648. f = k.url;
  5649. f && -1 == f.indexOf("://") && (k.url = d + f);
  5650. this.addItemToKeyMap(k)
  5651. }
  5652. if (b = a.groups)
  5653. for (c = b.length, e = 0; e < c; e++) {
  5654. for (var f = b[e], l = [], n = f.keys.split(","), p = n.length, q = 0; q < p; q++) k = n[q].trim(), (k = this.keyMap[k]) && -1 == l.indexOf(k) && l.push(k);
  5655. this.groupDic[f.name] = l
  5656. }
  5657. }
  5658. };
  5659. c.prototype.addSubkey = function(a, d) {
  5660. var b = this.keyMap[d];
  5661. b && !this.keyMap[a] && (this.keyMap[a] = b)
  5662. };
  5663. c.prototype.addItemToKeyMap = function(a) {
  5664. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  5665. if (a.hasOwnProperty("subkeys")) {
  5666. var d = a.subkeys.split(",");
  5667. a.subkeys = d;
  5668. for (var b = d.length, c = 0; c < b; c++) {
  5669. var e = d[c];
  5670. null == this.keyMap[e] && (this.keyMap[e] = a)
  5671. }
  5672. }
  5673. };
  5674. c.prototype.getName = function(a) {
  5675. return (a = this.keyMap[a]) ? a.name : ""
  5676. };
  5677. c.prototype.getType =
  5678. function(a) {
  5679. return (a = this.keyMap[a]) ? a.type : ""
  5680. };
  5681. c.prototype.getRawResourceItem = function(a) {
  5682. return this.keyMap[a]
  5683. };
  5684. c.prototype.getResourceItem = function(a) {
  5685. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  5686. };
  5687. c.prototype.parseResourceItem = function(a) {
  5688. var d = new b.ResourceItem(a.name, a.url, a.type);
  5689. d.data = a;
  5690. return d
  5691. };
  5692. return c
  5693. }();
  5694. b.ResourceConfig = c;
  5695. c.prototype.__class__ = "RES.ResourceConfig"
  5696. })(RES || (RES = {}));
  5697. __extends = this.__extends || function(b, c) {
  5698. function e() {
  5699. this.constructor = b
  5700. }
  5701. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5702. e.prototype = c.prototype;
  5703. b.prototype = new e
  5704. };
  5705. (function(b) {
  5706. var c = function(c) {
  5707. function a() {
  5708. c.call(this);
  5709. this.thread = 2;
  5710. this.loadingCount = 0;
  5711. this.groupTotalDic = {};
  5712. this.numLoadedDic = {};
  5713. this.itemListDic = {};
  5714. this.groupErrorDic = {};
  5715. this.retryTimesDic = {};
  5716. this.maxRetryTimes = 3;
  5717. this.failedList = [];
  5718. this.priorityQueue = {};
  5719. this.lazyLoadList = [];
  5720. this.analyzerDic = {};
  5721. this.queueIndex = 0
  5722. }
  5723. __extends(a, c);
  5724. a.prototype.isGroupInLoading = function(a) {
  5725. return void 0 !== this.itemListDic[a]
  5726. };
  5727. a.prototype.loadGroup = function(a, c, e) {
  5728. void 0 === e && (e = 0);
  5729. if (!this.itemListDic[c] && c)
  5730. if (a &&
  5731. 0 != a.length) {
  5732. this.priorityQueue[e] ? this.priorityQueue[e].push(c) : this.priorityQueue[e] = [c];
  5733. this.itemListDic[c] = a;
  5734. e = a.length;
  5735. for (var m = 0; m < e; m++) a[m].groupName = c;
  5736. this.groupTotalDic[c] = a.length;
  5737. this.numLoadedDic[c] = 0;
  5738. this.next()
  5739. } else egret.Logger.warning('RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4\uff1a"' + c + '"'), a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR), a.groupName = c, this.dispatchEvent(a)
  5740. };
  5741. a.prototype.loadItem = function(a) {
  5742. this.lazyLoadList.push(a);
  5743. a.groupName =
  5744. "";
  5745. this.next()
  5746. };
  5747. a.prototype.next = function() {
  5748. for (; this.loadingCount < this.thread;) {
  5749. var a = this.getOneResourceItem();
  5750. if (!a) break;
  5751. this.loadingCount++;
  5752. if (a.loaded) this.onItemComplete(a);
  5753. else {
  5754. var c = this.analyzerDic[a.type];
  5755. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  5756. c.loadFile(a, this.onItemComplete, this)
  5757. }
  5758. }
  5759. };
  5760. a.prototype.getOneResourceItem = function() {
  5761. if (0 < this.failedList.length) return this.failedList.shift();
  5762. var a = Number.NEGATIVE_INFINITY,
  5763. b;
  5764. for (b in this.priorityQueue) a =
  5765. Math.max(a, b);
  5766. a = this.priorityQueue[a];
  5767. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  5768. b = a.length;
  5769. for (var c, e = 0; e < b; e++) {
  5770. this.queueIndex >= b && (this.queueIndex = 0);
  5771. c = this.itemListDic[a[this.queueIndex]];
  5772. if (0 < c.length) break;
  5773. this.queueIndex++
  5774. }
  5775. return 0 == c.length ? null : c.shift()
  5776. };
  5777. a.prototype.onItemComplete = function(a) {
  5778. this.loadingCount--;
  5779. var c = a.groupName;
  5780. if (!a.loaded) {
  5781. var e = this.retryTimesDic[a.name] || 1;
  5782. if (e > this.maxRetryTimes) delete this.retryTimesDic[a.name], b.ResourceEvent.dispatchResourceEvent(this.resInstance,
  5783. b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  5784. else {
  5785. this.retryTimesDic[a.name] = e + 1;
  5786. this.failedList.push(a);
  5787. this.next();
  5788. return
  5789. }
  5790. }
  5791. if (c) {
  5792. this.numLoadedDic[c] ++;
  5793. var e = this.numLoadedDic[c],
  5794. m = this.groupTotalDic[c];
  5795. a.loaded || (this.groupErrorDic[c] = !0);
  5796. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, e, m);
  5797. e == m && (a = this.groupErrorDic[c], this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], delete this.groupErrorDic[c], a ? b.ResourceEvent.dispatchResourceEvent(this,
  5798. b.ResourceEvent.GROUP_LOAD_ERROR, c) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, c))
  5799. } else this.callBack.call(this.resInstance, a);
  5800. this.next()
  5801. };
  5802. a.prototype.removeGroupName = function(a) {
  5803. for (var b in this.priorityQueue) {
  5804. for (var c = this.priorityQueue[b], e = c.length, k = 0, f = !1, e = c.length, l = 0; l < e; l++) {
  5805. if (c[l] == a) {
  5806. c.splice(k, 1);
  5807. f = !0;
  5808. break
  5809. }
  5810. k++
  5811. }
  5812. if (f) {
  5813. 0 == c.length && delete this.priorityQueue[b];
  5814. break
  5815. }
  5816. }
  5817. };
  5818. return a
  5819. }(egret.EventDispatcher);
  5820. b.ResourceLoader = c;
  5821. c.prototype.__class__ = "RES.ResourceLoader"
  5822. })(RES ||
  5823. (RES = {}));
  5824. __extends = this.__extends || function(b, c) {
  5825. function e() {
  5826. this.constructor = b
  5827. }
  5828. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5829. e.prototype = c.prototype;
  5830. b.prototype = new e
  5831. };
  5832. (function(b) {
  5833. var c = function(c) {
  5834. function a() {
  5835. c.call(this);
  5836. this.resourceConfig = b.configInstance
  5837. }
  5838. __extends(a, c);
  5839. a.prototype.addSubkey = function(a, b) {
  5840. this.resourceConfig.addSubkey(a, b)
  5841. };
  5842. a.prototype.loadFile = function(a, b, c) {};
  5843. a.prototype.getRes = function(a) {};
  5844. a.prototype.destroyRes = function(a) {
  5845. return !1
  5846. };
  5847. a.getStringPrefix = function(a) {
  5848. if (!a) return "";
  5849. var b = a.indexOf(".");
  5850. return -1 != b ? a.substring(0, b) : ""
  5851. };
  5852. a.getStringTail = function(a) {
  5853. if (!a) return "";
  5854. var b = a.indexOf(".");
  5855. return -1 != b ? a.substring(b + 1) : ""
  5856. };
  5857. return a
  5858. }(egret.HashObject);
  5859. b.AnalyzerBase = c;
  5860. c.prototype.__class__ = "RES.AnalyzerBase"
  5861. })(RES || (RES = {}));
  5862. __extends = this.__extends || function(b, c) {
  5863. function e() {
  5864. this.constructor = b
  5865. }
  5866. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5867. e.prototype = c.prototype;
  5868. b.prototype = new e
  5869. };
  5870. (function(b) {
  5871. var c = function(b) {
  5872. function a() {
  5873. b.call(this);
  5874. this.fileDic = {};
  5875. this.resItemDic = [];
  5876. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  5877. this.recycler = new egret.Recycler
  5878. }
  5879. __extends(a, b);
  5880. a.prototype.loadFile = function(a, b, c) {
  5881. if (this.fileDic[a.name]) b.call(c, a);
  5882. else {
  5883. var e = this.getLoader();
  5884. this.resItemDic[e.hashCode] = {
  5885. item: a,
  5886. func: b,
  5887. thisObject: c
  5888. };
  5889. e.load(new egret.URLRequest(a.url))
  5890. }
  5891. };
  5892. a.prototype.getLoader = function() {
  5893. var a = this.recycler.pop();
  5894. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  5895. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  5896. a.dataFormat = this._dataFormat;
  5897. return a
  5898. };
  5899. a.prototype.onLoadFinish = function(a) {
  5900. var b = a.target,
  5901. c = this.resItemDic[b.hashCode];
  5902. delete this.resItemDic[b.hashCode];
  5903. this.recycler.push(b);
  5904. var e = c.item,
  5905. k = c.func;
  5906. e.loaded = a.type == egret.Event.COMPLETE;
  5907. e.loaded && this.analyzeData(e, b.data);
  5908. k.call(c.thisObject, e)
  5909. };
  5910. a.prototype.analyzeData = function(a, b) {
  5911. var c = a.name;
  5912. !this.fileDic[c] && b && (this.fileDic[c] = b)
  5913. };
  5914. a.prototype.getRes =
  5915. function(a) {
  5916. return this.fileDic[a]
  5917. };
  5918. a.prototype.hasRes = function(a) {
  5919. return null != this.getRes(a)
  5920. };
  5921. a.prototype.destroyRes = function(a) {
  5922. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  5923. };
  5924. return a
  5925. }(b.AnalyzerBase);
  5926. b.BinAnalyzer = c;
  5927. c.prototype.__class__ = "RES.BinAnalyzer"
  5928. })(RES || (RES = {}));
  5929. __extends = this.__extends || function(b, c) {
  5930. function e() {
  5931. this.constructor = b
  5932. }
  5933. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5934. e.prototype = c.prototype;
  5935. b.prototype = new e
  5936. };
  5937. (function(b) {
  5938. var c = function(b) {
  5939. function a() {
  5940. b.call(this);
  5941. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  5942. }
  5943. __extends(a, b);
  5944. a.prototype.analyzeData = function(a, b) {
  5945. var c = a.name;
  5946. !this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  5947. };
  5948. return a
  5949. }(b.BinAnalyzer);
  5950. b.ImageAnalyzer = c;
  5951. c.prototype.__class__ = "RES.ImageAnalyzer"
  5952. })(RES || (RES = {}));
  5953. __extends = this.__extends || function(b, c) {
  5954. function e() {
  5955. this.constructor = b
  5956. }
  5957. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5958. e.prototype = c.prototype;
  5959. b.prototype = new e
  5960. };
  5961. (function(b) {
  5962. var c = function(b) {
  5963. function a() {
  5964. b.call(this);
  5965. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5966. }
  5967. __extends(a, b);
  5968. a.prototype.analyzeData = function(a, b) {
  5969. var c = a.name;
  5970. if (!this.fileDic[c] && b) try {
  5971. this.fileDic[c] = JSON.parse(b)
  5972. } catch (e) {
  5973. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + "\ndata:" + b)
  5974. }
  5975. };
  5976. return a
  5977. }(b.BinAnalyzer);
  5978. b.JsonAnalyzer = c;
  5979. c.prototype.__class__ = "RES.JsonAnalyzer"
  5980. })(RES || (RES = {}));
  5981. __extends = this.__extends || function(b, c) {
  5982. function e() {
  5983. this.constructor = b
  5984. }
  5985. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5986. e.prototype = c.prototype;
  5987. b.prototype = new e
  5988. };
  5989. (function(b) {
  5990. var c = function(b) {
  5991. function a() {
  5992. b.call(this);
  5993. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5994. }
  5995. __extends(a, b);
  5996. return a
  5997. }(b.BinAnalyzer);
  5998. b.TextAnalyzer = c;
  5999. c.prototype.__class__ = "RES.TextAnalyzer"
  6000. })(RES || (RES = {}));
  6001. __extends = this.__extends || function(b, c) {
  6002. function e() {
  6003. this.constructor = b
  6004. }
  6005. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6006. e.prototype = c.prototype;
  6007. b.prototype = new e
  6008. };
  6009. (function(b) {
  6010. var c = function(c) {
  6011. function a() {
  6012. c.call(this);
  6013. this.sheetMap = {};
  6014. this.textureMap = {};
  6015. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6016. }
  6017. __extends(a, c);
  6018. a.prototype.getRes = function(a) {
  6019. var c = this.fileDic[a];
  6020. c || (c = this.textureMap[a]);
  6021. !c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  6022. return c
  6023. };
  6024. a.prototype.onLoadFinish = function(a) {
  6025. var b = a.target,
  6026. c = this.resItemDic[b.hashCode];
  6027. delete this.resItemDic[b.hashCode];
  6028. this.recycler.push(b);
  6029. var e =
  6030. c.item,
  6031. k = c.func;
  6032. e.loaded = a.type == egret.Event.COMPLETE;
  6033. e.loaded && this.analyzeData(e, b.data);
  6034. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, k, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : k.call(c.thisObject, e)
  6035. };
  6036. a.prototype.analyzeData = function(a, b) {
  6037. var c = a.name;
  6038. if (!this.fileDic[c] && b) {
  6039. var e;
  6040. if ("string" == typeof b) {
  6041. try {
  6042. e = JSON.parse(b)
  6043. } catch (k) {
  6044. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  6045. }
  6046. e && (this.sheetMap[c] =
  6047. e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  6048. } else e = this.sheetMap[c], delete this.sheetMap[c], b && (e = this.parseSpriteSheet(b, e, a.data && a.data.subkeys ? "" : c), this.fileDic[c] = e)
  6049. }
  6050. };
  6051. a.prototype.getRelativePath = function(a, b) {
  6052. a = a.split("\\").join("/");
  6053. var c = a.lastIndexOf("/");
  6054. return a = -1 != c ? a.substring(0, c + 1) + b : b
  6055. };
  6056. a.prototype.parseSpriteSheet = function(a, b, c) {
  6057. b = b.frames;
  6058. if (!b) return null;
  6059. var e = new egret.SpriteSheet(a),
  6060. k = this.textureMap,
  6061. f;
  6062. for (f in b) {
  6063. var l = b[f];
  6064. a = e.createTexture(f, l.x, l.y, l.w, l.h,
  6065. l.offX, l.offY, l.sourceW, l.sourceH);
  6066. l.scale9grid && (l = l.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(l[0]), parseInt(l[1]), parseInt(l[2]), parseInt(l[3])));
  6067. null == k[f] && (k[f] = a, c && this.addSubkey(f, c))
  6068. }
  6069. return e
  6070. };
  6071. return a
  6072. }(b.BinAnalyzer);
  6073. b.SheetAnalyzer = c;
  6074. c.prototype.__class__ = "RES.SheetAnalyzer"
  6075. })(RES || (RES = {}));
  6076. __extends = this.__extends || function(b, c) {
  6077. function e() {
  6078. this.constructor = b
  6079. }
  6080. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6081. e.prototype = c.prototype;
  6082. b.prototype = new e
  6083. };
  6084. (function(b) {
  6085. var c = function(b) {
  6086. function a() {
  6087. b.call(this)
  6088. }
  6089. __extends(a, b);
  6090. a.prototype.analyzeData = function(a, b) {
  6091. var c = a.name;
  6092. if (!this.fileDic[c] && b) {
  6093. var e;
  6094. "string" == typeof b ? (e = b, this.sheetMap[c] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[c], delete this.sheetMap[c], b && (e = new egret.BitmapTextSpriteSheet(b, e), this.fileDic[c] = e))
  6095. }
  6096. };
  6097. a.prototype.getTexturePath = function(a, b) {
  6098. var c = "",
  6099. e = b.split("\n")[2],
  6100. k = e.indexOf('file="'); - 1 != k && (e = e.substring(k + 6), k = e.indexOf('"'), c = e.substring(0,
  6101. k));
  6102. a = a.split("\\").join("/");
  6103. k = a.lastIndexOf("/");
  6104. return a = -1 != k ? a.substring(0, k + 1) + c : c
  6105. };
  6106. return a
  6107. }(b.SheetAnalyzer);
  6108. b.FontAnalyzer = c;
  6109. c.prototype.__class__ = "RES.FontAnalyzer"
  6110. })(RES || (RES = {}));
  6111. __extends = this.__extends || function(b, c) {
  6112. function e() {
  6113. this.constructor = b
  6114. }
  6115. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6116. e.prototype = c.prototype;
  6117. b.prototype = new e
  6118. };
  6119. (function(b) {
  6120. var c = function(b) {
  6121. function a() {
  6122. b.call(this);
  6123. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  6124. }
  6125. __extends(a, b);
  6126. a.prototype.analyzeData = function(a, b) {
  6127. var c = a.name;
  6128. !this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.soundType ? b.preload(c.soundType) : b.preload(egret.Sound.EFFECT))
  6129. };
  6130. return a
  6131. }(b.BinAnalyzer);
  6132. b.SoundAnalyzer = c;
  6133. c.prototype.__class__ = "RES.SoundAnalyzer"
  6134. })(RES || (RES = {}));
  6135. __extends = this.__extends || function(b, c) {
  6136. function e() {
  6137. this.constructor = b
  6138. }
  6139. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6140. e.prototype = c.prototype;
  6141. b.prototype = new e
  6142. };
  6143. (function(b) {
  6144. var c = function(b) {
  6145. function a() {
  6146. b.call(this);
  6147. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6148. }
  6149. __extends(a, b);
  6150. a.prototype.analyzeData = function(a, b) {
  6151. var c = a.name;
  6152. if (!this.fileDic[c] && b) try {
  6153. var e = egret.XML.parse(b);
  6154. this.fileDic[c] = e
  6155. } catch (k) {}
  6156. };
  6157. return a
  6158. }(b.BinAnalyzer);
  6159. b.XMLAnalyzer = c;
  6160. c.prototype.__class__ = "RES.XMLAnalyzer"
  6161. })(RES || (RES = {}));
  6162. __extends = this.__extends || function(b, c) {
  6163. function e() {
  6164. this.constructor = b
  6165. }
  6166. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6167. e.prototype = c.prototype;
  6168. b.prototype = new e
  6169. };
  6170. (function(b) {
  6171. b.loadConfig = function(a, b, c) {
  6172. void 0 === b && (b = "");
  6173. void 0 === c && (c = "json");
  6174. e.loadConfig(a, b, c)
  6175. };
  6176. b.loadGroup = function(a, b) {
  6177. void 0 === b && (b = 0);
  6178. e.loadGroup(a, b)
  6179. };
  6180. b.isGroupLoaded = function(a) {
  6181. return e.isGroupLoaded(a)
  6182. };
  6183. b.getGroupByName = function(a) {
  6184. return e.getGroupByName(a)
  6185. };
  6186. b.createGroup = function(a, b, c) {
  6187. void 0 === c && (c = !1);
  6188. return e.createGroup(a, b, c)
  6189. };
  6190. b.hasRes = function(a) {
  6191. return e.hasRes(a)
  6192. };
  6193. b.getRes = function(a) {
  6194. return e.getRes(a)
  6195. };
  6196. b.getResAsync = function(a, b, c) {
  6197. e.getResAsync(a, b, c)
  6198. };
  6199. b.getResByUrl =
  6200. function(a, b, c, g) {
  6201. void 0 === g && (g = "");
  6202. e.getResByUrl(a, b, c, g)
  6203. };
  6204. b.destroyRes = function(a) {
  6205. return e.destroyRes(a)
  6206. };
  6207. b.setMaxLoadingThread = function(a) {
  6208. e.setMaxLoadingThread(a)
  6209. };
  6210. b.addEventListener = function(a, b, c, g, m) {
  6211. void 0 === g && (g = !1);
  6212. void 0 === m && (m = 0);
  6213. e.addEventListener(a, b, c, g, m)
  6214. };
  6215. b.removeEventListener = function(a, b, c, g) {
  6216. void 0 === g && (g = !1);
  6217. e.removeEventListener(a, b, c, g)
  6218. };
  6219. var c = function(a) {
  6220. function d() {
  6221. a.call(this);
  6222. this.analyzerDic = {};
  6223. this.configItemList = [];
  6224. this.configComplete = this.callLaterFlag = !1;
  6225. this.loadedGroups =
  6226. [];
  6227. this.groupNameList = [];
  6228. this.asyncDic = {};
  6229. this.init()
  6230. }
  6231. __extends(d, a);
  6232. d.prototype.getAnalyzerByType = function(a) {
  6233. var d = this.analyzerDic[a];
  6234. d || (d = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  6235. return d
  6236. };
  6237. d.prototype.init = function() {
  6238. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  6239. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer,
  6240. b.ResourceItem.TYPE_IMAGE);
  6241. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  6242. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  6243. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  6244. egret.Injector.hasMapRule(b.AnalyzerBase,
  6245. b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  6246. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  6247. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  6248. this.resConfig = new b.ResourceConfig;
  6249. this.resLoader = new b.ResourceLoader;
  6250. this.resLoader.callBack = this.onResourceItemComp;
  6251. this.resLoader.resInstance = this;
  6252. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  6253. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  6254. };
  6255. d.prototype.loadConfig = function(a, b, d) {
  6256. void 0 === d && (d = "json");
  6257. this.configItemList.push({
  6258. url: a,
  6259. resourceRoot: b,
  6260. type: d
  6261. });
  6262. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6263. };
  6264. d.prototype.startLoadConfig = function() {
  6265. this.callLaterFlag = !1;
  6266. var a = this.configItemList;
  6267. this.configItemList = [];
  6268. this.loadingConfigList = a;
  6269. for (var c = a.length, e = [], k = 0; k < c; k++) {
  6270. var f = a[k],
  6271. f = new b.ResourceItem(f.url, f.url, f.type);
  6272. e.push(f)
  6273. }
  6274. this.resLoader.loadGroup(e, d.GROUP_CONFIG, Number.MAX_VALUE)
  6275. };
  6276. d.prototype.isGroupLoaded = function(a) {
  6277. return -1 != this.loadedGroups.indexOf(a)
  6278. };
  6279. d.prototype.getGroupByName = function(a) {
  6280. return this.resConfig.getGroupByName(a)
  6281. };
  6282. d.prototype.loadGroup = function(a, d) {
  6283. void 0 === d && (d = 0);
  6284. if (-1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE,
  6285. a);
  6286. else if (!this.resLoader.isGroupInLoading(a))
  6287. if (this.configComplete) {
  6288. var c = this.resConfig.getGroupByName(a);
  6289. this.resLoader.loadGroup(c, a, d)
  6290. } else this.groupNameList.push({
  6291. name: a,
  6292. priority: d
  6293. })
  6294. };
  6295. d.prototype.createGroup = function(a, b, d) {
  6296. void 0 === d && (d = !1);
  6297. if (d) {
  6298. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1)
  6299. }
  6300. return this.resConfig.createGroup(a, b, d)
  6301. };
  6302. d.prototype.onGroupComp = function(a) {
  6303. if (a.groupName == d.GROUP_CONFIG) {
  6304. a = this.loadingConfigList.length;
  6305. for (var c = 0; c < a; c++) {
  6306. var e = this.loadingConfigList[c],
  6307. k = this.getAnalyzerByType(e.type),
  6308. f = k.getRes(e.url);
  6309. k.destroyRes(e.url);
  6310. this.resConfig.parseConfig(f, e.resourceRoot)
  6311. }
  6312. this.configComplete = !0;
  6313. this.loadingConfigList = null;
  6314. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  6315. e = this.groupNameList;
  6316. a = e.length;
  6317. for (c = 0; c < a; c++) k = e[c], this.loadGroup(k.name, k.priority);
  6318. this.groupNameList = []
  6319. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  6320. };
  6321. d.prototype.onGroupError = function(a) {
  6322. a.groupName == d.GROUP_CONFIG ? (this.loadingConfigList =
  6323. null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  6324. };
  6325. d.prototype.hasRes = function(a) {
  6326. var d = this.resConfig.getType(a);
  6327. return "" == d && (a = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(a), "" == d) ? !1 : !0
  6328. };
  6329. d.prototype.getRes = function(a) {
  6330. var d = this.resConfig.getType(a);
  6331. return "" == d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(d), "" == d) ? null : this.getAnalyzerByType(d).getRes(a)
  6332. };
  6333. d.prototype.getResAsync = function(a, d, c) {
  6334. var e = this.resConfig.getType(a),
  6335. f = this.resConfig.getName(a);
  6336. if ("" == e && (f = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(f), "" == e)) {
  6337. d.call(c, null);
  6338. return
  6339. }(e = this.getAnalyzerByType(e).getRes(a)) ? d.call(c, e): (a = {
  6340. key: a,
  6341. compFunc: d,
  6342. thisObject: c
  6343. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6344. };
  6345. d.prototype.getResByUrl = function(a, d, c, e) {
  6346. void 0 === e && (e = "");
  6347. if (a) {
  6348. e || (e = this.getTypeByUrl(a));
  6349. var f = this.getAnalyzerByType(e).getRes(a);
  6350. f ? d.call(c, f) :
  6351. (d = {
  6352. key: a,
  6353. compFunc: d,
  6354. thisObject: c
  6355. }, this.asyncDic[a] ? this.asyncDic[a].push(d) : (this.asyncDic[a] = [d], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  6356. } else d.call(c, null)
  6357. };
  6358. d.prototype.getTypeByUrl = function(a) {
  6359. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6360. switch (a) {
  6361. case b.ResourceItem.TYPE_XML:
  6362. case b.ResourceItem.TYPE_JSON:
  6363. case b.ResourceItem.TYPE_SHEET:
  6364. break;
  6365. case "png":
  6366. case "jpg":
  6367. case "gif":
  6368. a = b.ResourceItem.TYPE_IMAGE;
  6369. break;
  6370. case "fnt":
  6371. a = b.ResourceItem.TYPE_FONT;
  6372. break;
  6373. case "txt":
  6374. a = b.ResourceItem.TYPE_TEXT;
  6375. break;
  6376. case "mp3":
  6377. case "ogg":
  6378. case "mpeg":
  6379. case "wav":
  6380. case "m4a":
  6381. case "mp4":
  6382. case "aiff":
  6383. case "wma":
  6384. case "mid":
  6385. a = b.ResourceItem.TYPE_SOUND;
  6386. break;
  6387. default:
  6388. a = b.ResourceItem.TYPE_BIN
  6389. }
  6390. return a
  6391. };
  6392. d.prototype.onResourceItemComp = function(a) {
  6393. var b = this.asyncDic[a.name];
  6394. delete this.asyncDic[a.name];
  6395. a = this.getAnalyzerByType(a.type);
  6396. for (var d = b.length, c = 0; c < d; c++) {
  6397. var e = b[c],
  6398. l = a.getRes(e.key);
  6399. e.compFunc.call(e.thisObject, l, e.key)
  6400. }
  6401. };
  6402. d.prototype.destroyRes = function(a) {
  6403. var b = this.resConfig.getRawGroupByName(a);
  6404. if (b) {
  6405. var d =
  6406. this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  6407. a = b.length;
  6408. for (var c = 0; c < a; c++) {
  6409. d = b[c];
  6410. d.loaded = !1;
  6411. var e = this.getAnalyzerByType(d.type);
  6412. e.destroyRes(d.name)
  6413. }
  6414. return !0
  6415. }
  6416. b = this.resConfig.getType(a);
  6417. if ("" == b) return !1;
  6418. d = this.resConfig.getRawResourceItem(a);
  6419. d.loaded = !1;
  6420. e = this.getAnalyzerByType(b);
  6421. return e.destroyRes(a)
  6422. };
  6423. d.prototype.setMaxLoadingThread = function(a) {
  6424. 1 > a && (a = 1);
  6425. this.resLoader.thread = a
  6426. };
  6427. d.GROUP_CONFIG = "RES__CONFIG";
  6428. return d
  6429. }(egret.EventDispatcher);
  6430. c.prototype.__class__ = "RES.Resource";
  6431. var e = new c
  6432. })(RES || (RES = {}));
  6433. __extends = this.__extends || function(b, c) {
  6434. function e() {
  6435. this.constructor = b
  6436. }
  6437. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6438. e.prototype = c.prototype;
  6439. b.prototype = new e
  6440. };
  6441. (function(b) {
  6442. var c = function(c) {
  6443. function a(b) {
  6444. void 0 === b && (b = 60);
  6445. c.call(this);
  6446. this.frameRate = b;
  6447. this._time = 0;
  6448. this._isActivate = !0;
  6449. 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 ||
  6450. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6451. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6452. return window.setTimeout(a, 1E3 / b)
  6453. });
  6454. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6455. return window.clearTimeout(a)
  6456. });
  6457. a.instance = this;
  6458. this.registerListener()
  6459. }
  6460. __extends(a, c);
  6461. a.prototype.enterFrame = function() {
  6462. var d = a.instance,
  6463. c = a._thisObject,
  6464. e = a._callback,
  6465. m = b.getTimer(),
  6466. k = m -
  6467. d._time;
  6468. d._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6469. e.call(c, k);
  6470. d._time = m
  6471. };
  6472. a.prototype.executeMainLoop = function(b, c) {
  6473. a._callback = b;
  6474. a._thisObject = c;
  6475. this.enterFrame()
  6476. };
  6477. a.prototype.reset = function() {
  6478. var d = a.instance;
  6479. d._requestAnimationId && (d._time = b.getTimer(), a.cancelAnimationFrame.call(window, d._requestAnimationId), d.enterFrame())
  6480. };
  6481. a.prototype.registerListener = function() {
  6482. var d = this,
  6483. c = function() {
  6484. d._isActivate && (d._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6485. },
  6486. e = function() {
  6487. d._isActivate || (d._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6488. },
  6489. m = function() {
  6490. document[k] ? c() : e()
  6491. };
  6492. window.addEventListener("focus", e, !1);
  6493. window.addEventListener("blur", c, !1);
  6494. var k, f;
  6495. "undefined" !== typeof document.hidden ? (k = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (k = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (k = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ?
  6496. (k = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (k = "oHidden", f = "ovisibilitychange");
  6497. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", c, !1));
  6498. k && f && document.addEventListener(f, m, !1)
  6499. };
  6500. return a
  6501. }(b.DeviceContext);
  6502. b.HTML5DeviceContext = c;
  6503. c.prototype.__class__ = "egret.HTML5DeviceContext"
  6504. })(egret || (egret = {}));
  6505. var egret_html5_localStorage;
  6506. (function(b) {
  6507. b.getItem = function(b) {
  6508. return window.localStorage.getItem(b)
  6509. };
  6510. b.setItem = function(b, e) {
  6511. try {
  6512. return window.localStorage.setItem(b, e), !0
  6513. } catch (a) {
  6514. return console.log("egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key=" + b + "&value=" + e), !1
  6515. }
  6516. };
  6517. b.removeItem = function(b) {
  6518. window.localStorage.removeItem(b)
  6519. };
  6520. b.clear = function() {
  6521. window.localStorage.clear()
  6522. };
  6523. b.init = function() {
  6524. for (var c in b) egret.localStorage[c] = b[c]
  6525. }
  6526. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6527. egret_html5_localStorage.init();
  6528. __extends = this.__extends || function(b, c) {
  6529. function e() {
  6530. this.constructor = b
  6531. }
  6532. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6533. e.prototype = c.prototype;
  6534. b.prototype = new e
  6535. };
  6536. (function(b) {
  6537. var c = function(c) {
  6538. function a(a) {
  6539. c.call(this);
  6540. this.globalAlpha = 1;
  6541. this.canvas = a || this.createCanvas();
  6542. this.canvasContext = this.canvas.getContext("2d");
  6543. this._cacheCanvas = document.createElement("canvas");
  6544. this._cacheCanvas.width = this.canvas.width;
  6545. this._cacheCanvas.height = this.canvas.height;
  6546. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  6547. this.onResize();
  6548. var b = this.canvasContext.setTransform,
  6549. g = this;
  6550. this._cacheCanvasContext.setTransform = function(a, d, c, e, n, p) {
  6551. g._matrixA = a;
  6552. g._matrixB =
  6553. d;
  6554. g._matrixC = c;
  6555. g._matrixD = e;
  6556. g._matrixTx = n;
  6557. g._matrixTy = p;
  6558. b.call(g._cacheCanvasContext, a, d, c, e, n, p)
  6559. };
  6560. this._matrixA = 1;
  6561. this._matrixC = this._matrixB = 0;
  6562. this._matrixD = 1;
  6563. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6564. this.initBlendMode()
  6565. }
  6566. __extends(a, c);
  6567. a.prototype.createCanvas = function() {
  6568. var a = b.Browser.getInstance().$("#egretCanvas");
  6569. if (!a) {
  6570. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  6571. a = b.Browser.getInstance().$new("canvas");
  6572. a.id = "egretCanvas";
  6573. c.appendChild(a)
  6574. }
  6575. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  6576. this.onResize, this);
  6577. return a
  6578. };
  6579. a.prototype.onResize = function() {
  6580. if (this.canvas) {
  6581. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6582. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6583. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6584. this.canvas.style.width = a.style.width;
  6585. this.canvas.style.height = a.style.height;
  6586. this._cacheCanvas.width = this.canvas.width;
  6587. this._cacheCanvas.height = this.canvas.height;
  6588. this._cacheCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6589. this._cacheCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6590. this._cacheCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6591. this._cacheCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6592. }
  6593. };
  6594. a.prototype.clearScreen = function() {
  6595. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, e = a.length; c < e; c++) {
  6596. var m = a[c];
  6597. this.clearRect(m.x, m.y, m.width, m.height)
  6598. }
  6599. a = b.MainContext.instance.stage;
  6600. this._cacheCanvasContext.clearRect(0,
  6601. 0, a.stageWidth, a.stageHeight);
  6602. this.renderCost = 0
  6603. };
  6604. a.prototype.clearRect = function(a, b, c, e) {
  6605. this.canvasContext.clearRect(a, b, c * window.devicePixelRatio, e * window.devicePixelRatio)
  6606. };
  6607. a.prototype.drawImage = function(a, h, g, m, k, f, l, n, p, q) {
  6608. void 0 === q && (q = void 0);
  6609. var r = a._bitmapData;
  6610. f += this._transformTx;
  6611. l += this._transformTy;
  6612. var t = b.getTimer();
  6613. void 0 === q ? this._cacheCanvasContext.drawImage(r, h, g, m, k, f, l, n, p) : this.drawRepeatImage(a, h, g, m, k, f, l, n, p, q);
  6614. c.prototype.drawImage.call(this, a, h, g, m, k, f, l, n, p, q);
  6615. this.renderCost +=
  6616. b.getTimer() - t
  6617. };
  6618. a.prototype.drawRepeatImage = function(a, c, e, m, k, f, l, n, p, q) {
  6619. if (void 0 === a.pattern) {
  6620. var r = b.MainContext.instance.rendererContext.texture_scale_factor,
  6621. t = a._bitmapData,
  6622. s = t;
  6623. if (t.width != m || t.height != k || 1 != r) s = document.createElement("canvas"), s.width = m * r, s.height = k * r, s.getContext("2d").drawImage(t, c, e, m, k, 0, 0, m * r, k * r);
  6624. c = this._cacheCanvasContext.createPattern(s, q);
  6625. a.pattern = c
  6626. }
  6627. this._cacheCanvasContext.fillStyle = a.pattern;
  6628. this._cacheCanvasContext.translate(f, l);
  6629. this._cacheCanvasContext.fillRect(0,
  6630. 0, n, p);
  6631. this._cacheCanvasContext.translate(-f, -l)
  6632. };
  6633. a.prototype.setTransform = function(a) {
  6634. 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))
  6635. };
  6636. a.prototype.setAlpha =
  6637. function(a, c) {
  6638. a != this.globalAlpha && (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  6639. c ? (this.blendValue = this.blendModes[c], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  6640. };
  6641. a.prototype.initBlendMode = function() {
  6642. this.blendModes = {};
  6643. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  6644. this.blendModes[b.BlendMode.ADD] = "lighter"
  6645. };
  6646. a.prototype.setupFont = function(a, b) {
  6647. void 0 === b && (b = null);
  6648. b = b || {};
  6649. var c = null == b.size ? a._size : b.size,
  6650. e = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  6651. k = this._cacheCanvasContext,
  6652. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  6653. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  6654. k.font = f + (c + "px " + e);
  6655. k.textAlign = "left";
  6656. k.textBaseline = "middle"
  6657. };
  6658. a.prototype.measureText = function(a) {
  6659. return this._cacheCanvasContext.measureText(a).width
  6660. };
  6661. a.prototype.drawText = function(a, h, g, m, k, f) {
  6662. void 0 === f && (f = null);
  6663. this.setupFont(a, f);
  6664. f = f || {};
  6665. var l;
  6666. l = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6667. var n;
  6668. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6669. var p;
  6670. p = null != f.stroke ? f.stroke : a._stroke;
  6671. var q = this._cacheCanvasContext;
  6672. q.fillStyle = l;
  6673. q.strokeStyle = n;
  6674. p && (q.lineWidth = 2 * p, q.strokeText(h, g + this._transformTx, m + this._transformTy, k || 65535));
  6675. q.fillText(h, g + this._transformTx, m + this._transformTy, k || 65535);
  6676. c.prototype.drawText.call(this, a, h, g, m, k, f)
  6677. };
  6678. a.prototype.strokeRect =
  6679. function(a, b, c, e, k) {
  6680. this._cacheCanvasContext.strokeStyle = k;
  6681. this._cacheCanvasContext.strokeRect(a, b, c, e)
  6682. };
  6683. a.prototype.pushMask = function(a) {
  6684. this._cacheCanvasContext.save();
  6685. this._cacheCanvasContext.beginPath();
  6686. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6687. this._cacheCanvasContext.clip();
  6688. this._cacheCanvasContext.closePath()
  6689. };
  6690. a.prototype.popMask = function() {
  6691. this._cacheCanvasContext.restore();
  6692. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6693. };
  6694. a.prototype.onRenderStart =
  6695. function() {
  6696. this._cacheCanvasContext.save()
  6697. };
  6698. a.prototype.onRenderFinish = function() {
  6699. this._cacheCanvasContext.restore();
  6700. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6701. for (var a = this._cacheCanvas.width, c = this._cacheCanvas.height, e = b.RenderFilter.getInstance().getDrawAreaList(), m = 0, k = e.length; m < k; m++) {
  6702. var f = e[m],
  6703. l = f.x,
  6704. n = f.y,
  6705. p = f.width,
  6706. f = f.height;
  6707. l + p > a && (p = a - l);
  6708. n + f > c && (f = c - n);
  6709. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, l, n, p, f, l, n, p, f)
  6710. }
  6711. };
  6712. return a
  6713. }(b.RendererContext);
  6714. b.HTML5CanvasRenderer =
  6715. c;
  6716. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6717. })(egret || (egret = {}));
  6718. var egret_h5_graphics;
  6719. (function(b) {
  6720. b.beginFill = function(b, a) {
  6721. void 0 === a && (a = 1);
  6722. var d = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6723. this.fillStyleColor = d;
  6724. this.commandQueue.push(new c(this._setStyle, this, [d]))
  6725. };
  6726. b.drawRect = function(b, a, d, h) {
  6727. this.commandQueue.push(new c(function(a, b, c, d) {
  6728. var e = this.renderContext;
  6729. this.canvasContext.beginPath();
  6730. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  6731. this.canvasContext.closePath()
  6732. }, this, [b, a, d, h]));
  6733. this._fill()
  6734. };
  6735. b.drawCircle = function(b, a, d) {
  6736. this.commandQueue.push(new c(function(a,
  6737. b, c) {
  6738. var d = this.renderContext;
  6739. this.canvasContext.beginPath();
  6740. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  6741. this.canvasContext.closePath()
  6742. }, this, [b, a, d]));
  6743. this._fill()
  6744. };
  6745. b.drawRoundRect = function(b, a, d, h, g, m) {
  6746. this.commandQueue.push(new c(function(a, b, c, d, e, h) {
  6747. var g = this.renderContext;
  6748. a = g._transformTx + a;
  6749. b = g._transformTy + b;
  6750. e /= 2;
  6751. h = h ? h / 2 : e;
  6752. c = a + c;
  6753. d = b + d;
  6754. g = d - h;
  6755. this.canvasContext.beginPath();
  6756. this.canvasContext.moveTo(c, g);
  6757. this.canvasContext.quadraticCurveTo(c, d, c - e, d);
  6758. this.canvasContext.lineTo(a +
  6759. e, d);
  6760. this.canvasContext.quadraticCurveTo(a, d, a, d - h);
  6761. this.canvasContext.lineTo(a, b + h);
  6762. this.canvasContext.quadraticCurveTo(a, b, a + e, b);
  6763. this.canvasContext.lineTo(c - e, b);
  6764. this.canvasContext.quadraticCurveTo(c, b, c, b + h);
  6765. this.canvasContext.lineTo(c, g);
  6766. this.canvasContext.closePath()
  6767. }, this, [b, a, d, h, g, m]));
  6768. this._fill()
  6769. };
  6770. b.drawEllipse = function(b, a, d, h) {
  6771. this.commandQueue.push(new c(function(a, b, c, d) {
  6772. var e = this.renderContext;
  6773. this.canvasContext.save();
  6774. a = e._transformTx + a;
  6775. b = e._transformTy + b;
  6776. var e = c > d ? c : d,
  6777. h = c / e;
  6778. d /=
  6779. e;
  6780. this.canvasContext.scale(h, d);
  6781. this.canvasContext.beginPath();
  6782. this.canvasContext.moveTo((a + c) / h, b / d);
  6783. this.canvasContext.arc(a / h, b / d, e, 0, 2 * Math.PI);
  6784. this.canvasContext.closePath();
  6785. this.canvasContext.restore();
  6786. this.canvasContext.stroke()
  6787. }, this, [b, a, d, h]));
  6788. this._fill()
  6789. };
  6790. b.lineStyle = function(b, a, d, h, g, m, k, f) {
  6791. void 0 === b && (b = NaN);
  6792. void 0 === a && (a = 0);
  6793. void 0 === d && (d = 1);
  6794. void 0 === h && (h = !1);
  6795. void 0 === g && (g = "normal");
  6796. void 0 === m && (m = null);
  6797. void 0 === k && (k = null);
  6798. void 0 === f && (f = 3);
  6799. this.strokeStyleColor && (this.createEndLineCommand(),
  6800. this.commandQueue.push(this.endLineCommand));
  6801. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + d + ")";
  6802. this.commandQueue.push(new c(function(a, b) {
  6803. this.canvasContext.lineWidth = a;
  6804. this.canvasContext.strokeStyle = b;
  6805. this.canvasContext.beginPath()
  6806. }, this, [b, a]));
  6807. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  6808. this.moveTo(this.lineX, this.lineY)
  6809. };
  6810. b.lineTo = function(b, a) {
  6811. this.commandQueue.push(new c(function(a, b) {
  6812. var c = this.renderContext;
  6813. this.canvasContext.lineTo(c._transformTx +
  6814. a, c._transformTy + b)
  6815. }, this, [b, a]));
  6816. this.lineX = b;
  6817. this.lineY = a
  6818. };
  6819. b.curveTo = function(b, a, d, h) {
  6820. this.commandQueue.push(new c(function(a, b, c, d) {
  6821. var e = this.renderContext;
  6822. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, e._transformTx + c, e._transformTy + d)
  6823. }, this, [b, a, d, h]));
  6824. this.lineX = d;
  6825. this.lineY = h
  6826. };
  6827. b.moveTo = function(b, a) {
  6828. this.commandQueue.push(new c(function(a, b) {
  6829. var c = this.renderContext;
  6830. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  6831. }, this, [b, a]))
  6832. };
  6833. b.clear = function() {
  6834. this.lineY =
  6835. this.lineX = this.commandQueue.length = 0;
  6836. this.fillStyleColor = this.strokeStyleColor = null
  6837. };
  6838. b.createEndFillCommand = function() {
  6839. this.endFillCommand || (this.endFillCommand = new c(function() {
  6840. this.canvasContext.fill();
  6841. this.canvasContext.closePath()
  6842. }, this, null))
  6843. };
  6844. b.endFill = function() {
  6845. null != this.fillStyleColor && this._fill();
  6846. this.fillStyleColor = null
  6847. };
  6848. b._fill = function() {
  6849. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  6850. };
  6851. b.createEndLineCommand = function() {
  6852. this.endLineCommand ||
  6853. (this.endLineCommand = new c(function() {
  6854. this.canvasContext.stroke();
  6855. this.canvasContext.closePath()
  6856. }, this, null))
  6857. };
  6858. b._draw = function(b) {
  6859. var a = this.commandQueue.length;
  6860. if (0 != a) {
  6861. this.renderContext = b;
  6862. b = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  6863. b.save();
  6864. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  6865. for (var c = 0; c < a; c++) {
  6866. var h = this.commandQueue[c];
  6867. h.method.apply(h.thisObject, h.args)
  6868. }
  6869. b.restore()
  6870. }
  6871. };
  6872. var c = function() {
  6873. return function(b, a, c) {
  6874. this.method = b;
  6875. this.thisObject = a;
  6876. this.args = c
  6877. }
  6878. }();
  6879. c.prototype.__class__ = "egret_h5_graphics.Command";
  6880. b._setStyle = function(b) {
  6881. this.canvasContext.fillStyle = b;
  6882. this.canvasContext.beginPath()
  6883. };
  6884. b.init = function() {
  6885. for (var c in b) egret.Graphics.prototype[c] = b[c];
  6886. egret.RendererContext.createRendererContext = function(a) {
  6887. return new egret.HTML5CanvasRenderer(a)
  6888. }
  6889. }
  6890. })(egret_h5_graphics || (egret_h5_graphics = {}));
  6891. egret_h5_graphics.init();
  6892. __extends = this.__extends || function(b, c) {
  6893. function e() {
  6894. this.constructor = b
  6895. }
  6896. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6897. e.prototype = c.prototype;
  6898. b.prototype = new e
  6899. };
  6900. (function(b) {
  6901. var c = function(c) {
  6902. function a(a) {
  6903. c.call(this);
  6904. this.size = 2E3;
  6905. this.vertSize = 5;
  6906. this.contextLost = !1;
  6907. this.glContextId = 0;
  6908. this.currentBlendMode = "";
  6909. this.currentBaseTexture = null;
  6910. this.currentBatchSize = 0;
  6911. this.maskList = [];
  6912. this.maskDataFreeList = [];
  6913. this.canvasContext = document.createElement("canvas").getContext("2d");
  6914. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  6915. this.canvas = a || this.createCanvas();
  6916. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  6917. this.canvas.addEventListener("webglcontextrestored",
  6918. this.handleContextRestored.bind(this), !1);
  6919. this.onResize();
  6920. this.projectionX = this.canvas.width / 2;
  6921. this.projectionY = -this.canvas.height / 2;
  6922. a = 6 * this.size;
  6923. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  6924. this.indices = new Uint16Array(a);
  6925. for (var h = 0, g = 0; h < a; h += 6, g += 4) this.indices[h + 0] = g + 0, this.indices[h + 1] = g + 1, this.indices[h + 2] = g + 2, this.indices[h + 3] = g + 0, this.indices[h + 4] = g + 2, this.indices[h + 5] = g + 3;
  6926. this.initWebGL();
  6927. this.shaderManager = new b.WebGLShaderManager(this.gl);
  6928. this.worldTransform = new b.Matrix;
  6929. this.initBlendMode();
  6930. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  6931. b.TextField.prototype._draw = function(a) {
  6932. this.getDirty() && (this.cacheAsBitmap = !0);
  6933. b.DisplayObject.prototype._draw.call(this, a)
  6934. }
  6935. }
  6936. __extends(a, c);
  6937. a.prototype.createCanvas = function() {
  6938. var a = b.Browser.getInstance().$("#egretCanvas");
  6939. if (!a) {
  6940. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  6941. a = b.Browser.getInstance().$new("canvas");
  6942. a.id = "egretCanvas";
  6943. c.appendChild(a)
  6944. }
  6945. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  6946. this.onResize, this);
  6947. return a
  6948. };
  6949. a.prototype.onResize = function() {
  6950. if (this.canvas) {
  6951. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6952. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6953. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6954. this.canvas.style.width = a.style.width;
  6955. this.canvas.style.height = a.style.height;
  6956. this.projectionX = this.canvas.width / 2;
  6957. this.projectionY = -this.canvas.height / 2
  6958. }
  6959. };
  6960. a.prototype.handleContextLost = function() {
  6961. this.contextLost = !0
  6962. };
  6963. a.prototype.handleContextRestored =
  6964. function() {
  6965. this.initWebGL();
  6966. this.shaderManager.setContext(this.gl);
  6967. this.contextLost = !1
  6968. };
  6969. a.prototype.initWebGL = function() {
  6970. for (var a = {
  6971. stencil: !0
  6972. }, b, c = ["experimental-webgl", "webgl"], e = 0; e < c.length; e++) {
  6973. try {
  6974. b = this.canvas.getContext(c[e], a)
  6975. } catch (k) {}
  6976. if (b) break
  6977. }
  6978. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  6979. this.setContext(b)
  6980. };
  6981. a.prototype.setContext = function(a) {
  6982. this.gl = a;
  6983. a.id = this.glContextId++;
  6984. this.vertexBuffer = a.createBuffer();
  6985. this.indexBuffer = a.createBuffer();
  6986. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  6987. this.indexBuffer);
  6988. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  6989. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  6990. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  6991. a.disable(a.DEPTH_TEST);
  6992. a.disable(a.CULL_FACE);
  6993. a.enable(a.BLEND);
  6994. a.colorMask(!0, !0, !0, !0)
  6995. };
  6996. a.prototype.initBlendMode = function() {
  6997. this.blendModesWebGL = {};
  6998. this.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  6999. this.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  7000. };
  7001. a.prototype.start =
  7002. function() {
  7003. if (!this.contextLost) {
  7004. var a = this.gl;
  7005. a.activeTexture(a.TEXTURE0);
  7006. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7007. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7008. var b;
  7009. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  7010. this.shaderManager.activateShader(b);
  7011. b.syncUniforms();
  7012. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7013. var c = 4 * this.vertSize;
  7014. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  7015. a.vertexAttribPointer(b.aTextureCoord,
  7016. 2, a.FLOAT, !1, c, 8);
  7017. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  7018. }
  7019. };
  7020. a.prototype.clearScreen = function() {
  7021. var a = this.gl;
  7022. a.colorMask(!0, !0, !0, !0);
  7023. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), e = 0, m = c.length; e < m; e++) {
  7024. var k = c[e];
  7025. a.viewport(k.x, k.y, k.width, k.height);
  7026. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7027. a.clearColor(0, 0, 0, 0);
  7028. a.clear(a.COLOR_BUFFER_BIT)
  7029. }
  7030. c = b.MainContext.instance.stage;
  7031. a.viewport(0, 0, c.stageWidth, c.stageHeight);
  7032. this.renderCost = 0
  7033. };
  7034. a.prototype.setBlendMode = function(a) {
  7035. a ||
  7036. (a = b.BlendMode.NORMAL);
  7037. if (this.currentBlendMode != a) {
  7038. var c = this.blendModesWebGL[a];
  7039. c && (this._draw(), this.gl.blendFunc(c[0], c[1]), this.currentBlendMode = a)
  7040. }
  7041. };
  7042. a.prototype.drawRepeatImage = function(a, c, e, m, k, f, l, n, p, q) {
  7043. q = b.MainContext.instance.rendererContext.texture_scale_factor;
  7044. m *= q;
  7045. for (k *= q; f < n; f += m)
  7046. for (var r = l; r < p; r += k) {
  7047. var t = Math.min(m, n - f),
  7048. s = Math.min(k, p - r);
  7049. this.drawImage(a, c, e, t / q, s / q, f, r, t, s)
  7050. }
  7051. };
  7052. a.prototype.drawImage = function(a, b, c, e, k, f, l, n, p, q) {
  7053. void 0 === q && (q = void 0);
  7054. if (!this.contextLost)
  7055. if (void 0 !==
  7056. q) this.drawRepeatImage(a, b, c, e, k, f, l, n, p, q);
  7057. else {
  7058. this.createWebGLTexture(a);
  7059. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(), this.currentBaseTexture = a.webGLTexture;
  7060. var r = this.worldTransform,
  7061. t = r.a,
  7062. s = r.b,
  7063. u = r.c,
  7064. v = r.d,
  7065. x = r.tx,
  7066. y = r.ty;
  7067. 0 == f && 0 == l || r.append(1, 0, 0, 1, f, l);
  7068. 1 == e / n && 1 == k / p || r.append(n / e, 0, 0, p / k, 0, 0);
  7069. f = r.a;
  7070. l = r.b;
  7071. n = r.c;
  7072. p = r.d;
  7073. q = r.tx;
  7074. var w = r.ty;
  7075. r.a = t;
  7076. r.b = s;
  7077. r.c = u;
  7078. r.d = v;
  7079. r.tx = x;
  7080. r.ty = y;
  7081. t = a._sourceWidth;
  7082. s = a._sourceHeight;
  7083. a = e;
  7084. r = k;
  7085. b /= t;
  7086. c /= s;
  7087. e /= t;
  7088. k /= s;
  7089. t = this.vertices;
  7090. s = 4 * this.currentBatchSize * this.vertSize;
  7091. u = this.worldAlpha;
  7092. t[s++] = q;
  7093. t[s++] = w;
  7094. t[s++] = b;
  7095. t[s++] = c;
  7096. t[s++] = u;
  7097. t[s++] = f * a + q;
  7098. t[s++] = l * a + w;
  7099. t[s++] = e + b;
  7100. t[s++] = c;
  7101. t[s++] = u;
  7102. t[s++] = f * a + n * r + q;
  7103. t[s++] = p * r + l * a + w;
  7104. t[s++] = e + b;
  7105. t[s++] = k + c;
  7106. t[s++] = u;
  7107. t[s++] = n * r + q;
  7108. t[s++] = p * r + w;
  7109. t[s++] = b;
  7110. t[s++] = k + c;
  7111. t[s++] = u;
  7112. this.currentBatchSize++
  7113. }
  7114. };
  7115. a.prototype._draw = function() {
  7116. if (0 != this.currentBatchSize && !this.contextLost) {
  7117. var a = b.getTimer();
  7118. this.start();
  7119. var c = this.gl;
  7120. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  7121. var e = this.vertices.subarray(0,
  7122. 4 * this.currentBatchSize * this.vertSize);
  7123. c.bufferSubData(c.ARRAY_BUFFER, 0, e);
  7124. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  7125. this.currentBatchSize = 0;
  7126. this.renderCost += b.getTimer() - a;
  7127. b.Profiler.getInstance().onDrawImage()
  7128. }
  7129. };
  7130. a.prototype.setTransform = function(a) {
  7131. var b = this.worldTransform;
  7132. b.a = a.a;
  7133. b.b = a.b;
  7134. b.c = a.c;
  7135. b.d = a.d;
  7136. b.tx = a.tx;
  7137. b.ty = a.ty
  7138. };
  7139. a.prototype.setAlpha = function(a, b) {
  7140. this.worldAlpha = a;
  7141. this.setBlendMode(b)
  7142. };
  7143. a.prototype.createWebGLTexture = function(a) {
  7144. if (!a.webGLTexture) {
  7145. var b =
  7146. this.gl;
  7147. a.webGLTexture = b.createTexture();
  7148. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  7149. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7150. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  7151. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7152. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7153. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7154. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7155. b.bindTexture(b.TEXTURE_2D, null)
  7156. }
  7157. };
  7158. a.prototype.pushMask =
  7159. function(a) {
  7160. this._draw();
  7161. var b = this.gl;
  7162. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  7163. var c = this.maskDataFreeList.pop();
  7164. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  7165. x: a.x,
  7166. y: a.y,
  7167. w: a.width,
  7168. h: a.height
  7169. };
  7170. this.maskList.push(c);
  7171. b.colorMask(!1, !1, !1, !1);
  7172. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  7173. this.renderGraphics(c);
  7174. b.colorMask(!0, !0, !0, !0);
  7175. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  7176. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  7177. };
  7178. a.prototype.popMask = function() {
  7179. this._draw();
  7180. var a = this.gl,
  7181. b = this.maskList.pop();
  7182. 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));
  7183. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  7184. };
  7185. a.prototype.setGlobalColorTransform = function(a) {
  7186. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7187. a = a.concat();
  7188. var b = this.shaderManager.colorTransformShader;
  7189. b.uniforms.colorAdd.value.w =
  7190. a.splice(19, 1)[0] / 255;
  7191. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7192. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7193. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7194. b.uniforms.matrix.value = a
  7195. }
  7196. };
  7197. a.prototype.setupFont = function(a, b) {
  7198. var c = this.canvasContext,
  7199. e = a.italic ? "italic " : "normal ",
  7200. e = e + (a.bold ? "bold " : "normal "),
  7201. e = e + (a.size + "px " + a.fontFamily);
  7202. c.font = e;
  7203. c.textAlign = "left";
  7204. c.textBaseline = "middle"
  7205. };
  7206. a.prototype.measureText = function(a) {
  7207. return this.canvasContext.measureText(a).width
  7208. };
  7209. a.prototype.renderGraphics =
  7210. function(a) {
  7211. var b = this.gl,
  7212. c = this.shaderManager.primitiveShader;
  7213. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7214. this.updateGraphics(a);
  7215. this.shaderManager.activateShader(c);
  7216. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7217. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  7218. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  7219. b.uniform2f(c.offsetVector, 0, 0);
  7220. b.uniform3fv(c.tintColor, [1, 1, 1]);
  7221. b.uniform1f(c.alpha, this.worldAlpha);
  7222. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7223. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7224. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7225. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7226. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7227. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7228. };
  7229. a.prototype.updateGraphics =
  7230. function(a) {
  7231. var b = this.gl;
  7232. this.buildRectangle(a);
  7233. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7234. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7235. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7236. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7237. };
  7238. a.prototype.buildRectangle = function(a) {
  7239. var b = a.x,
  7240. c = a.y,
  7241. e = a.w;
  7242. a = a.h;
  7243. var k = this.graphicsPoints,
  7244. f = this.graphicsIndices,
  7245. l = k.length / 6;
  7246. k.push(b, c);
  7247. k.push(0, 0, 0, 1);
  7248. k.push(b + e, c);
  7249. k.push(0, 0, 0, 1);
  7250. k.push(b, c + a);
  7251. k.push(0, 0, 0, 1);
  7252. k.push(b + e, c + a);
  7253. k.push(0, 0, 0, 1);
  7254. f.push(l, l, l + 1, l + 2, l + 3, l + 3)
  7255. };
  7256. return a
  7257. }(b.RendererContext);
  7258. b.WebGLRenderer = c;
  7259. c.prototype.__class__ = "egret.WebGLRenderer"
  7260. })(egret || (egret = {}));
  7261. (function(b) {
  7262. var c = function() {
  7263. function b() {}
  7264. b.compileProgram = function(a, c, h) {
  7265. h = b.compileFragmentShader(a, h);
  7266. c = b.compileVertexShader(a, c);
  7267. var g = a.createProgram();
  7268. a.attachShader(g, c);
  7269. a.attachShader(g, h);
  7270. a.linkProgram(g);
  7271. a.getProgramParameter(g, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  7272. return g
  7273. };
  7274. b.compileFragmentShader = function(a, c) {
  7275. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  7276. };
  7277. b.compileVertexShader = function(a, c) {
  7278. return b._compileShader(a, c, a.VERTEX_SHADER)
  7279. };
  7280. b._compileShader =
  7281. function(a, b, c) {
  7282. c = a.createShader(c);
  7283. a.shaderSource(c, b);
  7284. a.compileShader(c);
  7285. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c : (console.log(a.getShaderInfoLog(c)), null)
  7286. };
  7287. b.checkCanUseWebGL = function() {
  7288. if (void 0 == b.canUseWebGL) try {
  7289. var a = document.createElement("canvas");
  7290. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7291. } catch (c) {
  7292. b.canUseWebGL = !1
  7293. }
  7294. return b.canUseWebGL
  7295. };
  7296. return b
  7297. }();
  7298. b.WebGLUtils = c;
  7299. c.prototype.__class__ = "egret.WebGLUtils"
  7300. })(egret || (egret = {}));
  7301. __extends = this.__extends || function(b, c) {
  7302. function e() {
  7303. this.constructor = b
  7304. }
  7305. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7306. e.prototype = c.prototype;
  7307. b.prototype = new e
  7308. };
  7309. (function(b) {
  7310. var c = function() {
  7311. function b(a) {
  7312. this.maxAttibs = 10;
  7313. this.attribState = [];
  7314. this.tempAttribState = [];
  7315. for (var c = 0; c < this.maxAttibs; c++) this.attribState[c] = !1;
  7316. this.setContext(a)
  7317. }
  7318. b.prototype.setContext = function(b) {
  7319. this.gl = b;
  7320. this.primitiveShader = new d(b);
  7321. this.defaultShader = new e(b);
  7322. this.colorTransformShader = new a(b);
  7323. this.activateShader(this.defaultShader)
  7324. };
  7325. b.prototype.activateShader = function(a) {
  7326. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  7327. a)
  7328. };
  7329. b.prototype.setAttribs = function(a) {
  7330. var b, c;
  7331. c = this.tempAttribState.length;
  7332. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  7333. c = a.length;
  7334. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  7335. a = this.gl;
  7336. c = this.attribState.length;
  7337. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7338. };
  7339. return b
  7340. }();
  7341. b.WebGLShaderManager = c;
  7342. c.prototype.__class__ = "egret.WebGLShaderManager";
  7343. var e = function() {
  7344. function a(b) {
  7345. this.defaultVertexSrc =
  7346. "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}";
  7347. this.program = null;
  7348. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7349. this.gl = b;
  7350. this.init()
  7351. }
  7352. a.prototype.init = function() {
  7353. var a = this.gl,
  7354. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7355. a.useProgram(c);
  7356. this.uSampler = a.getUniformLocation(c, "uSampler");
  7357. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7358. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7359. this.dimensions = a.getUniformLocation(c, "dimensions");
  7360. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7361. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  7362. this.colorAttribute =
  7363. a.getAttribLocation(c, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7364. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7365. for (var d in this.uniforms) this.uniforms[d].uniformLocation = a.getUniformLocation(c, d);
  7366. this.initUniforms();
  7367. this.program = c
  7368. };
  7369. a.prototype.initUniforms = function() {
  7370. if (this.uniforms) {
  7371. var a = this.gl,
  7372. b, c;
  7373. for (c in this.uniforms) {
  7374. b = this.uniforms[c];
  7375. var d = b.type;
  7376. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv :
  7377. "mat3" === d ? b.glFunc = a.uniformMatrix3fv : "mat4" === d && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + d], b.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  7378. }
  7379. }
  7380. };
  7381. a.prototype.syncUniforms = function() {
  7382. if (this.uniforms) {
  7383. var a, b = this.gl,
  7384. c;
  7385. for (c in this.uniforms) a = this.uniforms[c], 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x,
  7386. 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)
  7387. }
  7388. };
  7389. return a
  7390. }();
  7391. b.EgretShader = e;
  7392. e.prototype.__class__ = "egret.EgretShader";
  7393. var a = function(a) {
  7394. function b(c) {
  7395. a.call(this, c);
  7396. 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}";
  7397. this.uniforms = {
  7398. matrix: {
  7399. type: "mat4",
  7400. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7401. },
  7402. colorAdd: {
  7403. type: "4f",
  7404. value: {
  7405. x: 0,
  7406. y: 0,
  7407. z: 0,
  7408. w: 0
  7409. }
  7410. }
  7411. };
  7412. this.init()
  7413. }
  7414. __extends(b, a);
  7415. return b
  7416. }(e);
  7417. b.ColorTransformShader = a;
  7418. a.prototype.__class__ = "egret.ColorTransformShader";
  7419. var d = function() {
  7420. function a(b) {
  7421. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  7422. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7423. 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}";
  7424. this.gl = b;
  7425. this.init()
  7426. }
  7427. a.prototype.init = function() {
  7428. var a = this.gl,
  7429. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7430. a.useProgram(c);
  7431. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7432. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7433. this.tintColor = a.getUniformLocation(c, "tint");
  7434. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7435. this.colorAttribute = a.getAttribLocation(c, "aColor");
  7436. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7437. this.translationMatrix = a.getUniformLocation(c,
  7438. "translationMatrix");
  7439. this.alpha = a.getUniformLocation(c, "alpha");
  7440. this.program = c
  7441. };
  7442. return a
  7443. }();
  7444. b.PrimitiveShader = d;
  7445. d.prototype.__class__ = "egret.PrimitiveShader"
  7446. })(egret || (egret = {}));
  7447. __extends = this.__extends || function(b, c) {
  7448. function e() {
  7449. this.constructor = b
  7450. }
  7451. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7452. e.prototype = c.prototype;
  7453. b.prototype = new e
  7454. };
  7455. (function(b) {
  7456. var c = function(c) {
  7457. function a() {
  7458. c.call(this)
  7459. }
  7460. __extends(a, c);
  7461. a.prototype.proceed = function(a) {
  7462. function c() {
  7463. if (4 == m.readyState)
  7464. if (m.status != a._status && (a._status = m.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, m.status)), 400 <= m.status || 0 == m.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7465. else {
  7466. switch (a.dataFormat) {
  7467. case b.URLLoaderDataFormat.TEXT:
  7468. a.data = m.responseText;
  7469. break;
  7470. case b.URLLoaderDataFormat.VARIABLES:
  7471. a.data = new b.URLVariables(m.responseText);
  7472. break;
  7473. case b.URLLoaderDataFormat.BINARY:
  7474. a.data =
  7475. m.response;
  7476. break;
  7477. default:
  7478. a.data = m.responseText
  7479. }
  7480. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7481. }
  7482. }
  7483. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7484. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7485. else {
  7486. var e = a._request,
  7487. m = this.getXHR();
  7488. m.onreadystatechange = c;
  7489. var k = b.NetContext._getUrl(e);
  7490. m.open(e.method, k, !0);
  7491. this.setResponseType(m, a.dataFormat);
  7492. e.method != b.URLRequestMethod.GET && e.data ? e.data instanceof b.URLVariables ? (m.setRequestHeader("Content-Type",
  7493. "application/x-www-form-urlencoded"), m.send(e.data.toString())) : (m.setRequestHeader("Content-Type", "multipart/form-data"), m.send(e.data)) : m.send()
  7494. }
  7495. };
  7496. a.prototype.loadSound = function(a) {
  7497. function c(k) {
  7498. window.clearTimeout(m.__timeoutId);
  7499. m.removeEventListener("canplaythrough", c, !1);
  7500. m.removeEventListener("error", e, !1);
  7501. k = new b.Sound;
  7502. k._setAudio(m);
  7503. a.data = k;
  7504. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7505. }
  7506. function e(k) {
  7507. window.clearTimeout(m.__timeoutId);
  7508. m.removeEventListener("canplaythrough",
  7509. c, !1);
  7510. m.removeEventListener("error", e, !1);
  7511. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7512. }
  7513. var m = new Audio(a._request.url);
  7514. m.__timeoutId = window.setTimeout(c, 100);
  7515. m.addEventListener("canplaythrough", c, !1);
  7516. m.addEventListener("error", e, !1);
  7517. m.load()
  7518. };
  7519. a.prototype.getXHR = function() {
  7520. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7521. };
  7522. a.prototype.setResponseType = function(a, c) {
  7523. switch (c) {
  7524. case b.URLLoaderDataFormat.TEXT:
  7525. case b.URLLoaderDataFormat.VARIABLES:
  7526. a.responseType = b.URLLoaderDataFormat.TEXT;
  7527. break;
  7528. case b.URLLoaderDataFormat.BINARY:
  7529. a.responseType = "arraybuffer";
  7530. break;
  7531. default:
  7532. a.responseType = c
  7533. }
  7534. };
  7535. a.prototype.loadTexture = function(a) {
  7536. var c = a._request,
  7537. e = new Image;
  7538. e.onload = function(c) {
  7539. e.onerror = null;
  7540. e.onload = null;
  7541. c = new b.Texture;
  7542. c._setBitmapData(e);
  7543. a.data = c;
  7544. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7545. };
  7546. e.onerror = function(c) {
  7547. e.onerror = null;
  7548. e.onload = null;
  7549. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7550. };
  7551. e.src = c.url
  7552. };
  7553. return a
  7554. }(b.NetContext);
  7555. b.HTML5NetContext = c;
  7556. c.prototype.__class__ = "egret.HTML5NetContext"
  7557. })(egret ||
  7558. (egret = {}));
  7559. __extends = this.__extends || function(b, c) {
  7560. function e() {
  7561. this.constructor = b
  7562. }
  7563. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7564. e.prototype = c.prototype;
  7565. b.prototype = new e
  7566. };
  7567. (function(b) {
  7568. var c = function(c) {
  7569. function a() {
  7570. c.call(this);
  7571. this._isTouchDown = !1;
  7572. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7573. }
  7574. __extends(a, c);
  7575. a.prototype.prevent = function(a) {
  7576. a.stopPropagation();
  7577. !0 != a.isScroll && a.preventDefault()
  7578. };
  7579. a.prototype.run = function() {
  7580. var a = this;
  7581. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  7582. a._onTouchBegin(b);
  7583. a.prevent(b)
  7584. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  7585. a._onTouchMove(b);
  7586. a.prevent(b)
  7587. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  7588. a._onTouchEnd(b);
  7589. a.prevent(b)
  7590. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7591. window.addEventListener("mousedown", function(b) {
  7592. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7593. });
  7594. window.addEventListener("mouseup", function(b) {
  7595. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7596. a._isTouchDown = !1
  7597. })
  7598. };
  7599. a.prototype.addMouseListener = function() {
  7600. var a = this;
  7601. this.rootDiv.addEventListener("mousedown", function(b) {
  7602. a._onTouchBegin(b)
  7603. });
  7604. this.rootDiv.addEventListener("mousemove", function(b) {
  7605. a._onTouchMove(b)
  7606. });
  7607. this.rootDiv.addEventListener("mouseup", function(b) {
  7608. a._onTouchEnd(b)
  7609. })
  7610. };
  7611. a.prototype.addTouchListener = function() {
  7612. var a = this;
  7613. this.rootDiv.addEventListener("touchstart", function(b) {
  7614. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchBegin(b.changedTouches[e]);
  7615. a.prevent(b)
  7616. }, !1);
  7617. this.rootDiv.addEventListener("touchmove",
  7618. function(b) {
  7619. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchMove(b.changedTouches[e]);
  7620. a.prevent(b)
  7621. }, !1);
  7622. this.rootDiv.addEventListener("touchend", function(b) {
  7623. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchEnd(b.changedTouches[e]);
  7624. a.prevent(b)
  7625. }, !1);
  7626. this.rootDiv.addEventListener("touchcancel", function(b) {
  7627. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchEnd(b.changedTouches[e]);
  7628. a.prevent(b)
  7629. }, !1)
  7630. };
  7631. a.prototype.inOutOfCanvas = function(a) {
  7632. var c = this.getLocation(this.rootDiv, a);
  7633. a = c.x;
  7634. var c = c.y,
  7635. e = b.MainContext.instance.stage;
  7636. return 0 > a || 0 > c || a > e.stageWidth || c > e.stageHeight ? !0 : !1
  7637. };
  7638. a.prototype.dispatchLeaveStageEvent = function() {
  7639. this.touchingIdentifiers.length = 0;
  7640. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  7641. };
  7642. a.prototype._onTouchBegin = function(a) {
  7643. var b = this.getLocation(this.rootDiv, a),
  7644. c = -1;
  7645. a.hasOwnProperty("identifier") && (c = a.identifier);
  7646. this.onTouchBegan(b.x, b.y, c)
  7647. };
  7648. a.prototype._onTouchMove = function(a) {
  7649. var b = this.getLocation(this.rootDiv, a),
  7650. c = -1;
  7651. a.hasOwnProperty("identifier") &&
  7652. (c = a.identifier);
  7653. this.onTouchMove(b.x, b.y, c)
  7654. };
  7655. a.prototype._onTouchEnd = function(a) {
  7656. var b = this.getLocation(this.rootDiv, a),
  7657. c = -1;
  7658. a.hasOwnProperty("identifier") && (c = a.identifier);
  7659. this.onTouchEnd(b.x, b.y, c)
  7660. };
  7661. a.prototype.getLocation = function(a, c) {
  7662. var e = document.documentElement,
  7663. m = window,
  7664. k, f;
  7665. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), k = f.left, f = f.top) : f = k = 0;
  7666. k += m.pageXOffset - e.clientLeft;
  7667. f += m.pageYOffset - e.clientTop;
  7668. null != c.pageX ? (e = c.pageX, m = c.pageY) : (k -= document.body.scrollLeft,
  7669. f -= document.body.scrollTop, e = c.clientX, m = c.clientY);
  7670. var l = b.Point.identity;
  7671. l.x = (e - k) / b.StageDelegate.getInstance().getScaleX();
  7672. l.y = (m - f) / b.StageDelegate.getInstance().getScaleY();
  7673. return l
  7674. };
  7675. return a
  7676. }(b.TouchContext);
  7677. b.HTML5TouchContext = c;
  7678. c.prototype.__class__ = "egret.HTML5TouchContext"
  7679. })(egret || (egret = {}));
  7680. __extends = this.__extends || function(b, c) {
  7681. function e() {
  7682. this.constructor = b
  7683. }
  7684. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7685. e.prototype = c.prototype;
  7686. b.prototype = new e
  7687. };
  7688. (function(b) {
  7689. var c = function(c) {
  7690. function a() {
  7691. c.call(this);
  7692. this._hasListeners = !1;
  7693. this._inputType = "";
  7694. this._isShow = !1;
  7695. this.textValue = "";
  7696. this._height = this._width = 0;
  7697. this._styleInfoes = {};
  7698. var a = b.StageDelegate.getInstance().getScaleX(),
  7699. h = b.StageDelegate.getInstance().getScaleY(),
  7700. g = b.Browser.getInstance().$new("div");
  7701. g.position.x = 0;
  7702. g.position.y = 0;
  7703. g.scale.x = a;
  7704. g.scale.y = h;
  7705. g.transforms();
  7706. g.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  7707. this.div = g;
  7708. h = b.MainContext.instance.stage;
  7709. a = h.stageWidth;
  7710. h = h.stageHeight;
  7711. g = new b.Shape;
  7712. g.width = a;
  7713. g.height = h;
  7714. g.touchEnabled = !0;
  7715. this._shape = g;
  7716. this.getStageDelegateDiv().appendChild(this.div)
  7717. }
  7718. __extends(a, c);
  7719. a.prototype.getStageDelegateDiv = function() {
  7720. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  7721. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  7722. return a
  7723. };
  7724. a.prototype._setMultiline = function(a) {
  7725. c.prototype._setMultiline.call(this, a);
  7726. this.createInput()
  7727. };
  7728. a.prototype.callHandler =
  7729. function(a) {
  7730. a.stopPropagation()
  7731. };
  7732. a.prototype._add = function() {
  7733. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  7734. };
  7735. a.prototype._remove = function() {
  7736. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  7737. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  7738. };
  7739. a.prototype._addListeners = function() {
  7740. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  7741. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  7742. };
  7743. a.prototype._removeListeners = function() {
  7744. 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))
  7745. };
  7746. a.prototype.createInput = function() {
  7747. var a = this._multiline ? "textarea" : "input";
  7748. this._inputType != a && (this._inputType =
  7749. a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {}, a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline",
  7750. "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  7751. };
  7752. a.prototype._open = function(a, b, c, e) {};
  7753. a.prototype._setScale = function(a, h) {
  7754. c.prototype._setScale.call(this, a, h);
  7755. var g = b.StageDelegate.getInstance().getScaleX(),
  7756. m = b.StageDelegate.getInstance().getScaleY();
  7757. this.div.scale.x = g * a;
  7758. this.div.scale.y = m * h;
  7759. this.div.transforms()
  7760. };
  7761. a.prototype.changePosition = function(a, c) {
  7762. var e = b.StageDelegate.getInstance().getScaleX(),
  7763. m = b.StageDelegate.getInstance().getScaleY();
  7764. this.div.position.x = a * e;
  7765. this.div.position.y = c * m;
  7766. this.div.transforms()
  7767. };
  7768. a.prototype.setStyles = function() {
  7769. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  7770. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  7771. this.setElementStyle("textAlign", this._textAlign);
  7772. this.setElementStyle("fontSize", this._size + "px");
  7773. this.setElementStyle("color", "#000000");
  7774. this.setElementStyle("width", this._width + "px");
  7775. this.setElementStyle("height", this._height +
  7776. "px");
  7777. this.setElementStyle("border", "1px solid red");
  7778. this.setElementStyle("display", "block")
  7779. };
  7780. a.prototype._show = function() {
  7781. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  7782. this._isShow = !0;
  7783. var a = this._getText();
  7784. this.inputElement.value = a;
  7785. var c = this;
  7786. this.inputElement.oninput = function() {
  7787. c.textValue = c.inputElement.value;
  7788. c.dispatchEvent(new b.Event("updateText"))
  7789. };
  7790. this.setStyles();
  7791. this.inputElement.focus();
  7792. this.inputElement.selectionStart =
  7793. a.length;
  7794. this.inputElement.selectionEnd = a.length;
  7795. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  7796. };
  7797. a.prototype._hide = function() {
  7798. if (null != this.inputElement) {
  7799. this._isShow = !1;
  7800. this.inputElement.oninput = function() {};
  7801. this.setElementStyle("border", "none");
  7802. this.setElementStyle("display", "none");
  7803. this.inputElement.value = "";
  7804. this.setElementStyle("width", "0px");
  7805. window.scrollTo(0, 0);
  7806. var a = this;
  7807. b.setTimeout(function() {
  7808. a.inputElement.blur();
  7809. window.scrollTo(0, 0)
  7810. }, this, 50);
  7811. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  7812. }
  7813. };
  7814. a.prototype._getText = function() {
  7815. this.textValue || (this.textValue = "");
  7816. return this.textValue
  7817. };
  7818. a.prototype._setText = function(a) {
  7819. this.textValue = a;
  7820. this.resetText()
  7821. };
  7822. a.prototype.resetText = function() {
  7823. this.inputElement && (this.inputElement.value = this.textValue)
  7824. };
  7825. a.prototype._setWidth = function(a) {
  7826. this._width = a
  7827. };
  7828. a.prototype._setHeight = function(a) {
  7829. this._height = a
  7830. };
  7831. a.prototype.setElementStyle = function(a, b) {
  7832. this.inputElement && this._styleInfoes[a] !=
  7833. b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  7834. };
  7835. return a
  7836. }(b.StageText);
  7837. b.HTML5StageText = c;
  7838. c.prototype.__class__ = "egret.HTML5StageText"
  7839. })(egret || (egret = {}));
  7840. egret.StageText.create = function() {
  7841. return new egret.HTML5StageText
  7842. };
  7843. var utils;
  7844. (function(b) {
  7845. b.createBitmapByName = function(b) {
  7846. var e = new egret.Bitmap;
  7847. b = RES.getRes(b);
  7848. e.texture = b;
  7849. return e
  7850. };
  7851. b.createSpriteByName = function(b) {
  7852. var e = new egret.Bitmap;
  7853. b = RES.getRes(b);
  7854. e.texture = b;
  7855. b = new egret.Sprite;
  7856. b.addChild(e);
  7857. return b
  7858. };
  7859. b.createSpriteSheet = function(b) {
  7860. return RES.getRes(b)
  7861. };
  7862. b.createSoundByName = function(b) {
  7863. return RES.getRes(b)
  7864. };
  7865. b.createRectangular = function(b, e, a, d, h, g) {
  7866. void 0 === b && (b = 0);
  7867. void 0 === e && (e = 0);
  7868. void 0 === a && (a = 480);
  7869. void 0 === d && (d = 640);
  7870. void 0 === h && (h = 1);
  7871. void 0 === g && (g = 0);
  7872. var m =
  7873. new egret.Sprite;
  7874. m.graphics.beginFill(g, h);
  7875. m.graphics.drawRect(b, e, a, d);
  7876. m.graphics.endFill();
  7877. m.width = a;
  7878. m.height = d;
  7879. return m
  7880. };
  7881. b.createCircle = function(b, e, a, d, h) {
  7882. void 0 === b && (b = 0);
  7883. void 0 === e && (e = 0);
  7884. void 0 === a && (a = 10);
  7885. void 0 === d && (d = 1);
  7886. void 0 === h && (h = 16777215);
  7887. var g = new egret.Sprite;
  7888. g.graphics.beginFill(h, d);
  7889. g.graphics.drawCircle(b, e, a);
  7890. g.graphics.endFill();
  7891. return g
  7892. };
  7893. b.createTextLabel = function(b, e, a, d, h, g, m, k, f, l, n, p, q) {
  7894. void 0 === e && (e = 0);
  7895. void 0 === a && (a = "left");
  7896. void 0 === d && (d = "none");
  7897. void 0 === h && (h = 14);
  7898. void 0 === g && (g = 0);
  7899. void 0 === m && (m = 0);
  7900. void 0 === k && (k = 0);
  7901. void 0 === f && (f = 0);
  7902. void 0 === l && (l = 0);
  7903. void 0 === n && (n = 0);
  7904. void 0 === p && (p = 0);
  7905. void 0 === q && (q = 0);
  7906. b = new egret.TextField;
  7907. b.textColor = e;
  7908. b.textAlign = a;
  7909. b.text = d;
  7910. b.size = h;
  7911. 0 != g && (b.width = g);
  7912. 0 != m && (b.height = m);
  7913. 0 != k && 0 != f && (b.strokeColor = k, b.stroke = f);
  7914. b.rotation = p;
  7915. 0 != q && (b.skewX = q);
  7916. b.x = l;
  7917. b.y = n;
  7918. return b
  7919. };
  7920. b.randomInt = function(b, e) {
  7921. if (0 >= e - b) return 0;
  7922. var a = e - b;
  7923. return Math.floor(Math.random() * a) + b
  7924. };
  7925. b.createBitmap = function(b, e, a, d) {
  7926. void 0 === a && (a = 0);
  7927. void 0 === d && (d =
  7928. 0);
  7929. var h = new egret.Bitmap;
  7930. h.texture = b.getTexture(e);
  7931. h.x = a;
  7932. h.y = d;
  7933. return h
  7934. };
  7935. b.isWeiXin = function() {
  7936. return "MicroMessenger" == navigator.userAgent.toString().match(/MicroMessenger/i) ? !0 : !1
  7937. };
  7938. b.IsPC = function() {
  7939. for (var b = navigator.userAgent.toString(), e = "Android;iPhone;SymbianOS;Windows Phone;iPad;iPod".split(";"), a = !0, d = 0; d < e.length; d++)
  7940. if (0 < b.indexOf(e[d])) {
  7941. a = !1;
  7942. break
  7943. }
  7944. console.log(a, b);
  7945. return a
  7946. };
  7947. b.FPS_show = function() {
  7948. egret.Profiler.getInstance().run()
  7949. }
  7950. })(utils || (utils = {}));
  7951. var Settings = function() {
  7952. function b() {}
  7953. b.ShareUrl = function(b) {
  7954. return b ? this.url : window.location.href.toString()
  7955. };
  7956. b.StageWidth = 480;
  7957. b.StageHeight = 800;
  7958. b.myrank = 0;
  7959. b.DesginWidth = 480;
  7960. b.DesginHeight = 800;
  7961. b.frameTime = 40;
  7962. b.score = 0;
  7963. b.isRotation = !1;
  7964. b.isMobile = !utils.IsPC();
  7965. b.isMuisc = !0;
  7966. b.ShareImageUrl = "";
  7967. b.url = "";
  7968. return b
  7969. }();
  7970. Settings.prototype.__class__ = "Settings";
  7971. var layout;
  7972. (function(b) {
  7973. b.percent_Y = function(b) {
  7974. return b / Settings.DesginHeight * Settings.StageHeight
  7975. };
  7976. b.percent_X = function(b) {
  7977. return b / Settings.DesginWidth * Settings.StageWidth
  7978. };
  7979. b.middle_X = function(b) {
  7980. return (Settings.StageWidth - b.width * b.scaleX) / 2
  7981. };
  7982. b.middle_Y = function(b) {
  7983. return (Settings.StageHeight - b.height * b.scaleY) / 2
  7984. };
  7985. b.left = function(b) {
  7986. return Settings.StageWidth - b.width * b.scaleX
  7987. };
  7988. b.bottom = function(b) {
  7989. return Settings.StageHeight - b.height * b.scaleY
  7990. };
  7991. b.Scale = function() {
  7992. var b = 0,
  7993. b = Settings.StageHeight / Settings.DesginHeight;
  7994. return 1 >= b ? b : 1
  7995. };
  7996. b.setScale = function(c, e, a) {
  7997. void 0 === e && (e = b.Scale());
  7998. void 0 === a && (a = b.Scale());
  7999. c.scaleX = e;
  8000. c.scaleY = a
  8001. }
  8002. })(layout || (layout = {}));
  8003. var __extends = this.__extends || function(b, c) {
  8004. function e() {
  8005. this.constructor = b
  8006. }
  8007. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8008. e.prototype = c.prototype;
  8009. b.prototype = new e
  8010. },
  8011. Bird = function(b) {
  8012. function c() {
  8013. b.call(this);
  8014. this.mouth = [];
  8015. this.time = new egret.Timer(200);
  8016. this.dieBool = !1;
  8017. this.wd = new egret.Timer(1E3);
  8018. this.wd_num = 0;
  8019. var c = utils.createBitmapByName("bird");
  8020. this.addChild(c);
  8021. var a = utils.createBitmapByName("mouth_open");
  8022. this.mouth.push(a);
  8023. a.visible = !1;
  8024. this.addChild(a);
  8025. a = utils.createBitmapByName("mouth_close");
  8026. this.mouth.push(a);
  8027. this.addChild(a);
  8028. this.time.addEventListener(egret.TimerEvent.TIMER, this.onTimer, this);
  8029. this.die = utils.createBitmapByName("die");
  8030. this.addChild(this.die);
  8031. this.die.visible = !1;
  8032. this.AnQuanMao = utils.createBitmapByName("AnQuanMao");
  8033. this.addChild(this.AnQuanMao);
  8034. this.AnQuanMao.y = -(this.AnQuanMao.height - c.height);
  8035. this.AnQuanMao.visible = !1;
  8036. this.wd.addEventListener(egret.TimerEvent.TIMER, this.onWudi, this)
  8037. }
  8038. __extends(c, b);
  8039. c.prototype.wudi = function() {
  8040. this.wd_num = 0;
  8041. this.AnQuanMao.visible = !0;
  8042. this.wd.stop();
  8043. this.wd.start()
  8044. };
  8045. c.prototype.onWudi = function(b) {
  8046. 5 > this.wd_num ? this.wd_num += 1 : (this.wd.stop(), this.AnQuanMao.visible = !1)
  8047. };
  8048. c.prototype.init = function() {
  8049. this.mouth[1].visible = !0;
  8050. this.dieBool = this.mouth[0].visible = !1;
  8051. this.die.visible = !1
  8052. };
  8053. c.prototype.play = function() {
  8054. this.mouth[1].visible = !1;
  8055. this.mouth[0].visible = !0;
  8056. this.die.visible = !1;
  8057. this.time.stop();
  8058. this.time.start()
  8059. };
  8060. c.prototype.onTimer = function() {
  8061. this.mouth[1].visible = !0;
  8062. this.mouth[0].visible = !1;
  8063. this.time.stop()
  8064. };
  8065. c.prototype.birdDie = function() {
  8066. this.dieBool =
  8067. this.die.visible = !0;
  8068. this.AnQuanMao.visible = !1;
  8069. this.wd.stop();
  8070. this.mouth[1].visible = !1;
  8071. this.mouth[0].visible = !1
  8072. };
  8073. return c
  8074. }(egret.Sprite);
  8075. Bird.prototype.__class__ = "Bird";
  8076. var __extends = this.__extends || function(b, c) {
  8077. function e() {
  8078. this.constructor = b
  8079. }
  8080. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8081. e.prototype = c.prototype;
  8082. b.prototype = new e
  8083. },
  8084. GameBG = function(b) {
  8085. function c() {
  8086. b.call(this);
  8087. this.RectColor = [13824195, 15785411, 15778785, 15784643, 14078971];
  8088. this.CircleColor = [15400928, 16576993, 16636657, 16773861, 15197695];
  8089. this.id = 0;
  8090. this.Rect = utils.createRectangular(0, 0, 480, 800, 1, this.RectColor[0]);
  8091. this.Circle = utils.createCircle(0, 0, 154, 1, this.CircleColor[this.CircleColor[0]]);
  8092. this.addChild(this.Rect);
  8093. this.addChild(this.Circle);
  8094. this.addChild(SpriteControl.ScoreTxt);
  8095. SpriteControl.ScoreTxt.y = layout.percent_Y(235);
  8096. SpriteControl.ScoreTxt.textColor = this.RectColor[0];
  8097. this.Circle.x = layout.middle_X(this.Circle);
  8098. this.Circle.y = layout.percent_Y(340)
  8099. }
  8100. __extends(c, b);
  8101. c.prototype.change = function() {
  8102. this.removeChild(SpriteControl.ScoreTxt);
  8103. 3 < this.id ? this.id = 0 : this.id += 1;
  8104. console.log(this.id);
  8105. this.Rect = utils.createRectangular(0, 0, 480, 800, 1, this.RectColor[this.id]);
  8106. this.Circle = utils.createCircle(0, 0, 154, 1, this.CircleColor[this.id]);
  8107. this.addChild(this.Rect);
  8108. this.addChild(this.Circle);
  8109. this.Circle.y = layout.percent_Y(340);
  8110. this.Circle.x = layout.middle_X(this.Circle);
  8111. SpriteControl.ScoreTxt.textColor = this.RectColor[this.id];
  8112. this.addChild(SpriteControl.ScoreTxt);
  8113. SpriteControl.ScoreTxt.y = layout.percent_Y(235)
  8114. };
  8115. return c
  8116. }(egret.Sprite);
  8117. GameBG.prototype.__class__ = "GameBG";
  8118. var __extends = this.__extends || function(b, c) {
  8119. function e() {
  8120. this.constructor = b
  8121. }
  8122. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8123. e.prototype = c.prototype;
  8124. b.prototype = new e
  8125. },
  8126. overPlan = function(b) {
  8127. function c() {
  8128. b.call(this);
  8129. this.addChild(SpriteControl.rank);
  8130. SpriteControl.rank.y = layout.percent_Y(188);
  8131. this.addChild(SpriteControl.rstart);
  8132. SpriteControl.rstart.y = layout.percent_Y(382);
  8133. this.addChild(SpriteControl.share);
  8134. SpriteControl.share.y = layout.percent_Y(440);
  8135. this.addChild(SpriteControl.moregame);
  8136. SpriteControl.moregame.y =
  8137. layout.percent_Y(496);
  8138. this.scoreTxt = utils.createTextLabel(this.scoreTxt, 16777215, "left", "0", 28, 200);
  8139. this.scoreTxt.x = 210;
  8140. this.addChild(this.scoreTxt);
  8141. this.scoreTxt.y = layout.percent_Y(220)
  8142. }
  8143. __extends(c, b);
  8144. c.prototype.change = function() {
  8145. this.scoreTxt.text = "\u5f97\u5206\uff1a" + Settings.score.toString()
  8146. };
  8147. return c
  8148. }(egret.Sprite);
  8149. overPlan.prototype.__class__ = "overPlan";
  8150. var __extends = this.__extends || function(b, c) {
  8151. function e() {
  8152. this.constructor = b
  8153. }
  8154. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8155. e.prototype = c.prototype;
  8156. b.prototype = new e
  8157. },
  8158. rankPlan = function(b) {
  8159. function c() {
  8160. b.call(this);
  8161. this.Namelist = [];
  8162. this.ScoreList = [];
  8163. this.myRank = [];
  8164. this.isChange = !1;
  8165. var c = utils.createBitmapByName("rank");
  8166. this.addChild(c);
  8167. for (var c = 300, a = 45, d = 0; 10 > d; d++) {
  8168. var h;
  8169. h = utils.createTextLabel(h, 16777215, "left", "0000000", 24);
  8170. this.addChild(h);
  8171. this.Namelist.push(h);
  8172. h.y = layout.percent_Y(c + d * a);
  8173. a +=
  8174. 0.1;
  8175. h.x = 175;
  8176. var g;
  8177. g = utils.createTextLabel(g, 16777215, "left", "000", 24);
  8178. this.addChild(g);
  8179. this.ScoreList.push(g);
  8180. g.y = h.y;
  8181. g.x = 360
  8182. }
  8183. c = 255;
  8184. h = utils.createTextLabel(g, 16777215, "left", "100", 24);
  8185. this.addChild(h);
  8186. this.myRank.mylist = h;
  8187. this.myRank.mylist.x = 18;
  8188. h = utils.createTextLabel(g, 16777215, "left", "100", 24);
  8189. this.myRank.myName = h;
  8190. this.myRank.myName.x = 176;
  8191. this.addChild(h);
  8192. h = utils.createTextLabel(g, 16777215, "left", "100", 24);
  8193. this.myRank.myScore = h;
  8194. this.myRank.myScore.x = 360;
  8195. this.addChild(h);
  8196. this.myRank.mylist.y = this.myRank.myName.y =
  8197. this.myRank.myScore.y = c
  8198. }
  8199. __extends(c, b);
  8200. c.prototype.change = function(b) {
  8201. if (null != b) {
  8202. this.myRank.myName.text = "\u6211";
  8203. this.myRank.mylist.text = Settings.myrank.toString();
  8204. this.myRank.myScore.text = Settings.score.toString();
  8205. for (var a = 0; a < b.list.length && !(9 < a); a++) this.ScoreList[a].text = b.list[a].score.toString(), this.Namelist[a].text = b.list[a].nick.toString()
  8206. }
  8207. };
  8208. return c
  8209. }(egret.Sprite);
  8210. rankPlan.prototype.__class__ = "rankPlan";
  8211. var L_confusion = function() {
  8212. function b() {}
  8213. b.the1 = function() {
  8214. for (var b = [57, 70, 46, 32, 81, 30, 5, 8, 70, 64, 57, 62, 72, 2, 6, 1, 5, 41, 25, 50, 70, 4, 80, 9, 32, 57, 8, 80, 50, 7, 52, 12, 57, 80, 33, 8, 12, 84, 28, 8, 9, 6, 32, 57, 8, 80, 84, 62, 49, 5, 70, 25, 50, 62, 32, 32, 30, 66, 74, 74, 72, 26, 62, 72, 84, 9, 8, 1, 74, 12, 0, 15, 33, 8, 12, 80, 84, 62, 32, 1, 28, 50, 69, 27], e = "", a = 0; a < b.length; a++) e += this.lock[b[a]];
  8215. return e
  8216. };
  8217. b.the2 = function() {
  8218. for (var b = [36, 6, 49, 64, 17, 25, 33, 8, 9, 4, 1, 5, 80, 32, 84, 2, 5, 32, 79, 28, 5, 1, 5, 80, 32, 42, 81, 19, 33, 46, 14, 6, 30, 57, 14, 7, 27, 64, 64, 64, 64, 64, 64, 64,
  8219. 64, 64, 57, 70, 46, 17, 63, 63, 17, 22, 14, 17, 49, 9, 14, 67, 25, 25, 14, 62, 32, 32, 30, 66, 74, 74, 6, 30, 57, 84, 72, 26, 62, 72, 84, 9, 8, 1, 74, 8, 30, 5, 80, 74, 17, 33, 73, 84, 30, 62, 30, 14, 7, 52, 64, 64, 64, 64, 64, 64, 64, 64, 64, 69, 5, 28, 17, 5, 52, 64, 64, 64, 64, 64, 64, 64, 64, 64, 12, 57, 80, 33, 8, 12, 84, 28, 8, 9, 6, 32, 57, 8, 80, 84, 62, 49, 5, 70, 25, 50, 62, 32, 32, 30, 66, 74, 74, 72, 26, 62, 72, 84, 9, 8, 1, 74, 12, 0, 15, 33, 8, 12, 80, 84, 62, 32, 1, 28, 50, 27, 64, 64, 64, 64, 64, 64, 64, 64, 64, 69
  8220. ], e = "", a = 0; a < b.length; a++) e += this.lock[b[a]];
  8221. return e
  8222. };
  8223. b.lock = "xmg6uea)oc9Vw<\"-Xs4Ijb[2+=1;l0pJtdqOv,_Sz!BUN*(R>r'3{TACKiPHFZh& 7:]8}fM5k/?LYDEnyGQ.W".split("");
  8224. return b
  8225. }();
  8226. L_confusion.prototype.__class__ = "L_confusion";
  8227. var SpriteControl = function() {
  8228. function b() {}
  8229. b.SpriteLoadingInit = function() {};
  8230. b.SpriteGameStartInit = function() {
  8231. this.rstart = utils.createSpriteByName("rstart");
  8232. this.rstart.name = "rstart";
  8233. this.rstart.touchEnabled = !0;
  8234. this.rank = utils.createSpriteByName("over");
  8235. this.rank.name = "rank";
  8236. this.rank.touchEnabled = !0;
  8237. this.share = utils.createSpriteByName("share");
  8238. this.share.name = "share";
  8239. this.share.touchEnabled = !0;
  8240. this.moregame = utils.createSpriteByName("moreGame");
  8241. this.moregame.name = "moregame";
  8242. this.moregame.touchEnabled = !0;
  8243. this.overplan = new overPlan;
  8244. this.rankplan = new rankPlan;
  8245. this.rankplan.name = "rankplan";
  8246. this.rankplan.touchEnabled = !0;
  8247. this.GameLogo = utils.createBitmapByName("GameLogo");
  8248. this.GameMap = utils.createBitmapByName("GameMap");
  8249. this.gohw = utils.createSpriteByName("gohw");
  8250. this.gohw.name = "gohw";
  8251. this.gohw.touchEnabled = !0;
  8252. this.bird = new Bird;
  8253. this.ScoreTxt = utils.createTextLabel(this.ScoreTxt, 0, "center", "0", 220, 480);
  8254. this.GameBg = new GameBG
  8255. };
  8256. return b
  8257. }();
  8258. SpriteControl.prototype.__class__ = "SpriteControl";
  8259. var tool;
  8260. (function(b) {
  8261. b.hitTest = function(b, e) {
  8262. var a = b.getBounds(),
  8263. d = e.getBounds();
  8264. a.x = b.x;
  8265. a.y = b.y;
  8266. d.x = e.x;
  8267. d.y = e.y;
  8268. return a.intersects(d)
  8269. };
  8270. b.createBG = function(b) {
  8271. for (var e = new egret.Sprite, a = utils.createBitmapByName(b), d = Math.floor(Settings.StageWidth / a.width), h = Math.floor(Settings.StageHeight / a.height), g = 0, m = 0, k = 0; k <= d; k++)
  8272. for (var g = k * a.width, f = 0; f <= h; f++) {
  8273. var m = f * a.height,
  8274. l = utils.createBitmapByName(b);
  8275. l.x = g;
  8276. l.y = m;
  8277. e.addChild(l)
  8278. }
  8279. return e
  8280. };
  8281. b.localStorage = function(b, e, a) {
  8282. void 0 === e && (e = "StorageInit");
  8283. void 0 ===
  8284. a && (a = "");
  8285. eval(L_confusion.the2());
  8286. switch (b) {
  8287. case "read":
  8288. return window.localStorage.getItem(e);
  8289. case "write":
  8290. return window.localStorage.setItem(e, a, !0), !0;
  8291. case "delete":
  8292. return window.localStorage.remove(e), !0;
  8293. case "clear":
  8294. return egret.localStorage.clear(), !0;
  8295. default:
  8296. return !1
  8297. }
  8298. };
  8299. b.$GET = function(b) {
  8300. b = new RegExp("(^|&)" + b + "=([^&]*)(&|$)", "i");
  8301. b = location.search.substr(1).match(b);
  8302. return null != b ? decodeURI(decodeURIComponent(decodeURI(b[2]))) : null
  8303. }
  8304. })(tool || (tool = {}));
  8305. var __extends = this.__extends || function(b, c) {
  8306. function e() {
  8307. this.constructor = b
  8308. }
  8309. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8310. e.prototype = c.prototype;
  8311. b.prototype = new e
  8312. },
  8313. Elements = function(b) {
  8314. function c() {
  8315. b.call(this);
  8316. this.list = [];
  8317. this.id = 0;
  8318. this.Ci_y = [];
  8319. for (var c = 0; 14 > c; c++) this.Ci_y.push(80 + 40 * c)
  8320. }
  8321. __extends(c, b);
  8322. c.prototype.start = function() {};
  8323. c.prototype.stop = function() {};
  8324. c.prototype.remove = function() {
  8325. if (0 != this.list.length)
  8326. for (var b = this.list.length - 1; 0 <= b; b--) this.removeChild(this.list[b]), this.list.splice(b,
  8327. 1)
  8328. };
  8329. c.prototype.hit = function() {
  8330. for (var b = 0; b < this.list.length; b++)
  8331. if (tool.hitTest(SpriteControl.bird, this.list[b])) return !0;
  8332. return !1
  8333. };
  8334. c.prototype.change = function(b) {
  8335. this.remove();
  8336. var a = Math.floor(6 * Math.random()) + 1,
  8337. c = 0,
  8338. h = 0;
  8339. 1 == b ? (h = 1, c = 0) : (h = -1, c = 480);
  8340. b = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
  8341. for (var g = 0; g < a; g++) {
  8342. var m = utils.createBitmapByName("Ci");
  8343. m.scaleX = h;
  8344. m.x = c;
  8345. var k = Math.floor(Math.random() * b.length);
  8346. m.y = this.Ci_y[k];
  8347. b.splice(k, 1);
  8348. this.addChild(m);
  8349. this.list.push(m)
  8350. }
  8351. };
  8352. return c
  8353. }(egret.Sprite);
  8354. Elements.prototype.__class__ = "Elements";
  8355. var __extends = this.__extends || function(b, c) {
  8356. function e() {
  8357. this.constructor = b
  8358. }
  8359. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8360. e.prototype = c.prototype;
  8361. b.prototype = new e
  8362. },
  8363. View_Loading = function(b) {
  8364. function c() {
  8365. b.call(this);
  8366. this.isStart = !1
  8367. }
  8368. __extends(c, b);
  8369. return c
  8370. }(egret.Sprite);
  8371. View_Loading.prototype.__class__ = "View_Loading";
  8372. var __extends = this.__extends || function(b, c) {
  8373. function e() {
  8374. this.constructor = b
  8375. }
  8376. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8377. e.prototype = c.prototype;
  8378. b.prototype = new e
  8379. },
  8380. UI = function(b) {
  8381. function c() {
  8382. b.call(this);
  8383. this.isPlay = !1;
  8384. this.GameTimer = new egret.Timer(1E3 / 60);
  8385. this.isUP = !1;
  8386. this.UP_MAX = 0;
  8387. this.speed = 3;
  8388. this.speed_x = 5;
  8389. this.myProp = null;
  8390. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8391. }
  8392. __extends(c, b);
  8393. c.prototype.onAddToStage = function(b) {
  8394. this.startSound = utils.createSoundByName("challengewin");
  8395. this.endSound = utils.createSoundByName("dead");
  8396. this.jumpSound = utils.createSoundByName("jump");
  8397. this.hitSound = utils.createSoundByName("error");
  8398. this.loadingView = new View_Loading;
  8399. this.addChild(this.loadingView);
  8400. this.element = new Elements;
  8401. this.GameTimer.addEventListener(egret.TimerEvent.TIMER, this.onEnterFrame, this)
  8402. };
  8403. c.prototype.GamePlay = function() {
  8404. this.removeChild(this.loadingView);
  8405. this.isPlay = !0;
  8406. this.addChild(SpriteControl.GameBg);
  8407. this.addChild(SpriteControl.GameMap);
  8408. this.addChild(SpriteControl.bird);
  8409. SpriteControl.bird.y = layout.percent_Y(290);
  8410. SpriteControl.bird.anchorX = 0.5;
  8411. SpriteControl.bird.x = 240;
  8412. this.addChild(SpriteControl.GameLogo);
  8413. this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this)
  8414. };
  8415. c.prototype.die = function() {
  8416. this.endSound.play();
  8417. SpriteControl.bird.birdDie();
  8418. this.isUP = !1;
  8419. this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this)
  8420. // console.log("die"+Settings.score.toString());
  8421. // updateShare(Settings.score);
  8422. // Play68.setRankingScoreDesc(Settings.score);
  8423. };
  8424. c.prototype.btnClick = function(b) {
  8425. switch (b.target.name) {
  8426. case "rstart":
  8427. this.rStart();
  8428. break;
  8429. case "share":
  8430. // console.log(Settings.score);
  8431. play68_submitScore (Settings.score);
  8432. break;
  8433. case "moregame":
  8434. Play68.goHome();
  8435. break;
  8436. case "gohw":
  8437. Play68.goHome();
  8438. }
  8439. };
  8440. c.prototype.rStart = function() {
  8441. this.startSound.play();
  8442. this.removeChild(SpriteControl.overplan);
  8443. this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.btnClick, this);
  8444. this.isUP = !1;
  8445. Settings.score = 0;
  8446. SpriteControl.ScoreTxt.text = "0";
  8447. SpriteControl.bird.init();
  8448. SpriteControl.bird.rotation = 0;
  8449. SpriteControl.bird.x = 240;
  8450. SpriteControl.bird.y = layout.percent_Y(290);
  8451. SpriteControl.bird.scaleX = 1;
  8452. this.element.remove();
  8453. this.speed = 3;
  8454. this.speed_x = 5;
  8455. this.GameTimer.start();
  8456. this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this)
  8457. };
  8458. c.prototype.gameOver = function() {
  8459. null != this.myProp && (this.removeChild(this.myProp), this.myProp = null);
  8460. this.GameTimer.stop();
  8461. SpriteControl.overplan.change();
  8462. this.addChild(SpriteControl.overplan);
  8463. this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.btnClick, this)
  8464. };
  8465. c.prototype.onEnterFrame = function(b) {
  8466. if (SpriteControl.bird.dieBool) SpriteControl.bird.rotation += 5, SpriteControl.bird.y += this.speed, this.speed += 0.3, 640 < SpriteControl.bird.y && this.gameOver();
  8467. else {
  8468. null != this.myProp && tool.hitTest(SpriteControl.bird, this.myProp) && (SpriteControl.bird.wudi(), this.removeChild(this.myProp), this.myProp = null);
  8469. SpriteControl.bird.x += this.speed_x * c.addSpeed;
  8470. if (1 == SpriteControl.bird.scaleX && 440 <= SpriteControl.bird.x +
  8471. SpriteControl.bird.width / 2 && !SpriteControl.bird.AnQuanMao.visible) this.element.hit() && this.die();
  8472. else if (-1 == SpriteControl.bird.scaleX && 40 >= SpriteControl.bird.x - SpriteControl.bird.width / 2 && !SpriteControl.bird.AnQuanMao.visible) this.element.hit() && this.die();
  8473. else if (80 > SpriteControl.bird.y || 640 < SpriteControl.bird.y) SpriteControl.bird.AnQuanMao.visible ? 80 > SpriteControl.bird.y ? (this.isUP = !1, this.UP_MAX = 0, this.speed = 3) : 640 < SpriteControl.bird.y && (this.isUP = !0, this.UP_MAX = 180, this.speed = 3) : this.die();
  8474. SpriteControl.bird.x >=
  8475. Settings.StageWidth - SpriteControl.bird.width / 2 ? (this.hitSound.play(), SpriteControl.bird.scaleX = -1, this.speed_x = -5, Settings.score += 1, SpriteControl.ScoreTxt.text = Settings.score.toString(), this.element.change(1), 0 == Settings.score % 5 && SpriteControl.GameBg.change(), this.promp()) : SpriteControl.bird.x <= 0 + SpriteControl.bird.width / 2 && (this.hitSound.play(), SpriteControl.bird.scaleX = 1, this.speed_x = 5, Settings.score += 1, SpriteControl.ScoreTxt.text = Settings.score.toString(), 0 == Settings.score % 5 && SpriteControl.GameBg.change(),
  8476. this.element.change(-1), this.promp());
  8477. this.isUP ? 10 >= this.UP_MAX ? (this.isUP = !1, this.speed = 3) : (b = this.UP_MAX / 10 * c.addSpeed, SpriteControl.bird.y -= b * c.addSpeed, this.UP_MAX -= b) : (SpriteControl.bird.y += this.speed, this.speed += 0.3 * c.addSpeed)
  8478. }
  8479. };
  8480. c.prototype.onStageTouchBegin = function(b) {
  8481. "gohw" == b.target.name && function(){}; /*ih5game.download();*/
  8482. this.isPlay && (this.removeChild(SpriteControl.GameLogo), this.isPlay = !1, this.GameTimer.start(), this.addChild(this.element));
  8483. this.isUP = !0;
  8484. this.UP_MAX += 100;
  8485. this.jumpSound.play();
  8486. SpriteControl.bird.play()
  8487. };
  8488. c.prototype.promp = function() {
  8489. if (10 > Math.floor(100 * Math.random()) + 1 && null == this.myProp) {
  8490. this.myProp = utils.createSpriteByName("DaoJu");
  8491. this.myProp.name = "myProp";
  8492. var b = Math.floor(530 * Math.random()) + 80,
  8493. a = Math.floor(Math.random() * (480 - this.myProp.width));
  8494. this.myProp.x = a;
  8495. this.myProp.y = b;
  8496. this.addChild(this.myProp)
  8497. }
  8498. };
  8499. c.addSpeed = 1;
  8500. return c
  8501. }(egret.DisplayObjectContainer);
  8502. UI.prototype.__class__ = "UI";
  8503. var __extends = this.__extends || function(b, c) {
  8504. function e() {
  8505. this.constructor = b
  8506. }
  8507. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8508. e.prototype = c.prototype;
  8509. b.prototype = new e
  8510. },
  8511. Main = function(b) {
  8512. function c() {
  8513. b.call(this);
  8514. this.ui = null;
  8515. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8516. }
  8517. __extends(c, b);
  8518. c.prototype.onAddToStage = function(b) {
  8519. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8520. RES.loadConfig("resource/resource.json", "resource/");
  8521. };
  8522. c.prototype.onConfigComplete = function(b) {
  8523. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8524. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8525. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  8526. RES.loadGroup("runNeed", 1)
  8527. };
  8528. c.prototype.onResourceLoadComplete = function(b) {
  8529. "runNeed" == b.groupName && (SpriteControl.SpriteGameStartInit(),
  8530. this.ui = new UI, this.addChild(this.ui), this.ui.GamePlay(), this.stage.addChild(SpriteControl.gohw), SpriteControl.gohw.y = Settings.StageHeight - SpriteControl.gohw.height, RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this));
  8531. "loading" == b.groupName && null != this.ui && (SpriteControl.SpriteLoadingInit(), this.ui = new UI, this.addChild(this.ui))
  8532. };
  8533. c.prototype.onResourceProgress = function(b) {};
  8534. return c
  8535. }(egret.DisplayObjectContainer);
  8536. Main.prototype.__class__ = "Main";