game-min.js 345 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762
  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 d() {
  22. this.constructor = b
  23. }
  24. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  25. d.prototype = c.prototype;
  26. b.prototype = new d
  27. };
  28. (function(b) {
  29. var c = function(b) {
  30. function a(e) {
  31. void 0 === e && (e = 300);
  32. b.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > e && (e = 1);
  36. this.autoDisposeTime = e;
  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(e) {
  52. var k = this.objectPool; - 1 == k.indexOf(e) && (k.push(e), 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 e = a._callBackList,
  64. k = e.indexOf(this); - 1 != k && e.splice(k, 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, d) {
  83. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  84. b.__callLaterFunctionList.push(c);
  85. b.__callLaterThisList.push(d);
  86. b.__callLaterArgsList.push(a)
  87. };
  88. b.__callAsyncFunctionList = [];
  89. b.__callAsyncThisList = [];
  90. b.__callAsyncArgsList = [];
  91. b.__callAsync = function(c, d) {
  92. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  93. b.__callAsyncFunctionList.push(c);
  94. b.__callAsyncThisList.push(d);
  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"], e = 0; e < a.length; e++)
  102. if (a[e] + "ransform" in b) return a[e];
  103. return a[0]
  104. }
  105. b.header = "";
  106. b.getHeader = c;
  107. b.getTrans = function(d) {
  108. "" == b.header && (b.header = c());
  109. return b.header + d.substring(1, d.length)
  110. }
  111. })(egret_dom || (egret_dom = {}));
  112. __extends = this.__extends || function(b, c) {
  113. function d() {
  114. this.constructor = b
  115. }
  116. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  117. d.prototype = c.prototype;
  118. b.prototype = new d
  119. };
  120. (function(b) {
  121. var c = function(d) {
  122. function a(e, a, b) {
  123. void 0 === a && (a = !1);
  124. void 0 === b && (b = !1);
  125. d.call(this);
  126. this._eventPhase = 2;
  127. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  128. this.isNew = !0;
  129. this._type = e;
  130. this._bubbles = a;
  131. this._cancelable = b
  132. }
  133. __extends(a, d);
  134. Object.defineProperty(a.prototype, "type", {
  135. get: function() {
  136. return this._type
  137. },
  138. enumerable: !0,
  139. configurable: !0
  140. });
  141. Object.defineProperty(a.prototype, "bubbles", {
  142. get: function() {
  143. return this._bubbles
  144. },
  145. enumerable: !0,
  146. configurable: !0
  147. });
  148. Object.defineProperty(a.prototype, "cancelable", {
  149. get: function() {
  150. return this._cancelable
  151. },
  152. enumerable: !0,
  153. configurable: !0
  154. });
  155. Object.defineProperty(a.prototype, "eventPhase", {
  156. get: function() {
  157. return this._eventPhase
  158. },
  159. enumerable: !0,
  160. configurable: !0
  161. });
  162. Object.defineProperty(a.prototype, "currentTarget", {
  163. get: function() {
  164. return this._currentTarget
  165. },
  166. enumerable: !0,
  167. configurable: !0
  168. });
  169. Object.defineProperty(a.prototype, "target", {
  170. get: function() {
  171. return this._target
  172. },
  173. enumerable: !0,
  174. configurable: !0
  175. });
  176. a.prototype.isDefaultPrevented =
  177. function() {
  178. return this._isDefaultPrevented
  179. };
  180. a.prototype.preventDefault = function() {
  181. this._cancelable && (this._isDefaultPrevented = !0)
  182. };
  183. a.prototype.stopPropagation = function() {
  184. this._bubbles && (this._isPropagationStopped = !0)
  185. };
  186. a.prototype.stopImmediatePropagation = function() {
  187. this._bubbles && (this._isPropagationImmediateStopped = !0)
  188. };
  189. a.prototype._reset = function() {
  190. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  191. null, this._eventPhase = 2)
  192. };
  193. a._dispatchByTarget = function(e, a, p, d, c, f) {
  194. void 0 === c && (c = !1);
  195. void 0 === f && (f = !1);
  196. var h = e.eventRecycler;
  197. h || (h = e.eventRecycler = new b.Recycler);
  198. var m = h.pop();
  199. m ? m._type = p : m = new e(p);
  200. m._bubbles = c;
  201. m._cancelable = f;
  202. if (d)
  203. for (var n in d) m[n] = d[n], null !== m[n] && (d[n] = null);
  204. e = a.dispatchEvent(m);
  205. h.push(m);
  206. return e
  207. };
  208. a._getPropertyData = function(e) {
  209. var a = e._props;
  210. a || (a = e._props = {});
  211. return a
  212. };
  213. a.dispatchEvent = function(e, k, b, d) {
  214. void 0 === b && (b = !1);
  215. var c = a._getPropertyData(a);
  216. d && (c.data = d);
  217. a._dispatchByTarget(a,
  218. e, k, c, b)
  219. };
  220. a.ADDED_TO_STAGE = "addedToStage";
  221. a.REMOVED_FROM_STAGE = "removedFromStage";
  222. a.ADDED = "added";
  223. a.REMOVED = "removed";
  224. a.COMPLETE = "complete";
  225. a.ENTER_FRAME = "enterFrame";
  226. a.RENDER = "render";
  227. a.FINISH_RENDER = "finishRender";
  228. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  229. a.LEAVE_STAGE = "leaveStage";
  230. a.RESIZE = "resize";
  231. a.CHANGE = "change";
  232. a.ACTIVATE = "activate";
  233. a.DEACTIVATE = "deactivate";
  234. 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 d() {
  243. this.constructor = b
  244. }
  245. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  246. d.prototype = c.prototype;
  247. b.prototype = new d
  248. };
  249. (function(b) {
  250. var c = function(b) {
  251. function a(e, a, p) {
  252. void 0 === a && (a = !1);
  253. void 0 === p && (p = !1);
  254. b.call(this, e, a, p);
  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(e, k) {
  266. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  267. a.httpStatusEvent._status = k;
  268. e.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 d() {
  280. this.constructor = b
  281. }
  282. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  283. d.prototype = c.prototype;
  284. b.prototype = new d
  285. };
  286. (function(b) {
  287. var c = function(d) {
  288. function a(e, a, b) {
  289. void 0 === a && (a = !1);
  290. void 0 === b && (b = !1);
  291. d.call(this, e, a, b)
  292. }
  293. __extends(a, d);
  294. a.dispatchIOErrorEvent = function(e) {
  295. b.Event._dispatchByTarget(a, e, 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 d() {
  305. this.constructor = b
  306. }
  307. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  308. d.prototype = c.prototype;
  309. b.prototype = new d
  310. };
  311. (function(b) {
  312. var c = function(d) {
  313. function a(e, a, b, l, c, f, h, m, n, q) {
  314. void 0 === a && (a = !0);
  315. void 0 === b && (b = !0);
  316. void 0 === l && (l = 0);
  317. void 0 === c && (c = 0);
  318. void 0 === f && (f = 0);
  319. void 0 === h && (h = !1);
  320. void 0 === m && (m = !1);
  321. void 0 === q && (q = !1);
  322. d.call(this, e, a, b);
  323. this._stageY = this._stageX = 0;
  324. this.touchPointID = l;
  325. this._stageX = c;
  326. this._stageY = f;
  327. this.ctrlKey = h;
  328. this.altKey = m;
  329. this.touchDown = q
  330. }
  331. __extends(a, d);
  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(e, k, p, d, c, f, h, m, n) {
  362. void 0 === p && (p = 0);
  363. void 0 === d && (d = 0);
  364. void 0 === c && (c = 0);
  365. void 0 === f && (f = !1);
  366. void 0 === h && (h = !1);
  367. void 0 === m && (m = !1);
  368. void 0 === n && (n = !1);
  369. var q = b.Event._getPropertyData(a);
  370. q.touchPointID = p;
  371. q._stageX = d;
  372. q._stageY = c;
  373. q.ctrlKey = f;
  374. q.altKey = h;
  375. q.shiftKey = m;
  376. q.touchDown = n;
  377. b.Event._dispatchByTarget(a, e, k, 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 d() {
  396. this.constructor = b
  397. }
  398. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  399. d.prototype = c.prototype;
  400. b.prototype = new d
  401. };
  402. (function(b) {
  403. var c = function(d) {
  404. function a(e, a, b) {
  405. void 0 === a && (a = !1);
  406. void 0 === b && (b = !1);
  407. d.call(this, e, a, b)
  408. }
  409. __extends(a, d);
  410. a.dispatchTimerEvent = function(e, k) {
  411. b.Event._dispatchByTarget(a, e, k)
  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 d() {
  422. this.constructor = b
  423. }
  424. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  425. d.prototype = c.prototype;
  426. b.prototype = new d
  427. };
  428. (function(b) {
  429. var c = function(d) {
  430. function a(e, a, b, l, c) {
  431. void 0 === a && (a = !1);
  432. void 0 === b && (b = !1);
  433. void 0 === l && (l = 0);
  434. void 0 === c && (c = 0);
  435. d.call(this, e, a, b);
  436. this.bytesLoaded = l;
  437. this.bytesTotal = c
  438. }
  439. __extends(a, d);
  440. a.dispatchProgressEvent = function(e, k, p, d) {
  441. void 0 === p && (p = 0);
  442. void 0 === d && (d = 0);
  443. b.Event._dispatchByTarget(a, e, k, {
  444. bytesLoaded: p,
  445. bytesTotal: d
  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 d() {
  468. this.constructor = b
  469. }
  470. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  471. d.prototype = c.prototype;
  472. b.prototype = new d
  473. };
  474. (function(b) {
  475. var c = function(d) {
  476. function a(e) {
  477. void 0 === e && (e = null);
  478. d.call(this);
  479. this._eventTarget = e ? e : this
  480. }
  481. __extends(a, d);
  482. a.prototype.addEventListener = function(e, a, p, d, c) {
  483. void 0 === d && (d = !1);
  484. void 0 === c && (c = 0);
  485. "undefined" === typeof d && (d = !1);
  486. "undefined" === typeof c && (c = 0);
  487. a || b.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  488. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  489. var f = d[e];
  490. f || (f = d[e] = []);
  491. this._insertEventBin(f, a, p, c)
  492. };
  493. a.prototype._insertEventBin = function(e, a, b, d, c) {
  494. void 0 === c && (c = void 0);
  495. for (var f = -1, h = e.length, m = 0; m < h; m++) {
  496. var n = e[m];
  497. if (n.listener === a && n.thisObject === b && n.display === c) return !1; - 1 == f && n.priority < d && (f = m)
  498. }
  499. a = {
  500. listener: a,
  501. thisObject: b,
  502. priority: d
  503. };
  504. c && (a.display = c); - 1 != f ? e.splice(f, 0, a) : e.push(a);
  505. return !0
  506. };
  507. a.prototype.removeEventListener = function(e, a, b, d) {
  508. void 0 === d && (d = !1);
  509. if (d = d ? this._captureEventsMap : this._eventsMap) {
  510. var c = d[e];
  511. c && (this._removeEventBin(c,
  512. a, b), 0 == c.length && delete d[e])
  513. }
  514. };
  515. a.prototype._removeEventBin = function(e, a, b, d) {
  516. void 0 === d && (d = void 0);
  517. for (var c = e.length, f = 0; f < c; f++) {
  518. var h = e[f];
  519. if (h.listener === a && h.thisObject === b && h.display === d) return e.splice(f, 1), !0
  520. }
  521. return !1
  522. };
  523. a.prototype.hasEventListener = function(e) {
  524. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  525. };
  526. a.prototype.willTrigger = function(e) {
  527. return this.hasEventListener(e)
  528. };
  529. a.prototype.dispatchEvent = function(e) {
  530. e._reset();
  531. e._target = this._eventTarget;
  532. e._currentTarget = this._eventTarget;
  533. return this._notifyListener(e)
  534. };
  535. a.prototype._notifyListener = function(e) {
  536. var a = 1 == e._eventPhase ? this._captureEventsMap : this._eventsMap;
  537. if (!a) return !0;
  538. a = a[e._type];
  539. if (!a) return !0;
  540. var b = a.length;
  541. if (0 == b) return !0;
  542. for (var a = a.concat(), d = 0; d < b; d++) {
  543. var c = a[d];
  544. c.listener.call(c.thisObject, e);
  545. if (e._isPropagationImmediateStopped) break
  546. }
  547. return !e._isDefaultPrevented
  548. };
  549. a.prototype.dispatchEventWith = function(e, a, p) {
  550. void 0 === a && (a = !1);
  551. b.Event.dispatchEvent(this, e, a, p)
  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 d() {
  560. this.constructor = b
  561. }
  562. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  563. d.prototype = c.prototype;
  564. b.prototype = new d
  565. };
  566. (function(b) {
  567. var c = function(d) {
  568. function a() {
  569. d.call(this);
  570. this.reuseEvent = new b.Event("")
  571. }
  572. __extends(a, d);
  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(e) {
  580. if (0 < b.__callLaterFunctionList.length) {
  581. var k = b.__callLaterFunctionList;
  582. b.__callLaterFunctionList = [];
  583. var p = b.__callLaterThisList;
  584. b.__callLaterThisList = [];
  585. var d = b.__callLaterArgsList;
  586. b.__callLaterArgsList = []
  587. }
  588. e = 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. k && this.doCallLaterList(k, p, d);
  594. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  595. k = this.rendererContext;
  596. k.onRenderStart();
  597. k.clearScreen();
  598. e._updateTransform();
  599. c._type = b.Event.FINISH_UPDATE_TRANSFORM;
  600. this.dispatchEvent(c);
  601. e._draw(k);
  602. c._type = b.Event.FINISH_RENDER;
  603. this.dispatchEvent(c);
  604. k.onRenderFinish()
  605. };
  606. a.prototype.broadcastEnterFrame = function(e) {
  607. e = this.reuseEvent;
  608. e._type = b.Event.ENTER_FRAME;
  609. this.dispatchEvent(e);
  610. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), p = a.length, d = 0; d < p; d++) {
  611. var c = a[d];
  612. e._target = c.display;
  613. e._currentTarget = c.display;
  614. c.listener.call(c.thisObject, e)
  615. }
  616. a = b.Recycler._callBackList;
  617. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  618. };
  619. a.prototype.broadcastRender = function() {
  620. var e = this.reuseEvent;
  621. e._type = b.Event.RENDER;
  622. for (var a = b.DisplayObject._renderCallBackList.concat(),
  623. p = a.length, d = 0; d < p; d++) {
  624. var c = a[d],
  625. f = c.display;
  626. e._target = f;
  627. e._currentTarget = f;
  628. c.listener.call(c.thisObject, e)
  629. }
  630. };
  631. a.prototype.doCallLaterList = function(e, a, b) {
  632. for (var d = e.length, c = 0; c < d; c++) {
  633. var f = e[c];
  634. null != f && f.apply(a[c], b[c])
  635. }
  636. };
  637. a.prototype.doCallAsyncList = function() {
  638. var e = b.__callAsyncFunctionList.concat(),
  639. a = b.__callAsyncThisList.concat(),
  640. p = b.__callAsyncArgsList.concat();
  641. b.__callAsyncFunctionList.length = 0;
  642. b.__callAsyncThisList.length = 0;
  643. for (var d = b.__callAsyncArgsList.length = 0; d < e.length; d++) {
  644. var c =
  645. e[d];
  646. null != c && c.apply(a[d], p[d])
  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 d() {
  675. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  676. this._maxDeltaTime = 500;
  677. this._totalDeltaTime = 0
  678. }
  679. d.getInstance = function() {
  680. null == d.instance && (d.instance = new d);
  681. return d.instance
  682. };
  683. d.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. d.prototype.onEnterFrame = function(a) {
  693. this._lastTime = b.getTimer()
  694. };
  695. d.prototype.onStartRender = function(a) {
  696. a = b.getTimer();
  697. this._logicPerformanceCost = a - this._lastTime;
  698. this._lastTime = a
  699. };
  700. d.prototype.onFinishUpdateTransform =
  701. function(a) {
  702. a = b.getTimer();
  703. this._updateTransformPerformanceCost = a - this._lastTime;
  704. this._lastTime = a
  705. };
  706. d.prototype.onFinishRender = function(a) {
  707. a = b.getTimer();
  708. this._renderPerformanceCost = a - this._lastTime;
  709. this._lastTime = a
  710. };
  711. d.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 e = 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:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  719. this._tick = this._totalDeltaTime = 0
  720. }
  721. this._preDrawCount = 0
  722. };
  723. d.prototype.onDrawImage = function() {
  724. this._preDrawCount++
  725. };
  726. return d
  727. }();
  728. b.Profiler = c;
  729. c.prototype.__class__ = "egret.Profiler"
  730. })(egret || (egret = {}));
  731. __extends = this.__extends || function(b, c) {
  732. function d() {
  733. this.constructor = b
  734. }
  735. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  736. d.prototype = c.prototype;
  737. b.prototype = new d
  738. };
  739. (function(b) {
  740. var c = function(d) {
  741. function a() {
  742. d.apply(this, arguments);
  743. this._timeScale = 1;
  744. this._paused = !1;
  745. this.callBackList = []
  746. }
  747. __extends(a, d);
  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(e) {
  753. var a = this.callBackList.concat(),
  754. b = a.length;
  755. e *= this._timeScale;
  756. e *= this._timeScale;
  757. for (var d = 0; d < b; d++) {
  758. var c = a[d];
  759. c.listener.call(c.thisObject, e)
  760. }
  761. };
  762. a.prototype.register = function(e, a, b) {
  763. void 0 === b &&
  764. (b = 0);
  765. this._insertEventBin(this.callBackList, e, a, b)
  766. };
  767. a.prototype.unregister = function(e, a) {
  768. this._removeEventBin(this.callBackList, e, a)
  769. };
  770. a.prototype.setTimeout = function(e, a, d) {
  771. for (var c = [], g = 3; g < arguments.length; g++) c[g - 3] = arguments[g];
  772. b.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  773. b.setTimeout.apply(null, [e, a, d].concat(c))
  774. };
  775. a.prototype.setTimeScale = function(e) {
  776. this._timeScale = e
  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 d() {
  824. this.constructor = b
  825. }
  826. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  827. d.prototype = c.prototype;
  828. b.prototype = new d
  829. };
  830. (function(b) {
  831. var c = function(d) {
  832. function a(e, a) {
  833. void 0 === a && (a = 0);
  834. d.call(this);
  835. this._currentCount = 0;
  836. this.delay = e;
  837. this.repeatCount = a
  838. }
  839. __extends(a, d);
  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(e) {
  862. e = b.getTimer();
  863. e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER_COMPLETE)))
  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. e = a.indexOf("("),
  876. a = a.substring(9, e);
  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 e = b.split("."), k = e.length, a = __global, p = 0; p < k; p++)
  907. if (a = a[e[p]], !a) return null;
  908. return c[b] = a
  909. }
  910. })(egret || (egret = {}));
  911. var __global = __global || this;
  912. (function(b) {
  913. function c(e) {
  914. for (var a in d) {
  915. var b = d[a];
  916. b.delay -= e;
  917. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete d[a])
  918. }
  919. }
  920. var d = {},
  921. a = 0;
  922. b.setTimeout = function(e, k, p) {
  923. for (var l = [], g = 3; g < arguments.length; g++) l[g - 3] = arguments[g];
  924. l = {
  925. listener: e,
  926. thisObject: k,
  927. delay: p,
  928. params: l
  929. };
  930. 0 == a && b.Ticker.getInstance().register(c, null);
  931. a++;
  932. d[a] = l;
  933. return a
  934. };
  935. b.clearTimeout = function(e) {
  936. delete d[e]
  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 d() {
  954. this.constructor = b
  955. }
  956. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  957. d.prototype = c.prototype;
  958. b.prototype = new d
  959. };
  960. (function(b) {
  961. var c = function(d) {
  962. function a(e, a, b, c, g, f) {
  963. void 0 === e && (e = 1);
  964. void 0 === a && (a = 0);
  965. void 0 === b && (b = 0);
  966. void 0 === c && (c = 1);
  967. void 0 === g && (g = 0);
  968. void 0 === f && (f = 0);
  969. d.call(this);
  970. this.a = e;
  971. this.b = a;
  972. this.c = b;
  973. this.d = c;
  974. this.tx = g;
  975. this.ty = f
  976. }
  977. __extends(a, d);
  978. a.prototype.prepend = function(e, a, b, d, c, f) {
  979. var h = this.tx;
  980. if (1 != e || 0 != a || 0 != b || 1 != d) {
  981. var m = this.a,
  982. n = this.c;
  983. this.a = m * e + this.b * b;
  984. this.b = m * a + this.b * d;
  985. this.c = n * e + this.d * b;
  986. this.d = n * a + this.d * d
  987. }
  988. this.tx = h * e + this.ty * b + c;
  989. this.ty = h * a + this.ty * d + f;
  990. return this
  991. };
  992. a.prototype.append =
  993. function(e, a, b, d, c, f) {
  994. var h = this.a,
  995. m = this.b,
  996. n = this.c,
  997. q = this.d;
  998. if (1 != e || 0 != a || 0 != b || 1 != d) this.a = e * h + a * n, this.b = e * m + a * q, this.c = b * h + d * n, this.d = b * m + d * q;
  999. this.tx = c * h + f * n + this.tx;
  1000. this.ty = c * m + f * q + this.ty;
  1001. return this
  1002. };
  1003. a.prototype.prependTransform = function(e, a, d, c, g, f, h, m, n) {
  1004. if (g % 360) {
  1005. var q = b.NumberUtils.cos(g);
  1006. g = b.NumberUtils.sin(g)
  1007. } else q = 1, g = 0; if (m || n) this.tx -= m, this.ty -= n;
  1008. f || h ? (this.prepend(q * d, g * d, -g * c, q * c, 0, 0), this.prepend(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f),
  1009. e, a)) : this.prepend(q * d, g * d, -g * c, q * c, e, a);
  1010. return this
  1011. };
  1012. a.prototype.appendTransform = function(e, a, d, c, g, f, h, m, n) {
  1013. if (g % 360) {
  1014. var q = b.NumberUtils.cos(g);
  1015. g = b.NumberUtils.sin(g)
  1016. } else q = 1, g = 0;
  1017. f || h ? (this.append(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a), this.append(q * d, g * d, -g * c, q * c, 0, 0)) : this.append(q * d, g * d, -g * c, q * c, e, a);
  1018. if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
  1019. return this
  1020. };
  1021. a.prototype.rotate = function(e) {
  1022. var a = Math.cos(e);
  1023. e = Math.sin(e);
  1024. var b =
  1025. this.a,
  1026. d = this.c,
  1027. c = this.tx;
  1028. this.a = b * a - this.b * e;
  1029. this.b = b * e + this.b * a;
  1030. this.c = d * a - this.d * e;
  1031. this.d = d * e + this.d * a;
  1032. this.tx = c * a - this.ty * e;
  1033. this.ty = c * e + this.ty * a;
  1034. return this
  1035. };
  1036. a.prototype.skew = function(e, a) {
  1037. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(e), b.NumberUtils.cos(e), 0, 0);
  1038. return this
  1039. };
  1040. a.prototype.scale = function(e, a) {
  1041. this.a *= e;
  1042. this.d *= a;
  1043. this.c *= e;
  1044. this.b *= a;
  1045. this.tx *= e;
  1046. this.ty *= a;
  1047. return this
  1048. };
  1049. a.prototype.translate = function(e, a) {
  1050. this.tx += e;
  1051. this.ty += a;
  1052. return this
  1053. };
  1054. a.prototype.identity =
  1055. function() {
  1056. this.a = this.d = 1;
  1057. this.b = this.c = this.tx = this.ty = 0;
  1058. return this
  1059. };
  1060. a.prototype.identityMatrix = function(e) {
  1061. this.a = e.a;
  1062. this.b = e.b;
  1063. this.c = e.c;
  1064. this.d = e.d;
  1065. this.tx = e.tx;
  1066. this.ty = e.ty;
  1067. return this
  1068. };
  1069. a.prototype.invert = function() {
  1070. var e = this.a,
  1071. a = this.b,
  1072. b = this.c,
  1073. d = this.d,
  1074. c = this.tx,
  1075. f = e * d - a * b;
  1076. this.a = d / f;
  1077. this.b = -a / f;
  1078. this.c = -b / f;
  1079. this.d = e / f;
  1080. this.tx = (b * this.ty - d * c) / f;
  1081. this.ty = -(e * this.ty - a * c) / f;
  1082. return this
  1083. };
  1084. a.transformCoords = function(e, a, d) {
  1085. var c = b.Point.identity;
  1086. c.x = e.a * a + e.c * d + e.tx;
  1087. c.y = e.d * d + e.b * a + e.ty;
  1088. return c
  1089. };
  1090. a.prototype.toArray = function(e) {
  1091. this.array || (this.array = new Float32Array(9));
  1092. e ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1093. this.array[8] = 1;
  1094. return this.array
  1095. };
  1096. a.identity = new a;
  1097. a.DEG_TO_RAD = Math.PI / 180;
  1098. return a
  1099. }(b.HashObject);
  1100. b.Matrix = c;
  1101. c.prototype.__class__ = "egret.Matrix"
  1102. })(egret || (egret = {}));
  1103. __extends = this.__extends || function(b, c) {
  1104. function d() {
  1105. this.constructor = b
  1106. }
  1107. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1108. d.prototype = c.prototype;
  1109. b.prototype = new d
  1110. };
  1111. (function(b) {
  1112. var c = function(b) {
  1113. function a(e, a) {
  1114. void 0 === e && (e = 0);
  1115. void 0 === a && (a = 0);
  1116. b.call(this);
  1117. this.x = e;
  1118. this.y = a
  1119. }
  1120. __extends(a, b);
  1121. a.prototype.clone = function() {
  1122. return new a(this.x, this.y)
  1123. };
  1124. a.prototype.equals = function(e) {
  1125. return this.x == e.x && this.y == e.y
  1126. };
  1127. a.distance = function(e, a) {
  1128. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  1129. };
  1130. a.identity = new a(0, 0);
  1131. return a
  1132. }(b.HashObject);
  1133. b.Point = c;
  1134. c.prototype.__class__ = "egret.Point"
  1135. })(egret || (egret = {}));
  1136. __extends = this.__extends || function(b, c) {
  1137. function d() {
  1138. this.constructor = b
  1139. }
  1140. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1141. d.prototype = c.prototype;
  1142. b.prototype = new d
  1143. };
  1144. (function(b) {
  1145. var c = function(b) {
  1146. function a(e, a, p, c) {
  1147. void 0 === e && (e = 0);
  1148. void 0 === a && (a = 0);
  1149. void 0 === p && (p = 0);
  1150. void 0 === c && (c = 0);
  1151. b.call(this);
  1152. this.x = e;
  1153. this.y = a;
  1154. this.width = p;
  1155. this.height = c
  1156. }
  1157. __extends(a, b);
  1158. Object.defineProperty(a.prototype, "right", {
  1159. get: function() {
  1160. return this.x + this.width
  1161. },
  1162. set: function(e) {
  1163. this.width = e - this.x
  1164. },
  1165. enumerable: !0,
  1166. configurable: !0
  1167. });
  1168. Object.defineProperty(a.prototype, "bottom", {
  1169. get: function() {
  1170. return this.y + this.height
  1171. },
  1172. set: function(e) {
  1173. this.height = e - this.y
  1174. },
  1175. enumerable: !0,
  1176. configurable: !0
  1177. });
  1178. a.prototype.initialize = function(e, a, b, d) {
  1179. this.x = e;
  1180. this.y = a;
  1181. this.width = b;
  1182. this.height = d;
  1183. return this
  1184. };
  1185. a.prototype.contains = function(e, a) {
  1186. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1187. };
  1188. a.prototype.intersects = function(e) {
  1189. var a = e.right,
  1190. b = e.bottom,
  1191. d = this.right,
  1192. c = this.bottom;
  1193. return this.contains(e.x, e.y) || this.contains(e.x, b) || this.contains(a, e.y) || this.contains(a, b) || e.contains(this.x, this.y) || e.contains(this.x, c) || e.contains(d, this.y) || e.contains(d, c) ? !0 : !1
  1194. };
  1195. a.prototype.clone =
  1196. function() {
  1197. return new a(this.x, this.y, this.width, this.height)
  1198. };
  1199. a.prototype.containsPoint = function(e) {
  1200. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1201. };
  1202. a.identity = new a(0, 0, 0, 0);
  1203. return a
  1204. }(b.HashObject);
  1205. b.Rectangle = c;
  1206. c.prototype.__class__ = "egret.Rectangle"
  1207. })(egret || (egret = {}));
  1208. (function(b) {
  1209. var c = function() {
  1210. function d() {}
  1211. d.fatal = function(a, e) {
  1212. void 0 === e && (e = null);
  1213. b.Logger.traceToConsole("Fatal", a, e);
  1214. throw Error(b.Logger.getTraceCode("Fatal", a, e));
  1215. };
  1216. d.info = function(a, e) {
  1217. void 0 === e && (e = null);
  1218. b.Logger.traceToConsole("Info", a, e)
  1219. };
  1220. d.warning = function(a, e) {
  1221. void 0 === e && (e = null);
  1222. b.Logger.traceToConsole("Warning", a, e)
  1223. };
  1224. d.traceToConsole = function(a, e, k) {
  1225. console.log(b.Logger.getTraceCode(a, e, k))
  1226. };
  1227. d.getTraceCode = function(a, e, k) {
  1228. return "[" + a + "]" + e + ":" + (null == k ? "" : k)
  1229. };
  1230. return d
  1231. }();
  1232. b.Logger =
  1233. c;
  1234. c.prototype.__class__ = "egret.Logger"
  1235. })(egret || (egret = {}));
  1236. __extends = this.__extends || function(b, c) {
  1237. function d() {
  1238. this.constructor = b
  1239. }
  1240. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1241. d.prototype = c.prototype;
  1242. b.prototype = new d
  1243. };
  1244. (function(b) {
  1245. var c = function(d) {
  1246. function a() {
  1247. d.call(this);
  1248. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1249. this._xmlDict = {};
  1250. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1251. }
  1252. __extends(a, d);
  1253. a.getInstance = function() {
  1254. a._instance || (a._instance = new a);
  1255. return a._instance
  1256. };
  1257. a.prototype.parserXML = function(e) {
  1258. for (var a = 0;
  1259. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1260. 0 != a && (e = e.substring(a, e.length));
  1261. this._isSupportDOMParser ?
  1262. a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1263. null == a && b.Logger.info("xml not found!");
  1264. return a
  1265. };
  1266. a._instance = null;
  1267. return a
  1268. }(b.HashObject);
  1269. b.SAXParser = c;
  1270. c.prototype.__class__ = "egret.SAXParser"
  1271. })(egret || (egret = {}));
  1272. __extends = this.__extends || function(b, c) {
  1273. function d() {
  1274. this.constructor = b
  1275. }
  1276. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1277. d.prototype = c.prototype;
  1278. b.prototype = new d
  1279. };
  1280. (function(b) {
  1281. var c = function(e) {
  1282. function k() {
  1283. e.call(this);
  1284. this._designHeight = this._designWidth = 0;
  1285. this._scaleY = this._scaleX = 1;
  1286. this._stageHeight = this._stageWidth = this._offSetY = 0
  1287. }
  1288. __extends(k, e);
  1289. k.getInstance = function() {
  1290. null == k.instance && (a.initialize(), k.instance = new k);
  1291. return k.instance
  1292. };
  1293. k.prototype.setDesignSize = function(e, a, k) {
  1294. this._designWidth = e;
  1295. this._designHeight = a;
  1296. k && (b.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1297. this._setResolutionPolicy(k))
  1298. };
  1299. k.prototype._setResolutionPolicy = function(e) {
  1300. this._resolutionPolicy = e;
  1301. e.init(this);
  1302. e._apply(this, this._designWidth, this._designHeight)
  1303. };
  1304. k.prototype.getScaleX = function() {
  1305. return this._scaleX
  1306. };
  1307. k.prototype.getScaleY = function() {
  1308. return this._scaleY
  1309. };
  1310. k.prototype.getOffSetY = function() {
  1311. return this._offSetY
  1312. };
  1313. k.canvas_name = "egretCanvas";
  1314. k.canvas_div_name = "gameDiv";
  1315. return k
  1316. }(b.HashObject);
  1317. b.StageDelegate = c;
  1318. c.prototype.__class__ = "egret.StageDelegate";
  1319. var d = function() {
  1320. function e(a,
  1321. k) {
  1322. this._containerStrategy = a;
  1323. this._contentStrategy = k
  1324. }
  1325. e.prototype.init = function(e) {
  1326. this._containerStrategy.init(e);
  1327. this._contentStrategy.init(e)
  1328. };
  1329. e.prototype._apply = function(e, a, k) {
  1330. this._containerStrategy._apply(e, a, k);
  1331. this._contentStrategy._apply(e, a, k)
  1332. };
  1333. return e
  1334. }();
  1335. b.ResolutionPolicy = d;
  1336. d.prototype.__class__ = "egret.ResolutionPolicy";
  1337. var a = function() {
  1338. function a() {}
  1339. a.initialize = function() {
  1340. a.EQUAL_TO_FRAME = new e
  1341. };
  1342. a.prototype.init = function(e) {};
  1343. a.prototype._apply = function(e, a, k) {};
  1344. a.prototype._setupContainer =
  1345. function() {
  1346. var e = document.body,
  1347. a;
  1348. e && (a = e.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1349. };
  1350. return a
  1351. }();
  1352. b.ContainerStrategy = a;
  1353. a.prototype.__class__ = "egret.ContainerStrategy";
  1354. var e = function(e) {
  1355. function a() {
  1356. e.apply(this, arguments)
  1357. }
  1358. __extends(a, e);
  1359. a.prototype._apply = function(e) {
  1360. this._setupContainer()
  1361. };
  1362. return a
  1363. }(a);
  1364. b.EqualToFrame = e;
  1365. e.prototype.__class__ = "egret.EqualToFrame";
  1366. d = function() {
  1367. function e() {}
  1368. e.prototype.init = function(e) {};
  1369. e.prototype._apply = function(e, a, k) {};
  1370. e.prototype.setEgretSize = function(e, a, k, d, p, n) {
  1371. void 0 === n && (n = 0);
  1372. b.StageDelegate.getInstance()._stageWidth = Math.round(e);
  1373. b.StageDelegate.getInstance()._stageHeight =
  1374. Math.round(a);
  1375. e = document.getElementById(c.canvas_div_name);
  1376. e.style.width = k + "px";
  1377. e.style.height = d + "px";
  1378. e.style.top = n + "px"
  1379. };
  1380. e.prototype._getClientWidth = function() {
  1381. return document.documentElement.clientWidth
  1382. };
  1383. e.prototype._getClientHeight = function() {
  1384. return document.documentElement.clientHeight
  1385. };
  1386. return e
  1387. }();
  1388. b.ContentStrategy = d;
  1389. d.prototype.__class__ = "egret.ContentStrategy";
  1390. var k = function(e) {
  1391. function a(k) {
  1392. void 0 === k && (k = 0);
  1393. e.call(this);
  1394. this.minWidth = k
  1395. }
  1396. __extends(a, e);
  1397. a.prototype._apply = function(e, a, k) {
  1398. a =
  1399. this._getClientWidth();
  1400. var b = this._getClientHeight(),
  1401. d = b / k,
  1402. p = a / d,
  1403. c = 1;
  1404. 0 != this.minWidth && (c = Math.min(1, p / this.minWidth));
  1405. this.setEgretSize(p / c, k, a, b * c);
  1406. e._scaleX = d * c;
  1407. e._scaleY = d * c
  1408. };
  1409. return a
  1410. }(d);
  1411. b.FixedHeight = k;
  1412. k.prototype.__class__ = "egret.FixedHeight";
  1413. k = function(e) {
  1414. function a(k) {
  1415. void 0 === k && (k = 0);
  1416. e.call(this);
  1417. this.minHeight = k
  1418. }
  1419. __extends(a, e);
  1420. a.prototype._apply = function(e, a, k) {
  1421. k = this._getClientWidth();
  1422. var b = this._getClientHeight(),
  1423. d = k / a,
  1424. p = b / d,
  1425. c = 1;
  1426. 0 != this.minHeight && (c = Math.min(1, p / this.minHeight));
  1427. this.setEgretSize(a,
  1428. p / c, k * c, b, k * (1 - c) / 2);
  1429. e._scaleX = d * c;
  1430. e._scaleY = d * c
  1431. };
  1432. return a
  1433. }(d);
  1434. b.FixedWidth = k;
  1435. k.prototype.__class__ = "egret.FixedWidth";
  1436. k = function(e) {
  1437. function a(k, b) {
  1438. e.call(this);
  1439. this.width = k;
  1440. this.height = b
  1441. }
  1442. __extends(a, e);
  1443. a.prototype._apply = function(e, a, k) {
  1444. k = this.width;
  1445. var b = this.height,
  1446. d = k / a;
  1447. this.setEgretSize(a, b / d, k, b);
  1448. e._scaleX = d;
  1449. e._scaleY = d
  1450. };
  1451. return a
  1452. }(d);
  1453. b.FixedSize = k;
  1454. k.prototype.__class__ = "egret.FixedSize";
  1455. k = function(e) {
  1456. function a() {
  1457. e.call(this)
  1458. }
  1459. __extends(a, e);
  1460. a.prototype._apply = function(e, a, k) {
  1461. this.setEgretSize(a,
  1462. k, a, k, Math.floor((a - a) / 2));
  1463. e._scaleX = 1;
  1464. e._scaleY = 1
  1465. };
  1466. return a
  1467. }(d);
  1468. b.NoScale = k;
  1469. k.prototype.__class__ = "egret.NoScale";
  1470. k = function(e) {
  1471. function a() {
  1472. e.call(this)
  1473. }
  1474. __extends(a, e);
  1475. a.prototype._apply = function(e, a, k) {
  1476. var b = this._getClientWidth(),
  1477. d = this._getClientHeight(),
  1478. p = b,
  1479. c = d,
  1480. l = p / a < c / k ? p / a : c / k,
  1481. p = a * l,
  1482. c = k * l,
  1483. b = Math.floor((b - p) / 2);
  1484. e._offSetY = Math.floor((d - c) / 2);
  1485. this.setEgretSize(a, k / 1, 1 * p, c, b, e._offSetY);
  1486. e._scaleX = 1 * l;
  1487. e._scaleY = 1 * l
  1488. };
  1489. return a
  1490. }(d);
  1491. b.ShowAll = k;
  1492. k.prototype.__class__ = "egret.ShowAll";
  1493. d = function(e) {
  1494. function a() {
  1495. e.call(this)
  1496. }
  1497. __extends(a, e);
  1498. a.prototype._apply = function(e, a, k) {
  1499. var b = this._getClientWidth(),
  1500. d = this._getClientHeight(),
  1501. b = b / a,
  1502. d = d / k;
  1503. this.setEgretSize(a, k, a * b, k * d);
  1504. e._scaleX = b;
  1505. e._scaleY = d
  1506. };
  1507. return a
  1508. }(d);
  1509. b.FullScreen = d;
  1510. d.prototype.__class__ = "egret.FullScreen"
  1511. })(egret || (egret = {}));
  1512. __extends = this.__extends || function(b, c) {
  1513. function d() {
  1514. this.constructor = b
  1515. }
  1516. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1517. d.prototype = c.prototype;
  1518. b.prototype = new d
  1519. };
  1520. (function(b) {
  1521. var c = function(d) {
  1522. function a() {
  1523. d.call(this);
  1524. this._originalData = {};
  1525. this._drawAreaList = []
  1526. }
  1527. __extends(a, d);
  1528. a.getInstance = function() {
  1529. null == a.instance && (a.instance = new a);
  1530. return a.instance
  1531. };
  1532. a.prototype.addDrawArea = function(e) {
  1533. this._drawAreaList.push(e)
  1534. };
  1535. a.prototype.clearDrawArea = function() {
  1536. this._drawAreaList = []
  1537. };
  1538. a.prototype.drawImage = function(e, a, d, c, g, f, h, m, n, q, r) {
  1539. void 0 === r && (r = void 0);
  1540. h = h || 0;
  1541. m = m || 0;
  1542. var t = a._texture_to_render;
  1543. if (null != t && 0 != f && 0 != g && 0 != n && 0 != q) {
  1544. var s = b.MainContext.instance.rendererContext.texture_scale_factor;
  1545. g /= s;
  1546. f /= s;
  1547. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1548. s = b.DisplayObject.getTransformBounds(a._getSize(b.Rectangle.identity), a._worldTransform);
  1549. a._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1550. s = this._originalData;
  1551. s.sourceX = d;
  1552. s.sourceY = c;
  1553. s.sourceWidth = g;
  1554. s.sourceHeight = f;
  1555. s.destX = h;
  1556. s.destY = m;
  1557. s.destWidth = n;
  1558. s.destHeight = q;
  1559. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1560. if (!this.ignoreRender(a, u[v], s.destX, s.destY)) {
  1561. e.drawImage(t, d, c, g, f, h, m, n, q, r);
  1562. break
  1563. }
  1564. } else e.drawImage(t, d, c, g, f, h, m, n, q, r)
  1565. }
  1566. };
  1567. a.prototype.ignoreRender = function(e, a, b, d) {
  1568. var c = e._worldBounds;
  1569. b *= e._worldTransform.a;
  1570. d *= e._worldTransform.d;
  1571. return c.x + c.width + b <= a.x || c.x + b >= a.x + a.width || c.y + c.height + d <= a.y || c.y + d >= a.y + a.height ? !0 : !1
  1572. };
  1573. a.prototype.getDrawAreaList = function() {
  1574. var e;
  1575. 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,
  1576. this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1577. return e
  1578. };
  1579. a.prototype.onResize = function() {
  1580. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1581. this._defaultDrawAreaList = null
  1582. };
  1583. return a
  1584. }(b.HashObject);
  1585. b.RenderFilter = c;
  1586. c.prototype.__class__ = "egret.RenderFilter"
  1587. })(egret || (egret = {}));
  1588. (function(b) {
  1589. var c = function() {
  1590. function d() {}
  1591. d.mapClass = function(a, e, k) {
  1592. void 0 === k && (k = "");
  1593. a = this.getKey(a) + "#" + k;
  1594. this.mapClassDic[a] = e
  1595. };
  1596. d.getKey = function(a) {
  1597. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1598. };
  1599. d.mapValue = function(a, e, k) {
  1600. void 0 === k && (k = "");
  1601. a = this.getKey(a) + "#" + k;
  1602. this.mapValueDic[a] = e
  1603. };
  1604. d.hasMapRule = function(a, e) {
  1605. void 0 === e && (e = "");
  1606. var k = this.getKey(a) + "#" + e;
  1607. return this.mapValueDic[k] || this.mapClassDic[k] ? !0 : !1
  1608. };
  1609. d.getInstance = function(a, e) {
  1610. void 0 === e && (e = "");
  1611. var k = this.getKey(a) + "#" +
  1612. e;
  1613. if (this.mapValueDic[k]) return this.mapValueDic[k];
  1614. var b = this.mapClassDic[k];
  1615. if (b) return b = new b, this.mapValueDic[k] = b, delete this.mapClassDic[k], b;
  1616. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + k + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1617. };
  1618. d.mapClassDic = {};
  1619. d.mapValueDic = {};
  1620. return d
  1621. }();
  1622. b.Injector = c;
  1623. c.prototype.__class__ = "egret.Injector"
  1624. })(egret ||
  1625. (egret = {}));
  1626. (function(b) {
  1627. var c = function() {
  1628. function b() {}
  1629. b.NORMAL = "normal";
  1630. b.ADD = "add";
  1631. return b
  1632. }();
  1633. b.BlendMode = c;
  1634. c.prototype.__class__ = "egret.BlendMode"
  1635. })(egret || (egret = {}));
  1636. __extends = this.__extends || function(b, c) {
  1637. function d() {
  1638. this.constructor = b
  1639. }
  1640. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1641. d.prototype = c.prototype;
  1642. b.prototype = new d
  1643. };
  1644. (function(b) {
  1645. var c = function(d) {
  1646. function a() {
  1647. d.call(this);
  1648. this.__hack_local_matrix = null;
  1649. this._sizeDirty = this._normalDirty = !0;
  1650. this._parent = this._texture_to_render = null;
  1651. this._y = this._x = 0;
  1652. this._scaleY = this._scaleX = 1;
  1653. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1654. this._visible = !0;
  1655. this._rotation = 0;
  1656. this._alpha = 1;
  1657. this._skewY = this._skewX = 0;
  1658. this._touchEnabled = !1;
  1659. this._scrollRect = this.blendMode = null;
  1660. this._hasHeightSet = this._hasWidthSet = !1;
  1661. this._worldBounds = this.mask = null;
  1662. this.worldAlpha =
  1663. 1;
  1664. this._rectH = this._rectW = 0;
  1665. this._stage = null;
  1666. this._cacheDirty = this._cacheAsBitmap = !1;
  1667. this._colorTransform = null;
  1668. this._worldTransform = new b.Matrix;
  1669. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1670. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1671. }
  1672. __extends(a, d);
  1673. a.prototype._setDirty = function() {
  1674. this._normalDirty = !0
  1675. };
  1676. a.prototype.getDirty = function() {
  1677. return this._normalDirty || this._sizeDirty
  1678. };
  1679. a.prototype._setParentSizeDirty = function() {
  1680. var e = this._parent;
  1681. !e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
  1682. };
  1683. a.prototype._setSizeDirty =
  1684. function() {
  1685. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1686. };
  1687. a.prototype._clearDirty = function() {
  1688. this._normalDirty = !1
  1689. };
  1690. a.prototype._clearSizeDirty = function() {
  1691. this._sizeDirty = !1
  1692. };
  1693. Object.defineProperty(a.prototype, "parent", {
  1694. get: function() {
  1695. return this._parent
  1696. },
  1697. enumerable: !0,
  1698. configurable: !0
  1699. });
  1700. a.prototype._parentChanged = function(e) {
  1701. this._parent = e
  1702. };
  1703. Object.defineProperty(a.prototype, "x", {
  1704. get: function() {
  1705. return this._x
  1706. },
  1707. set: function(e) {
  1708. this._setX(e)
  1709. },
  1710. enumerable: !0,
  1711. configurable: !0
  1712. });
  1713. a.prototype._setX = function(e) {
  1714. b.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1715. };
  1716. Object.defineProperty(a.prototype, "y", {
  1717. get: function() {
  1718. return this._y
  1719. },
  1720. set: function(e) {
  1721. this._setY(e)
  1722. },
  1723. enumerable: !0,
  1724. configurable: !0
  1725. });
  1726. a.prototype._setY = function(e) {
  1727. b.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1728. };
  1729. Object.defineProperty(a.prototype, "scaleX", {
  1730. get: function() {
  1731. return this._scaleX
  1732. },
  1733. set: function(e) {
  1734. b.NumberUtils.isNumber(e) &&
  1735. this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1736. },
  1737. enumerable: !0,
  1738. configurable: !0
  1739. });
  1740. Object.defineProperty(a.prototype, "scaleY", {
  1741. get: function() {
  1742. return this._scaleY
  1743. },
  1744. set: function(e) {
  1745. b.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1746. },
  1747. enumerable: !0,
  1748. configurable: !0
  1749. });
  1750. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1751. get: function() {
  1752. return this._anchorOffsetX
  1753. },
  1754. set: function(e) {
  1755. b.NumberUtils.isNumber(e) && this._anchorOffsetX !=
  1756. e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1757. },
  1758. enumerable: !0,
  1759. configurable: !0
  1760. });
  1761. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1762. get: function() {
  1763. return this._anchorOffsetY
  1764. },
  1765. set: function(e) {
  1766. b.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1767. },
  1768. enumerable: !0,
  1769. configurable: !0
  1770. });
  1771. Object.defineProperty(a.prototype, "anchorX", {
  1772. get: function() {
  1773. return this._anchorX
  1774. },
  1775. set: function(e) {
  1776. this._setAnchorX(e)
  1777. },
  1778. enumerable: !0,
  1779. configurable: !0
  1780. });
  1781. a.prototype._setAnchorX = function(e) {
  1782. b.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1783. };
  1784. Object.defineProperty(a.prototype, "anchorY", {
  1785. get: function() {
  1786. return this._anchorY
  1787. },
  1788. set: function(e) {
  1789. this._setAnchorY(e)
  1790. },
  1791. enumerable: !0,
  1792. configurable: !0
  1793. });
  1794. a.prototype._setAnchorY = function(e) {
  1795. b.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1796. };
  1797. Object.defineProperty(a.prototype, "visible", {
  1798. get: function() {
  1799. return this._visible
  1800. },
  1801. set: function(e) {
  1802. this._setVisible(e)
  1803. },
  1804. enumerable: !0,
  1805. configurable: !0
  1806. });
  1807. a.prototype._setVisible = function(e) {
  1808. this._visible != e && (this._visible = e, this._setSizeDirty())
  1809. };
  1810. Object.defineProperty(a.prototype, "rotation", {
  1811. get: function() {
  1812. return this._rotation
  1813. },
  1814. set: function(e) {
  1815. b.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setSizeDirty())
  1816. },
  1817. enumerable: !0,
  1818. configurable: !0
  1819. });
  1820. Object.defineProperty(a.prototype, "alpha", {
  1821. get: function() {
  1822. return this._alpha
  1823. },
  1824. set: function(e) {
  1825. b.NumberUtils.isNumber(e) &&
  1826. this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
  1827. },
  1828. enumerable: !0,
  1829. configurable: !0
  1830. });
  1831. Object.defineProperty(a.prototype, "skewX", {
  1832. get: function() {
  1833. return this._skewX
  1834. },
  1835. set: function(e) {
  1836. b.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setSizeDirty())
  1837. },
  1838. enumerable: !0,
  1839. configurable: !0
  1840. });
  1841. Object.defineProperty(a.prototype, "skewY", {
  1842. get: function() {
  1843. return this._skewY
  1844. },
  1845. set: function(e) {
  1846. b.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setSizeDirty())
  1847. },
  1848. enumerable: !0,
  1849. configurable: !0
  1850. });
  1851. Object.defineProperty(a.prototype, "touchEnabled", {
  1852. get: function() {
  1853. return this._touchEnabled
  1854. },
  1855. set: function(e) {
  1856. this._setTouchEnabled(e)
  1857. },
  1858. enumerable: !0,
  1859. configurable: !0
  1860. });
  1861. a.prototype._setTouchEnabled = function(e) {
  1862. this._touchEnabled = e
  1863. };
  1864. Object.defineProperty(a.prototype, "scrollRect", {
  1865. get: function() {
  1866. return this._scrollRect
  1867. },
  1868. set: function(e) {
  1869. this._setScrollRect(e)
  1870. },
  1871. enumerable: !0,
  1872. configurable: !0
  1873. });
  1874. a.prototype._setScrollRect = function(e) {
  1875. this._scrollRect = e;
  1876. this._setSizeDirty()
  1877. };
  1878. Object.defineProperty(a.prototype,
  1879. "measuredWidth", {
  1880. get: function() {
  1881. return this._measureBounds().width
  1882. },
  1883. enumerable: !0,
  1884. configurable: !0
  1885. });
  1886. Object.defineProperty(a.prototype, "measuredHeight", {
  1887. get: function() {
  1888. return this._measureBounds().height
  1889. },
  1890. enumerable: !0,
  1891. configurable: !0
  1892. });
  1893. Object.defineProperty(a.prototype, "explicitWidth", {
  1894. get: function() {
  1895. return this._explicitWidth
  1896. },
  1897. enumerable: !0,
  1898. configurable: !0
  1899. });
  1900. Object.defineProperty(a.prototype, "explicitHeight", {
  1901. get: function() {
  1902. return this._explicitHeight
  1903. },
  1904. enumerable: !0,
  1905. configurable: !0
  1906. });
  1907. Object.defineProperty(a.prototype,
  1908. "width", {
  1909. get: function() {
  1910. return this._getSize(b.Rectangle.identity).width
  1911. },
  1912. set: function(e) {
  1913. this._setWidth(e)
  1914. },
  1915. enumerable: !0,
  1916. configurable: !0
  1917. });
  1918. Object.defineProperty(a.prototype, "height", {
  1919. get: function() {
  1920. return this._getSize(b.Rectangle.identity).height
  1921. },
  1922. set: function(e) {
  1923. this._setHeight(e)
  1924. },
  1925. enumerable: !0,
  1926. configurable: !0
  1927. });
  1928. a.prototype._setWidth = function(e) {
  1929. this._setSizeDirty();
  1930. this._setCacheDirty();
  1931. this._explicitWidth = e;
  1932. this._hasWidthSet = b.NumberUtils.isNumber(e)
  1933. };
  1934. a.prototype._setHeight = function(e) {
  1935. this._setSizeDirty();
  1936. this._setCacheDirty();
  1937. this._explicitHeight = e;
  1938. this._hasHeightSet = b.NumberUtils.isNumber(e)
  1939. };
  1940. a.prototype._draw = function(e) {
  1941. if (this._visible && !this.drawCacheTexture(e)) {
  1942. this._colorTransform && e.setGlobalColorTransform(this._colorTransform.matrix);
  1943. e.setAlpha(this.worldAlpha, this.blendMode);
  1944. e.setTransform(this._worldTransform);
  1945. var a = this.mask || this._scrollRect;
  1946. a && e.pushMask(a);
  1947. this._render(e);
  1948. a && e.popMask();
  1949. this._colorTransform && e.setGlobalColorTransform(null)
  1950. }
  1951. this.destroyCacheBounds()
  1952. };
  1953. a.prototype.drawCacheTexture =
  1954. function(e) {
  1955. if (!1 == this._cacheAsBitmap) return !1;
  1956. 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();
  1957. if (null == this._texture_to_render) return !1;
  1958. var a = this._texture_to_render,
  1959. d = a._offsetX,
  1960. c = a._offsetY,
  1961. g = a._textureWidth,
  1962. a = a._textureHeight;
  1963. this._updateTransform();
  1964. e.setAlpha(this.worldAlpha, this.blendMode);
  1965. e.setTransform(this._worldTransform);
  1966. var f = b.MainContext.instance.rendererContext.texture_scale_factor;
  1967. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, g * f, a * f, d, c, g, a);
  1968. return !0
  1969. };
  1970. a.prototype._updateTransform = function() {
  1971. this._calculateWorldTransform()
  1972. };
  1973. a.prototype._calculateWorldTransform = function() {
  1974. var e = this._worldTransform,
  1975. a = this._parent;
  1976. e.identityMatrix(a._worldTransform);
  1977. this._getMatrix(e);
  1978. var b = this._scrollRect;
  1979. b && e.append(1, 0, 0, 1, -b.x, -b.y);
  1980. this.worldAlpha = a.worldAlpha * this._alpha
  1981. };
  1982. a.prototype._render = function(e) {};
  1983. a.prototype.getBounds =
  1984. function(e, a) {
  1985. void 0 === a && (a = !0);
  1986. var d = this._measureBounds(),
  1987. c = this._hasWidthSet ? this._explicitWidth : d.width,
  1988. g = this._hasHeightSet ? this._explicitHeight : d.height;
  1989. this._rectW = d.width;
  1990. this._rectH = d.height;
  1991. this._clearSizeDirty();
  1992. var f = d.x,
  1993. d = d.y,
  1994. h = 0,
  1995. m = 0;
  1996. a && (0 != this._anchorX || 0 != this._anchorY ? (h = c * this._anchorX, m = g * this._anchorY) : (h = this._anchorOffsetX, m = this._anchorOffsetY));
  1997. this._cacheBounds.initialize(f - h, d - m, c, g);
  1998. c = this._cacheBounds;
  1999. e || (e = new b.Rectangle);
  2000. return e.initialize(c.x, c.y, c.width, c.height)
  2001. };
  2002. a.prototype.destroyCacheBounds = function() {
  2003. this._cacheBounds.x = 0;
  2004. this._cacheBounds.y = 0;
  2005. this._cacheBounds.width = 0;
  2006. this._cacheBounds.height = 0
  2007. };
  2008. a.prototype._getConcatenatedMatrix = function() {
  2009. for (var e = a.identityMatrixForGetConcatenated.identity(), k = this; null != k;) {
  2010. if (0 != k._anchorX || 0 != k._anchorY) {
  2011. var d = k._getSize(b.Rectangle.identity);
  2012. e.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, d.width * k._anchorX, d.height * k._anchorY)
  2013. } else e.prependTransform(k._x, k._y, k._scaleX, k._scaleY,
  2014. k._rotation, k._skewX, k._skewY, k._anchorOffsetX, k._anchorOffsetY);
  2015. k._scrollRect && e.prepend(1, 0, 0, 1, -k._scrollRect.x, -k._scrollRect.y);
  2016. k = k._parent
  2017. }
  2018. return e
  2019. };
  2020. a.prototype.localToGlobal = function(e, a, d) {
  2021. void 0 === e && (e = 0);
  2022. void 0 === a && (a = 0);
  2023. var c = this._getConcatenatedMatrix();
  2024. c.append(1, 0, 0, 1, e, a);
  2025. d || (d = new b.Point);
  2026. d.x = c.tx;
  2027. d.y = c.ty;
  2028. return d
  2029. };
  2030. a.prototype.globalToLocal = function(e, a, d) {
  2031. void 0 === e && (e = 0);
  2032. void 0 === a && (a = 0);
  2033. var c = this._getConcatenatedMatrix();
  2034. c.invert();
  2035. c.append(1, 0, 0, 1, e, a);
  2036. d || (d = new b.Point);
  2037. d.x = c.tx;
  2038. d.y = c.ty;
  2039. return d
  2040. };
  2041. a.prototype.hitTest = function(e, a, d) {
  2042. void 0 === d && (d = !1);
  2043. if (!this._visible || !d && !this._touchEnabled) return null;
  2044. d = this._getSize(b.Rectangle.identity);
  2045. return 0 <= e && e < d.width && 0 <= a && a < d.height ? this.mask || this._scrollRect ? this._scrollRect && e > this._scrollRect.x && a > this._scrollRect.y && e < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ?
  2046. this : null : this : null
  2047. };
  2048. a.prototype.hitTestPoint = function(e, a, d) {
  2049. e = this.globalToLocal(e, a);
  2050. return d ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), d = this._hitTestPointTexture, d.drawToTexture(this), 0 != d.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  2051. };
  2052. a.prototype._getMatrix = function(e) {
  2053. e || (e = b.Matrix.identity.identity());
  2054. var a, d;
  2055. d = this._getOffsetPoint();
  2056. a = d.x;
  2057. d = d.y;
  2058. var c = this.__hack_local_matrix;
  2059. c ? (e.append(c.a, c.b, c.c, c.d, c.tx, c.ty), e.append(1, 0, 0, 1, -a, -d)) : e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, d);
  2060. return e
  2061. };
  2062. a.prototype._getSize = function(e) {
  2063. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(e)
  2064. };
  2065. a.prototype._measureSize = function(e) {
  2066. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW,
  2067. e.height = this._rectH);
  2068. e.x = 0;
  2069. e.y = 0;
  2070. return e
  2071. };
  2072. a.prototype._measureBounds = function() {
  2073. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2074. };
  2075. a.prototype._getOffsetPoint = function() {
  2076. var e = this._anchorOffsetX,
  2077. a = this._anchorOffsetY;
  2078. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity), e = this._anchorX * a.width, a = this._anchorY * a.height;
  2079. var d = b.Point.identity;
  2080. d.x = e;
  2081. d.y = a;
  2082. return d
  2083. };
  2084. a.prototype._onAddToStage = function() {
  2085. this._stage = b.MainContext.instance.stage;
  2086. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2087. };
  2088. a.prototype._onRemoveFromStage = function() {
  2089. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2090. };
  2091. Object.defineProperty(a.prototype, "stage", {
  2092. get: function() {
  2093. return this._stage
  2094. },
  2095. enumerable: !0,
  2096. configurable: !0
  2097. });
  2098. a.prototype.addEventListener = function(e, k, p, c, g) {
  2099. void 0 === c && (c = !1);
  2100. void 0 === g && (g = 0);
  2101. d.prototype.addEventListener.call(this, e, k, p, c, g);
  2102. ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(c ? a._enterFrameCallBackList : a._renderCallBackList, k, p, g, this)
  2103. };
  2104. a.prototype.removeEventListener =
  2105. function(e, k, p, c) {
  2106. void 0 === c && (c = !1);
  2107. d.prototype.removeEventListener.call(this, e, k, p, c);
  2108. ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(c ? a._enterFrameCallBackList : a._renderCallBackList, k, p, this)
  2109. };
  2110. a.prototype.dispatchEvent = function(e) {
  2111. if (!e._bubbles) return d.prototype.dispatchEvent.call(this, e);
  2112. for (var a = [], b = this; b;) a.push(b), b = b._parent;
  2113. e._reset();
  2114. this._dispatchPropagationEvent(e, a);
  2115. return !e._isDefaultPrevented
  2116. };
  2117. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2118. b = a.length;
  2119. for (var d = 1, c = b - 1; 0 <= c; c--) {
  2120. var f = a[c];
  2121. e._currentTarget = f;
  2122. e._target = this;
  2123. e._eventPhase = d;
  2124. f._notifyListener(e);
  2125. if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
  2126. }
  2127. f = a[0];
  2128. e._currentTarget = f;
  2129. e._target = this;
  2130. e._eventPhase = 2;
  2131. f._notifyListener(e);
  2132. if (!e._isPropagationStopped && !e._isPropagationImmediateStopped)
  2133. for (d = 3, c = 1; c < b && (f = a[c], e._currentTarget = f, e._target = this, e._eventPhase = d, f._notifyListener(e), !e._isPropagationStopped && !e._isPropagationImmediateStopped); c++);
  2134. };
  2135. a.prototype.willTrigger =
  2136. function(e) {
  2137. for (var a = this; a;) {
  2138. if (a.hasEventListener(e)) return !0;
  2139. a = a._parent
  2140. }
  2141. return !1
  2142. };
  2143. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2144. get: function() {
  2145. return this._cacheAsBitmap
  2146. },
  2147. set: function(e) {
  2148. (this._cacheAsBitmap = e) ? b.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2149. },
  2150. enumerable: !0,
  2151. configurable: !0
  2152. });
  2153. a.prototype._makeBitmapCache = function() {
  2154. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2155. var e = this.renderTexture.drawToTexture(this);
  2156. this._texture_to_render = e ? this.renderTexture :
  2157. null;
  2158. return e
  2159. };
  2160. a.prototype._setCacheDirty = function(e) {
  2161. void 0 === e && (e = !0);
  2162. this._cacheDirty = e
  2163. };
  2164. a.getTransformBounds = function(e, a) {
  2165. var b = e.x,
  2166. d = e.y,
  2167. c = e.width,
  2168. f = e.height;
  2169. (b || d) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -d);
  2170. var h = c * a.a,
  2171. c = c * a.b,
  2172. m = f * a.c,
  2173. f = f * a.d,
  2174. n = a.tx,
  2175. q = a.ty,
  2176. r = n,
  2177. t = n,
  2178. s = q,
  2179. u = q;
  2180. (b = h + n) < r ? r = b : b > t && (t = b);
  2181. (b = h + m + n) < r ? r = b : b > t && (t = b);
  2182. (b = m + n) < r ? r = b : b > t && (t = b);
  2183. (d = c + q) < s ? s = d : d > u && (u = d);
  2184. (d = c + f + q) < s ? s = d : d > u && (u = d);
  2185. (d = f + q) < s ? s = d : d > u && (u = d);
  2186. return e.initialize(r, s, t - r, u - s)
  2187. };
  2188. Object.defineProperty(a.prototype, "colorTransform", {
  2189. get: function() {
  2190. return this._colorTransform
  2191. },
  2192. set: function(e) {
  2193. this._colorTransform = e
  2194. },
  2195. enumerable: !0,
  2196. configurable: !0
  2197. });
  2198. a.identityMatrixForGetConcatenated = new b.Matrix;
  2199. a._enterFrameCallBackList = [];
  2200. a._renderCallBackList = [];
  2201. return a
  2202. }(b.EventDispatcher);
  2203. b.DisplayObject = c;
  2204. c.prototype.__class__ = "egret.DisplayObject";
  2205. c = function() {
  2206. function b() {
  2207. this.matrix = null
  2208. }
  2209. b.prototype.updateColor = function(a, e, b, d, c, g, f, h) {};
  2210. return b
  2211. }();
  2212. b.ColorTransform = c;
  2213. c.prototype.__class__ = "egret.ColorTransform"
  2214. })(egret || (egret = {}));
  2215. __extends = this.__extends || function(b, c) {
  2216. function d() {
  2217. this.constructor = b
  2218. }
  2219. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2220. d.prototype = c.prototype;
  2221. b.prototype = new d
  2222. };
  2223. (function(b) {
  2224. var c = function(d) {
  2225. function a() {
  2226. d.call(this);
  2227. this._touchChildren = !0;
  2228. this._children = []
  2229. }
  2230. __extends(a, d);
  2231. Object.defineProperty(a.prototype, "touchChildren", {
  2232. get: function() {
  2233. return this._touchChildren
  2234. },
  2235. set: function(e) {
  2236. this._touchChildren = e
  2237. },
  2238. enumerable: !0,
  2239. configurable: !0
  2240. });
  2241. Object.defineProperty(a.prototype, "numChildren", {
  2242. get: function() {
  2243. return this._children.length
  2244. },
  2245. enumerable: !0,
  2246. configurable: !0
  2247. });
  2248. a.prototype.setChildIndex = function(e, a) {
  2249. this.doSetChildIndex(e, a)
  2250. };
  2251. a.prototype.doSetChildIndex = function(e,
  2252. a) {
  2253. var d = this._children.indexOf(e);
  2254. 0 > d && b.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2255. this._children.splice(d, 1);
  2256. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2257. };
  2258. a.prototype.addChild = function(e) {
  2259. var a = this._children.length;
  2260. e._parent == this && a--;
  2261. return this._doAddChild(e, a)
  2262. };
  2263. a.prototype.addChildAt = function(e, a) {
  2264. return this._doAddChild(e, a)
  2265. };
  2266. a.prototype._doAddChild = function(e, k, d) {
  2267. void 0 === d && (d = !0);
  2268. if (e == this) return e;
  2269. if (0 > k || k > this._children.length) return b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2270. e;
  2271. var c = e._parent;
  2272. if (c == this) return this.doSetChildIndex(e, k), e;
  2273. c && (k = c._children.indexOf(e), 0 <= k && c._doRemoveChild(k));
  2274. this._children.splice(k, 0, e);
  2275. e._parentChanged(this);
  2276. d && e.dispatchEventWith(b.Event.ADDED, !0);
  2277. if (this._stage)
  2278. for (e._onAddToStage(), k = a.__EVENT__ADD_TO_STAGE_LIST; 0 < k.length;) k.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2279. e._setDirty();
  2280. this._setSizeDirty();
  2281. return e
  2282. };
  2283. a.prototype.removeChild = function(e) {
  2284. e = this._children.indexOf(e);
  2285. if (0 <= e) return this._doRemoveChild(e);
  2286. b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2287. return null
  2288. };
  2289. a.prototype.removeChildAt = function(e) {
  2290. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2291. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2292. return null
  2293. };
  2294. a.prototype._doRemoveChild = function(e, k) {
  2295. void 0 === k && (k = !0);
  2296. var d = this._children,
  2297. c = d[e];
  2298. k && c.dispatchEventWith(b.Event.REMOVED, !0);
  2299. if (this._stage) {
  2300. c._onRemoveFromStage();
  2301. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2302. var f = g.shift();
  2303. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2304. f._stage = null
  2305. }
  2306. }
  2307. c._parentChanged(null);
  2308. d.splice(e, 1);
  2309. this._setSizeDirty();
  2310. return c
  2311. };
  2312. a.prototype.getChildAt = function(e) {
  2313. if (0 <= e && e < this._children.length) return this._children[e];
  2314. b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2315. return null
  2316. };
  2317. a.prototype.contains = function(e) {
  2318. for (; e;) {
  2319. if (e == this) return !0;
  2320. e = e._parent
  2321. }
  2322. return !1
  2323. };
  2324. a.prototype.swapChildrenAt = function(e, a) {
  2325. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2326. };
  2327. a.prototype.swapChildren = function(e, a) {
  2328. var d = this._children.indexOf(e),
  2329. c = this._children.indexOf(a); - 1 == d || -1 == c ? b.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(d, c)
  2330. };
  2331. a.prototype._swapChildrenAt = function(e, a) {
  2332. if (e != a) {
  2333. var b = this._children,
  2334. d = b[e];
  2335. b[e] = b[a];
  2336. b[a] = d
  2337. }
  2338. };
  2339. a.prototype.getChildIndex = function(e) {
  2340. return this._children.indexOf(e)
  2341. };
  2342. a.prototype.removeChildren = function() {
  2343. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2344. };
  2345. a.prototype._updateTransform =
  2346. function() {
  2347. if (this._visible) {
  2348. d.prototype._updateTransform.call(this);
  2349. for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2350. }
  2351. };
  2352. a.prototype._render = function(e) {
  2353. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._draw(e)
  2354. };
  2355. a.prototype._measureBounds = function() {
  2356. for (var e = 0, a = 0, d = 0, c = 0, g = this._children.length, f = 0; f < g; f++) {
  2357. var h = this._children[f];
  2358. if (h._visible) {
  2359. var m = h.getBounds(b.Rectangle.identity, !1),
  2360. n = m.x,
  2361. q = m.y,
  2362. r = m.width,
  2363. m = m.height,
  2364. h = h._getMatrix(),
  2365. h = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(n,
  2366. q, r, m), h),
  2367. n = h.x,
  2368. q = h.y,
  2369. r = h.width + h.x,
  2370. h = h.height + h.y;
  2371. if (n < e || 0 == f) e = n;
  2372. if (r > a || 0 == f) a = r;
  2373. if (q < d || 0 == f) d = q;
  2374. if (h > c || 0 == f) c = h
  2375. }
  2376. }
  2377. return b.Rectangle.identity.initialize(e, d, a - e, c - d)
  2378. };
  2379. a.prototype.hitTest = function(e, a, c) {
  2380. void 0 === c && (c = !1);
  2381. var l;
  2382. if (!this._visible) return null;
  2383. if (this._scrollRect) {
  2384. if (e < this._scrollRect.x || a < this._scrollRect.y || e > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2385. } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y >
  2386. a || a > this.mask.y + this.mask.height)) return null;
  2387. for (var g = this._children, f = this._touchChildren, h = g.length - 1; 0 <= h; h--) {
  2388. var m = g[h],
  2389. n = m._getMatrix(),
  2390. q = m._scrollRect;
  2391. q && n.append(1, 0, 0, 1, -q.x, -q.y);
  2392. n.invert();
  2393. n = b.Matrix.transformCoords(n, e, a);
  2394. if (m = m.hitTest(n.x, n.y, !0)) {
  2395. if (!f) return this;
  2396. if (m._touchEnabled && f) return m;
  2397. l = this
  2398. }
  2399. }
  2400. return l ? l : this._texture_to_render || this.graphics ? d.prototype.hitTest.call(this, e, a, c) : null
  2401. };
  2402. a.prototype._onAddToStage = function() {
  2403. d.prototype._onAddToStage.call(this);
  2404. for (var e = this._children.length,
  2405. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2406. };
  2407. a.prototype._onRemoveFromStage = function() {
  2408. d.prototype._onRemoveFromStage.call(this);
  2409. for (var e = this._children.length, a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
  2410. };
  2411. a.prototype.getChildByName = function(e) {
  2412. for (var a = this._children, b = a.length, d, c = 0; c < b; c++)
  2413. if (d = a[c], d.name == e) return d;
  2414. return null
  2415. };
  2416. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2417. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2418. return a
  2419. }(b.DisplayObject);
  2420. b.DisplayObjectContainer = c;
  2421. c.prototype.__class__ = "egret.DisplayObjectContainer"
  2422. })(egret ||
  2423. (egret = {}));
  2424. __extends = this.__extends || function(b, c) {
  2425. function d() {
  2426. this.constructor = b
  2427. }
  2428. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2429. d.prototype = c.prototype;
  2430. b.prototype = new d
  2431. };
  2432. (function(b) {
  2433. var c = function(d) {
  2434. function a(e, a) {
  2435. void 0 === e && (e = 480);
  2436. void 0 === a && (a = 800);
  2437. d.call(this);
  2438. this.touchEnabled = !0;
  2439. this._stage = this;
  2440. this._stageWidth = e;
  2441. this._stageHeight = a
  2442. }
  2443. __extends(a, d);
  2444. a.prototype.invalidate = function() {
  2445. a._invalidateRenderFlag = !0
  2446. };
  2447. Object.defineProperty(a.prototype, "scaleMode", {
  2448. get: function() {
  2449. return this._scaleMode
  2450. },
  2451. set: function(e) {
  2452. this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
  2453. },
  2454. enumerable: !0,
  2455. configurable: !0
  2456. });
  2457. a.prototype.changeSize = function() {
  2458. this.setResolutionPolicy();
  2459. this.dispatchEventWith(b.Event.RESIZE)
  2460. };
  2461. a.prototype.setResolutionPolicy = function() {
  2462. var e = {};
  2463. e[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2464. e[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2465. e[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2466. e[b.StageScaleMode.EXACT_FIT] = new b.FullScreen;
  2467. e = e[this._scaleMode];
  2468. if (!e) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2469. var a = new b.EqualToFrame,
  2470. e = new b.ResolutionPolicy(a, e);
  2471. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  2472. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2473. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2474. };
  2475. Object.defineProperty(a.prototype, "stageWidth", {
  2476. get: function() {
  2477. return this._stageWidth
  2478. },
  2479. enumerable: !0,
  2480. configurable: !0
  2481. });
  2482. Object.defineProperty(a.prototype, "stageHeight", {
  2483. get: function() {
  2484. return this._stageHeight
  2485. },
  2486. enumerable: !0,
  2487. configurable: !0
  2488. });
  2489. a.prototype.hitTest = function(e, a, d) {
  2490. if (!this._touchEnabled) return null;
  2491. var c;
  2492. if (!this._touchChildren) return this;
  2493. d = this._children;
  2494. for (var g = d.length - 1; 0 <= g; g--) {
  2495. c = d[g];
  2496. var f = c._getMatrix(),
  2497. h = c._scrollRect;
  2498. h && f.append(1, 0, 0, 1, -h.x, -h.y);
  2499. f.invert();
  2500. f = b.Matrix.transformCoords(f, e, a);
  2501. if ((c = c.hitTest(f.x, f.y, !0)) && c._touchEnabled) return c
  2502. }
  2503. return this
  2504. };
  2505. a.prototype.getBounds = function(e) {
  2506. e || (e = new b.Rectangle);
  2507. return e.initialize(0, 0, this._stageWidth, this._stageHeight)
  2508. };
  2509. a.prototype._updateTransform = function() {
  2510. for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2511. };
  2512. Object.defineProperty(a.prototype, "focus", {
  2513. get: function() {
  2514. return null
  2515. },
  2516. enumerable: !0,
  2517. configurable: !0
  2518. });
  2519. a._invalidateRenderFlag = !1;
  2520. return a
  2521. }(b.DisplayObjectContainer);
  2522. b.Stage = c;
  2523. c.prototype.__class__ = "egret.Stage"
  2524. })(egret || (egret = {}));
  2525. (function(b) {
  2526. var c = function() {
  2527. function b() {}
  2528. b.NO_BORDER = "noBorder";
  2529. b.NO_SCALE = "noScale";
  2530. b.SHOW_ALL = "showAll";
  2531. b.EXACT_FIT = "exactFit";
  2532. return b
  2533. }();
  2534. b.StageScaleMode = c;
  2535. c.prototype.__class__ = "egret.StageScaleMode"
  2536. })(egret || (egret = {}));
  2537. __extends = this.__extends || function(b, c) {
  2538. function d() {
  2539. this.constructor = b
  2540. }
  2541. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2542. d.prototype = c.prototype;
  2543. b.prototype = new d
  2544. };
  2545. (function(b) {
  2546. var c = function(d) {
  2547. function a(e) {
  2548. void 0 === e && (e = null);
  2549. d.call(this);
  2550. this._lastTouchPosition = new b.Point(0, 0);
  2551. this._lastTouchTime = 0;
  2552. this._lastTouchEvent = null;
  2553. this._velocitys = [];
  2554. this._content = null;
  2555. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2556. this._scrollTop = this._scrollLeft = 0;
  2557. this._vCanScroll = this._hCanScroll = !1;
  2558. this.touchEnabled = !0;
  2559. e && this.setContent(e)
  2560. }
  2561. __extends(a, d);
  2562. a.prototype.setContent = function(e) {
  2563. this._content !== e && (this.removeContent(), e && (this._content = e, d.prototype.addChild.call(this,
  2564. e), this._addEvents()))
  2565. };
  2566. a.prototype.removeContent = function() {
  2567. this._content && (this._removeEvents(), d.prototype.removeChildAt.call(this, 0));
  2568. this._content = null
  2569. };
  2570. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2571. get: function() {
  2572. return this._verticalScrollPolicy
  2573. },
  2574. set: function(e) {
  2575. e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
  2576. },
  2577. enumerable: !0,
  2578. configurable: !0
  2579. });
  2580. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2581. get: function() {
  2582. return this._horizontalScrollPolicy
  2583. },
  2584. set: function(e) {
  2585. e !=
  2586. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
  2587. },
  2588. enumerable: !0,
  2589. configurable: !0
  2590. });
  2591. Object.defineProperty(a.prototype, "scrollLeft", {
  2592. get: function() {
  2593. return this._scrollLeft
  2594. },
  2595. set: function(e) {
  2596. e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
  2597. },
  2598. enumerable: !0,
  2599. configurable: !0
  2600. });
  2601. Object.defineProperty(a.prototype, "scrollTop", {
  2602. get: function() {
  2603. return this._scrollTop
  2604. },
  2605. set: function(e) {
  2606. e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
  2607. },
  2608. enumerable: !0,
  2609. configurable: !0
  2610. });
  2611. a.prototype.setScrollPosition = function(e, a, b) {
  2612. void 0 === b && (b = !1);
  2613. if (!b || 0 != e || 0 != a)
  2614. if (b || this._scrollTop != e || this._scrollLeft != a) {
  2615. if (b) {
  2616. b = this._isOnTheEdge(!0);
  2617. var d = this._isOnTheEdge(!1);
  2618. this._scrollTop += b ? e / 2 : e;
  2619. this._scrollLeft += d ? a / 2 : a
  2620. } else this._scrollTop = e, this._scrollLeft = a;
  2621. this._validatePosition(!0, !0);
  2622. this._updateContentPosition()
  2623. }
  2624. };
  2625. a.prototype._isOnTheEdge = function(e) {
  2626. void 0 === e && (e = !0);
  2627. var a = this._scrollTop,
  2628. b = this._scrollLeft;
  2629. return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2630. };
  2631. a.prototype._validatePosition = function(e, a) {
  2632. void 0 === e && (e = !1);
  2633. void 0 === a && (a = !1);
  2634. if (e) {
  2635. var b = this.height,
  2636. d = this._getContentHeight();
  2637. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2638. this._scrollTop = Math.min(this._scrollTop, d > b ? d - b / 2 : d / 2)
  2639. }
  2640. a && (b = this.width, d = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, d > b ? d - b / 2 : d / 2))
  2641. };
  2642. a.prototype._setWidth = function(e) {
  2643. this._explicitWidth !=
  2644. e && (d.prototype._setWidth.call(this, e), this._updateContentPosition())
  2645. };
  2646. a.prototype._setHeight = function(e) {
  2647. this._explicitHeight != e && (d.prototype._setHeight.call(this, e), this._updateContentPosition())
  2648. };
  2649. a.prototype._updateContentPosition = function() {
  2650. var e = this.getBounds(b.Rectangle.identity);
  2651. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
  2652. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2653. };
  2654. a.prototype._checkScrollPolicy = function() {
  2655. var e = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2656. this._getContentWidth(), this.width);
  2657. this._hCanScroll = e;
  2658. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2659. this._vCanScroll = a;
  2660. return e || a
  2661. };
  2662. a.prototype.__checkScrollPolicy = function(e, a, b) {
  2663. return "on" == e ? !0 : "off" == e ? !1 : a > b
  2664. };
  2665. a.prototype._addEvents = function() {
  2666. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2667. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2668. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2669. this, !0)
  2670. };
  2671. a.prototype._removeEvents = function() {
  2672. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2673. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2674. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2675. };
  2676. a.prototype._onTouchBegin = function(e) {
  2677. !e._isDefaultPrevented && this._checkScrollPolicy() && (b.Tween.removeTweens(this), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END,
  2678. this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(e), e.preventDefault())
  2679. };
  2680. a.prototype._onTouchBeginCapture = function(e) {
  2681. var d = this._checkScrollPolicy();
  2682. if (d) {
  2683. for (var c = e.target; c != this;) {
  2684. if (c instanceof a && (d = c._checkScrollPolicy())) return;
  2685. c = c.parent
  2686. }
  2687. e.stopPropagation();
  2688. this.delayTouchBeginEvent = this.cloneTouchEvent(e);
  2689. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100,
  2690. 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2691. this.touchBeginTimer.start();
  2692. this._onTouchBegin(e)
  2693. }
  2694. };
  2695. a.prototype._onTouchEndCapture = function(e) {
  2696. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2697. };
  2698. a.prototype._onTouchBeginTimer = function() {
  2699. this.touchBeginTimer.stop();
  2700. var e = this.delayTouchBeginEvent;
  2701. this.delayTouchBeginEvent = null;
  2702. this.dispatchPropagationEvent(e)
  2703. };
  2704. a.prototype.dispatchPropagationEvent = function(e) {
  2705. for (var a = [], b = e._target; b;) a.push(b),
  2706. b = b.parent;
  2707. for (var d = this._content, c = 1;; c += 2) {
  2708. b = a[c];
  2709. if (!b || b === d) break;
  2710. a.unshift(b)
  2711. }
  2712. this._dispatchPropagationEvent(e, a)
  2713. };
  2714. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2715. for (var d = a.length, c = 0; c < d; c++) {
  2716. var f = a[c];
  2717. e._currentTarget = f;
  2718. e._target = this;
  2719. e._eventPhase = c < b ? 1 : c == b ? 2 : 3;
  2720. f._notifyListener(e);
  2721. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  2722. }
  2723. };
  2724. a.prototype._onTouchMove = function(e) {
  2725. if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
  2726. this.delayTouchBeginEvent &&
  2727. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2728. this.touchChildren = !1;
  2729. var a = this._getPointChange(e);
  2730. this.setScrollPosition(a.y, a.x, !0);
  2731. this._calcVelocitys(e);
  2732. this._logTouchEvent(e)
  2733. }
  2734. };
  2735. a.prototype._onTouchEnd = function(e) {
  2736. this.touchChildren = !0;
  2737. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2738. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2739. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE,
  2740. this._onTouchEnd, this);
  2741. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2742. this._moveAfterTouchEnd()
  2743. };
  2744. a.prototype._onEnterFrame = function(e) {
  2745. e = b.getTimer();
  2746. 100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2747. };
  2748. a.prototype._logTouchEvent = function(e) {
  2749. this._lastTouchPosition.x = e.stageX;
  2750. this._lastTouchPosition.y = e.stageY;
  2751. this._lastTouchEvent = this.cloneTouchEvent(e);
  2752. this._lastTouchTime = b.getTimer()
  2753. };
  2754. a.prototype._getPointChange = function(e) {
  2755. return {
  2756. x: !1 ===
  2757. this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
  2758. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
  2759. }
  2760. };
  2761. a.prototype._calcVelocitys = function(e) {
  2762. var a = b.getTimer();
  2763. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  2764. else {
  2765. var d = this._getPointChange(e),
  2766. a = a - this._lastTouchTime;
  2767. d.x /= a;
  2768. d.y /= a;
  2769. this._velocitys.push(d);
  2770. 5 < this._velocitys.length && this._velocitys.shift();
  2771. this._lastTouchPosition.x = e.stageX;
  2772. this._lastTouchPosition.y = e.stageY
  2773. }
  2774. };
  2775. a.prototype._getContentWidth = function() {
  2776. return this._content.explicitWidth ||
  2777. this._content.width
  2778. };
  2779. a.prototype._getContentHeight = function() {
  2780. return this._content.explicitHeight || this._content.height
  2781. };
  2782. a.prototype.getMaxScrollLeft = function() {
  2783. var e = this._getContentWidth() - this.width;
  2784. return Math.max(0, e)
  2785. };
  2786. a.prototype.getMaxScrollTop = function() {
  2787. var e = this._getContentHeight() - this.height;
  2788. return Math.max(0, e)
  2789. };
  2790. a.prototype._moveAfterTouchEnd = function() {
  2791. if (0 != this._velocitys.length) {
  2792. for (var e = 0, b = 0, d = 0, c = 0; c < this._velocitys.length; c++) var g = this._velocitys[c],
  2793. f = a.weight[c],
  2794. e = e + g.x * f,
  2795. b = b + g.y * f,
  2796. d = d + f;
  2797. this._velocitys.length = 0;
  2798. e /= d;
  2799. b /= d;
  2800. g = Math.abs(e);
  2801. d = Math.abs(b);
  2802. f = this.getMaxScrollLeft();
  2803. c = this.getMaxScrollTop();
  2804. e = 0.02 < g ? this.getAnimationDatas(e, this._scrollLeft, f) : {
  2805. position: this._scrollLeft,
  2806. duration: 1
  2807. };
  2808. b = 0.02 < d ? this.getAnimationDatas(b, this._scrollTop, c) : {
  2809. position: this._scrollTop,
  2810. duration: 1
  2811. };
  2812. this.setScrollLeft(e.position, e.duration);
  2813. this.setScrollTop(b.position, b.duration)
  2814. }
  2815. };
  2816. a.prototype.setScrollTop = function(e, a) {
  2817. void 0 === a && (a = 0);
  2818. var d = Math.min(this.getMaxScrollTop(), Math.max(e,
  2819. 0));
  2820. if (0 == a) return this.scrollTop = d, null;
  2821. var c = b.Tween.get(this).to({
  2822. scrollTop: e
  2823. }, a, b.Ease.quartOut);
  2824. d != e && c.to({
  2825. scrollTop: d
  2826. }, 300, b.Ease.quintOut)
  2827. };
  2828. a.prototype.setScrollLeft = function(e, a) {
  2829. void 0 === a && (a = 0);
  2830. var d = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
  2831. if (0 == a) return this.scrollLeft = d, null;
  2832. var c = b.Tween.get(this).to({
  2833. scrollLeft: e
  2834. }, a, b.Ease.quartOut);
  2835. d != e && c.to({
  2836. scrollLeft: d
  2837. }, 300, b.Ease.quintOut)
  2838. };
  2839. a.prototype.getAnimationDatas = function(e, a, b) {
  2840. var d = Math.abs(e),
  2841. c = 0,
  2842. f = a + 500 * e;
  2843. if (0 > f || f > b)
  2844. for (f =
  2845. a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e, e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e, c++;
  2846. else c = 500 * -Math.log(0.02 / d);
  2847. return {
  2848. position: Math.min(b + 50, Math.max(f, -50)),
  2849. duration: c
  2850. }
  2851. };
  2852. a.prototype.cloneTouchEvent = function(e) {
  2853. var a = new b.TouchEvent(e._type, e._bubbles, e.cancelable);
  2854. a.touchPointID = e.touchPointID;
  2855. a._stageX = e._stageX;
  2856. a._stageY = e._stageY;
  2857. a.ctrlKey = e.ctrlKey;
  2858. a.altKey = e.altKey;
  2859. a.shiftKey = e.shiftKey;
  2860. a.touchDown = e.touchDown;
  2861. a._isDefaultPrevented = !1;
  2862. a._target = e._target;
  2863. return a
  2864. };
  2865. a.prototype.throwNotSupportedError =
  2866. function() {
  2867. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  2868. };
  2869. a.prototype.addChild = function(e) {
  2870. this.throwNotSupportedError();
  2871. return null
  2872. };
  2873. a.prototype.addChildAt = function(e, a) {
  2874. this.throwNotSupportedError();
  2875. return null
  2876. };
  2877. a.prototype.removeChild = function(e) {
  2878. this.throwNotSupportedError();
  2879. return null
  2880. };
  2881. a.prototype.removeChildAt = function(e) {
  2882. this.throwNotSupportedError();
  2883. return null
  2884. };
  2885. a.prototype.setChildIndex = function(e, a) {
  2886. this.throwNotSupportedError()
  2887. };
  2888. a.prototype.swapChildren = function(e,
  2889. a) {
  2890. this.throwNotSupportedError()
  2891. };
  2892. a.prototype.swapChildrenAt = function(e, a) {
  2893. this.throwNotSupportedError()
  2894. };
  2895. a.prototype.hitTest = function(e, a, c) {
  2896. void 0 === c && (c = !1);
  2897. var l = d.prototype.hitTest.call(this, e, a, c);
  2898. return l ? l : b.DisplayObject.prototype.hitTest.call(this, e, a, c)
  2899. };
  2900. a.weight = [1, 1.33, 1.66, 2, 2.33];
  2901. return a
  2902. }(b.DisplayObjectContainer);
  2903. b.ScrollView = c;
  2904. c.prototype.__class__ = "egret.ScrollView"
  2905. })(egret || (egret = {}));
  2906. (function(b) {
  2907. var c = function() {
  2908. function b() {}
  2909. b.REPEAT = "repeat";
  2910. b.SCALE = "scale";
  2911. return b
  2912. }();
  2913. b.BitmapFillMode = c;
  2914. c.prototype.__class__ = "egret.BitmapFillMode"
  2915. })(egret || (egret = {}));
  2916. __extends = this.__extends || function(b, c) {
  2917. function d() {
  2918. this.constructor = b
  2919. }
  2920. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2921. d.prototype = c.prototype;
  2922. b.prototype = new d
  2923. };
  2924. (function(b) {
  2925. var c = function(d) {
  2926. function a(e) {
  2927. d.call(this);
  2928. this.debug = !1;
  2929. this.debugColor = 16711680;
  2930. this.scale9Grid = null;
  2931. this.fillMode = "scale";
  2932. e && (this._texture = e, this._setSizeDirty())
  2933. }
  2934. __extends(a, d);
  2935. Object.defineProperty(a.prototype, "texture", {
  2936. get: function() {
  2937. return this._texture
  2938. },
  2939. set: function(e) {
  2940. e != this._texture && (this._setSizeDirty(), this._texture = e)
  2941. },
  2942. enumerable: !0,
  2943. configurable: !0
  2944. });
  2945. a.prototype._render = function(e) {
  2946. var b = this._texture;
  2947. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth :
  2948. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2949. };
  2950. a._drawBitmap = function(e, b, d, c) {
  2951. var g = c._texture_to_render;
  2952. if (g) {
  2953. var f = g._textureWidth,
  2954. h = g._textureHeight;
  2955. if ("scale" == c.fillMode) {
  2956. var m = c.scale9Grid || g.scale9Grid;
  2957. if (m && f - m.width < b && h - m.height < d) a.drawScale9GridImage(e, c, m, b, d);
  2958. else {
  2959. var m = g._offsetX,
  2960. n = g._offsetY,
  2961. q = g._bitmapWidth || f,
  2962. r = g._bitmapHeight || h;
  2963. b /= f;
  2964. m = Math.round(m * b);
  2965. b = Math.round(q * b);
  2966. d /= h;
  2967. n = Math.round(n * d);
  2968. d = Math.round(r * d);
  2969. a.renderFilter.drawImage(e,
  2970. c, g._bitmapX, g._bitmapY, q, r, m, n, b, d)
  2971. }
  2972. } else a.drawRepeatImage(e, c, b, d, c.fillMode)
  2973. }
  2974. };
  2975. a.drawRepeatImage = function(e, a, d, c, g) {
  2976. var f = a._texture_to_render;
  2977. if (f) {
  2978. var h = f._textureWidth,
  2979. m = f._textureHeight,
  2980. n = f._bitmapX,
  2981. q = f._bitmapY,
  2982. h = f._bitmapWidth || h,
  2983. m = f._bitmapHeight || m,
  2984. r = f._offsetX,
  2985. f = f._offsetY;
  2986. b.RenderFilter.getInstance().drawImage(e, a, n, q, h, m, r, f, d, c, g)
  2987. }
  2988. };
  2989. a.drawScale9GridImage = function(e, a, d, c, g) {
  2990. var f = a._texture_to_render;
  2991. if (f && d) {
  2992. var h = b.RenderFilter.getInstance(),
  2993. m = f._textureWidth,
  2994. n = f._textureHeight,
  2995. q = f._bitmapX,
  2996. r = f._bitmapY,
  2997. t = f._bitmapWidth || m,
  2998. s = f._bitmapHeight || n,
  2999. u = f._offsetX,
  3000. v = f._offsetY,
  3001. f = b.MainContext.instance.rendererContext.texture_scale_factor;
  3002. d = b.Rectangle.identity.initialize(d.x - Math.round(u), d.y - Math.round(u), d.width, d.height);
  3003. u = Math.round(u);
  3004. v = Math.round(v);
  3005. c -= m - t;
  3006. g -= n - s;
  3007. d.y == d.bottom && (d.bottom < s ? d.bottom++ : d.y--);
  3008. d.x == d.right && (d.right < t ? d.right++ : d.x--);
  3009. var m = q + d.x,
  3010. n = q + d.right,
  3011. x = t - d.right,
  3012. y = r + d.y,
  3013. w = r + d.bottom,
  3014. z = s - d.bottom,
  3015. A = u + d.x,
  3016. B = v + d.y,
  3017. s = g - (s - d.bottom),
  3018. t = c - (t - d.right);
  3019. h.drawImage(e,
  3020. a, q / f, r / f, d.x, d.y, u, v, d.x, d.y);
  3021. h.drawImage(e, a, m / f, r / f, d.width, d.y, A, v, t - d.x, d.y);
  3022. h.drawImage(e, a, n / f, r / f, x, d.y, u + t, v, c - t, d.y);
  3023. h.drawImage(e, a, q / f, y / f, d.x, d.height, u, B, d.x, s - d.y);
  3024. h.drawImage(e, a, m / f, y / f, d.width, d.height, A, B, t - d.x, s - d.y);
  3025. h.drawImage(e, a, n / f, y / f, x, d.height, u + t, B, c - t, s - d.y);
  3026. h.drawImage(e, a, q / f, w / f, d.x, z, u, v + s, d.x, g - s);
  3027. h.drawImage(e, a, m / f, w / f, d.width, z, A, v + s, t - d.x, g - s);
  3028. h.drawImage(e, a, n / f, w / f, x, z, u + t, v + s, c - t, g - s)
  3029. }
  3030. };
  3031. a.prototype._measureBounds = function() {
  3032. var e = this._texture;
  3033. return e ? b.Rectangle.identity.initialize(e._offsetX,
  3034. e._offsetY, e._textureWidth, e._textureHeight) : d.prototype._measureBounds.call(this)
  3035. };
  3036. a.debug = !1;
  3037. a.renderFilter = b.RenderFilter.getInstance();
  3038. return a
  3039. }(b.DisplayObject);
  3040. b.Bitmap = c;
  3041. c.prototype.__class__ = "egret.Bitmap"
  3042. })(egret || (egret = {}));
  3043. __extends = this.__extends || function(b, c) {
  3044. function d() {
  3045. this.constructor = b
  3046. }
  3047. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3048. d.prototype = c.prototype;
  3049. b.prototype = new d
  3050. };
  3051. (function(b) {
  3052. var c = function(d) {
  3053. function a() {
  3054. d.call(this);
  3055. this._text = "";
  3056. this._textChanged = !1;
  3057. this._spriteSheet = null;
  3058. this._spriteSheetChanged = !1;
  3059. this._bitmapPool = []
  3060. }
  3061. __extends(a, d);
  3062. Object.defineProperty(a.prototype, "text", {
  3063. get: function() {
  3064. return this._text
  3065. },
  3066. set: function(e) {
  3067. this._textChanged = !0;
  3068. this._text = e;
  3069. this._setSizeDirty()
  3070. },
  3071. enumerable: !0,
  3072. configurable: !0
  3073. });
  3074. Object.defineProperty(a.prototype, "spriteSheet", {
  3075. get: function() {
  3076. return this._spriteSheet
  3077. },
  3078. set: function(e) {
  3079. this._spriteSheet != e && (this._spriteSheet =
  3080. e, this._spriteSheetChanged = !0, this._setSizeDirty())
  3081. },
  3082. enumerable: !0,
  3083. configurable: !0
  3084. });
  3085. a.prototype._updateTransform = function() {
  3086. this.visible && ((this._textChanged || this._spriteSheetChanged) && this._renderText(), d.prototype._updateTransform.call(this))
  3087. };
  3088. a.prototype._renderText = function(e) {
  3089. var a = e = 0;
  3090. (this._textChanged || this._spriteSheetChanged) && this.removeChildren();
  3091. for (var d = 0, c = this.text.length; d < c; d++) {
  3092. var g = this.text.charAt(d),
  3093. f = this.spriteSheet.getTexture(g);
  3094. if (null == f) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" +
  3095. g);
  3096. else {
  3097. var g = f._offsetX,
  3098. h = f._offsetY,
  3099. m = f._textureWidth;
  3100. if (this._textChanged || this._spriteSheetChanged) {
  3101. var n = this._bitmapPool[d];
  3102. n || (n = new b.Bitmap, this._bitmapPool.push(n));
  3103. n.texture = f;
  3104. this.addChild(n);
  3105. n.x = e
  3106. }
  3107. e += m + g;
  3108. h + f._textureHeight > a && (a = h + f._textureHeight)
  3109. }
  3110. }
  3111. this._spriteSheetChanged = this._textChanged = !1;
  3112. return b.Rectangle.identity.initialize(0, 0, e, a)
  3113. };
  3114. a.prototype._measureBounds = function() {
  3115. return this._renderText(!0)
  3116. };
  3117. return a
  3118. }(b.DisplayObjectContainer);
  3119. b.BitmapText = c;
  3120. c.prototype.__class__ = "egret.BitmapText"
  3121. })(egret ||
  3122. (egret = {}));
  3123. (function(b) {
  3124. var c = function() {
  3125. function b() {
  3126. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3127. this.commandQueue = []
  3128. }
  3129. b.prototype.beginFill = function(a, e) {};
  3130. b.prototype._setStyle = function(a) {};
  3131. b.prototype.drawRect = function(a, e, b, d) {
  3132. this.checkRect(a, e, b, d)
  3133. };
  3134. b.prototype.drawCircle = function(a, e, b) {
  3135. this.checkRect(a - b, e - b, 2 * b, 2 * b)
  3136. };
  3137. b.prototype.drawRoundRect = function(a, e, b, d, c, g) {
  3138. this.checkRect(a, e, b, d)
  3139. };
  3140. b.prototype.drawEllipse = function(a, e, b, d) {
  3141. this.checkRect(a - b, e - d, 2 * b, 2 * d)
  3142. };
  3143. b.prototype.lineStyle =
  3144. function(a, e, b, d, c, g, f, h) {};
  3145. b.prototype.lineTo = function(a, e) {
  3146. this.checkPoint(a, e)
  3147. };
  3148. b.prototype.curveTo = function(a, e, b, d) {
  3149. this.checkPoint(a, e);
  3150. this.checkPoint(b, d)
  3151. };
  3152. b.prototype.moveTo = function(a, e) {
  3153. this.checkPoint(a, e)
  3154. };
  3155. b.prototype.clear = function() {
  3156. this._maxY = this._maxX = this._minY = this._minX = 0
  3157. };
  3158. b.prototype.endFill = function() {};
  3159. b.prototype._draw = function(a) {};
  3160. b.prototype.checkRect = function(a, e, b, d) {
  3161. this._minX = Math.min(this._minX, a);
  3162. this._minY = Math.min(this._minY, e);
  3163. this._maxX = Math.max(this._maxX, a +
  3164. b);
  3165. this._maxY = Math.max(this._maxY, e + d)
  3166. };
  3167. b.prototype.checkPoint = function(a, e) {
  3168. this._minX = Math.min(this._minX, a);
  3169. this._minY = Math.min(this._minY, e);
  3170. this._maxX = Math.max(this._maxX, a);
  3171. this._maxY = Math.max(this._maxY, e);
  3172. this._lastX = a;
  3173. this._lastY = e
  3174. };
  3175. return b
  3176. }();
  3177. b.Graphics = c;
  3178. c.prototype.__class__ = "egret.Graphics";
  3179. (function() {
  3180. return function(b, a, e) {
  3181. this.method = b;
  3182. this.thisObject = a;
  3183. this.args = e
  3184. }
  3185. })().prototype.__class__ = "egret.Command"
  3186. })(egret || (egret = {}));
  3187. __extends = this.__extends || function(b, c) {
  3188. function d() {
  3189. this.constructor = b
  3190. }
  3191. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3192. d.prototype = c.prototype;
  3193. b.prototype = new d
  3194. };
  3195. (function(b) {
  3196. var c = function(d) {
  3197. function a() {
  3198. d.call(this)
  3199. }
  3200. __extends(a, d);
  3201. Object.defineProperty(a.prototype, "graphics", {
  3202. get: function() {
  3203. this._graphics || (this._graphics = new b.Graphics);
  3204. return this._graphics
  3205. },
  3206. enumerable: !0,
  3207. configurable: !0
  3208. });
  3209. a.prototype._render = function(e) {
  3210. this._graphics && this._graphics._draw(e)
  3211. };
  3212. return a
  3213. }(b.DisplayObject);
  3214. b.Shape = c;
  3215. c.prototype.__class__ = "egret.Shape"
  3216. })(egret || (egret = {}));
  3217. __extends = this.__extends || function(b, c) {
  3218. function d() {
  3219. this.constructor = b
  3220. }
  3221. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3222. d.prototype = c.prototype;
  3223. b.prototype = new d
  3224. };
  3225. (function(b) {
  3226. var c = function(d) {
  3227. function a() {
  3228. d.call(this)
  3229. }
  3230. __extends(a, d);
  3231. Object.defineProperty(a.prototype, "graphics", {
  3232. get: function() {
  3233. this._graphics || (this._graphics = new b.Graphics);
  3234. return this._graphics
  3235. },
  3236. enumerable: !0,
  3237. configurable: !0
  3238. });
  3239. a.prototype._render = function(e) {
  3240. this._graphics && this._graphics._draw(e);
  3241. d.prototype._render.call(this, e)
  3242. };
  3243. return a
  3244. }(b.DisplayObjectContainer);
  3245. b.Sprite = c;
  3246. c.prototype.__class__ = "egret.Sprite"
  3247. })(egret || (egret = {}));
  3248. __extends = this.__extends || function(b, c) {
  3249. function d() {
  3250. this.constructor = b
  3251. }
  3252. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3253. d.prototype = c.prototype;
  3254. b.prototype = new d
  3255. };
  3256. (function(b) {
  3257. var c = function(d) {
  3258. function a() {
  3259. d.call(this);
  3260. this._inputEnabled = !1;
  3261. this._text = this._type = "";
  3262. this._displayAsPassword = !1;
  3263. this._fontFamily = a.default_fontFamily;
  3264. this._size = 30;
  3265. this._textColorString = "#FFFFFF";
  3266. this._textColor = 16777215;
  3267. this._strokeColorString = "#000000";
  3268. this._stroke = this._strokeColor = 0;
  3269. this._textAlign = "left";
  3270. this._verticalAlign = "top";
  3271. this._maxChars = 0;
  3272. this._scrollV = -1;
  3273. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3274. this._isFlow = this._multiline = !1;
  3275. this._textArr = [];
  3276. this._isArrayChanged = !1;
  3277. this._textMaxHeight = this._textMaxWidth = 0;
  3278. this._linesArr = []
  3279. }
  3280. __extends(a, d);
  3281. a.prototype.isInput = function() {
  3282. return this._type == b.TextFieldType.INPUT
  3283. };
  3284. a.prototype._setTouchEnabled = function(e) {
  3285. d.prototype._setTouchEnabled.call(this, e);
  3286. this.isInput() && (this._inputEnabled = !0)
  3287. };
  3288. Object.defineProperty(a.prototype, "type", {
  3289. get: function() {
  3290. return this._type
  3291. },
  3292. set: function(e) {
  3293. this._setType(e)
  3294. },
  3295. enumerable: !0,
  3296. configurable: !0
  3297. });
  3298. a.prototype._setType = function(e) {
  3299. this._type != e && (this._type = e, this._type == b.TextFieldType.INPUT ?
  3300. (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))
  3301. };
  3302. Object.defineProperty(a.prototype, "text", {
  3303. get: function() {
  3304. return this._getText()
  3305. },
  3306. set: function(e) {
  3307. this._setText(e)
  3308. },
  3309. enumerable: !0,
  3310. configurable: !0
  3311. });
  3312. a.prototype._getText = function() {
  3313. return this._type ==
  3314. b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3315. };
  3316. a.prototype._setSizeDirty = function() {
  3317. d.prototype._setSizeDirty.call(this);
  3318. this._isArrayChanged = !0
  3319. };
  3320. a.prototype._setTextDirty = function() {
  3321. this._setSizeDirty()
  3322. };
  3323. a.prototype._setBaseText = function(e) {
  3324. null == e && (e = "");
  3325. this._isFlow = !1;
  3326. if (this._text != e || this._displayAsPassword) this._setTextDirty(), this._text = e, e = "", e = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3327. text: e
  3328. }])
  3329. };
  3330. a.prototype._setText = function(e) {
  3331. null ==
  3332. e && (e = "");
  3333. this._setBaseText(e);
  3334. this._inputUtils && this._inputUtils._setText(this._text)
  3335. };
  3336. Object.defineProperty(a.prototype, "displayAsPassword", {
  3337. get: function() {
  3338. return this._displayAsPassword
  3339. },
  3340. set: function(e) {
  3341. this._setDisplayAsPassword(e)
  3342. },
  3343. enumerable: !0,
  3344. configurable: !0
  3345. });
  3346. a.prototype._setDisplayAsPassword = function(e) {
  3347. this._displayAsPassword != e && (this._displayAsPassword = e, this._setText(this._text))
  3348. };
  3349. Object.defineProperty(a.prototype, "fontFamily", {
  3350. get: function() {
  3351. return this._fontFamily
  3352. },
  3353. set: function(e) {
  3354. this._setFontFamily(e)
  3355. },
  3356. enumerable: !0,
  3357. configurable: !0
  3358. });
  3359. a.prototype._setFontFamily = function(e) {
  3360. this._fontFamily != e && (this._setTextDirty(), this._fontFamily = e)
  3361. };
  3362. Object.defineProperty(a.prototype, "size", {
  3363. get: function() {
  3364. return this._size
  3365. },
  3366. set: function(e) {
  3367. this._setSize(e)
  3368. },
  3369. enumerable: !0,
  3370. configurable: !0
  3371. });
  3372. a.prototype._setSize = function(e) {
  3373. this._size != e && (this._setTextDirty(), this._size = e)
  3374. };
  3375. Object.defineProperty(a.prototype, "italic", {
  3376. get: function() {
  3377. return this._italic
  3378. },
  3379. set: function(e) {
  3380. this._setItalic(e)
  3381. },
  3382. enumerable: !0,
  3383. configurable: !0
  3384. });
  3385. a.prototype._setItalic = function(e) {
  3386. this._italic != e && (this._setTextDirty(), this._italic = e)
  3387. };
  3388. Object.defineProperty(a.prototype, "bold", {
  3389. get: function() {
  3390. return this._bold
  3391. },
  3392. set: function(e) {
  3393. this._setBold(e)
  3394. },
  3395. enumerable: !0,
  3396. configurable: !0
  3397. });
  3398. a.prototype._setBold = function(e) {
  3399. this._bold != e && (this._setTextDirty(), this._bold = e)
  3400. };
  3401. Object.defineProperty(a.prototype, "textColor", {
  3402. get: function() {
  3403. return this._textColor
  3404. },
  3405. set: function(e) {
  3406. this._setTextColor(e)
  3407. },
  3408. enumerable: !0,
  3409. configurable: !0
  3410. });
  3411. a.prototype._setTextColor =
  3412. function(e) {
  3413. this._textColor != e && (this._setTextDirty(), this._textColor = e, this._textColorString = b.toColorString(e))
  3414. };
  3415. Object.defineProperty(a.prototype, "strokeColor", {
  3416. get: function() {
  3417. return this._strokeColor
  3418. },
  3419. set: function(e) {
  3420. this._setStrokeColor(e)
  3421. },
  3422. enumerable: !0,
  3423. configurable: !0
  3424. });
  3425. a.prototype._setStrokeColor = function(e) {
  3426. this._strokeColor != e && (this._setTextDirty(), this._strokeColor = e, this._strokeColorString = b.toColorString(e))
  3427. };
  3428. Object.defineProperty(a.prototype, "stroke", {
  3429. get: function() {
  3430. return this._stroke
  3431. },
  3432. set: function(e) {
  3433. this._setStroke(e)
  3434. },
  3435. enumerable: !0,
  3436. configurable: !0
  3437. });
  3438. a.prototype._setStroke = function(e) {
  3439. this._stroke != e && (this._setTextDirty(), this._stroke = e)
  3440. };
  3441. Object.defineProperty(a.prototype, "textAlign", {
  3442. get: function() {
  3443. return this._textAlign
  3444. },
  3445. set: function(e) {
  3446. this._setTextAlign(e)
  3447. },
  3448. enumerable: !0,
  3449. configurable: !0
  3450. });
  3451. a.prototype._setTextAlign = function(e) {
  3452. this._textAlign != e && (this._setTextDirty(), this._textAlign = e)
  3453. };
  3454. Object.defineProperty(a.prototype, "verticalAlign", {
  3455. get: function() {
  3456. return this._verticalAlign
  3457. },
  3458. set: function(e) {
  3459. this._setVerticalAlign(e)
  3460. },
  3461. enumerable: !0,
  3462. configurable: !0
  3463. });
  3464. a.prototype._setVerticalAlign = function(e) {
  3465. this._verticalAlign != e && (this._setTextDirty(), this._verticalAlign = e)
  3466. };
  3467. Object.defineProperty(a.prototype, "maxChars", {
  3468. get: function() {
  3469. return this._maxChars
  3470. },
  3471. set: function(e) {
  3472. this._setMaxChars(e)
  3473. },
  3474. enumerable: !0,
  3475. configurable: !0
  3476. });
  3477. a.prototype._setMaxChars = function(e) {
  3478. this._maxChars != e && (this._maxChars = e)
  3479. };
  3480. Object.defineProperty(a.prototype, "scrollV", {
  3481. set: function(e) {
  3482. this._scrollV = e;
  3483. this._setDirty()
  3484. },
  3485. enumerable: !0,
  3486. configurable: !0
  3487. });
  3488. Object.defineProperty(a.prototype, "maxScrollV", {
  3489. get: function() {
  3490. return this._maxScrollV
  3491. },
  3492. enumerable: !0,
  3493. configurable: !0
  3494. });
  3495. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3496. get: function() {
  3497. return 0
  3498. },
  3499. enumerable: !0,
  3500. configurable: !0
  3501. });
  3502. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3503. get: function() {
  3504. return 0
  3505. },
  3506. enumerable: !0,
  3507. configurable: !0
  3508. });
  3509. Object.defineProperty(a.prototype, "caretIndex", {
  3510. get: function() {
  3511. return 0
  3512. },
  3513. enumerable: !0,
  3514. configurable: !0
  3515. });
  3516. a.prototype._setSelection =
  3517. function(e, a) {};
  3518. Object.defineProperty(a.prototype, "lineSpacing", {
  3519. get: function() {
  3520. return this._lineSpacing
  3521. },
  3522. set: function(e) {
  3523. this._setLineSpacing(e)
  3524. },
  3525. enumerable: !0,
  3526. configurable: !0
  3527. });
  3528. a.prototype._setLineSpacing = function(e) {
  3529. this._lineSpacing != e && (this._setTextDirty(), this._lineSpacing = e)
  3530. };
  3531. a.prototype._getLineHeight = function() {
  3532. return this._lineSpacing + this._size
  3533. };
  3534. Object.defineProperty(a.prototype, "numLines", {
  3535. get: function() {
  3536. return this._numLines
  3537. },
  3538. enumerable: !0,
  3539. configurable: !0
  3540. });
  3541. Object.defineProperty(a.prototype,
  3542. "multiline", {
  3543. get: function() {
  3544. return this._multiline
  3545. },
  3546. set: function(e) {
  3547. this._setMultiline(e)
  3548. },
  3549. enumerable: !0,
  3550. configurable: !0
  3551. });
  3552. a.prototype._setMultiline = function(e) {
  3553. this._multiline = e;
  3554. this._setDirty()
  3555. };
  3556. a.prototype.setFocus = function() {
  3557. b.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3558. };
  3559. a.prototype._onRemoveFromStage = function() {
  3560. d.prototype._onRemoveFromStage.call(this);
  3561. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3562. };
  3563. a.prototype._onAddToStage = function() {
  3564. d.prototype._onAddToStage.call(this);
  3565. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3566. };
  3567. a.prototype._updateBaseTransform = function() {
  3568. d.prototype._updateTransform.call(this)
  3569. };
  3570. a.prototype._updateTransform = function() {
  3571. this._type == b.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3572. };
  3573. a.prototype._render = function(e) {
  3574. this.drawText(e);
  3575. this._clearDirty()
  3576. };
  3577. a.prototype._measureBounds = function() {
  3578. return this.measureText()
  3579. };
  3580. Object.defineProperty(a.prototype, "textFlow", {
  3581. get: function() {
  3582. return this._textArr
  3583. },
  3584. set: function(e) {
  3585. this._isFlow = !0;
  3586. var a = "";
  3587. null == e && (e = []);
  3588. for (var b = 0; b < e.length; b++) a += e[b].text;
  3589. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(e))
  3590. },
  3591. enumerable: !0,
  3592. configurable: !0
  3593. });
  3594. a.prototype.changeToPassText = function(a) {
  3595. if (this._displayAsPassword) {
  3596. for (var b = "", d = 0, c = a.length; d < c; d++) switch (a.charAt(d)) {
  3597. case "\n":
  3598. b += "\n";
  3599. break;
  3600. case "\r":
  3601. break;
  3602. default:
  3603. b += "*"
  3604. }
  3605. return b
  3606. }
  3607. return a
  3608. };
  3609. a.prototype.setMiddleStyle =
  3610. function(a) {
  3611. this._isArrayChanged = !0;
  3612. this._textArr = a;
  3613. this._setSizeDirty()
  3614. };
  3615. Object.defineProperty(a.prototype, "textWidth", {
  3616. get: function() {
  3617. return this._textMaxWidth
  3618. },
  3619. enumerable: !0,
  3620. configurable: !0
  3621. });
  3622. Object.defineProperty(a.prototype, "textHeight", {
  3623. get: function() {
  3624. return this._textMaxHeight
  3625. },
  3626. enumerable: !0,
  3627. configurable: !0
  3628. });
  3629. a.prototype.appendText = function(a) {
  3630. this.appendElement({
  3631. text: a
  3632. })
  3633. };
  3634. a.prototype.appendElement = function(a) {
  3635. this._textArr.push(a);
  3636. this.setMiddleStyle(this._textArr)
  3637. };
  3638. a.prototype._getLinesArr =
  3639. function() {
  3640. if (!this._isArrayChanged) return this._linesArr;
  3641. this._isArrayChanged = !1;
  3642. var a = this._textArr,
  3643. d = b.MainContext.instance.rendererContext;
  3644. this._linesArr = [];
  3645. this._textMaxWidth = this._textMaxHeight = 0;
  3646. if (this._hasWidthSet && 0 == this._explicitWidth) return console.warn("\u6587\u672c\u5bbd\u5ea6\u88ab\u8bbe\u7f6e\u4e3a0"), this._numLines = 0, [{
  3647. width: 0,
  3648. height: 0,
  3649. elements: []
  3650. }];
  3651. var c = this._linesArr,
  3652. l = 0,
  3653. g = 0,
  3654. f = 0,
  3655. h;
  3656. this._isFlow || d.setupFont(this);
  3657. for (var m = 0; m < a.length; m++) {
  3658. var n = a[m];
  3659. n.style = n.style || {};
  3660. for (var q =
  3661. n.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  3662. null == c[f] && (h = {
  3663. width: 0,
  3664. height: 0,
  3665. elements: []
  3666. }, c[f] = h, g = l = 0);
  3667. g = this._type == b.TextFieldType.INPUT ? this._size : Math.max(g, n.style.size || this._size);
  3668. if ("" != q[r]) {
  3669. this._isFlow && d.setupFont(this, n.style);
  3670. var t = d.measureText(q[r]);
  3671. if (this._hasWidthSet)
  3672. if (l + t <= this._explicitWidth) h.elements.push({
  3673. width: t,
  3674. text: q[r],
  3675. style: n.style
  3676. }), l += t;
  3677. else {
  3678. for (var s = 0, u = 0, v = q[r]; s < v.length; s++) {
  3679. t = d.measureText(v.charAt(s));
  3680. if (l + t > this._explicitWidth) break;
  3681. u += t;
  3682. l += t
  3683. }
  3684. 0 < s && (h.elements.push({
  3685. width: u,
  3686. text: v.substring(0, s),
  3687. style: n.style
  3688. }), q[r] = v.substring(s));
  3689. r--
  3690. } else l += t, h.elements.push({
  3691. width: t,
  3692. text: q[r],
  3693. style: n.style
  3694. })
  3695. }
  3696. if (r < q.length - 1) {
  3697. h.width = l;
  3698. h.height = g;
  3699. this._textMaxWidth = Math.max(this._textMaxWidth, l);
  3700. this._textMaxHeight += g;
  3701. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = c.length, c;
  3702. f++
  3703. }
  3704. }
  3705. m == a.length - 1 && h && (h.width = l, h.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, l), this._textMaxHeight += g)
  3706. }
  3707. this._numLines = c.length;
  3708. return c
  3709. };
  3710. a.prototype.measureText = function() {
  3711. 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)
  3712. };
  3713. a.prototype.drawText = function(a) {
  3714. var d = this._getLinesArr();
  3715. if (d) {
  3716. this._isFlow || a.setupFont(this);
  3717. var c = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3718. l = this._textMaxHeight + (this._numLines -
  3719. 1) * this._lineSpacing,
  3720. g = 0,
  3721. f = 0;
  3722. if (this._hasHeightSet)
  3723. if (l < this._explicitHeight) {
  3724. var h = 0;
  3725. this._verticalAlign == b.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (h = 1);
  3726. g += h * (this._explicitHeight - l)
  3727. } else l > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3728. g = Math.round(g);
  3729. l = 0;
  3730. this._textAlign == b.HorizontalAlign.CENTER ? l = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (l = 1);
  3731. for (h = 0; f < this._numLines; f++) {
  3732. var m = d[f],
  3733. n = m.height,
  3734. g = g + n / 2;
  3735. if (0 != f && this._hasHeightSet &&
  3736. g > this._explicitHeight) break;
  3737. for (var h = Math.round((c - m.width) * l), q = 0; q < m.elements.length; q++) {
  3738. var r = m.elements[q],
  3739. t = r.style.size || this._size;
  3740. this._type == b.TextFieldType.INPUT ? a.drawText(this, r.text, h, g + (n - t) / 2, r.width) : (this._isFlow && a.setupFont(this, r.style), a.drawText(this, r.text, h, g + (n - t) / 2, r.width, r.style));
  3741. h += r.width
  3742. }
  3743. g += n / 2 + this._lineSpacing
  3744. }
  3745. }
  3746. };
  3747. a.default_fontFamily = "Arial";
  3748. return a
  3749. }(b.DisplayObject);
  3750. b.TextField = c;
  3751. c.prototype.__class__ = "egret.TextField"
  3752. })(egret || (egret = {}));
  3753. (function(b) {
  3754. var c = function() {
  3755. function b() {
  3756. this.resutlArr = []
  3757. }
  3758. b.prototype.parser = function(a) {
  3759. this.stackArray = [];
  3760. this.resutlArr = [];
  3761. for (var e = 0, b = a.length; e < b;) {
  3762. var d = a.indexOf("<", e);
  3763. 0 > d ? (this.addToResultArr(a.substring(e)), e = b) : (this.addToResultArr(a.substring(e, d)), e = a.indexOf(">", d), "/" == a.charAt(d + 1) ? this.stackArray.pop() : this.addToArray(a.substring(d + 1, e)), e += 1)
  3764. }
  3765. return this.resutlArr
  3766. };
  3767. b.prototype.addToResultArr = function(a) {
  3768. if ("" != a) {
  3769. var e = [];
  3770. e.push(["&lt;", "<"]);
  3771. e.push(["&gt;", ">"]);
  3772. e.push(["&amp;",
  3773. "&"
  3774. ]);
  3775. e.push(["&quot;", '"']);
  3776. e.push(["&apos;;", "'"]);
  3777. for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
  3778. 0 < this.stackArray.length ? this.resutlArr.push({
  3779. text: a,
  3780. style: this.stackArray[this.stackArray.length - 1]
  3781. }) : this.resutlArr.push({
  3782. text: a
  3783. })
  3784. }
  3785. };
  3786. b.prototype.changeStringToObject = function(a) {
  3787. var e = {};
  3788. a = a.replace(/( )+/g, " ").split(" ");
  3789. for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
  3790. return e
  3791. };
  3792. b.prototype.addProperty = function(a, e) {
  3793. var b = e.replace(/( )*=( )*/g, "=").split("=");
  3794. b[1] && (b[1] =
  3795. b[1].replace(/(\"|\')/g, ""));
  3796. switch (b[0].toLowerCase()) {
  3797. case "color":
  3798. a.textColor = parseInt(b[1]);
  3799. break;
  3800. case "b":
  3801. a.bold = "true" == (b[1] || "true");
  3802. break;
  3803. case "i":
  3804. a.italic = "true" == (b[1] || "true");
  3805. break;
  3806. case "size":
  3807. a.size = parseInt(b[1]);
  3808. break;
  3809. case "fontFamily":
  3810. a.fontFamily = b[1]
  3811. }
  3812. };
  3813. b.prototype.addToArray = function(a) {
  3814. a = this.changeStringToObject(a);
  3815. if (0 != this.stackArray.length) {
  3816. var e = this.stackArray[this.stackArray.length - 1],
  3817. b;
  3818. for (b in e) null == a[b] && (a[b] = e[b])
  3819. }
  3820. this.stackArray.push(a)
  3821. };
  3822. return b
  3823. }();
  3824. b.HtmlTextParser =
  3825. c;
  3826. c.prototype.__class__ = "egret.HtmlTextParser"
  3827. })(egret || (egret = {}));
  3828. (function(b) {
  3829. var c = function() {
  3830. function b() {}
  3831. b.DYNAMIC = "dynamic";
  3832. b.INPUT = "input";
  3833. return b
  3834. }();
  3835. b.TextFieldType = c;
  3836. c.prototype.__class__ = "egret.TextFieldType"
  3837. })(egret || (egret = {}));
  3838. __extends = this.__extends || function(b, c) {
  3839. function d() {
  3840. this.constructor = b
  3841. }
  3842. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3843. d.prototype = c.prototype;
  3844. b.prototype = new d
  3845. };
  3846. (function(b) {
  3847. var c = function(d) {
  3848. function a(a) {
  3849. d.call(this);
  3850. var b = a.bitmapData;
  3851. this.bitmapData = b;
  3852. this._textureMap = {};
  3853. this._sourceWidth = b.width;
  3854. this._sourceHeight = b.height;
  3855. this._bitmapX = a._bitmapX - a._offsetX;
  3856. this._bitmapY = a._bitmapY - a._offsetY
  3857. }
  3858. __extends(a, d);
  3859. a.prototype.getTexture = function(a) {
  3860. return this._textureMap[a]
  3861. };
  3862. a.prototype.createTexture = function(a, d, c, l, g, f, h, m, n) {
  3863. void 0 === f && (f = 0);
  3864. void 0 === h && (h = 0);
  3865. "undefined" === typeof m && (m = f + l);
  3866. "undefined" === typeof n && (n = h + g);
  3867. var q = new b.Texture,
  3868. r = b.MainContext.instance.rendererContext.texture_scale_factor;
  3869. q._bitmapData = this.bitmapData;
  3870. q._bitmapX = this._bitmapX + d;
  3871. q._bitmapY = this._bitmapY + c;
  3872. q._bitmapWidth = l * r;
  3873. q._bitmapHeight = g * r;
  3874. q._offsetX = f;
  3875. q._offsetY = h;
  3876. q._textureWidth = m * r;
  3877. q._textureHeight = n * r;
  3878. q._sourceWidth = this._sourceWidth;
  3879. q._sourceHeight = this._sourceHeight;
  3880. return this._textureMap[a] = q
  3881. };
  3882. return a
  3883. }(b.HashObject);
  3884. b.SpriteSheet = c;
  3885. c.prototype.__class__ = "egret.SpriteSheet"
  3886. })(egret || (egret = {}));
  3887. __extends = this.__extends || function(b, c) {
  3888. function d() {
  3889. this.constructor = b
  3890. }
  3891. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3892. d.prototype = c.prototype;
  3893. b.prototype = new d
  3894. };
  3895. (function(b) {
  3896. var c = function(d) {
  3897. function a() {
  3898. d.call(this);
  3899. this._isFocus = !1;
  3900. this._isFirst = this._isFirst = !0
  3901. }
  3902. __extends(a, d);
  3903. a.prototype.init = function(a) {
  3904. this._text = a;
  3905. this.stageText = b.StageText.create();
  3906. a = this._text.localToGlobal();
  3907. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  3908. };
  3909. a.prototype._addStageText = function() {
  3910. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3911. this.stageText._add();
  3912. this.stageText._addListeners();
  3913. this.stageText.addEventListener("blur", this.onBlurHandler,
  3914. this);
  3915. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3916. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3917. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3918. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3919. };
  3920. a.prototype._removeStageText = function() {
  3921. this.stageText._remove();
  3922. this.stageText._removeListeners();
  3923. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3924. this.stageText.removeEventListener("blur",
  3925. this.onBlurHandler, this);
  3926. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3927. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3928. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3929. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3930. };
  3931. a.prototype._getText = function() {
  3932. return this.stageText._getText()
  3933. };
  3934. a.prototype._setText = function(a) {
  3935. this.stageText._setText(a)
  3936. };
  3937. a.prototype.onFocusHandler =
  3938. function(a) {
  3939. this.hideText()
  3940. };
  3941. a.prototype.onBlurHandler = function(a) {
  3942. this.showText()
  3943. };
  3944. a.prototype.onMouseDownHandler = function(a) {
  3945. a.stopPropagation();
  3946. this._text._visible && this.stageText._show()
  3947. };
  3948. a.prototype.onStageDownHandler = function(a) {
  3949. this.stageText._hide();
  3950. this.showText()
  3951. };
  3952. a.prototype.showText = function() {
  3953. this._isFocus && (this._isFocus = !1, this.resetText())
  3954. };
  3955. a.prototype.hideText = function() {
  3956. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  3957. };
  3958. a.prototype.updateTextHandler = function(a) {
  3959. this.resetText();
  3960. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  3961. };
  3962. a.prototype.resetText = function() {
  3963. this._text._setBaseText(this.stageText._getText())
  3964. };
  3965. a.prototype._updateTransform = function() {
  3966. var a = this._text._worldTransform.a,
  3967. d = this._text._worldTransform.b,
  3968. c = this._text._worldTransform.c,
  3969. l = this._text._worldTransform.d,
  3970. g = this._text._worldTransform.tx,
  3971. f = this._text._worldTransform.ty;
  3972. this._text._updateBaseTransform();
  3973. var h = this._text._worldTransform;
  3974. if (this._isFirst || a != h.a || d != h.b || c != h.c || l != h.d || g != h.tx || f !=
  3975. h.ty) {
  3976. this._isFirst = !1;
  3977. a = this._text.localToGlobal();
  3978. this.stageText.changePosition(a.x, a.y);
  3979. var m = this;
  3980. b.callLater(function() {
  3981. m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
  3982. }, this)
  3983. }
  3984. };
  3985. a.prototype._updateProperties = function() {
  3986. var a = this._text._stage;
  3987. if (null == a) this.stageText._setVisible(!1);
  3988. else {
  3989. for (var d = this._text, c = d._visible; c;) {
  3990. d = d.parent;
  3991. if (d == a) break;
  3992. c = d._visible
  3993. }
  3994. this.stageText._setVisible(c)
  3995. }
  3996. this.stageText._setMultiline(this._text._multiline);
  3997. this.stageText._setMaxChars(this._text._maxChars);
  3998. this.stageText._setSize(this._text._size);
  3999. this.stageText._setTextColor(this._text._textColorString);
  4000. this.stageText._setTextFontFamily(this._text._fontFamily);
  4001. this.stageText._setBold(this._text._bold);
  4002. this.stageText._setItalic(this._text._italic);
  4003. this.stageText._setTextAlign(this._text._textAlign);
  4004. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4005. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4006. this.stageText._setTextType(this._text._displayAsPassword ?
  4007. "password" : "text");
  4008. this.stageText._setText(this._text._text);
  4009. this.stageText._resetStageText();
  4010. this._updateTransform()
  4011. };
  4012. return a
  4013. }(b.HashObject);
  4014. b.InputController = c;
  4015. c.prototype.__class__ = "egret.InputController"
  4016. })(egret || (egret = {}));
  4017. __extends = this.__extends || function(b, c) {
  4018. function d() {
  4019. this.constructor = b
  4020. }
  4021. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4022. d.prototype = c.prototype;
  4023. b.prototype = new d
  4024. };
  4025. (function(b) {
  4026. var c = function(b) {
  4027. function a(a, c) {
  4028. b.call(this, a);
  4029. this.charList = this.parseConfig(c)
  4030. }
  4031. __extends(a, b);
  4032. a.prototype.getTexture = function(a) {
  4033. var b = this._textureMap[a];
  4034. if (!b) {
  4035. b = this.charList[a];
  4036. if (!b) return null;
  4037. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  4038. this._textureMap[a] = b
  4039. }
  4040. return b
  4041. };
  4042. a.prototype.parseConfig = function(a) {
  4043. a = a.split("\r\n").join("\n");
  4044. a = a.split("\n");
  4045. for (var b = this.getConfigByKey(a[3], "count"), d = {}, c = 4; c < 4 + b; c++) {
  4046. var g = a[c],
  4047. f = String.fromCharCode(this.getConfigByKey(g,
  4048. "id")),
  4049. h = {};
  4050. d[f] = h;
  4051. h.x = this.getConfigByKey(g, "x");
  4052. h.y = this.getConfigByKey(g, "y");
  4053. h.width = this.getConfigByKey(g, "width");
  4054. h.height = this.getConfigByKey(g, "height");
  4055. h.offsetX = this.getConfigByKey(g, "xoffset");
  4056. h.offsetY = this.getConfigByKey(g, "yoffset")
  4057. }
  4058. return d
  4059. };
  4060. a.prototype.getConfigByKey = function(a, b) {
  4061. for (var d = a.split(" "), c = 0, g = d.length; c < g; c++) {
  4062. var f = d[c];
  4063. if (b == f.substring(0, b.length)) return d = f.substring(b.length + 1), parseInt(d)
  4064. }
  4065. return 0
  4066. };
  4067. return a
  4068. }(b.SpriteSheet);
  4069. b.BitmapTextSpriteSheet = c;
  4070. c.prototype.__class__ =
  4071. "egret.BitmapTextSpriteSheet"
  4072. })(egret || (egret = {}));
  4073. __extends = this.__extends || function(b, c) {
  4074. function d() {
  4075. this.constructor = b
  4076. }
  4077. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4078. d.prototype = c.prototype;
  4079. b.prototype = new d
  4080. };
  4081. (function(b) {
  4082. var c = function(a) {
  4083. function e(e, c) {
  4084. a.call(this);
  4085. this.frameRate = 60;
  4086. e instanceof d ? (b.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new d(e, c);
  4087. this.delegate.setMovieClip(this)
  4088. }
  4089. __extends(e, a);
  4090. e.prototype.gotoAndPlay = function(a) {
  4091. this.delegate.gotoAndPlay(a)
  4092. };
  4093. e.prototype.gotoAndStop = function(a) {
  4094. this.delegate.gotoAndStop(a)
  4095. };
  4096. e.prototype.stop =
  4097. function() {
  4098. this.delegate.stop()
  4099. };
  4100. e.prototype.dispose = function() {
  4101. this.delegate.dispose()
  4102. };
  4103. e.prototype.release = function() {
  4104. b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4105. this.dispose()
  4106. };
  4107. e.prototype.getCurrentFrameIndex = function() {
  4108. b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4109. return this.delegate._currentFrameIndex
  4110. };
  4111. e.prototype.getTotalFrame = function() {
  4112. b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4113. return this.delegate._totalFrame
  4114. };
  4115. e.prototype.setInterval = function(a) {
  4116. b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4117. this.frameRate = 60 / a
  4118. };
  4119. e.prototype.getIsPlaying = function() {
  4120. b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4121. return this.delegate.isPlaying
  4122. };
  4123. return e
  4124. }(b.DisplayObjectContainer);
  4125. b.MovieClip = c;
  4126. c.prototype.__class__ = "egret.MovieClip";
  4127. var d = function() {
  4128. function a(a, d) {
  4129. this.data = a;
  4130. this._currentFrameIndex = this._passTime =
  4131. this._totalFrame = 0;
  4132. this._isPlaying = !1;
  4133. this._frameData = a;
  4134. this._spriteSheet = new b.SpriteSheet(d)
  4135. }
  4136. a.prototype.setMovieClip = function(a) {
  4137. this.movieClip = a;
  4138. this.bitmap = new b.Bitmap;
  4139. this.movieClip.addChild(this.bitmap)
  4140. };
  4141. a.prototype.gotoAndPlay = function(a) {
  4142. this.checkHasFrame(a);
  4143. this._isPlaying = !0;
  4144. this._currentFrameIndex = 0;
  4145. this._currentFrameName = a;
  4146. this._totalFrame = this._frameData.frames[a].totalFrame;
  4147. this.playNextFrame();
  4148. this._passTime = 0;
  4149. b.Ticker.getInstance().register(this.update, this)
  4150. };
  4151. a.prototype.gotoAndStop =
  4152. function(a) {
  4153. this.checkHasFrame(a);
  4154. this.stop();
  4155. this._currentFrameIndex = this._passTime = 0;
  4156. this._currentFrameName = a;
  4157. this._totalFrame = this._frameData.frames[a].totalFrame;
  4158. this.playNextFrame()
  4159. };
  4160. a.prototype.stop = function() {
  4161. this._isPlaying = !1;
  4162. b.Ticker.getInstance().unregister(this.update, this)
  4163. };
  4164. a.prototype.dispose = function() {};
  4165. a.prototype.checkHasFrame = function(a) {
  4166. void 0 == this._frameData.frames[a] && b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  4167. };
  4168. a.prototype.update = function(a) {
  4169. for (var b =
  4170. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  4171. this._passTime += a
  4172. };
  4173. a.prototype.playNextFrame = function(a) {
  4174. void 0 === a && (a = !0);
  4175. var d = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4176. if (a) {
  4177. a = this.getTexture(d.res);
  4178. var c = this.bitmap;
  4179. c.x = d.x;
  4180. c.y = d.y;
  4181. c.texture = a
  4182. }
  4183. null != d.action && this.movieClip.dispatchEventWith(d.action);
  4184. this._currentFrameIndex++;
  4185. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4186. 0, d.action != b.Event.COMPLETE && this.movieClip.dispatchEventWith(b.Event.COMPLETE))
  4187. };
  4188. a.prototype.getTexture = function(a) {
  4189. var b = this._frameData.res[a],
  4190. d = this._spriteSheet.getTexture(a);
  4191. d || (d = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4192. return d
  4193. };
  4194. return a
  4195. }();
  4196. b.DefaultMovieClipDelegate = d;
  4197. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4198. })(egret || (egret = {}));
  4199. __extends = this.__extends || function(b, c) {
  4200. function d() {
  4201. this.constructor = b
  4202. }
  4203. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4204. d.prototype = c.prototype;
  4205. b.prototype = new d
  4206. };
  4207. (function(b) {
  4208. var c = function(b) {
  4209. function a() {
  4210. b.call(this);
  4211. this._scaleY = this._scaleX = 1;
  4212. this._size = 30;
  4213. this._color = "#FFFFFF";
  4214. this._fontFamily = "Arial";
  4215. this._italic = this._bold = !1;
  4216. this._textAlign = "left";
  4217. this._multiline = this._visible = !1;
  4218. this._maxChars = 0
  4219. }
  4220. __extends(a, b);
  4221. a.prototype._getText = function() {
  4222. return null
  4223. };
  4224. a.prototype._setText = function(a) {};
  4225. a.prototype._setTextType = function(a) {};
  4226. a.prototype._getTextType = function() {
  4227. return null
  4228. };
  4229. a.prototype._open = function(a, b, d, c) {};
  4230. a.prototype._show = function() {};
  4231. a.prototype._add =
  4232. function() {};
  4233. a.prototype._remove = function() {};
  4234. a.prototype._hide = function() {};
  4235. a.prototype._addListeners = function() {};
  4236. a.prototype._removeListeners = function() {};
  4237. a.prototype._setScale = function(a, b) {
  4238. this._scaleX = a;
  4239. this._scaleY = b
  4240. };
  4241. a.prototype.changePosition = function(a, b) {};
  4242. a.prototype._setSize = function(a) {
  4243. this._size = a
  4244. };
  4245. a.prototype._setTextColor = function(a) {
  4246. this._color = a
  4247. };
  4248. a.prototype._setTextFontFamily = function(a) {
  4249. this._fontFamily = a
  4250. };
  4251. a.prototype._setBold = function(a) {
  4252. this._bold = a
  4253. };
  4254. a.prototype._setItalic =
  4255. function(a) {
  4256. this._italic = a
  4257. };
  4258. a.prototype._setTextAlign = function(a) {
  4259. this._textAlign = a
  4260. };
  4261. a.prototype._setVisible = function(a) {
  4262. this._visible = a
  4263. };
  4264. a.prototype._setWidth = function(a) {};
  4265. a.prototype._setHeight = function(a) {};
  4266. a.prototype._setMultiline = function(a) {
  4267. this._multiline = a
  4268. };
  4269. a.prototype._setMaxChars = function(a) {
  4270. this._maxChars = a
  4271. };
  4272. a.prototype._resetStageText = function() {};
  4273. a.create = function() {
  4274. return null
  4275. };
  4276. return a
  4277. }(b.EventDispatcher);
  4278. b.StageText = c;
  4279. c.prototype.__class__ = "egret.StageText"
  4280. })(egret || (egret = {}));
  4281. (function(b) {
  4282. var c = function() {
  4283. function b() {}
  4284. b.GET = "get";
  4285. b.POST = "post";
  4286. return b
  4287. }();
  4288. b.URLRequestMethod = c;
  4289. c.prototype.__class__ = "egret.URLRequestMethod"
  4290. })(egret || (egret = {}));
  4291. (function(b) {
  4292. var c = function() {
  4293. function b() {}
  4294. b.BINARY = "binary";
  4295. b.TEXT = "text";
  4296. b.VARIABLES = "variables";
  4297. b.TEXTURE = "texture";
  4298. b.SOUND = "sound";
  4299. return b
  4300. }();
  4301. b.URLLoaderDataFormat = c;
  4302. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  4303. })(egret || (egret = {}));
  4304. __extends = this.__extends || function(b, c) {
  4305. function d() {
  4306. this.constructor = b
  4307. }
  4308. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4309. d.prototype = c.prototype;
  4310. b.prototype = new d
  4311. };
  4312. (function(b) {
  4313. var c = function(b) {
  4314. function a(a) {
  4315. void 0 === a && (a = null);
  4316. b.call(this);
  4317. null !== a && this.decode(a)
  4318. }
  4319. __extends(a, b);
  4320. a.prototype.decode = function(a) {
  4321. this.variables || (this.variables = {});
  4322. a = a.split("+").join(" ");
  4323. for (var b, d = /[?&]?([^=]+)=([^&]*)/g; b = d.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  4324. };
  4325. a.prototype.toString = function() {
  4326. if (!this.variables) return "";
  4327. var a = this.variables,
  4328. b = "",
  4329. d = !0,
  4330. c;
  4331. for (c in a) d ? d = !1 : b += "&", b += c + "=" + a[c];
  4332. return b
  4333. };
  4334. return a
  4335. }(b.HashObject);
  4336. b.URLVariables =
  4337. c;
  4338. c.prototype.__class__ = "egret.URLVariables"
  4339. })(egret || (egret = {}));
  4340. (function(b) {
  4341. var c = function() {
  4342. return function(b, a) {
  4343. this.name = b;
  4344. this.value = a
  4345. }
  4346. }();
  4347. b.URLRequestHeader = c;
  4348. c.prototype.__class__ = "egret.URLRequestHeader"
  4349. })(egret || (egret = {}));
  4350. __extends = this.__extends || function(b, c) {
  4351. function d() {
  4352. this.constructor = b
  4353. }
  4354. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4355. d.prototype = c.prototype;
  4356. b.prototype = new d
  4357. };
  4358. (function(b) {
  4359. var c = function(d) {
  4360. function a(a) {
  4361. void 0 === a && (a = null);
  4362. d.call(this);
  4363. this.method = b.URLRequestMethod.GET;
  4364. this.url = a
  4365. }
  4366. __extends(a, d);
  4367. return a
  4368. }(b.HashObject);
  4369. b.URLRequest = c;
  4370. c.prototype.__class__ = "egret.URLRequest"
  4371. })(egret || (egret = {}));
  4372. __extends = this.__extends || function(b, c) {
  4373. function d() {
  4374. this.constructor = b
  4375. }
  4376. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4377. d.prototype = c.prototype;
  4378. b.prototype = new d
  4379. };
  4380. (function(b) {
  4381. var c = function(d) {
  4382. function a(a) {
  4383. void 0 === a && (a = null);
  4384. d.call(this);
  4385. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  4386. this._status = -1;
  4387. a && this.load(a)
  4388. }
  4389. __extends(a, d);
  4390. a.prototype.load = function(a) {
  4391. this._request = a;
  4392. this.data = null;
  4393. b.MainContext.instance.netContext.proceed(this)
  4394. };
  4395. return a
  4396. }(b.EventDispatcher);
  4397. b.URLLoader = c;
  4398. c.prototype.__class__ = "egret.URLLoader"
  4399. })(egret || (egret = {}));
  4400. __extends = this.__extends || function(b, c) {
  4401. function d() {
  4402. this.constructor = b
  4403. }
  4404. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4405. d.prototype = c.prototype;
  4406. b.prototype = new d
  4407. };
  4408. (function(b) {
  4409. var c = function(d) {
  4410. function a() {
  4411. d.call(this);
  4412. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4413. }
  4414. __extends(a, d);
  4415. Object.defineProperty(a.prototype, "textureWidth", {
  4416. get: function() {
  4417. return this._textureWidth
  4418. },
  4419. enumerable: !0,
  4420. configurable: !0
  4421. });
  4422. Object.defineProperty(a.prototype, "textureHeight", {
  4423. get: function() {
  4424. return this._textureHeight
  4425. },
  4426. enumerable: !0,
  4427. configurable: !0
  4428. });
  4429. Object.defineProperty(a.prototype, "bitmapData", {
  4430. get: function() {
  4431. return this._bitmapData
  4432. },
  4433. enumerable: !0,
  4434. configurable: !0
  4435. });
  4436. a.prototype._setBitmapData = function(a) {
  4437. var d = b.MainContext.instance.rendererContext.texture_scale_factor;
  4438. this._bitmapData = a;
  4439. this._sourceWidth = a.width;
  4440. this._sourceHeight = a.height;
  4441. this._textureWidth = this._sourceWidth * d;
  4442. this._textureHeight = this._sourceHeight * d;
  4443. this._bitmapWidth = this._textureWidth;
  4444. this._bitmapHeight = this._textureHeight;
  4445. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4446. };
  4447. a.prototype.getPixel32 = function(a, b) {
  4448. return this._bitmapData.getContext("2d").getImageData(a,
  4449. b, 1, 1).data
  4450. };
  4451. return a
  4452. }(b.HashObject);
  4453. b.Texture = c;
  4454. c.prototype.__class__ = "egret.Texture"
  4455. })(egret || (egret = {}));
  4456. __extends = this.__extends || function(b, c) {
  4457. function d() {
  4458. this.constructor = b
  4459. }
  4460. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4461. d.prototype = c.prototype;
  4462. b.prototype = new d
  4463. };
  4464. (function(b) {
  4465. var c = function(d) {
  4466. function a() {
  4467. d.call(this);
  4468. this._bitmapData = document.createElement("canvas");
  4469. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  4470. }
  4471. __extends(a, d);
  4472. a.prototype.drawToTexture = function(e) {
  4473. var d = this._bitmapData,
  4474. c = e.getBounds(b.Rectangle.identity);
  4475. if (0 == c.width || 0 == c.height) return b.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4476. c.width = Math.floor(c.width);
  4477. c.height = Math.floor(c.height);
  4478. d.width = c.width;
  4479. d.height = c.height;
  4480. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = c.width, this.renderContext._cacheCanvas.height = c.height);
  4481. a.identityRectangle.width = c.width;
  4482. a.identityRectangle.height = c.height;
  4483. e._worldTransform.identity();
  4484. e.worldAlpha = 1;
  4485. if (e instanceof b.DisplayObjectContainer) {
  4486. var d = e._anchorOffsetX,
  4487. l = e._anchorOffsetY;
  4488. if (0 != e._anchorX || 0 != e._anchorY) d = e._anchorX * c.width, l = e._anchorY * c.height;
  4489. this._offsetX = c.x + d;
  4490. this._offsetY = c.y +
  4491. l;
  4492. e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4493. c = e._children;
  4494. d = 0;
  4495. for (l = c.length; d < l; d++) c[d]._updateTransform()
  4496. }
  4497. c = b.RenderFilter.getInstance();
  4498. d = c._drawAreaList.concat();
  4499. c._drawAreaList.length = 0;
  4500. this.renderContext.clearScreen();
  4501. this.renderContext.onRenderStart();
  4502. this.webGLTexture = null;
  4503. (l = e.mask || e._scrollRect) && this.renderContext.pushMask(l);
  4504. e._render(this.renderContext);
  4505. l && this.renderContext.popMask();
  4506. c.addDrawArea(a.identityRectangle);
  4507. this.renderContext.onRenderFinish();
  4508. c._drawAreaList =
  4509. d;
  4510. this._textureWidth = this._bitmapData.width;
  4511. this._textureHeight = this._bitmapData.height;
  4512. this._sourceWidth = this._textureWidth;
  4513. this._sourceHeight = this._textureHeight;
  4514. return !0
  4515. };
  4516. a.identityRectangle = new b.Rectangle;
  4517. return a
  4518. }(b.Texture);
  4519. b.RenderTexture = c;
  4520. c.prototype.__class__ = "egret.RenderTexture"
  4521. })(egret || (egret = {}));
  4522. __extends = this.__extends || function(b, c) {
  4523. function d() {
  4524. this.constructor = b
  4525. }
  4526. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4527. d.prototype = c.prototype;
  4528. b.prototype = new d
  4529. };
  4530. (function(b) {
  4531. var c = function(d) {
  4532. function a() {
  4533. d.call(this);
  4534. this.renderCost = 0;
  4535. this.texture_scale_factor = 1;
  4536. this.profiler = b.Profiler.getInstance()
  4537. }
  4538. __extends(a, d);
  4539. a.prototype.clearScreen = function() {};
  4540. a.prototype.clearRect = function(a, b, d, c) {};
  4541. a.prototype.drawImage = function(a, b, d, c, g, f, h, m, n, q) {
  4542. this.profiler.onDrawImage()
  4543. };
  4544. a.prototype.setTransform = function(a) {};
  4545. a.prototype.setAlpha = function(a, b) {};
  4546. a.prototype.setupFont = function(a, b) {};
  4547. a.prototype.measureText = function(a) {
  4548. return 0
  4549. };
  4550. a.prototype.drawText = function(a,
  4551. b, d, c, g, f) {
  4552. this.profiler.onDrawImage()
  4553. };
  4554. a.prototype.strokeRect = function(a, b, d, c, g) {};
  4555. a.prototype.pushMask = function(a) {};
  4556. a.prototype.popMask = function() {};
  4557. a.prototype.onRenderStart = function() {};
  4558. a.prototype.onRenderFinish = function() {};
  4559. a.prototype.setGlobalColorTransform = function(a) {};
  4560. a.createRendererContext = function(a) {
  4561. return null
  4562. };
  4563. a.imageSmoothingEnabled = !0;
  4564. return a
  4565. }(b.HashObject);
  4566. b.RendererContext = c;
  4567. c.prototype.__class__ = "egret.RendererContext"
  4568. })(egret || (egret = {}));
  4569. (function(b) {
  4570. var c = function() {
  4571. function b() {}
  4572. b.MOUSE = "mouse";
  4573. b.TOUCH = "touch";
  4574. b.mode = "touch";
  4575. return b
  4576. }();
  4577. b.InteractionMode = c;
  4578. c.prototype.__class__ = "egret.InteractionMode"
  4579. })(egret || (egret = {}));
  4580. __extends = this.__extends || function(b, c) {
  4581. function d() {
  4582. this.constructor = b
  4583. }
  4584. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4585. d.prototype = c.prototype;
  4586. b.prototype = new d
  4587. };
  4588. (function(b) {
  4589. var c = function(d) {
  4590. function a() {
  4591. d.call(this);
  4592. this._currentTouchTarget = {};
  4593. this.maxTouches = 2;
  4594. this.touchDownTarget = {};
  4595. this.touchingIdentifiers = [];
  4596. this.lastTouchY = this.lastTouchX = -1
  4597. }
  4598. __extends(a, d);
  4599. a.prototype.run = function() {};
  4600. a.prototype.getTouchData = function(a, b, d) {
  4601. var c = this._currentTouchTarget[a];
  4602. null == c && (c = {}, this._currentTouchTarget[a] = c);
  4603. c.stageX = b;
  4604. c.stageY = d;
  4605. c.identifier = a;
  4606. return c
  4607. };
  4608. a.prototype.dispatchEvent = function(a, d) {
  4609. b.TouchEvent.dispatchTouchEvent(d.target, a, d.identifier, d.stageX,
  4610. d.stageY, !1, !1, !1, !0 == this.touchDownTarget[d.identifier])
  4611. };
  4612. a.prototype.onTouchBegan = function(a, d, c) {
  4613. if (this.touchingIdentifiers.length != this.maxTouches) {
  4614. var l = b.MainContext.instance.stage.hitTest(a, d);
  4615. l && (a = this.getTouchData(c, a, d), this.touchDownTarget[c] = !0, a.target = l, a.beginTarget = l, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  4616. this.touchingIdentifiers.push(c)
  4617. }
  4618. };
  4619. a.prototype.onTouchMove = function(a, d, c) {
  4620. if (-1 != this.touchingIdentifiers.indexOf(c) && (a != this.lastTouchX || d != this.lastTouchY)) {
  4621. this.lastTouchX =
  4622. a;
  4623. this.lastTouchY = d;
  4624. var l = b.MainContext.instance.stage.hitTest(a, d);
  4625. l && (a = this.getTouchData(c, a, d), a.target = l, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  4626. }
  4627. };
  4628. a.prototype.onTouchEnd = function(a, d, c) {
  4629. var l = this.touchingIdentifiers.indexOf(c); - 1 != l && (this.touchingIdentifiers.splice(l, 1), l = b.MainContext.instance.stage.hitTest(a, d)) && (a = this.getTouchData(c, a, d), delete this.touchDownTarget[c], c = a.beginTarget, a.target = l, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), c == l ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  4630. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4631. };
  4632. return a
  4633. }(b.HashObject);
  4634. b.TouchContext = c;
  4635. c.prototype.__class__ = "egret.TouchContext"
  4636. })(egret || (egret = {}));
  4637. __extends = this.__extends || function(b, c) {
  4638. function d() {
  4639. this.constructor = b
  4640. }
  4641. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4642. d.prototype = c.prototype;
  4643. b.prototype = new d
  4644. };
  4645. (function(b) {
  4646. var c = function(d) {
  4647. function a() {
  4648. d.call(this)
  4649. }
  4650. __extends(a, d);
  4651. a.prototype.proceed = function(a) {};
  4652. a._getUrl = function(a) {
  4653. var d = a.url; - 1 == d.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (d = d + "?" + a.data.toString());
  4654. return d
  4655. };
  4656. a.prototype.getChangeList = function() {
  4657. return []
  4658. };
  4659. return a
  4660. }(b.HashObject);
  4661. b.NetContext = c;
  4662. c.prototype.__class__ = "egret.NetContext"
  4663. })(egret || (egret = {}));
  4664. __extends = this.__extends || function(b, c) {
  4665. function d() {
  4666. this.constructor = b
  4667. }
  4668. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4669. d.prototype = c.prototype;
  4670. b.prototype = new d
  4671. };
  4672. (function(b) {
  4673. var c = function(b) {
  4674. function a() {
  4675. b.call(this);
  4676. this.frameRate = 60
  4677. }
  4678. __extends(a, b);
  4679. a.prototype.executeMainLoop = function(a, b) {};
  4680. return a
  4681. }(b.HashObject);
  4682. b.DeviceContext = c;
  4683. c.prototype.__class__ = "egret.DeviceContext"
  4684. })(egret || (egret = {}));
  4685. (function(b) {
  4686. var c = function() {
  4687. function b() {}
  4688. b.call = function(a, e) {};
  4689. b.addCallback = function(a, e) {};
  4690. return b
  4691. }();
  4692. b.ExternalInterface = c;
  4693. c.prototype.__class__ = "egret.ExternalInterface"
  4694. })(egret || (egret = {}));
  4695. __extends = this.__extends || function(b, c) {
  4696. function d() {
  4697. this.constructor = b
  4698. }
  4699. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4700. d.prototype = c.prototype;
  4701. b.prototype = new d
  4702. };
  4703. (function(b) {
  4704. var c = function(d) {
  4705. function a() {
  4706. d.call(this);
  4707. this.ua = navigator.userAgent.toLowerCase();
  4708. this.trans = this._getTrans()
  4709. }
  4710. __extends(a, d);
  4711. a.getInstance = function() {
  4712. null == a.instance && (a.instance = new a);
  4713. return a.instance
  4714. };
  4715. Object.defineProperty(a.prototype, "isMobile", {
  4716. get: function() {
  4717. 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 ");
  4718. return b.MainContext.deviceType ==
  4719. b.MainContext.DEVICE_MOBILE
  4720. },
  4721. enumerable: !0,
  4722. configurable: !0
  4723. });
  4724. a.prototype._getHeader = function(a) {
  4725. if ("transform" in a) return "";
  4726. for (var b = ["webkit", "ms", "Moz", "O"], d = 0; d < b.length; d++)
  4727. if (b[d] + "Transform" in a) return b[d];
  4728. return ""
  4729. };
  4730. a.prototype._getTrans = function() {
  4731. var a = document.createElement("div").style,
  4732. a = this._getHeader(a);
  4733. return "" == a ? "transform" : a + "Transform"
  4734. };
  4735. a.prototype.$new = function(a) {
  4736. return this.$(document.createElement(a))
  4737. };
  4738. a.prototype.$ = function(e) {
  4739. var d = document;
  4740. if (e = e instanceof HTMLElement ?
  4741. e : d.querySelector(e)) e.find = e.find || this.$, e.hasClass = e.hasClass || function(a) {
  4742. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4743. }, e.addClass = e.addClass || function(a) {
  4744. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4745. return this
  4746. }, e.removeClass = e.removeClass || function(a) {
  4747. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4748. return this
  4749. }, e.remove = e.remove || function() {}, e.appendTo = e.appendTo || function(a) {
  4750. a.appendChild(this);
  4751. return this
  4752. }, e.prependTo = e.prependTo ||
  4753. function(a) {
  4754. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4755. return this
  4756. }, e.transforms = e.transforms || function() {
  4757. 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);
  4758. return this
  4759. }, e.position = e.position || {
  4760. x: 0,
  4761. y: 0
  4762. }, e.rotation = e.rotation || 0, e.scale = e.scale || {
  4763. x: 1,
  4764. y: 1
  4765. }, e.skew = e.skew || {
  4766. x: 0,
  4767. y: 0
  4768. }, e.translates = function(a, e) {
  4769. this.position.x = a;
  4770. this.position.y = e -
  4771. b.MainContext.instance.stage.stageHeight;
  4772. this.transforms();
  4773. return this
  4774. }, e.rotate = function(a) {
  4775. this.rotation = a;
  4776. this.transforms();
  4777. return this
  4778. }, e.resize = function(a, e) {
  4779. this.scale.x = a;
  4780. this.scale.y = e;
  4781. this.transforms();
  4782. return this
  4783. }, e.setSkew = function(a, e) {
  4784. this.skew.x = a;
  4785. this.skew.y = e;
  4786. this.transforms();
  4787. return this
  4788. };
  4789. return e
  4790. };
  4791. a.prototype.translate = function(a) {
  4792. return "translate(" + a.x + "px, " + a.y + "px) "
  4793. };
  4794. a.prototype.rotate = function(a) {
  4795. return "rotate(" + a + "deg) "
  4796. };
  4797. a.prototype.scale = function(a) {
  4798. return "scale(" + a.x + ", " +
  4799. a.y + ") "
  4800. };
  4801. a.prototype.skew = function(a) {
  4802. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4803. };
  4804. return a
  4805. }(b.HashObject);
  4806. b.Browser = c;
  4807. c.prototype.__class__ = "egret.Browser"
  4808. })(egret || (egret = {}));
  4809. (function(b) {
  4810. (function(b) {
  4811. b.getItem = function(b) {
  4812. return null
  4813. };
  4814. b.setItem = function(b, a) {
  4815. return !1
  4816. };
  4817. b.removeItem = function(b) {};
  4818. b.clear = function() {}
  4819. })(b.localStorage || (b.localStorage = {}))
  4820. })(egret || (egret = {}));
  4821. (function(b) {
  4822. var c = function() {
  4823. function d() {}
  4824. d.parse = function(a) {
  4825. a = b.SAXParser.getInstance().parserXML(a);
  4826. if (!a || !a.childNodes) return null;
  4827. for (var e = a.childNodes.length, c = !1, p = 0; p < e; p++) {
  4828. var l = a.childNodes[p];
  4829. if (1 == l.nodeType) {
  4830. c = !0;
  4831. break
  4832. }
  4833. }
  4834. return c ? d.parseNode(l) : null
  4835. };
  4836. d.parseNode = function(a) {
  4837. if (!a || 1 != a.nodeType) return null;
  4838. var e = {};
  4839. e.localName = a.localName;
  4840. e.name = a.nodeName;
  4841. a.namespaceURI && (e.namespace = a.namespaceURI);
  4842. a.prefix && (e.prefix = a.prefix);
  4843. for (var b = a.attributes, c = b.length, l = 0; l < c; l++) {
  4844. var g =
  4845. b[l],
  4846. f = g.name;
  4847. 0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
  4848. }
  4849. b = a.childNodes;
  4850. c = b.length;
  4851. for (l = 0; l < c; l++)
  4852. if (g = d.parseNode(b[l])) e.children || (e.children = []), g.parent = e, e.children.push(g);
  4853. !e.children && (a = a.textContent.trim()) && (e.text = a);
  4854. return e
  4855. };
  4856. d.findChildren = function(a, e, b) {
  4857. b ? b.length = 0 : b = [];
  4858. d.findByPath(a, e, b);
  4859. return b
  4860. };
  4861. d.findByPath = function(a, e, b) {
  4862. var c = e.indexOf("."),
  4863. l; - 1 == c ? (l = e, c = !0) : (l = e.substring(0, c), e = e.substring(c + 1), c = !1);
  4864. if (a = a.children)
  4865. for (var g = a.length, f = 0; f < g; f++) {
  4866. var h = a[f];
  4867. h.localName ==
  4868. l && (c ? b.push(h) : d.findByPath(h, e, b))
  4869. }
  4870. };
  4871. d.getAttributes = function(a, e) {
  4872. e ? e.length = 0 : e = [];
  4873. for (var b in a) "$" == b.charAt(0) && e.push(b.substring(1));
  4874. return e
  4875. };
  4876. return d
  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 d = 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. d = new Uint8Array(this.arraybytes, 0, this.length);
  4937. (new Uint8Array(b, 0, this.length)).set(d);
  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, d) {
  4953. void 0 === b && (b = 0);
  4954. void 0 === d && (d = 0);
  4955. null == d && (d = a.length);
  4956. a.ensureWriteableSpace(b + d);
  4957. var c = new Int8Array(a.arraybytes),
  4958. g = new Int8Array(this.arraybytes);
  4959. c.set(g.subarray(this.position, this.position + d), b);
  4960. this.position += d;
  4961. d + b > a.length && (a.length += d + 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 d = new DataView(this.arraybytes); this.position < a;) {
  4985. var c = d.getUint8(this.position++);
  4986. if (128 > c) {
  4987. if (0 == c) break;
  4988. b += String.fromCharCode(c)
  4989. } else if (224 > c) b += String.fromCharCode((c & 63) << 6 | d.getUint8(this.position++) & 127);
  4990. else if (240 > c) var g = d.getUint8(this.position++),
  4991. b = b + String.fromCharCode((c & 31) << 12 | (g & 127) << 6 | d.getUint8(this.position++) & 127);
  4992. else var g = d.getUint8(this.position++),
  4993. f = d.getUint8(this.position++),
  4994. b = b + String.fromCharCode((c & 15) << 18 | (g & 127) << 12 | f << 6 & 127 | d.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 = d;
  5081. d.prototype.__class__ = "egret.ByteArray"
  5082. })(egret || (egret = {}));
  5083. __extends = this.__extends || function(b, c) {
  5084. function d() {
  5085. this.constructor = b
  5086. }
  5087. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5088. d.prototype = c.prototype;
  5089. b.prototype = new d
  5090. };
  5091. (function(b) {
  5092. var c = function(d) {
  5093. function a(a, b, c) {
  5094. d.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, c)
  5105. }
  5106. __extends(a, d);
  5107. a.get = function(e, b, d, c) {
  5108. void 0 === b && (b = null);
  5109. void 0 === d && (d = null);
  5110. void 0 === c && (c = !1);
  5111. c && a.removeTweens(e);
  5112. return new a(e, b, d)
  5113. };
  5114. a.removeTweens = function(e) {
  5115. if (e.tween_count) {
  5116. for (var b =
  5117. a._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == e && (b[d].paused = !0, b.splice(d, 1));
  5118. e.tween_count = 0
  5119. }
  5120. };
  5121. a.pauseTweens = function(a) {
  5122. if (a.tween_count)
  5123. for (var d = b.Tween._tweens, c = d.length - 1; 0 <= c; c--) d[c]._target == a && (d[c].paused = !0)
  5124. };
  5125. a.resumeTweens = function(a) {
  5126. if (a.tween_count)
  5127. for (var d = b.Tween._tweens, c = d.length - 1; 0 <= c; c--) d[c]._target == a && (d[c].paused = !1)
  5128. };
  5129. a.tick = function(e, b) {
  5130. void 0 === b && (b = !1);
  5131. for (var d = a._tweens.concat(), c = d.length - 1; 0 <= c; c--) {
  5132. var g = d[c];
  5133. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
  5134. 1 : e)
  5135. }
  5136. };
  5137. a._register = function(e, d) {
  5138. var c = e._target,
  5139. l = a._tweens;
  5140. if (d) c && (c.tween_count = c.tween_count ? c.tween_count + 1 : 1), l.push(e), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5141. else
  5142. for (c && c.tween_count--, c = l.length; c--;)
  5143. if (l[c] == e) {
  5144. l.splice(c, 1);
  5145. break
  5146. }
  5147. };
  5148. a.removeAllTweens = function() {
  5149. for (var e = a._tweens, b = 0, d = e.length; b < d; b++) {
  5150. var c = e[b];
  5151. c.paused = !0;
  5152. c._target.tweenjs_count = 0
  5153. }
  5154. e.length = 0
  5155. };
  5156. a.prototype.initialize = function(e, b, d) {
  5157. this._target = e;
  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(e));
  5160. this.pluginData = d || {};
  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 d = a,
  5172. c = !1;
  5173. d >= this.duration && (this.loop ? d %= this.duration : (d = this.duration, c = !0));
  5174. if (d == this._prevPos) return c;
  5175. var g = this._prevPos;
  5176. this.position = this._prevPos = d;
  5177. this._prevPosition = a;
  5178. if (this._target)
  5179. if (c) this._updateTargetProps(null, 1);
  5180. else if (0 < this._steps.length) {
  5181. for (var f = 0, h = this._steps.length; f < h && !(this._steps[f].t > d); f++);
  5182. f = this._steps[f - 1];
  5183. this._updateTargetProps(f, (this._stepPosition = d - f.t) / f.d)
  5184. }
  5185. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, d, !0)) : this._runActions(g, d));
  5186. c && this.setPaused(!0);
  5187. this.dispatchEventWith("change");
  5188. return c
  5189. };
  5190. a.prototype._runActions = function(a, b, d) {
  5191. void 0 === d && (d = !1);
  5192. var c = a,
  5193. g = b,
  5194. f = -1,
  5195. h = this._actions.length,
  5196. m = 1;
  5197. a > b && (c = b, g = a, f = h, h = m = -1);
  5198. for (;
  5199. (f += m) != h;) {
  5200. b = this._actions[f];
  5201. var n = b.t;
  5202. (n == g || n > c && n < g || d && n == a) && b.f.apply(b.o, b.p)
  5203. }
  5204. };
  5205. a.prototype._updateTargetProps = function(e, b) {
  5206. var d, c, g, f;
  5207. if (e || 1 != b) {
  5208. if (this.passive = !!e.v) return;
  5209. e.e && (b = e.e(b, 0, 1, 1));
  5210. d = e.p0;
  5211. c = e.p1
  5212. } else this.passive = !1, d = c = this._curQueueProps;
  5213. for (var h in this._initQueueProps) {
  5214. null == (g = d[h]) && (d[h] = g = this._initQueueProps[h]);
  5215. null ==
  5216. (f = c[h]) && (c[h] = f = g);
  5217. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f : g : g + (f - g) * b;
  5218. var m = !1;
  5219. if (f = a._plugins[h])
  5220. for (var n = 0, q = f.length; n < q; n++) {
  5221. var r = f[n].tween(this, h, g, d, c, b, !!e && d == c, !e);
  5222. r == a.IGNORE ? m = !0 : g = r
  5223. }
  5224. m || (this._target[h] = g)
  5225. }
  5226. };
  5227. a.prototype.setPaused = function(e) {
  5228. this.paused = e;
  5229. a._register(this, !e);
  5230. return this
  5231. };
  5232. a.prototype._cloneProps = function(a) {
  5233. var b = {},
  5234. d;
  5235. for (d in a) b[d] = a[d];
  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(e) {
  5243. var b, d, c, g, f, h;
  5244. for (h in e)
  5245. if (void 0 === this._initQueueProps[h]) {
  5246. d = this._target[h];
  5247. if (b = a._plugins[h])
  5248. for (c = 0, g = b.length; c < g; c++) d = b[c].init(this, h, d);
  5249. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === d ? null : d
  5250. }
  5251. for (h in e) {
  5252. d = this._curQueueProps[h];
  5253. if (b = a._plugins[h])
  5254. for (f = f || {}, c = 0, g = b.length; c < g; c++) b[c].step && b[c].step(this, h, d, e[h], f);
  5255. this._curQueueProps[h] = e[h]
  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 d in a) b[d] = a[d]
  5268. };
  5269. a.prototype.wait = function(a, b) {
  5270. if (null == a || 0 >= a) return this;
  5271. var d = this._cloneProps(this._curQueueProps);
  5272. return this._addStep({
  5273. d: a,
  5274. p0: d,
  5275. p1: d,
  5276. v: b
  5277. })
  5278. };
  5279. a.prototype.to = function(a, b, d) {
  5280. void 0 === d && (d = 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: d,
  5286. p1: this._cloneProps(this._appendQueueProps(a))
  5287. })
  5288. };
  5289. a.prototype.call = function(a, b, d) {
  5290. void 0 === b && (b = void 0);
  5291. void 0 === d && (d = void 0);
  5292. return this._addAction({
  5293. f: a,
  5294. p: d ? d : [],
  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 d() {
  5332. b.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5333. }
  5334. d.get = function(a) {
  5335. -1 > a && (a = -1);
  5336. 1 < a && (a = 1);
  5337. return function(e) {
  5338. return 0 == a ? e : 0 > a ? e * (e * -a + 1 + a) : e * ((2 - e) * a + (1 - a))
  5339. }
  5340. };
  5341. d.getPowIn = function(a) {
  5342. return function(e) {
  5343. return Math.pow(e, a)
  5344. }
  5345. };
  5346. d.getPowOut = function(a) {
  5347. return function(e) {
  5348. return 1 - Math.pow(1 - e, a)
  5349. }
  5350. };
  5351. d.getPowInOut = function(a) {
  5352. return function(e) {
  5353. return 1 > (e *= 2) ? 0.5 * Math.pow(e, a) : 1 - 0.5 * Math.abs(Math.pow(2 - e, a))
  5354. }
  5355. };
  5356. d.sineIn = function(a) {
  5357. return 1 - Math.cos(a *
  5358. Math.PI / 2)
  5359. };
  5360. d.sineOut = function(a) {
  5361. return Math.sin(a * Math.PI / 2)
  5362. };
  5363. d.sineInOut = function(a) {
  5364. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5365. };
  5366. d.getBackIn = function(a) {
  5367. return function(e) {
  5368. return e * e * ((a + 1) * e - a)
  5369. }
  5370. };
  5371. d.getBackOut = function(a) {
  5372. return function(e) {
  5373. return --e * e * ((a + 1) * e + a) + 1
  5374. }
  5375. };
  5376. d.getBackInOut = function(a) {
  5377. a *= 1.525;
  5378. return function(e) {
  5379. return 1 > (e *= 2) ? 0.5 * e * e * ((a + 1) * e - a) : 0.5 * ((e -= 2) * e * ((a + 1) * e + a) + 2)
  5380. }
  5381. };
  5382. d.circIn = function(a) {
  5383. return -(Math.sqrt(1 - a * a) - 1)
  5384. };
  5385. d.circOut = function(a) {
  5386. return Math.sqrt(1 - --a * a)
  5387. };
  5388. d.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. d.bounceIn = function(a) {
  5393. return 1 - d.bounceOut(1 - a)
  5394. };
  5395. d.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. d.bounceInOut = function(a) {
  5399. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5400. };
  5401. d.getElasticIn = function(a, e) {
  5402. var b = 2 * Math.PI;
  5403. return function(d) {
  5404. if (0 == d || 1 == d) return d;
  5405. var c = e / b * Math.asin(1 / a);
  5406. return -(a * Math.pow(2, 10 *
  5407. (d -= 1)) * Math.sin((d - c) * b / e))
  5408. }
  5409. };
  5410. d.getElasticOut = function(a, e) {
  5411. var b = 2 * Math.PI;
  5412. return function(d) {
  5413. if (0 == d || 1 == d) return d;
  5414. var c = e / b * Math.asin(1 / a);
  5415. return a * Math.pow(2, -10 * d) * Math.sin((d - c) * b / e) + 1
  5416. }
  5417. };
  5418. d.getElasticInOut = function(a, e) {
  5419. var b = 2 * Math.PI;
  5420. return function(d) {
  5421. var c = e / b * Math.asin(1 / a);
  5422. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - c) * b / e) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - c) * b / e) * 0.5 + 1
  5423. }
  5424. };
  5425. d.quadIn = d.getPowIn(2);
  5426. d.quadOut = d.getPowOut(2);
  5427. d.quadInOut = d.getPowInOut(2);
  5428. d.cubicIn = d.getPowIn(3);
  5429. d.cubicOut = d.getPowOut(3);
  5430. d.cubicInOut = d.getPowInOut(3);
  5431. d.quartIn = d.getPowIn(4);
  5432. d.quartOut = d.getPowOut(4);
  5433. d.quartInOut = d.getPowInOut(4);
  5434. d.quintIn = d.getPowIn(5);
  5435. d.quintOut = d.getPowOut(5);
  5436. d.quintInOut = d.getPowInOut(5);
  5437. d.backIn = d.getBackIn(1.7);
  5438. d.backOut = d.getBackOut(1.7);
  5439. d.backInOut = d.getBackInOut(1.7);
  5440. d.elasticIn = d.getElasticIn(1, 0.3);
  5441. d.elasticOut = d.getElasticOut(1, 0.3);
  5442. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5443. return d
  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 e = this.audio;
  5456. e && (isNaN(e.duration) || (e.currentTime = 0), e.loop = a, e.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, e) {
  5467. this.audio && this.audio.addEventListener(a, e, !1)
  5468. };
  5469. b.prototype.removeEventListener = function(a, e) {
  5470. this.audio && this.audio.removeEventListener(a, e, !1)
  5471. };
  5472. b.prototype.setVolume =
  5473. function(a) {
  5474. var e = this.audio;
  5475. e && (e.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. d = this,
  5522. a = function() {},
  5523. e = function() {
  5524. return d.apply(this instanceof a && b ? this : b, c.concat(Array.prototype.slice.call(arguments)))
  5525. };
  5526. a.prototype = this.prototype;
  5527. e.prototype = new a;
  5528. return e
  5529. });
  5530. var __extends = this.__extends || function(b, c) {
  5531. function d() {
  5532. this.constructor = b
  5533. }
  5534. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5535. d.prototype = c.prototype;
  5536. b.prototype = new d
  5537. },
  5538. RES;
  5539. (function(b) {
  5540. var c = function(b) {
  5541. function a(a, c, p) {
  5542. void 0 === c && (c = !1);
  5543. void 0 === p && (p = !1);
  5544. b.call(this, a, c, p);
  5545. this.itemsTotal = this.itemsLoaded = 0
  5546. }
  5547. __extends(a, b);
  5548. a.dispatchResourceEvent = function(e, b, d, c, g, f) {
  5549. void 0 === d && (d = "");
  5550. void 0 === c && (c = null);
  5551. void 0 === g && (g = 0);
  5552. void 0 === f && (f = 0);
  5553. var h = egret.Event._getPropertyData(a);
  5554. h.groupName = d;
  5555. h.resItem = c;
  5556. h.itemsLoaded = g;
  5557. h.itemsTotal = f;
  5558. egret.Event._dispatchByTarget(a, e, b, h)
  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, e, d) {
  5575. this._loaded = !1;
  5576. this.name = a;
  5577. this.url = e;
  5578. this.type = d
  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 d() {
  5611. this.keyMap = {};
  5612. this.groupDic = {};
  5613. b.configInstance = this
  5614. }
  5615. d.prototype.getGroupByName = function(a) {
  5616. var e = [];
  5617. if (!this.groupDic[a]) return e;
  5618. a = this.groupDic[a];
  5619. for (var b = a.length, d = 0; d < b; d++) e.push(this.parseResourceItem(a[d]));
  5620. return e
  5621. };
  5622. d.prototype.getRawGroupByName = function(a) {
  5623. return this.groupDic[a] ? this.groupDic[a] : []
  5624. };
  5625. d.prototype.createGroup = function(a, e, b) {
  5626. void 0 === b && (b = !1);
  5627. if (!b && this.groupDic[a] || !e || 0 == e.length) return !1;
  5628. b = this.groupDic;
  5629. for (var d = [], c = e.length,
  5630. g = 0; g < c; g++) {
  5631. var f = e[g],
  5632. h = b[f];
  5633. if (h)
  5634. for (var f = h.length, m = 0; m < f; m++) {
  5635. var n = h[m]; - 1 == d.indexOf(n) && d.push(n)
  5636. } else(n = this.keyMap[f]) && -1 == d.indexOf(n) && d.push(n)
  5637. }
  5638. if (0 == d.length) return !1;
  5639. this.groupDic[a] = d;
  5640. return !0
  5641. };
  5642. d.prototype.parseConfig = function(a, e) {
  5643. if (a) {
  5644. var b = a.resources;
  5645. if (b)
  5646. for (var d = b.length, c = 0; c < d; c++) {
  5647. var g = b[c],
  5648. f = g.url;
  5649. f && -1 == f.indexOf("://") && (g.url = e + f);
  5650. this.addItemToKeyMap(g)
  5651. }
  5652. if (b = a.groups)
  5653. for (d = b.length, c = 0; c < d; c++) {
  5654. for (var f = b[c], h = [], m = f.keys.split(","), n = m.length, q = 0; q < n; q++) g = m[q].trim(), (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
  5655. this.groupDic[f.name] = h
  5656. }
  5657. }
  5658. };
  5659. d.prototype.addSubkey = function(a, e) {
  5660. var b = this.keyMap[e];
  5661. b && !this.keyMap[a] && (this.keyMap[a] = b)
  5662. };
  5663. d.prototype.addItemToKeyMap = function(a) {
  5664. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  5665. if (a.hasOwnProperty("subkeys")) {
  5666. var e = a.subkeys.split(",");
  5667. a.subkeys = e;
  5668. for (var b = e.length, d = 0; d < b; d++) {
  5669. var c = e[d];
  5670. null == this.keyMap[c] && (this.keyMap[c] = a)
  5671. }
  5672. }
  5673. };
  5674. d.prototype.getName = function(a) {
  5675. return (a = this.keyMap[a]) ? a.name : ""
  5676. };
  5677. d.prototype.getType =
  5678. function(a) {
  5679. return (a = this.keyMap[a]) ? a.type : ""
  5680. };
  5681. d.prototype.getRawResourceItem = function(a) {
  5682. return this.keyMap[a]
  5683. };
  5684. d.prototype.getResourceItem = function(a) {
  5685. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  5686. };
  5687. d.prototype.parseResourceItem = function(a) {
  5688. var e = new b.ResourceItem(a.name, a.url, a.type);
  5689. e.data = a;
  5690. return e
  5691. };
  5692. return d
  5693. }();
  5694. b.ResourceConfig = c;
  5695. c.prototype.__class__ = "RES.ResourceConfig"
  5696. })(RES || (RES = {}));
  5697. __extends = this.__extends || function(b, c) {
  5698. function d() {
  5699. this.constructor = b
  5700. }
  5701. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5702. d.prototype = c.prototype;
  5703. b.prototype = new d
  5704. };
  5705. (function(b) {
  5706. var c = function(d) {
  5707. function a() {
  5708. d.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, d);
  5724. a.prototype.isGroupInLoading = function(a) {
  5725. return void 0 !== this.itemListDic[a]
  5726. };
  5727. a.prototype.loadGroup = function(a, d, c) {
  5728. void 0 === c && (c = 0);
  5729. if (!this.itemListDic[d] && d)
  5730. if (a &&
  5731. 0 != a.length) {
  5732. this.priorityQueue[c] ? this.priorityQueue[c].push(d) : this.priorityQueue[c] = [d];
  5733. this.itemListDic[d] = a;
  5734. c = a.length;
  5735. for (var l = 0; l < c; l++) a[l].groupName = d;
  5736. this.groupTotalDic[d] = a.length;
  5737. this.numLoadedDic[d] = 0;
  5738. this.next()
  5739. } else egret.Logger.warning('RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4\uff1a"' + d + '"'), a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR), a.groupName = d, 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 d = this.analyzerDic[a.type];
  5755. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  5756. d.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 d, c = 0; c < b; c++) {
  5770. this.queueIndex >= b && (this.queueIndex = 0);
  5771. d = this.itemListDic[a[this.queueIndex]];
  5772. if (0 < d.length) break;
  5773. this.queueIndex++
  5774. }
  5775. return 0 == d.length ? null : d.shift()
  5776. };
  5777. a.prototype.onItemComplete = function(a) {
  5778. this.loadingCount--;
  5779. var d = a.groupName;
  5780. if (!a.loaded) {
  5781. var c = this.retryTimesDic[a.name] || 1;
  5782. if (c > this.maxRetryTimes) delete this.retryTimesDic[a.name], b.ResourceEvent.dispatchResourceEvent(this.resInstance,
  5783. b.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  5784. else {
  5785. this.retryTimesDic[a.name] = c + 1;
  5786. this.failedList.push(a);
  5787. this.next();
  5788. return
  5789. }
  5790. }
  5791. if (d) {
  5792. this.numLoadedDic[d]++;
  5793. var c = this.numLoadedDic[d],
  5794. l = this.groupTotalDic[d];
  5795. a.loaded || (this.groupErrorDic[d] = !0);
  5796. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, d, a, c, l);
  5797. c == l && (a = this.groupErrorDic[d], this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], delete this.groupErrorDic[d], a ? b.ResourceEvent.dispatchResourceEvent(this,
  5798. b.ResourceEvent.GROUP_LOAD_ERROR, d) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, d))
  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 d = this.priorityQueue[b], c = d.length, g = 0, f = !1, c = d.length, h = 0; h < c; h++) {
  5805. if (d[h] == a) {
  5806. d.splice(g, 1);
  5807. f = !0;
  5808. break
  5809. }
  5810. g++
  5811. }
  5812. if (f) {
  5813. 0 == d.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 d() {
  5826. this.constructor = b
  5827. }
  5828. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5829. d.prototype = c.prototype;
  5830. b.prototype = new d
  5831. };
  5832. (function(b) {
  5833. var c = function(d) {
  5834. function a() {
  5835. d.call(this);
  5836. this.resourceConfig = b.configInstance
  5837. }
  5838. __extends(a, d);
  5839. a.prototype.addSubkey = function(a, b) {
  5840. this.resourceConfig.addSubkey(a, b)
  5841. };
  5842. a.prototype.loadFile = function(a, b, d) {};
  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 d() {
  5864. this.constructor = b
  5865. }
  5866. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5867. d.prototype = c.prototype;
  5868. b.prototype = new d
  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, d) {
  5881. if (this.fileDic[a.name]) b.call(d, a);
  5882. else {
  5883. var c = this.getLoader();
  5884. this.resItemDic[c.hashCode] = {
  5885. item: a,
  5886. func: b,
  5887. thisObject: d
  5888. };
  5889. c.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. d = this.resItemDic[b.hashCode];
  5902. delete this.resItemDic[b.hashCode];
  5903. this.recycler.push(b);
  5904. var c = d.item,
  5905. g = d.func;
  5906. c.loaded = a.type == egret.Event.COMPLETE;
  5907. c.loaded && this.analyzeData(c, b.data);
  5908. g.call(d.thisObject, c)
  5909. };
  5910. a.prototype.analyzeData = function(a, b) {
  5911. var d = a.name;
  5912. !this.fileDic[d] && b && (this.fileDic[d] = 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 d() {
  5931. this.constructor = b
  5932. }
  5933. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5934. d.prototype = c.prototype;
  5935. b.prototype = new d
  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 d = a.name;
  5946. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  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 d() {
  5955. this.constructor = b
  5956. }
  5957. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5958. d.prototype = c.prototype;
  5959. b.prototype = new d
  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 d = a.name;
  5970. if (!this.fileDic[d] && b) try {
  5971. this.fileDic[d] = JSON.parse(b)
  5972. } catch (c) {
  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 d() {
  5983. this.constructor = b
  5984. }
  5985. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5986. d.prototype = c.prototype;
  5987. b.prototype = new d
  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 d() {
  6003. this.constructor = b
  6004. }
  6005. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6006. d.prototype = c.prototype;
  6007. b.prototype = new d
  6008. };
  6009. (function(b) {
  6010. var c = function(d) {
  6011. function a() {
  6012. d.call(this);
  6013. this.sheetMap = {};
  6014. this.textureMap = {};
  6015. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6016. }
  6017. __extends(a, d);
  6018. a.prototype.getRes = function(a) {
  6019. var d = this.fileDic[a];
  6020. d || (d = this.textureMap[a]);
  6021. !d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = b.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  6022. return d
  6023. };
  6024. a.prototype.onLoadFinish = function(a) {
  6025. var b = a.target,
  6026. d = this.resItemDic[b.hashCode];
  6027. delete this.resItemDic[b.hashCode];
  6028. this.recycler.push(b);
  6029. var c =
  6030. d.item,
  6031. g = d.func;
  6032. c.loaded = a.type == egret.Event.COMPLETE;
  6033. c.loaded && this.analyzeData(c, b.data);
  6034. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(c, g, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : g.call(d.thisObject, c)
  6035. };
  6036. a.prototype.analyzeData = function(a, b) {
  6037. var d = a.name;
  6038. if (!this.fileDic[d] && b) {
  6039. var c;
  6040. if ("string" == typeof b) {
  6041. try {
  6042. c = JSON.parse(b)
  6043. } catch (g) {
  6044. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  6045. }
  6046. c && (this.sheetMap[d] =
  6047. c, a.loaded = !1, a.url = this.getRelativePath(a.url, c.file))
  6048. } else c = this.sheetMap[d], delete this.sheetMap[d], b && (c = this.parseSpriteSheet(b, c, a.data && a.data.subkeys ? "" : d), this.fileDic[d] = c)
  6049. }
  6050. };
  6051. a.prototype.getRelativePath = function(a, b) {
  6052. a = a.split("\\").join("/");
  6053. var d = a.lastIndexOf("/");
  6054. return a = -1 != d ? a.substring(0, d + 1) + b : b
  6055. };
  6056. a.prototype.parseSpriteSheet = function(a, b, d) {
  6057. b = b.frames;
  6058. if (!b) return null;
  6059. var c = new egret.SpriteSheet(a),
  6060. g = this.textureMap,
  6061. f;
  6062. for (f in b) {
  6063. var h = b[f];
  6064. a = c.createTexture(f, h.x, h.y, h.w, h.h,
  6065. h.offX, h.offY, h.sourceW, h.sourceH);
  6066. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  6067. null == g[f] && (g[f] = a, d && this.addSubkey(f, d))
  6068. }
  6069. return c
  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 d() {
  6078. this.constructor = b
  6079. }
  6080. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6081. d.prototype = c.prototype;
  6082. b.prototype = new d
  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 d = a.name;
  6092. if (!this.fileDic[d] && b) {
  6093. var c;
  6094. "string" == typeof b ? (c = b, this.sheetMap[d] = c, a.loaded = !1, a.url = this.getTexturePath(a.url, c)) : (c = this.sheetMap[d], delete this.sheetMap[d], b && (c = new egret.BitmapTextSpriteSheet(b, c), this.fileDic[d] = c))
  6095. }
  6096. };
  6097. a.prototype.getTexturePath = function(a, b) {
  6098. var d = "",
  6099. c = b.split("\n")[2],
  6100. g = c.indexOf('file="'); - 1 != g && (c = c.substring(g + 6), g = c.indexOf('"'), d = c.substring(0,
  6101. g));
  6102. a = a.split("\\").join("/");
  6103. g = a.lastIndexOf("/");
  6104. return a = -1 != g ? a.substring(0, g + 1) + d : d
  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 d() {
  6113. this.constructor = b
  6114. }
  6115. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6116. d.prototype = c.prototype;
  6117. b.prototype = new d
  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 d = a.name;
  6128. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.soundType ? b.preload(d.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 d() {
  6137. this.constructor = b
  6138. }
  6139. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6140. d.prototype = c.prototype;
  6141. b.prototype = new d
  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 d = a.name;
  6152. if (!this.fileDic[d] && b) try {
  6153. var c = egret.XML.parse(b);
  6154. this.fileDic[d] = c
  6155. } catch (g) {}
  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 d() {
  6164. this.constructor = b
  6165. }
  6166. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6167. d.prototype = c.prototype;
  6168. b.prototype = new d
  6169. };
  6170. (function(b) {
  6171. b.loadConfig = function(a, b, c) {
  6172. void 0 === b && (b = "");
  6173. void 0 === c && (c = "json");
  6174. d.loadConfig(a, b, c)
  6175. };
  6176. b.loadGroup = function(a, b) {
  6177. void 0 === b && (b = 0);
  6178. d.loadGroup(a, b)
  6179. };
  6180. b.isGroupLoaded = function(a) {
  6181. return d.isGroupLoaded(a)
  6182. };
  6183. b.getGroupByName = function(a) {
  6184. return d.getGroupByName(a)
  6185. };
  6186. b.createGroup = function(a, b, c) {
  6187. void 0 === c && (c = !1);
  6188. return d.createGroup(a, b, c)
  6189. };
  6190. b.hasRes = function(a) {
  6191. return d.hasRes(a)
  6192. };
  6193. b.getRes = function(a) {
  6194. return d.getRes(a)
  6195. };
  6196. b.getResAsync = function(a, b, c) {
  6197. d.getResAsync(a, b, c)
  6198. };
  6199. b.getResByUrl =
  6200. function(a, b, c, p) {
  6201. void 0 === p && (p = "");
  6202. d.getResByUrl(a, b, c, p)
  6203. };
  6204. b.destroyRes = function(a) {
  6205. return d.destroyRes(a)
  6206. };
  6207. b.setMaxLoadingThread = function(a) {
  6208. d.setMaxLoadingThread(a)
  6209. };
  6210. b.addEventListener = function(a, b, c, p, l) {
  6211. void 0 === p && (p = !1);
  6212. void 0 === l && (l = 0);
  6213. d.addEventListener(a, b, c, p, l)
  6214. };
  6215. b.removeEventListener = function(a, b, c, p) {
  6216. void 0 === p && (p = !1);
  6217. d.removeEventListener(a, b, c, p)
  6218. };
  6219. var c = function(a) {
  6220. function e() {
  6221. a.call(this);
  6222. this.analyzerDic = {};
  6223. this.configItemList = [];
  6224. this.configComplete = this.callLaterFlag = !1;
  6225. this.loadedGroups = [];
  6226. this.groupNameList = [];
  6227. this.asyncDic = {};
  6228. this.init()
  6229. }
  6230. __extends(e, a);
  6231. e.prototype.getAnalyzerByType = function(a) {
  6232. var e = this.analyzerDic[a];
  6233. e || (e = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  6234. return e
  6235. };
  6236. e.prototype.init = function() {
  6237. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  6238. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer,
  6239. b.ResourceItem.TYPE_IMAGE);
  6240. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  6241. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  6242. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  6243. egret.Injector.hasMapRule(b.AnalyzerBase,
  6244. b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  6245. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  6246. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  6247. this.resConfig = new b.ResourceConfig;
  6248. this.resLoader = new b.ResourceLoader;
  6249. this.resLoader.callBack = this.onResourceItemComp;
  6250. this.resLoader.resInstance = this;
  6251. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  6252. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  6253. };
  6254. e.prototype.loadConfig = function(a, b, e) {
  6255. void 0 === e && (e = "json");
  6256. this.configItemList.push({
  6257. url: a,
  6258. resourceRoot: b,
  6259. type: e
  6260. });
  6261. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6262. };
  6263. e.prototype.startLoadConfig = function() {
  6264. this.callLaterFlag = !1;
  6265. var a = this.configItemList;
  6266. this.configItemList = [];
  6267. this.loadingConfigList = a;
  6268. for (var d = a.length, c = [], g = 0; g < d; g++) {
  6269. var f = a[g],
  6270. f = new b.ResourceItem(f.url, f.url, f.type);
  6271. c.push(f)
  6272. }
  6273. this.resLoader.loadGroup(c, e.GROUP_CONFIG, Number.MAX_VALUE)
  6274. };
  6275. e.prototype.isGroupLoaded = function(a) {
  6276. return -1 != this.loadedGroups.indexOf(a)
  6277. };
  6278. e.prototype.getGroupByName = function(a) {
  6279. return this.resConfig.getGroupByName(a)
  6280. };
  6281. e.prototype.loadGroup = function(a, e) {
  6282. void 0 === e && (e = 0);
  6283. if (-1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE,
  6284. a);
  6285. else if (!this.resLoader.isGroupInLoading(a))
  6286. if (this.configComplete) {
  6287. var d = this.resConfig.getGroupByName(a);
  6288. this.resLoader.loadGroup(d, a, e)
  6289. } else this.groupNameList.push({
  6290. name: a,
  6291. priority: e
  6292. })
  6293. };
  6294. e.prototype.createGroup = function(a, b, e) {
  6295. void 0 === e && (e = !1);
  6296. if (e) {
  6297. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  6298. }
  6299. return this.resConfig.createGroup(a, b, e)
  6300. };
  6301. e.prototype.onGroupComp = function(a) {
  6302. if (a.groupName == e.GROUP_CONFIG) {
  6303. a = this.loadingConfigList.length;
  6304. for (var d = 0; d < a; d++) {
  6305. var c = this.loadingConfigList[d],
  6306. g = this.getAnalyzerByType(c.type),
  6307. f = g.getRes(c.url);
  6308. g.destroyRes(c.url);
  6309. this.resConfig.parseConfig(f, c.resourceRoot)
  6310. }
  6311. this.configComplete = !0;
  6312. this.loadingConfigList = null;
  6313. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  6314. c = this.groupNameList;
  6315. a = c.length;
  6316. for (d = 0; d < a; d++) g = c[d], this.loadGroup(g.name, g.priority);
  6317. this.groupNameList = []
  6318. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  6319. };
  6320. e.prototype.onGroupError = function(a) {
  6321. a.groupName == e.GROUP_CONFIG ? (this.loadingConfigList =
  6322. null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  6323. };
  6324. e.prototype.hasRes = function(a) {
  6325. var e = this.resConfig.getType(a);
  6326. return "" == e && (a = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(a), "" == e) ? !1 : !0
  6327. };
  6328. e.prototype.getRes = function(a) {
  6329. var e = this.resConfig.getType(a);
  6330. return "" == e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(e), "" == e) ? null : this.getAnalyzerByType(e).getRes(a)
  6331. };
  6332. e.prototype.getResAsync = function(a, e, d) {
  6333. var c = this.resConfig.getType(a),
  6334. f = this.resConfig.getName(a);
  6335. if ("" == c && (f = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(f), "" == c)) {
  6336. e.call(d, null);
  6337. return
  6338. }(c = this.getAnalyzerByType(c).getRes(a)) ? e.call(d, c): (a = {
  6339. key: a,
  6340. compFunc: e,
  6341. thisObject: d
  6342. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6343. };
  6344. e.prototype.getResByUrl = function(a, e, d, c) {
  6345. void 0 === c && (c = "");
  6346. if (a) {
  6347. c || (c = this.getTypeByUrl(a));
  6348. var f = this.getAnalyzerByType(c).getRes(a);
  6349. f ? e.call(d, f) :
  6350. (e = {
  6351. key: a,
  6352. compFunc: e,
  6353. thisObject: d
  6354. }, this.asyncDic[a] ? this.asyncDic[a].push(e) : (this.asyncDic[a] = [e], a = new b.ResourceItem(a, a, c), this.resLoader.loadItem(a)))
  6355. } else e.call(d, null)
  6356. };
  6357. e.prototype.getTypeByUrl = function(a) {
  6358. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6359. switch (a) {
  6360. case b.ResourceItem.TYPE_XML:
  6361. case b.ResourceItem.TYPE_JSON:
  6362. case b.ResourceItem.TYPE_SHEET:
  6363. break;
  6364. case "png":
  6365. case "jpg":
  6366. case "gif":
  6367. a = b.ResourceItem.TYPE_IMAGE;
  6368. break;
  6369. case "fnt":
  6370. a = b.ResourceItem.TYPE_FONT;
  6371. break;
  6372. case "txt":
  6373. a = b.ResourceItem.TYPE_TEXT;
  6374. break;
  6375. case "mp3":
  6376. case "ogg":
  6377. case "mpeg":
  6378. case "wav":
  6379. case "m4a":
  6380. case "mp4":
  6381. case "aiff":
  6382. case "wma":
  6383. case "mid":
  6384. a = b.ResourceItem.TYPE_SOUND;
  6385. break;
  6386. default:
  6387. a = b.ResourceItem.TYPE_BIN
  6388. }
  6389. return a
  6390. };
  6391. e.prototype.onResourceItemComp = function(a) {
  6392. var b = this.asyncDic[a.name];
  6393. delete this.asyncDic[a.name];
  6394. a = this.getAnalyzerByType(a.type);
  6395. for (var e = b.length, d = 0; d < e; d++) {
  6396. var c = b[d],
  6397. h = a.getRes(c.key);
  6398. c.compFunc.call(c.thisObject, h, c.key)
  6399. }
  6400. };
  6401. e.prototype.destroyRes = function(a) {
  6402. var b = this.resConfig.getRawGroupByName(a);
  6403. if (b) {
  6404. var e =
  6405. this.loadedGroups.indexOf(a); - 1 != e && this.loadedGroups.splice(e, 1);
  6406. a = b.length;
  6407. for (var d = 0; d < a; d++) {
  6408. e = b[d];
  6409. e.loaded = !1;
  6410. var c = this.getAnalyzerByType(e.type);
  6411. c.destroyRes(e.name)
  6412. }
  6413. return !0
  6414. }
  6415. b = this.resConfig.getType(a);
  6416. if ("" == b) return !1;
  6417. e = this.resConfig.getRawResourceItem(a);
  6418. e.loaded = !1;
  6419. c = this.getAnalyzerByType(b);
  6420. return c.destroyRes(a)
  6421. };
  6422. e.prototype.setMaxLoadingThread = function(a) {
  6423. 1 > a && (a = 1);
  6424. this.resLoader.thread = a
  6425. };
  6426. e.GROUP_CONFIG = "RES__CONFIG";
  6427. return e
  6428. }(egret.EventDispatcher);
  6429. c.prototype.__class__ = "RES.Resource";
  6430. var d = new c
  6431. })(RES || (RES = {}));
  6432. __extends = this.__extends || function(b, c) {
  6433. function d() {
  6434. this.constructor = b
  6435. }
  6436. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6437. d.prototype = c.prototype;
  6438. b.prototype = new d
  6439. };
  6440. (function(b) {
  6441. var c = function(d) {
  6442. function a(b) {
  6443. void 0 === b && (b = 60);
  6444. d.call(this);
  6445. this.frameRate = b;
  6446. this._time = 0;
  6447. this._isActivate = !0;
  6448. 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 ||
  6449. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6450. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6451. return window.setTimeout(a, 1E3 / b)
  6452. });
  6453. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6454. return window.clearTimeout(a)
  6455. });
  6456. a.instance = this;
  6457. this.registerListener()
  6458. }
  6459. __extends(a, d);
  6460. a.prototype.enterFrame = function() {
  6461. var e = a.instance,
  6462. d = a._thisObject,
  6463. c = a._callback,
  6464. l = b.getTimer(),
  6465. g = l -
  6466. e._time;
  6467. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6468. c.call(d, g);
  6469. e._time = l
  6470. };
  6471. a.prototype.executeMainLoop = function(b, d) {
  6472. a._callback = b;
  6473. a._thisObject = d;
  6474. this.enterFrame()
  6475. };
  6476. a.prototype.reset = function() {
  6477. var e = a.instance;
  6478. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  6479. };
  6480. a.prototype.registerListener = function() {
  6481. var e = this,
  6482. d = function() {
  6483. e._isActivate && (e._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6484. },
  6485. c = function() {
  6486. e._isActivate || (e._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6487. },
  6488. l = function() {
  6489. document[g] ? d() : c()
  6490. };
  6491. window.addEventListener("focus", c, !1);
  6492. window.addEventListener("blur", d, !1);
  6493. var g, f;
  6494. "undefined" !== typeof document.hidden ? (g = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (g = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (g = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ?
  6495. (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6496. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", c, !1), window.addEventListener("pagehide", d, !1));
  6497. g && f && document.addEventListener(f, l, !1)
  6498. };
  6499. return a
  6500. }(b.DeviceContext);
  6501. b.HTML5DeviceContext = c;
  6502. c.prototype.__class__ = "egret.HTML5DeviceContext"
  6503. })(egret || (egret = {}));
  6504. var egret_html5_localStorage;
  6505. (function(b) {
  6506. b.getItem = function(b) {
  6507. return window.localStorage.getItem(b)
  6508. };
  6509. b.setItem = function(b, d) {
  6510. try {
  6511. return window.localStorage.setItem(b, d), !0
  6512. } catch (a) {
  6513. return console.log("egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key=" + b + "&value=" + d), !1
  6514. }
  6515. };
  6516. b.removeItem = function(b) {
  6517. window.localStorage.removeItem(b)
  6518. };
  6519. b.clear = function() {
  6520. window.localStorage.clear()
  6521. };
  6522. b.init = function() {
  6523. for (var c in b) egret.localStorage[c] = b[c]
  6524. }
  6525. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6526. egret_html5_localStorage.init();
  6527. __extends = this.__extends || function(b, c) {
  6528. function d() {
  6529. this.constructor = b
  6530. }
  6531. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6532. d.prototype = c.prototype;
  6533. b.prototype = new d
  6534. };
  6535. (function(b) {
  6536. var c = function(d) {
  6537. function a(a) {
  6538. d.call(this);
  6539. this.globalAlpha = 1;
  6540. this.canvas = a || this.createCanvas();
  6541. this.canvasContext = this.canvas.getContext("2d");
  6542. this._cacheCanvas = document.createElement("canvas");
  6543. this._cacheCanvas.width = this.canvas.width;
  6544. this._cacheCanvas.height = this.canvas.height;
  6545. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  6546. this.onResize();
  6547. var b = this.canvasContext.setTransform,
  6548. c = this;
  6549. this._cacheCanvasContext.setTransform = function(a, e, d, h, m, n) {
  6550. c._matrixA = a;
  6551. c._matrixB =
  6552. e;
  6553. c._matrixC = d;
  6554. c._matrixD = h;
  6555. c._matrixTx = m;
  6556. c._matrixTy = n;
  6557. b.call(c._cacheCanvasContext, a, e, d, h, m, n)
  6558. };
  6559. this._matrixA = 1;
  6560. this._matrixC = this._matrixB = 0;
  6561. this._matrixD = 1;
  6562. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6563. this.initBlendMode()
  6564. }
  6565. __extends(a, d);
  6566. a.prototype.createCanvas = function() {
  6567. var a = b.Browser.getInstance().$("#egretCanvas");
  6568. if (!a) {
  6569. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  6570. a = b.Browser.getInstance().$new("canvas");
  6571. a.id = "egretCanvas";
  6572. d.appendChild(a)
  6573. }
  6574. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  6575. this.onResize, this);
  6576. return a
  6577. };
  6578. a.prototype.onResize = function() {
  6579. if (this.canvas) {
  6580. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6581. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6582. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6583. this.canvas.style.width = a.style.width;
  6584. this.canvas.style.height = a.style.height;
  6585. this._cacheCanvas.width = this.canvas.width;
  6586. this._cacheCanvas.height = this.canvas.height;
  6587. this._cacheCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6588. this._cacheCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6589. this._cacheCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6590. this._cacheCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6591. }
  6592. };
  6593. a.prototype.clearScreen = function() {
  6594. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, c = a.length; d < c; d++) {
  6595. var l = a[d];
  6596. this.clearRect(l.x, l.y, l.width, l.height)
  6597. }
  6598. a = b.MainContext.instance.stage;
  6599. this._cacheCanvasContext.clearRect(0,
  6600. 0, a.stageWidth, a.stageHeight);
  6601. this.renderCost = 0
  6602. };
  6603. a.prototype.clearRect = function(a, b, d, c) {
  6604. this.canvasContext.clearRect(a, b, d * window.devicePixelRatio, c * window.devicePixelRatio)
  6605. };
  6606. a.prototype.drawImage = function(a, c, p, l, g, f, h, m, n, q) {
  6607. void 0 === q && (q = void 0);
  6608. var r = a._bitmapData;
  6609. f += this._transformTx;
  6610. h += this._transformTy;
  6611. var t = b.getTimer();
  6612. void 0 === q ? this._cacheCanvasContext.drawImage(r, c, p, l, g, f, h, m, n) : this.drawRepeatImage(a, c, p, l, g, f, h, m, n, q);
  6613. d.prototype.drawImage.call(this, a, c, p, l, g, f, h, m, n, q);
  6614. this.renderCost +=
  6615. b.getTimer() - t
  6616. };
  6617. a.prototype.drawRepeatImage = function(a, d, c, l, g, f, h, m, n, q) {
  6618. if (void 0 === a.pattern) {
  6619. var r = b.MainContext.instance.rendererContext.texture_scale_factor,
  6620. t = a._bitmapData,
  6621. s = t;
  6622. if (t.width != l || t.height != g || 1 != r) s = document.createElement("canvas"), s.width = l * r, s.height = g * r, s.getContext("2d").drawImage(t, d, c, l, g, 0, 0, l * r, g * r);
  6623. d = this._cacheCanvasContext.createPattern(s, q);
  6624. a.pattern = d
  6625. }
  6626. this._cacheCanvasContext.fillStyle = a.pattern;
  6627. this._cacheCanvasContext.translate(f, h);
  6628. this._cacheCanvasContext.fillRect(0,
  6629. 0, m, n);
  6630. this._cacheCanvasContext.translate(-f, -h)
  6631. };
  6632. a.prototype.setTransform = function(a) {
  6633. 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))
  6634. };
  6635. a.prototype.setAlpha =
  6636. function(a, d) {
  6637. a != this.globalAlpha && (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  6638. d ? (this.blendValue = this.blendModes[d], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  6639. };
  6640. a.prototype.initBlendMode = function() {
  6641. this.blendModes = {};
  6642. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  6643. this.blendModes[b.BlendMode.ADD] = "lighter"
  6644. };
  6645. a.prototype.setupFont = function(a, b) {
  6646. void 0 === b && (b = null);
  6647. b = b || {};
  6648. var d = null == b.size ? a._size : b.size,
  6649. c = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  6650. g = this._cacheCanvasContext,
  6651. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  6652. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  6653. g.font = f + (d + "px " + c);
  6654. g.textAlign = "left";
  6655. g.textBaseline = "middle"
  6656. };
  6657. a.prototype.measureText = function(a) {
  6658. return this._cacheCanvasContext.measureText(a).width
  6659. };
  6660. a.prototype.drawText = function(a, c, p, l, g, f) {
  6661. void 0 === f && (f = null);
  6662. this.setupFont(a, f);
  6663. f = f || {};
  6664. var h;
  6665. h = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6666. var m;
  6667. m = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6668. var n;
  6669. n = null != f.stroke ? f.stroke : a._stroke;
  6670. var q = this._cacheCanvasContext;
  6671. q.fillStyle = h;
  6672. q.strokeStyle = m;
  6673. n && (q.lineWidth = 2 * n, q.strokeText(c, p + this._transformTx, l + this._transformTy, g || 65535));
  6674. q.fillText(c, p + this._transformTx, l + this._transformTy, g || 65535);
  6675. d.prototype.drawText.call(this, a, c, p, l, g, f)
  6676. };
  6677. a.prototype.strokeRect =
  6678. function(a, b, d, c, g) {
  6679. this._cacheCanvasContext.strokeStyle = g;
  6680. this._cacheCanvasContext.strokeRect(a, b, d, c)
  6681. };
  6682. a.prototype.pushMask = function(a) {
  6683. this._cacheCanvasContext.save();
  6684. this._cacheCanvasContext.beginPath();
  6685. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6686. this._cacheCanvasContext.clip();
  6687. this._cacheCanvasContext.closePath()
  6688. };
  6689. a.prototype.popMask = function() {
  6690. this._cacheCanvasContext.restore();
  6691. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6692. };
  6693. a.prototype.onRenderStart =
  6694. function() {
  6695. this._cacheCanvasContext.save()
  6696. };
  6697. a.prototype.onRenderFinish = function() {
  6698. this._cacheCanvasContext.restore();
  6699. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6700. for (var a = this._cacheCanvas.width, d = this._cacheCanvas.height, c = b.RenderFilter.getInstance().getDrawAreaList(), l = 0, g = c.length; l < g; l++) {
  6701. var f = c[l],
  6702. h = f.x,
  6703. m = f.y,
  6704. n = f.width,
  6705. f = f.height;
  6706. h + n > a && (n = a - h);
  6707. m + f > d && (f = d - m);
  6708. 0 < n && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, h, m, n, f, h, m, n, f)
  6709. }
  6710. };
  6711. return a
  6712. }(b.RendererContext);
  6713. b.HTML5CanvasRenderer =
  6714. c;
  6715. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6716. })(egret || (egret = {}));
  6717. var egret_h5_graphics;
  6718. (function(b) {
  6719. b.beginFill = function(b, a) {
  6720. void 0 === a && (a = 1);
  6721. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6722. this.fillStyleColor = e;
  6723. this.commandQueue.push(new c(this._setStyle, this, [e]))
  6724. };
  6725. b.drawRect = function(b, a, e, k) {
  6726. this.commandQueue.push(new c(function(a, b, e, d) {
  6727. var c = this.renderContext;
  6728. this.canvasContext.beginPath();
  6729. this.canvasContext.rect(c._transformTx + a, c._transformTy + b, e, d);
  6730. this.canvasContext.closePath()
  6731. }, this, [b, a, e, k]));
  6732. this._fill()
  6733. };
  6734. b.drawCircle = function(b, a, e) {
  6735. this.commandQueue.push(new c(function(a,
  6736. b, e) {
  6737. var d = this.renderContext;
  6738. this.canvasContext.beginPath();
  6739. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, e, 0, 2 * Math.PI);
  6740. this.canvasContext.closePath()
  6741. }, this, [b, a, e]));
  6742. this._fill()
  6743. };
  6744. b.drawRoundRect = function(b, a, e, k, p, l) {
  6745. this.commandQueue.push(new c(function(a, b, e, d, c, k) {
  6746. var p = this.renderContext;
  6747. a = p._transformTx + a;
  6748. b = p._transformTy + b;
  6749. c /= 2;
  6750. k = k ? k / 2 : c;
  6751. e = a + e;
  6752. d = b + d;
  6753. p = d - k;
  6754. this.canvasContext.beginPath();
  6755. this.canvasContext.moveTo(e, p);
  6756. this.canvasContext.quadraticCurveTo(e, d, e - c, d);
  6757. this.canvasContext.lineTo(a +
  6758. c, d);
  6759. this.canvasContext.quadraticCurveTo(a, d, a, d - k);
  6760. this.canvasContext.lineTo(a, b + k);
  6761. this.canvasContext.quadraticCurveTo(a, b, a + c, b);
  6762. this.canvasContext.lineTo(e - c, b);
  6763. this.canvasContext.quadraticCurveTo(e, b, e, b + k);
  6764. this.canvasContext.lineTo(e, p);
  6765. this.canvasContext.closePath()
  6766. }, this, [b, a, e, k, p, l]));
  6767. this._fill()
  6768. };
  6769. b.drawEllipse = function(b, a, e, k) {
  6770. this.commandQueue.push(new c(function(a, b, e, d) {
  6771. var c = this.renderContext;
  6772. this.canvasContext.save();
  6773. a = c._transformTx + a;
  6774. b = c._transformTy + b;
  6775. var c = e > d ? e : d,
  6776. k = e / c;
  6777. d /=
  6778. c;
  6779. this.canvasContext.scale(k, d);
  6780. this.canvasContext.beginPath();
  6781. this.canvasContext.moveTo((a + e) / k, b / d);
  6782. this.canvasContext.arc(a / k, b / d, c, 0, 2 * Math.PI);
  6783. this.canvasContext.closePath();
  6784. this.canvasContext.restore();
  6785. this.canvasContext.stroke()
  6786. }, this, [b, a, e, k]));
  6787. this._fill()
  6788. };
  6789. b.lineStyle = function(b, a, e, k, p, l, g, f) {
  6790. void 0 === b && (b = NaN);
  6791. void 0 === a && (a = 0);
  6792. void 0 === e && (e = 1);
  6793. void 0 === k && (k = !1);
  6794. void 0 === p && (p = "normal");
  6795. void 0 === l && (l = null);
  6796. void 0 === g && (g = null);
  6797. void 0 === f && (f = 3);
  6798. this.strokeStyleColor && (this.createEndLineCommand(),
  6799. this.commandQueue.push(this.endLineCommand));
  6800. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  6801. this.commandQueue.push(new c(function(a, b) {
  6802. this.canvasContext.lineWidth = a;
  6803. this.canvasContext.strokeStyle = b;
  6804. this.canvasContext.beginPath()
  6805. }, this, [b, a]));
  6806. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  6807. this.moveTo(this.lineX, this.lineY)
  6808. };
  6809. b.lineTo = function(b, a) {
  6810. this.commandQueue.push(new c(function(a, b) {
  6811. var d = this.renderContext;
  6812. this.canvasContext.lineTo(d._transformTx +
  6813. a, d._transformTy + b)
  6814. }, this, [b, a]));
  6815. this.lineX = b;
  6816. this.lineY = a
  6817. };
  6818. b.curveTo = function(b, a, e, k) {
  6819. this.commandQueue.push(new c(function(a, b, e, d) {
  6820. var c = this.renderContext;
  6821. this.canvasContext.quadraticCurveTo(c._transformTx + a, c._transformTy + b, c._transformTx + e, c._transformTy + d)
  6822. }, this, [b, a, e, k]));
  6823. this.lineX = e;
  6824. this.lineY = k
  6825. };
  6826. b.moveTo = function(b, a) {
  6827. this.commandQueue.push(new c(function(a, b) {
  6828. var d = this.renderContext;
  6829. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + b)
  6830. }, this, [b, a]))
  6831. };
  6832. b.clear = function() {
  6833. this.lineY =
  6834. this.lineX = this.commandQueue.length = 0;
  6835. this.fillStyleColor = this.strokeStyleColor = null
  6836. };
  6837. b.createEndFillCommand = function() {
  6838. this.endFillCommand || (this.endFillCommand = new c(function() {
  6839. this.canvasContext.fill();
  6840. this.canvasContext.closePath()
  6841. }, this, null))
  6842. };
  6843. b.endFill = function() {
  6844. null != this.fillStyleColor && this._fill();
  6845. this.fillStyleColor = null
  6846. };
  6847. b._fill = function() {
  6848. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  6849. };
  6850. b.createEndLineCommand = function() {
  6851. this.endLineCommand ||
  6852. (this.endLineCommand = new c(function() {
  6853. this.canvasContext.stroke();
  6854. this.canvasContext.closePath()
  6855. }, this, null))
  6856. };
  6857. b._draw = function(b) {
  6858. var a = this.commandQueue.length;
  6859. if (0 != a) {
  6860. this.renderContext = b;
  6861. b = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  6862. b.save();
  6863. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  6864. for (var e = 0; e < a; e++) {
  6865. var c = this.commandQueue[e];
  6866. c.method.apply(c.thisObject, c.args)
  6867. }
  6868. b.restore()
  6869. }
  6870. };
  6871. var c = function() {
  6872. return function(b, a, e) {
  6873. this.method = b;
  6874. this.thisObject = a;
  6875. this.args = e
  6876. }
  6877. }();
  6878. c.prototype.__class__ = "egret_h5_graphics.Command";
  6879. b._setStyle = function(b) {
  6880. this.canvasContext.fillStyle = b;
  6881. this.canvasContext.beginPath()
  6882. };
  6883. b.init = function() {
  6884. for (var d in b) egret.Graphics.prototype[d] = b[d];
  6885. egret.RendererContext.createRendererContext = function(a) {
  6886. return new egret.HTML5CanvasRenderer(a)
  6887. }
  6888. }
  6889. })(egret_h5_graphics || (egret_h5_graphics = {}));
  6890. egret_h5_graphics.init();
  6891. __extends = this.__extends || function(b, c) {
  6892. function d() {
  6893. this.constructor = b
  6894. }
  6895. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6896. d.prototype = c.prototype;
  6897. b.prototype = new d
  6898. };
  6899. (function(b) {
  6900. var c = function(d) {
  6901. function a(a) {
  6902. d.call(this);
  6903. this.size = 2E3;
  6904. this.vertSize = 5;
  6905. this.contextLost = !1;
  6906. this.glContextId = 0;
  6907. this.currentBlendMode = "";
  6908. this.currentBaseTexture = null;
  6909. this.currentBatchSize = 0;
  6910. this.maskList = [];
  6911. this.maskDataFreeList = [];
  6912. this.canvasContext = document.createElement("canvas").getContext("2d");
  6913. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  6914. this.canvas = a || this.createCanvas();
  6915. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  6916. this.canvas.addEventListener("webglcontextrestored",
  6917. this.handleContextRestored.bind(this), !1);
  6918. this.onResize();
  6919. this.projectionX = this.canvas.width / 2;
  6920. this.projectionY = -this.canvas.height / 2;
  6921. a = 6 * this.size;
  6922. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  6923. this.indices = new Uint16Array(a);
  6924. for (var c = 0, p = 0; c < a; c += 6, p += 4) this.indices[c + 0] = p + 0, this.indices[c + 1] = p + 1, this.indices[c + 2] = p + 2, this.indices[c + 3] = p + 0, this.indices[c + 4] = p + 2, this.indices[c + 5] = p + 3;
  6925. this.initWebGL();
  6926. this.shaderManager = new b.WebGLShaderManager(this.gl);
  6927. this.worldTransform = new b.Matrix;
  6928. this.initBlendMode();
  6929. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  6930. b.TextField.prototype._draw = function(a) {
  6931. this.getDirty() && (this.cacheAsBitmap = !0);
  6932. b.DisplayObject.prototype._draw.call(this, a)
  6933. }
  6934. }
  6935. __extends(a, d);
  6936. a.prototype.createCanvas = function() {
  6937. var a = b.Browser.getInstance().$("#egretCanvas");
  6938. if (!a) {
  6939. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  6940. a = b.Browser.getInstance().$new("canvas");
  6941. a.id = "egretCanvas";
  6942. d.appendChild(a)
  6943. }
  6944. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  6945. this.onResize, this);
  6946. return a
  6947. };
  6948. a.prototype.onResize = function() {
  6949. if (this.canvas) {
  6950. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6951. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6952. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6953. this.canvas.style.width = a.style.width;
  6954. this.canvas.style.height = a.style.height;
  6955. this.projectionX = this.canvas.width / 2;
  6956. this.projectionY = -this.canvas.height / 2
  6957. }
  6958. };
  6959. a.prototype.handleContextLost = function() {
  6960. this.contextLost = !0
  6961. };
  6962. a.prototype.handleContextRestored =
  6963. function() {
  6964. this.initWebGL();
  6965. this.shaderManager.setContext(this.gl);
  6966. this.contextLost = !1
  6967. };
  6968. a.prototype.initWebGL = function() {
  6969. for (var a = {
  6970. stencil: !0
  6971. }, b, d = ["experimental-webgl", "webgl"], c = 0; c < d.length; c++) {
  6972. try {
  6973. b = this.canvas.getContext(d[c], a)
  6974. } catch (g) {}
  6975. if (b) break
  6976. }
  6977. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  6978. this.setContext(b)
  6979. };
  6980. a.prototype.setContext = function(a) {
  6981. this.gl = a;
  6982. a.id = this.glContextId++;
  6983. this.vertexBuffer = a.createBuffer();
  6984. this.indexBuffer = a.createBuffer();
  6985. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  6986. this.indexBuffer);
  6987. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  6988. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  6989. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  6990. a.disable(a.DEPTH_TEST);
  6991. a.disable(a.CULL_FACE);
  6992. a.enable(a.BLEND);
  6993. a.colorMask(!0, !0, !0, !0)
  6994. };
  6995. a.prototype.initBlendMode = function() {
  6996. this.blendModesWebGL = {};
  6997. this.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  6998. this.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  6999. };
  7000. a.prototype.start =
  7001. function() {
  7002. if (!this.contextLost) {
  7003. var a = this.gl;
  7004. a.activeTexture(a.TEXTURE0);
  7005. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7006. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7007. var b;
  7008. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  7009. this.shaderManager.activateShader(b);
  7010. b.syncUniforms();
  7011. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7012. var d = 4 * this.vertSize;
  7013. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, d, 0);
  7014. a.vertexAttribPointer(b.aTextureCoord,
  7015. 2, a.FLOAT, !1, d, 8);
  7016. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, d, 16)
  7017. }
  7018. };
  7019. a.prototype.clearScreen = function() {
  7020. var a = this.gl;
  7021. a.colorMask(!0, !0, !0, !0);
  7022. for (var d = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, l = d.length; c < l; c++) {
  7023. var g = d[c];
  7024. a.viewport(g.x, g.y, g.width, g.height);
  7025. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7026. a.clearColor(0, 0, 0, 0);
  7027. a.clear(a.COLOR_BUFFER_BIT)
  7028. }
  7029. d = b.MainContext.instance.stage;
  7030. a.viewport(0, 0, d.stageWidth, d.stageHeight);
  7031. this.renderCost = 0
  7032. };
  7033. a.prototype.setBlendMode = function(a) {
  7034. a ||
  7035. (a = b.BlendMode.NORMAL);
  7036. if (this.currentBlendMode != a) {
  7037. var d = this.blendModesWebGL[a];
  7038. d && (this._draw(), this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = a)
  7039. }
  7040. };
  7041. a.prototype.drawRepeatImage = function(a, d, c, l, g, f, h, m, n, q) {
  7042. q = b.MainContext.instance.rendererContext.texture_scale_factor;
  7043. l *= q;
  7044. for (g *= q; f < m; f += l)
  7045. for (var r = h; r < n; r += g) {
  7046. var t = Math.min(l, m - f),
  7047. s = Math.min(g, n - r);
  7048. this.drawImage(a, d, c, t / q, s / q, f, r, t, s)
  7049. }
  7050. };
  7051. a.prototype.drawImage = function(a, b, d, c, g, f, h, m, n, q) {
  7052. void 0 === q && (q = void 0);
  7053. if (!this.contextLost)
  7054. if (void 0 !==
  7055. q) this.drawRepeatImage(a, b, d, c, g, f, h, m, n, q);
  7056. else {
  7057. this.createWebGLTexture(a);
  7058. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(), this.currentBaseTexture = a.webGLTexture;
  7059. var r = this.worldTransform,
  7060. t = r.a,
  7061. s = r.b,
  7062. u = r.c,
  7063. v = r.d,
  7064. x = r.tx,
  7065. y = r.ty;
  7066. 0 == f && 0 == h || r.append(1, 0, 0, 1, f, h);
  7067. 1 == c / m && 1 == g / n || r.append(m / c, 0, 0, n / g, 0, 0);
  7068. f = r.a;
  7069. h = r.b;
  7070. m = r.c;
  7071. n = r.d;
  7072. q = r.tx;
  7073. var w = r.ty;
  7074. r.a = t;
  7075. r.b = s;
  7076. r.c = u;
  7077. r.d = v;
  7078. r.tx = x;
  7079. r.ty = y;
  7080. t = a._sourceWidth;
  7081. s = a._sourceHeight;
  7082. a = c;
  7083. r = g;
  7084. b /= t;
  7085. d /= s;
  7086. c /= t;
  7087. g /= s;
  7088. t = this.vertices;
  7089. s = 4 * this.currentBatchSize * this.vertSize;
  7090. u = this.worldAlpha;
  7091. t[s++] = q;
  7092. t[s++] = w;
  7093. t[s++] = b;
  7094. t[s++] = d;
  7095. t[s++] = u;
  7096. t[s++] = f * a + q;
  7097. t[s++] = h * a + w;
  7098. t[s++] = c + b;
  7099. t[s++] = d;
  7100. t[s++] = u;
  7101. t[s++] = f * a + m * r + q;
  7102. t[s++] = n * r + h * a + w;
  7103. t[s++] = c + b;
  7104. t[s++] = g + d;
  7105. t[s++] = u;
  7106. t[s++] = m * r + q;
  7107. t[s++] = n * r + w;
  7108. t[s++] = b;
  7109. t[s++] = g + d;
  7110. t[s++] = u;
  7111. this.currentBatchSize++
  7112. }
  7113. };
  7114. a.prototype._draw = function() {
  7115. if (0 != this.currentBatchSize && !this.contextLost) {
  7116. var a = b.getTimer();
  7117. this.start();
  7118. var d = this.gl;
  7119. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  7120. var c = this.vertices.subarray(0,
  7121. 4 * this.currentBatchSize * this.vertSize);
  7122. d.bufferSubData(d.ARRAY_BUFFER, 0, c);
  7123. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  7124. this.currentBatchSize = 0;
  7125. this.renderCost += b.getTimer() - a;
  7126. b.Profiler.getInstance().onDrawImage()
  7127. }
  7128. };
  7129. a.prototype.setTransform = function(a) {
  7130. var b = this.worldTransform;
  7131. b.a = a.a;
  7132. b.b = a.b;
  7133. b.c = a.c;
  7134. b.d = a.d;
  7135. b.tx = a.tx;
  7136. b.ty = a.ty
  7137. };
  7138. a.prototype.setAlpha = function(a, b) {
  7139. this.worldAlpha = a;
  7140. this.setBlendMode(b)
  7141. };
  7142. a.prototype.createWebGLTexture = function(a) {
  7143. if (!a.webGLTexture) {
  7144. var b =
  7145. this.gl;
  7146. a.webGLTexture = b.createTexture();
  7147. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  7148. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7149. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  7150. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7151. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7152. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7153. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7154. b.bindTexture(b.TEXTURE_2D, null)
  7155. }
  7156. };
  7157. a.prototype.pushMask =
  7158. function(a) {
  7159. this._draw();
  7160. var b = this.gl;
  7161. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  7162. var d = this.maskDataFreeList.pop();
  7163. d ? (d.x = a.x, d.y = a.y, d.w = a.width, d.h = a.height) : d = {
  7164. x: a.x,
  7165. y: a.y,
  7166. w: a.width,
  7167. h: a.height
  7168. };
  7169. this.maskList.push(d);
  7170. b.colorMask(!1, !1, !1, !1);
  7171. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  7172. this.renderGraphics(d);
  7173. b.colorMask(!0, !0, !0, !0);
  7174. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  7175. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  7176. };
  7177. a.prototype.popMask = function() {
  7178. this._draw();
  7179. var a = this.gl,
  7180. b = this.maskList.pop();
  7181. 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));
  7182. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  7183. };
  7184. a.prototype.setGlobalColorTransform = function(a) {
  7185. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7186. a = a.concat();
  7187. var b = this.shaderManager.colorTransformShader;
  7188. b.uniforms.colorAdd.value.w =
  7189. a.splice(19, 1)[0] / 255;
  7190. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7191. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7192. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7193. b.uniforms.matrix.value = a
  7194. }
  7195. };
  7196. a.prototype.setupFont = function(a, b) {
  7197. var d = this.canvasContext,
  7198. c = a.italic ? "italic " : "normal ",
  7199. c = c + (a.bold ? "bold " : "normal "),
  7200. c = c + (a.size + "px " + a.fontFamily);
  7201. d.font = c;
  7202. d.textAlign = "left";
  7203. d.textBaseline = "middle"
  7204. };
  7205. a.prototype.measureText = function(a) {
  7206. return this.canvasContext.measureText(a).width
  7207. };
  7208. a.prototype.renderGraphics =
  7209. function(a) {
  7210. var b = this.gl,
  7211. d = this.shaderManager.primitiveShader;
  7212. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7213. this.updateGraphics(a);
  7214. this.shaderManager.activateShader(d);
  7215. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7216. b.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  7217. b.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  7218. b.uniform2f(d.offsetVector, 0, 0);
  7219. b.uniform3fv(d.tintColor, [1, 1, 1]);
  7220. b.uniform1f(d.alpha, this.worldAlpha);
  7221. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7222. b.vertexAttribPointer(d.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7223. b.vertexAttribPointer(d.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7224. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7225. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7226. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7227. };
  7228. a.prototype.updateGraphics =
  7229. function(a) {
  7230. var b = this.gl;
  7231. this.buildRectangle(a);
  7232. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7233. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7234. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7235. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7236. };
  7237. a.prototype.buildRectangle = function(a) {
  7238. var b = a.x,
  7239. d = a.y,
  7240. c = a.w;
  7241. a = a.h;
  7242. var g = this.graphicsPoints,
  7243. f = this.graphicsIndices,
  7244. h = g.length / 6;
  7245. g.push(b, d);
  7246. g.push(0, 0, 0, 1);
  7247. g.push(b + c, d);
  7248. g.push(0, 0, 0, 1);
  7249. g.push(b, d + a);
  7250. g.push(0, 0, 0, 1);
  7251. g.push(b + c, d + a);
  7252. g.push(0, 0, 0, 1);
  7253. f.push(h, h, h + 1, h + 2, h + 3, h + 3)
  7254. };
  7255. return a
  7256. }(b.RendererContext);
  7257. b.WebGLRenderer = c;
  7258. c.prototype.__class__ = "egret.WebGLRenderer"
  7259. })(egret || (egret = {}));
  7260. (function(b) {
  7261. var c = function() {
  7262. function b() {}
  7263. b.compileProgram = function(a, e, c) {
  7264. c = b.compileFragmentShader(a, c);
  7265. e = b.compileVertexShader(a, e);
  7266. var p = a.createProgram();
  7267. a.attachShader(p, e);
  7268. a.attachShader(p, c);
  7269. a.linkProgram(p);
  7270. a.getProgramParameter(p, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  7271. return p
  7272. };
  7273. b.compileFragmentShader = function(a, e) {
  7274. return b._compileShader(a, e, a.FRAGMENT_SHADER)
  7275. };
  7276. b.compileVertexShader = function(a, e) {
  7277. return b._compileShader(a, e, a.VERTEX_SHADER)
  7278. };
  7279. b._compileShader =
  7280. function(a, b, d) {
  7281. d = a.createShader(d);
  7282. a.shaderSource(d, b);
  7283. a.compileShader(d);
  7284. return a.getShaderParameter(d, a.COMPILE_STATUS) ? d : (console.log(a.getShaderInfoLog(d)), null)
  7285. };
  7286. b.checkCanUseWebGL = function() {
  7287. if (void 0 == b.canUseWebGL) try {
  7288. var a = document.createElement("canvas");
  7289. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7290. } catch (e) {
  7291. b.canUseWebGL = !1
  7292. }
  7293. return b.canUseWebGL
  7294. };
  7295. return b
  7296. }();
  7297. b.WebGLUtils = c;
  7298. c.prototype.__class__ = "egret.WebGLUtils"
  7299. })(egret || (egret = {}));
  7300. __extends = this.__extends || function(b, c) {
  7301. function d() {
  7302. this.constructor = b
  7303. }
  7304. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7305. d.prototype = c.prototype;
  7306. b.prototype = new d
  7307. };
  7308. (function(b) {
  7309. var c = function() {
  7310. function b(a) {
  7311. this.maxAttibs = 10;
  7312. this.attribState = [];
  7313. this.tempAttribState = [];
  7314. for (var d = 0; d < this.maxAttibs; d++) this.attribState[d] = !1;
  7315. this.setContext(a)
  7316. }
  7317. b.prototype.setContext = function(b) {
  7318. this.gl = b;
  7319. this.primitiveShader = new e(b);
  7320. this.defaultShader = new d(b);
  7321. this.colorTransformShader = new a(b);
  7322. this.activateShader(this.defaultShader)
  7323. };
  7324. b.prototype.activateShader = function(a) {
  7325. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  7326. a)
  7327. };
  7328. b.prototype.setAttribs = function(a) {
  7329. var b, d;
  7330. d = this.tempAttribState.length;
  7331. for (b = 0; b < d; b++) this.tempAttribState[b] = !1;
  7332. d = a.length;
  7333. for (b = 0; b < d; b++) this.tempAttribState[a[b]] = !0;
  7334. a = this.gl;
  7335. d = this.attribState.length;
  7336. for (b = 0; b < d; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7337. };
  7338. return b
  7339. }();
  7340. b.WebGLShaderManager = c;
  7341. c.prototype.__class__ = "egret.WebGLShaderManager";
  7342. var d = function() {
  7343. function a(b) {
  7344. this.defaultVertexSrc =
  7345. "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}";
  7346. this.program = null;
  7347. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7348. this.gl = b;
  7349. this.init()
  7350. }
  7351. a.prototype.init = function() {
  7352. var a = this.gl,
  7353. d = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7354. a.useProgram(d);
  7355. this.uSampler = a.getUniformLocation(d, "uSampler");
  7356. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  7357. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  7358. this.dimensions = a.getUniformLocation(d, "dimensions");
  7359. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  7360. this.aTextureCoord = a.getAttribLocation(d, "aTextureCoord");
  7361. this.colorAttribute =
  7362. a.getAttribLocation(d, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7363. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7364. for (var e in this.uniforms) this.uniforms[e].uniformLocation = a.getUniformLocation(d, e);
  7365. this.initUniforms();
  7366. this.program = d
  7367. };
  7368. a.prototype.initUniforms = function() {
  7369. if (this.uniforms) {
  7370. var a = this.gl,
  7371. b, d;
  7372. for (d in this.uniforms) {
  7373. b = this.uniforms[d];
  7374. var e = b.type;
  7375. "mat2" === e || "mat3" === e || "mat4" === e ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === e ? b.glFunc = a.uniformMatrix2fv :
  7376. "mat3" === e ? b.glFunc = a.uniformMatrix3fv : "mat4" === e && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + e], b.glValueLength = "2f" === e || "2i" === e ? 2 : "3f" === e || "3i" === e ? 3 : "4f" === e || "4i" === e ? 4 : 1)
  7377. }
  7378. }
  7379. };
  7380. a.prototype.syncUniforms = function() {
  7381. if (this.uniforms) {
  7382. var a, b = this.gl,
  7383. d;
  7384. for (d in this.uniforms) a = this.uniforms[d], 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,
  7385. 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)
  7386. }
  7387. };
  7388. return a
  7389. }();
  7390. b.EgretShader = d;
  7391. d.prototype.__class__ = "egret.EgretShader";
  7392. var a = function(a) {
  7393. function b(d) {
  7394. a.call(this, d);
  7395. 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}";
  7396. this.uniforms = {
  7397. matrix: {
  7398. type: "mat4",
  7399. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7400. },
  7401. colorAdd: {
  7402. type: "4f",
  7403. value: {
  7404. x: 0,
  7405. y: 0,
  7406. z: 0,
  7407. w: 0
  7408. }
  7409. }
  7410. };
  7411. this.init()
  7412. }
  7413. __extends(b, a);
  7414. return b
  7415. }(d);
  7416. b.ColorTransformShader = a;
  7417. a.prototype.__class__ = "egret.ColorTransformShader";
  7418. var e = function() {
  7419. function a(b) {
  7420. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  7421. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7422. 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}";
  7423. this.gl = b;
  7424. this.init()
  7425. }
  7426. a.prototype.init = function() {
  7427. var a = this.gl,
  7428. d = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7429. a.useProgram(d);
  7430. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  7431. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  7432. this.tintColor = a.getUniformLocation(d, "tint");
  7433. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  7434. this.colorAttribute = a.getAttribLocation(d, "aColor");
  7435. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7436. this.translationMatrix = a.getUniformLocation(d,
  7437. "translationMatrix");
  7438. this.alpha = a.getUniformLocation(d, "alpha");
  7439. this.program = d
  7440. };
  7441. return a
  7442. }();
  7443. b.PrimitiveShader = e;
  7444. e.prototype.__class__ = "egret.PrimitiveShader"
  7445. })(egret || (egret = {}));
  7446. __extends = this.__extends || function(b, c) {
  7447. function d() {
  7448. this.constructor = b
  7449. }
  7450. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7451. d.prototype = c.prototype;
  7452. b.prototype = new d
  7453. };
  7454. (function(b) {
  7455. var c = function(d) {
  7456. function a() {
  7457. d.call(this)
  7458. }
  7459. __extends(a, d);
  7460. a.prototype.proceed = function(a) {
  7461. function d() {
  7462. if (4 == l.readyState)
  7463. if (l.status != a._status && (a._status = l.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, l.status)), 400 <= l.status || 0 == l.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7464. else {
  7465. switch (a.dataFormat) {
  7466. case b.URLLoaderDataFormat.TEXT:
  7467. a.data = l.responseText;
  7468. break;
  7469. case b.URLLoaderDataFormat.VARIABLES:
  7470. a.data = new b.URLVariables(l.responseText);
  7471. break;
  7472. case b.URLLoaderDataFormat.BINARY:
  7473. a.data =
  7474. l.response;
  7475. break;
  7476. default:
  7477. a.data = l.responseText
  7478. }
  7479. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7480. }
  7481. }
  7482. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7483. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7484. else {
  7485. var c = a._request,
  7486. l = this.getXHR();
  7487. l.onreadystatechange = d;
  7488. var g = b.NetContext._getUrl(c);
  7489. l.open(c.method, g, !0);
  7490. this.setResponseType(l, a.dataFormat);
  7491. c.method != b.URLRequestMethod.GET && c.data ? c.data instanceof b.URLVariables ? (l.setRequestHeader("Content-Type",
  7492. "application/x-www-form-urlencoded"), l.send(c.data.toString())) : (l.setRequestHeader("Content-Type", "multipart/form-data"), l.send(c.data)) : l.send()
  7493. }
  7494. };
  7495. a.prototype.loadSound = function(a) {
  7496. function d(g) {
  7497. window.clearTimeout(l.__timeoutId);
  7498. l.removeEventListener("canplaythrough", d, !1);
  7499. l.removeEventListener("error", c, !1);
  7500. g = new b.Sound;
  7501. g._setAudio(l);
  7502. a.data = g;
  7503. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7504. }
  7505. function c(g) {
  7506. window.clearTimeout(l.__timeoutId);
  7507. l.removeEventListener("canplaythrough",
  7508. d, !1);
  7509. l.removeEventListener("error", c, !1);
  7510. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7511. }
  7512. var l = new Audio(a._request.url);
  7513. l.__timeoutId = window.setTimeout(d, 100);
  7514. l.addEventListener("canplaythrough", d, !1);
  7515. l.addEventListener("error", c, !1);
  7516. l.load()
  7517. };
  7518. a.prototype.getXHR = function() {
  7519. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7520. };
  7521. a.prototype.setResponseType = function(a, d) {
  7522. switch (d) {
  7523. case b.URLLoaderDataFormat.TEXT:
  7524. case b.URLLoaderDataFormat.VARIABLES:
  7525. a.responseType = b.URLLoaderDataFormat.TEXT;
  7526. break;
  7527. case b.URLLoaderDataFormat.BINARY:
  7528. a.responseType = "arraybuffer";
  7529. break;
  7530. default:
  7531. a.responseType = d
  7532. }
  7533. };
  7534. a.prototype.loadTexture = function(a) {
  7535. var d = a._request,
  7536. c = new Image;
  7537. c.onload = function(d) {
  7538. c.onerror = null;
  7539. c.onload = null;
  7540. d = new b.Texture;
  7541. d._setBitmapData(c);
  7542. a.data = d;
  7543. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7544. };
  7545. c.onerror = function(d) {
  7546. c.onerror = null;
  7547. c.onload = null;
  7548. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7549. };
  7550. c.src = d.url
  7551. };
  7552. return a
  7553. }(b.NetContext);
  7554. b.HTML5NetContext = c;
  7555. c.prototype.__class__ = "egret.HTML5NetContext"
  7556. })(egret ||
  7557. (egret = {}));
  7558. __extends = this.__extends || function(b, c) {
  7559. function d() {
  7560. this.constructor = b
  7561. }
  7562. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7563. d.prototype = c.prototype;
  7564. b.prototype = new d
  7565. };
  7566. (function(b) {
  7567. var c = function(d) {
  7568. function a() {
  7569. d.call(this);
  7570. this._isTouchDown = !1;
  7571. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7572. }
  7573. __extends(a, d);
  7574. a.prototype.prevent = function(a) {
  7575. a.stopPropagation();
  7576. !0 != a.isScroll && a.preventDefault()
  7577. };
  7578. a.prototype.run = function() {
  7579. var a = this;
  7580. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  7581. a._onTouchBegin(b);
  7582. a.prevent(b)
  7583. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  7584. a._onTouchMove(b);
  7585. a.prevent(b)
  7586. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  7587. a._onTouchEnd(b);
  7588. a.prevent(b)
  7589. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7590. window.addEventListener("mousedown", function(b) {
  7591. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7592. });
  7593. window.addEventListener("mouseup", function(b) {
  7594. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7595. a._isTouchDown = !1
  7596. })
  7597. };
  7598. a.prototype.addMouseListener = function() {
  7599. var a = this;
  7600. this.rootDiv.addEventListener("mousedown", function(b) {
  7601. a._onTouchBegin(b)
  7602. });
  7603. this.rootDiv.addEventListener("mousemove", function(b) {
  7604. a._onTouchMove(b)
  7605. });
  7606. this.rootDiv.addEventListener("mouseup", function(b) {
  7607. a._onTouchEnd(b)
  7608. })
  7609. };
  7610. a.prototype.addTouchListener = function() {
  7611. var a = this;
  7612. this.rootDiv.addEventListener("touchstart", function(b) {
  7613. for (var d = b.changedTouches.length, c = 0; c < d; c++) a._onTouchBegin(b.changedTouches[c]);
  7614. a.prevent(b)
  7615. }, !1);
  7616. this.rootDiv.addEventListener("touchmove",
  7617. function(b) {
  7618. for (var d = b.changedTouches.length, c = 0; c < d; c++) a._onTouchMove(b.changedTouches[c]);
  7619. a.prevent(b)
  7620. }, !1);
  7621. this.rootDiv.addEventListener("touchend", function(b) {
  7622. for (var d = b.changedTouches.length, c = 0; c < d; c++) a._onTouchEnd(b.changedTouches[c]);
  7623. a.prevent(b)
  7624. }, !1);
  7625. this.rootDiv.addEventListener("touchcancel", function(b) {
  7626. for (var d = b.changedTouches.length, c = 0; c < d; c++) a._onTouchEnd(b.changedTouches[c]);
  7627. a.prevent(b)
  7628. }, !1)
  7629. };
  7630. a.prototype.inOutOfCanvas = function(a) {
  7631. var d = this.getLocation(this.rootDiv, a);
  7632. a = d.x;
  7633. var d = d.y,
  7634. c = b.MainContext.instance.stage;
  7635. return 0 > a || 0 > d || a > c.stageWidth || d > c.stageHeight ? !0 : !1
  7636. };
  7637. a.prototype.dispatchLeaveStageEvent = function() {
  7638. this.touchingIdentifiers.length = 0;
  7639. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  7640. };
  7641. a.prototype._onTouchBegin = function(a) {
  7642. var b = this.getLocation(this.rootDiv, a),
  7643. d = -1;
  7644. a.hasOwnProperty("identifier") && (d = a.identifier);
  7645. this.onTouchBegan(b.x, b.y, d)
  7646. };
  7647. a.prototype._onTouchMove = function(a) {
  7648. var b = this.getLocation(this.rootDiv, a),
  7649. d = -1;
  7650. a.hasOwnProperty("identifier") &&
  7651. (d = a.identifier);
  7652. this.onTouchMove(b.x, b.y, d)
  7653. };
  7654. a.prototype._onTouchEnd = function(a) {
  7655. var b = this.getLocation(this.rootDiv, a),
  7656. d = -1;
  7657. a.hasOwnProperty("identifier") && (d = a.identifier);
  7658. this.onTouchEnd(b.x, b.y, d)
  7659. };
  7660. a.prototype.getLocation = function(a, d) {
  7661. var c = document.documentElement,
  7662. l = window,
  7663. g, f;
  7664. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  7665. g += l.pageXOffset - c.clientLeft;
  7666. f += l.pageYOffset - c.clientTop;
  7667. null != d.pageX ? (c = d.pageX, l = d.pageY) : (g -= document.body.scrollLeft,
  7668. f -= document.body.scrollTop, c = d.clientX, l = d.clientY);
  7669. var h = b.Point.identity;
  7670. h.x = (c - g) / b.StageDelegate.getInstance().getScaleX();
  7671. h.y = (l - f) / b.StageDelegate.getInstance().getScaleY();
  7672. return h
  7673. };
  7674. return a
  7675. }(b.TouchContext);
  7676. b.HTML5TouchContext = c;
  7677. c.prototype.__class__ = "egret.HTML5TouchContext"
  7678. })(egret || (egret = {}));
  7679. __extends = this.__extends || function(b, c) {
  7680. function d() {
  7681. this.constructor = b
  7682. }
  7683. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7684. d.prototype = c.prototype;
  7685. b.prototype = new d
  7686. };
  7687. (function(b) {
  7688. var c = function(d) {
  7689. function a() {
  7690. d.call(this);
  7691. this._hasListeners = !1;
  7692. this._inputType = "";
  7693. this._isShow = !1;
  7694. this.textValue = "";
  7695. this._height = this._width = 0;
  7696. this._styleInfoes = {};
  7697. var a = b.StageDelegate.getInstance().getScaleX(),
  7698. c = b.StageDelegate.getInstance().getScaleY(),
  7699. p = b.Browser.getInstance().$new("div");
  7700. p.position.x = 0;
  7701. p.position.y = 0;
  7702. p.scale.x = a;
  7703. p.scale.y = c;
  7704. p.transforms();
  7705. p.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  7706. this.div = p;
  7707. c = b.MainContext.instance.stage;
  7708. a = c.stageWidth;
  7709. c = c.stageHeight;
  7710. p = new b.Shape;
  7711. p.width = a;
  7712. p.height = c;
  7713. p.touchEnabled = !0;
  7714. this._shape = p;
  7715. this.getStageDelegateDiv().appendChild(this.div)
  7716. }
  7717. __extends(a, d);
  7718. a.prototype.getStageDelegateDiv = function() {
  7719. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  7720. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  7721. return a
  7722. };
  7723. a.prototype._setMultiline = function(a) {
  7724. d.prototype._setMultiline.call(this, a);
  7725. this.createInput()
  7726. };
  7727. a.prototype.callHandler =
  7728. function(a) {
  7729. a.stopPropagation()
  7730. };
  7731. a.prototype._add = function() {
  7732. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  7733. };
  7734. a.prototype._remove = function() {
  7735. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  7736. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  7737. };
  7738. a.prototype._addListeners = function() {
  7739. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  7740. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  7741. };
  7742. a.prototype._removeListeners = function() {
  7743. 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))
  7744. };
  7745. a.prototype.createInput = function() {
  7746. var a = this._multiline ? "textarea" : "input";
  7747. this._inputType != a && (this._inputType =
  7748. 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",
  7749. "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  7750. };
  7751. a.prototype._open = function(a, b, d, c) {};
  7752. a.prototype._setScale = function(a, c) {
  7753. d.prototype._setScale.call(this, a, c);
  7754. var p = b.StageDelegate.getInstance().getScaleX(),
  7755. l = b.StageDelegate.getInstance().getScaleY();
  7756. this.div.scale.x = p * a;
  7757. this.div.scale.y = l * c;
  7758. this.div.transforms()
  7759. };
  7760. a.prototype.changePosition = function(a, d) {
  7761. var c = b.StageDelegate.getInstance().getScaleX(),
  7762. l = b.StageDelegate.getInstance().getScaleY();
  7763. this.div.position.x = a * c;
  7764. this.div.position.y = d * l;
  7765. this.div.transforms()
  7766. };
  7767. a.prototype.setStyles = function() {
  7768. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  7769. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  7770. this.setElementStyle("textAlign", this._textAlign);
  7771. this.setElementStyle("fontSize", this._size + "px");
  7772. this.setElementStyle("color", "#000000");
  7773. this.setElementStyle("width", this._width + "px");
  7774. this.setElementStyle("height", this._height +
  7775. "px");
  7776. this.setElementStyle("border", "1px solid red");
  7777. this.setElementStyle("display", "block")
  7778. };
  7779. a.prototype._show = function() {
  7780. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  7781. this._isShow = !0;
  7782. var a = this._getText();
  7783. this.inputElement.value = a;
  7784. var d = this;
  7785. this.inputElement.oninput = function() {
  7786. d.textValue = d.inputElement.value;
  7787. d.dispatchEvent(new b.Event("updateText"))
  7788. };
  7789. this.setStyles();
  7790. this.inputElement.focus();
  7791. this.inputElement.selectionStart =
  7792. a.length;
  7793. this.inputElement.selectionEnd = a.length;
  7794. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  7795. };
  7796. a.prototype._hide = function() {
  7797. if (null != this.inputElement) {
  7798. this._isShow = !1;
  7799. this.inputElement.oninput = function() {};
  7800. this.setElementStyle("border", "none");
  7801. this.setElementStyle("display", "none");
  7802. this.inputElement.value = "";
  7803. this.setElementStyle("width", "0px");
  7804. window.scrollTo(0, 0);
  7805. var a = this;
  7806. b.setTimeout(function() {
  7807. a.inputElement.blur();
  7808. window.scrollTo(0, 0)
  7809. }, this, 50);
  7810. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  7811. }
  7812. };
  7813. a.prototype._getText = function() {
  7814. this.textValue || (this.textValue = "");
  7815. return this.textValue
  7816. };
  7817. a.prototype._setText = function(a) {
  7818. this.textValue = a;
  7819. this.resetText()
  7820. };
  7821. a.prototype.resetText = function() {
  7822. this.inputElement && (this.inputElement.value = this.textValue)
  7823. };
  7824. a.prototype._setWidth = function(a) {
  7825. this._width = a
  7826. };
  7827. a.prototype._setHeight = function(a) {
  7828. this._height = a
  7829. };
  7830. a.prototype.setElementStyle = function(a, b) {
  7831. this.inputElement && this._styleInfoes[a] !=
  7832. b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  7833. };
  7834. return a
  7835. }(b.StageText);
  7836. b.HTML5StageText = c;
  7837. c.prototype.__class__ = "egret.HTML5StageText"
  7838. })(egret || (egret = {}));
  7839. egret.StageText.create = function() {
  7840. return new egret.HTML5StageText
  7841. };
  7842. var __extends = this.__extends || function(b, c) {
  7843. function d() {
  7844. this.constructor = b
  7845. }
  7846. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7847. d.prototype = c.prototype;
  7848. b.prototype = new d
  7849. },
  7850. GameOverPanel = function(b) {
  7851. function c() {
  7852. b.call(this);
  7853. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.ats, this)
  7854. }
  7855. __extends(c, b);
  7856. c.prototype.ats = function(b) {
  7857. this.stageW = this.stage.stageWidth;
  7858. this.stageH = this.stage.stageHeight;
  7859. this.gameOverShape = new egret.Shape;
  7860. this.addChild(this.gameOverShape);
  7861. this.gameOverShape.graphics.beginFill(0, 0.5);
  7862. this.gameOverShape.graphics.drawRect(0, 0, this.stageW, this.stageH);
  7863. this.gameOverShape.graphics.endFill();
  7864. this.bg = XiaobinTool.createBitmapByName("gameOver_png");
  7865. this.addChild(this.bg);
  7866. this.bg.anchorOffsetX = this.bg.width / 2;
  7867. this.bg.anchorOffsetY = this.bg.height / 2;
  7868. this.bg.x = this.stageW / 2;
  7869. this.bg.y = this.stageH / 2;
  7870. var a = XiaobinTool.createBitmapByName("replay_btn_png");
  7871. this.addChild(a);
  7872. a.x = this.stageW / 4 - a.width / 4 - 10;
  7873. a.y = this.stageH - 100 - a.height - 270;
  7874. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doReplay, this);
  7875. a.touchEnabled = !0;
  7876. b = XiaobinTool.createBitmapByName("share_btn_png");
  7877. this.addChild(b);
  7878. b.x = 0.75 * this.stageW - b.width / 2 - 40;
  7879. b.y = a.y;
  7880. b.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doFenxiang, this);
  7881. b.touchEnabled = !0;
  7882. var c = XiaobinTool.createBitmapByName("more_btn_png");
  7883. this.addChild(c);
  7884. c.x = a.x;
  7885. c.y = a.y + 120;
  7886. c.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doMore, this);
  7887. c.touchEnabled = !0;
  7888. /*a = XiaobinTool.createBitmapByName("libao_btn_png");
  7889. this.addChild(a);
  7890. a.x = this.stageW / 2 - a.width / 2;
  7891. a.y = this.stageH - 220;
  7892. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doLibao, this);
  7893. a.touchEnabled = !0;
  7894. a = XiaobinTool.createBitmapByName("download_btn_png");
  7895. this.addChild(a);
  7896. a.x = b.x;
  7897. a.y = c.y;
  7898. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doDownload, this);
  7899. a.touchEnabled = !0;*/
  7900. b = new egret.TextField;
  7901. this.addChild(b);
  7902. this.scoreTxt = b;
  7903. this.scoreTxt.text = "0000";
  7904. b.width = this.stageW;
  7905. b.y = 200;
  7906. b.size = 50;
  7907. b.lineSpacing = 15;
  7908. b.textAlign = egret.HorizontalAlign.CENTER;
  7909. b.strokeColor = 2236962;
  7910. b.stroke = 4;
  7911. b = new egret.TextField;
  7912. this.addChild(b);
  7913. this.bestScoreTxt = b;
  7914. b.width = this.stageW;
  7915. b.y = 370;
  7916. b.text = '';
  7917. b.size = 50;
  7918. b.lineSpacing = 15;
  7919. b.textAlign = egret.HorizontalAlign.CENTER;
  7920. b.strokeColor = 2236962;
  7921. b.stroke = 4;
  7922. this.updateScoreTxt()
  7923. };
  7924. c.prototype.doFenxiang = function(b) {
  7925. };
  7926. c.prototype.showFxTxt = function() {
  7927. var b = XiaobinTool.createBitmapByName("fx_txt_png");
  7928. this.addChild(b);
  7929. b.touchEnabled = !0;
  7930. b.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.xytb, this)
  7931. };
  7932. c.prototype.xytb = function(b) {
  7933. b.target.parent && b.target.parent.removeChild(b.target)
  7934. };
  7935. c.prototype.doReplay = function(b) {
  7936. //console.log("doReplay");
  7937. b.target.parent && b.target.parent.removeChild(b.target);
  7938. b = new egret.Event("click_replay_btn", !0);
  7939. this.dispatchEvent(b)
  7940. };
  7941. c.prototype.doDownload = function(b) {
  7942. location.href = window.theURL || ih5game.more(true);
  7943. };
  7944. c.prototype.doLibao = function(b) {
  7945. b = XiaobinTool.createBitmapByName("newPanel_png");
  7946. this.addChild(b);
  7947. b.x = this.stageW / 2 - b.width / 2;
  7948. b.y = 160;
  7949. /* var a = XiaobinTool.createBitmapByName("download_btn_png");
  7950. this.addChild(a);
  7951. a.x = this.stageW / 2 - a.width / 2;
  7952. a.y = b.y + b.height - a.height - 20;
  7953. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doDownload, this);
  7954. a.touchEnabled = !0;*/
  7955. var c = XiaobinTool.createBitmapByName("close_btn_png");
  7956. this.addChild(c);
  7957. c.x = b.x + b.width - c.width / 2 - 20;
  7958. c.y = b.y + 20;
  7959. c.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doClose, this);
  7960. c.touchEnabled = !0;
  7961. this.bbbb = b;
  7962. this.dddd = a;
  7963. this.cccc = c
  7964. };
  7965. c.prototype.doClose = function(b) {
  7966. this.removeChild(this.bbbb);
  7967. this.removeChild(this.cccc);
  7968. this.removeChild(this.dddd)
  7969. };
  7970. c.prototype.doMore = function(b) {
  7971. // Play68.goHome();
  7972. gotomore();
  7973. };
  7974. c.prototype.updateScoreTxt = function() {
  7975. this.scoreTxt.text = c.showScore.toString();
  7976. };
  7977. return c
  7978. }(egret.Sprite);
  7979. GameOverPanel.prototype.__class__ = "GameOverPanel";
  7980. var XiaobinDrager = function() {
  7981. function b() {}
  7982. b.setMcDragable = function(c) {
  7983. if (!1 == b.isInit) {
  7984. b.isInit = !0;
  7985. var d = egret.MainContext.instance.stage;
  7986. d.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
  7987. d.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  7988. d.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  7989. d.addEventListener(egret.Event.LEAVE_STAGE, this.onTouchEnd, this)
  7990. }
  7991. this.mcArr.push(c)
  7992. };
  7993. b.onTouchMove = function(c) {
  7994. !0 != b.gameOver && !0 == b.canMove && b.theMc && (b.theMc.x = c.stageY - b.localY)
  7995. };
  7996. b.onTouchBegin = function(c) {
  7997. if (!0 != b.gameOver)
  7998. for (var d = this.mcArr.length - 1; 0 <= d; d--)
  7999. if (this.mcArr[d].hitTestPoint(c.stageX, c.stageY, !0)) {
  8000. b.theMc = this.mcArr[d];
  8001. c = b.theMc.globalToLocal(c.stageX, c.stageY);
  8002. this.localX = c.x * b.theMc.scaleX;
  8003. this.localY = c.y * b.theMc.scaleY;
  8004. this.canMove = !0;
  8005. b.theMc.parent.setChildIndex(b.theMc, b.theMc.parent.numChildren - 1);
  8006. b.theMc.gotoAndPlay("zhengzha");
  8007. break
  8008. }
  8009. };
  8010. b.onTouchEnd = function(c) {
  8011. this.canMove = !1;
  8012. null != b.theMc && (b.theMc.gotoAndPlay("leftRun"), b.theMc = null)
  8013. };
  8014. b.gameOver = !1;
  8015. b.sec = 0;
  8016. b.canMove = !1;
  8017. b.localX = 0;
  8018. b.localY = 0;
  8019. b.isInit = !1;
  8020. b.mcArr = [];
  8021. return b
  8022. }();
  8023. XiaobinDrager.prototype.__class__ = "XiaobinDrager";
  8024. var XiaobinTool = function() {
  8025. function b() {}
  8026. b.createBitmapByName = function(b) {
  8027. var d = new egret.Bitmap;
  8028. b = RES.getRes(b);
  8029. d.texture = b;
  8030. return d
  8031. };
  8032. b.creatMovieClip = function(b, d, a) {
  8033. void 0 === a && (a = "");
  8034. b = RES.getRes(b);
  8035. var e = RES.getRes(d);
  8036. b = new egret.MovieClip(b, e);
  8037. b.name = d;
  8038. b.frameRate = 60;
  8039. b.gotoAndPlay(a);
  8040. return b
  8041. };
  8042. b.fenxiang = function() {};
  8043. b.GAME_SCORE = "0";
  8044. b.OPEN_ID = "0";
  8045. b.NICK_NAME = "0";
  8046. return b
  8047. }();
  8048. XiaobinTool.prototype.__class__ = "XiaobinTool";
  8049. var __extends = this.__extends || function(b, c) {
  8050. function d() {
  8051. this.constructor = b
  8052. }
  8053. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8054. d.prototype = c.prototype;
  8055. b.prototype = new d
  8056. },
  8057. ScoreSixMc = function(b) {
  8058. function c() {
  8059. b.call(this);
  8060. this.num = 0;
  8061. this.space = 40;
  8062. this.theJSON = "numberText_json";
  8063. this.thePNG = "numberText_png";
  8064. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8065. }
  8066. __extends(c, b);
  8067. c.prototype.onAddToStage = function(b) {
  8068. this.handredthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8069. this.addChild(this.handredthousandText);
  8070. this.handredthousandText.x = 0;
  8071. this.tenthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8072. this.addChild(this.tenthousandText);
  8073. this.tenthousandText.x = this.handredthousandText.x + this.space;
  8074. this.thousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8075. this.addChild(this.thousandText);
  8076. this.thousandText.x = this.tenthousandText.x + this.space;
  8077. this.handredText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8078. this.addChild(this.handredText);
  8079. this.handredText.x = this.thousandText.x + this.space;
  8080. this.tenText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8081. this.addChild(this.tenText);
  8082. this.tenText.x = this.handredText.x + this.space;
  8083. this.oneText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8084. this.addChild(this.oneText);
  8085. this.oneText.x = this.tenText.x + this.space
  8086. };
  8087. c.prototype.setNum = function(b) {
  8088. this.num = b;
  8089. //console.log("setNum = " + this.num);
  8090. b = Math.floor(this.num / 1E5).toString();
  8091. this.handredthousandText.gotoAndStop("n" + b.toString());
  8092. 0 == b && (this.handredthousandText.visible = !1);
  8093. 0 < Math.floor(this.num / 1E5) && (this.handredthousandText.visible = !0);
  8094. // console.log("frameNum = " + b);
  8095. b = Math.floor(this.num / 1E4).toString();
  8096. b = b.slice(b.length - 1, b.length);
  8097. this.tenthousandText.gotoAndStop("n" + b.toString());
  8098. !1 == this.handredthousandText.visible && 0 == b && (this.tenthousandText.visible = !1);
  8099. 0 < Math.floor(this.num / 1E4) && (this.tenthousandText.visible = !0);
  8100. // console.log("frameNum = " + b);
  8101. b = Math.floor(this.num / 1E3).toString();
  8102. b = b.slice(b.length - 1, b.length);
  8103. this.thousandText.gotoAndStop("n" + b.toString());
  8104. !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.thousandText.visible = !1);
  8105. 0 < Math.floor(this.num / 1E3) && (this.thousandText.visible = !0);
  8106. // console.log("frameNum = " + b);
  8107. b = Math.floor(this.num / 100).toString();
  8108. b = b.slice(b.length - 1, b.length);
  8109. this.handredText.gotoAndStop("n" + b.toString());
  8110. !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.handredText.visible = !1);
  8111. 0 < Math.floor(this.num / 100) && (this.handredText.visible = !0);
  8112. // console.log("frameNum = " + b);
  8113. b = Math.floor(this.num / 10).toString();
  8114. b = b.slice(b.length - 1, b.length);
  8115. this.tenText.gotoAndStop("n" + b.toString());
  8116. !1 == this.handredText.visible && !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.tenText.visible = !1);
  8117. 0 < Math.floor(this.num / 10) && (this.tenText.visible = !0);
  8118. //console.log("frameNum = " + b);
  8119. b = this.num.toString();
  8120. b = b.slice(b.length - 1, b.length);
  8121. this.oneText.gotoAndStop("n" + b.toString());
  8122. // console.log("frameNum = " + b)
  8123. };
  8124. c.isCreat = !1;
  8125. return c
  8126. }(egret.Sprite);
  8127. ScoreSixMc.prototype.__class__ = "ScoreSixMc";
  8128. var __extends = this.__extends || function(b, c) {
  8129. function d() {
  8130. this.constructor = b
  8131. }
  8132. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8133. d.prototype = c.prototype;
  8134. b.prototype = new d
  8135. },
  8136. ScoreSixMc2 = function(b) {
  8137. function c() {
  8138. b.call(this);
  8139. this.num = 0;
  8140. this.space = 40;
  8141. this.theJSON = "numberText2_json";
  8142. this.thePNG = "numberText2_png";
  8143. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8144. }
  8145. __extends(c, b);
  8146. c.prototype.onAddToStage = function(b) {
  8147. this.handredthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8148. this.addChild(this.handredthousandText);
  8149. this.handredthousandText.x = 0;
  8150. this.tenthousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8151. this.addChild(this.tenthousandText);
  8152. this.tenthousandText.x = this.handredthousandText.x + this.space;
  8153. this.thousandText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8154. this.addChild(this.thousandText);
  8155. this.thousandText.x = this.tenthousandText.x + this.space;
  8156. this.handredText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8157. this.addChild(this.handredText);
  8158. this.handredText.x = this.thousandText.x + this.space;
  8159. this.tenText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8160. this.addChild(this.tenText);
  8161. this.tenText.x = this.handredText.x + this.space;
  8162. this.oneText = XiaobinTool.creatMovieClip(this.theJSON, this.thePNG, "n0");
  8163. this.addChild(this.oneText);
  8164. this.oneText.x = this.tenText.x + this.space
  8165. };
  8166. c.prototype.setNum = function(b) {
  8167. this.num = b;
  8168. // console.log("setNum = " + this.num);
  8169. b = Math.floor(this.num / 1E5).toString();
  8170. this.handredthousandText.gotoAndStop("n" + b.toString());
  8171. 0 == b && (this.handredthousandText.visible = !1);
  8172. 0 < Math.floor(this.num / 1E5) && (this.handredthousandText.visible = !0);
  8173. // console.log("frameNum = " + b);
  8174. b = Math.floor(this.num / 1E4).toString();
  8175. b = b.slice(b.length - 1, b.length);
  8176. this.tenthousandText.gotoAndStop("n" + b.toString());
  8177. !1 == this.handredthousandText.visible && 0 == b && (this.tenthousandText.visible = !1);
  8178. 0 < Math.floor(this.num / 1E4) && (this.tenthousandText.visible = !0);
  8179. // console.log("frameNum = " + b);
  8180. b = Math.floor(this.num / 1E3).toString();
  8181. b = b.slice(b.length - 1, b.length);
  8182. this.thousandText.gotoAndStop("n" + b.toString());
  8183. !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.thousandText.visible = !1);
  8184. 0 < Math.floor(this.num / 1E3) && (this.thousandText.visible = !0);
  8185. // console.log("frameNum = " + b);
  8186. b = Math.floor(this.num / 100).toString();
  8187. b = b.slice(b.length - 1, b.length);
  8188. this.handredText.gotoAndStop("n" + b.toString());
  8189. !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.handredText.visible = !1);
  8190. 0 < Math.floor(this.num / 100) && (this.handredText.visible = !0);
  8191. // console.log("frameNum = " + b);
  8192. b = Math.floor(this.num / 10).toString();
  8193. b = b.slice(b.length - 1, b.length);
  8194. this.tenText.gotoAndStop("n" + b.toString());
  8195. !1 == this.handredText.visible && !1 == this.thousandText.visible && !1 == this.tenthousandText.visible && !1 == this.handredthousandText.visible && 0 == b && (this.tenText.visible = !1);
  8196. 0 < Math.floor(this.num / 10) && (this.tenText.visible = !0);
  8197. // console.log("frameNum = " + b);
  8198. b = this.num.toString();
  8199. b = b.slice(b.length - 1, b.length);
  8200. this.oneText.gotoAndStop("n" + b.toString());
  8201. // console.log("frameNum = " + b)
  8202. };
  8203. c.isCreat = !1;
  8204. return c
  8205. }(egret.Sprite);
  8206. ScoreSixMc2.prototype.__class__ = "ScoreSixMc2";
  8207. var __extends = this.__extends || function(b, c) {
  8208. function d() {
  8209. this.constructor = b
  8210. }
  8211. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8212. d.prototype = c.prototype;
  8213. b.prototype = new d
  8214. },
  8215. StartBtn = function(b) {
  8216. function c() {
  8217. b.call(this);
  8218. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8219. }
  8220. __extends(c, b);
  8221. c.prototype.onAddToStage = function(b) {
  8222. this.bgBMP = new egret.Bitmap;
  8223. this.addChild(this.bgBMP);
  8224. this.bgBMP.texture = RES.getRes("start_btn_png")
  8225. };
  8226. return c
  8227. }(egret.Sprite);
  8228. StartBtn.prototype.__class__ = "StartBtn";
  8229. var __extends = this.__extends || function(b, c) {
  8230. function d() {
  8231. this.constructor = b
  8232. }
  8233. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8234. d.prototype = c.prototype;
  8235. b.prototype = new d
  8236. },
  8237. HomePage = function(b) {
  8238. function c() {
  8239. b.call(this);
  8240. this.stageH = this.stageW = 0;
  8241. this.homePage = null;
  8242. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.startGame, this)
  8243. }
  8244. __extends(c, b);
  8245. c.prototype.startGame = function(b) {
  8246. b = XiaobinTool.createBitmapByName("bg_jpg");
  8247. this.addChild(b);
  8248. this.stageW = this.stage.stageWidth;
  8249. this.stageH = this.stage.stageHeight;
  8250. null == this.homePage && (this.startBtn = new StartBtn, this.addChild(this.startBtn), this.startBtn.x = this.stageW / 2, this.startBtn.y = this.stageH - 350, this.startBtn.graphics.beginFill(0, 0.01), this.startBtn.graphics.drawRect(-1E3, -1E3, 2E3, 2E3), this.startBtn.graphics.endFill(), this.startBtn.anchorOffsetX = this.startBtn.width / 2, this.startBtn.touchEnabled = !0, this.startBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this));
  8251. this.touchEnabled = !0;
  8252. this.addEventListener(egret.Event.ENTER_FRAME, this.loop, this);
  8253. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onMouseHandler, this);
  8254. this.hw_logo = XiaobinTool.createBitmapByName("hw_logo_png");
  8255. this.addChild(this.hw_logo);
  8256. this.hw_logo.x = 320 - this.hw_logo.width / 2;
  8257. this.hw_logo.y = 960 - this.hw_logo.height - 20
  8258. };
  8259. c.prototype.loop = function(b) {};
  8260. c.prototype.onMouseHandler = function(b) {};
  8261. c.prototype.onTouchBegin = function(b) {
  8262. b.target && (b.target.scaleX = b.target.scaleY = 0.95, b.target.y = this.stageH - 345)
  8263. };
  8264. c.prototype.onTouchEnd = function(b) {
  8265. this.startBtn.hitTestPoint(b.stageX, b.stageY) ? (this.stage.removeEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this), b.target.parent && b.target.parent.removeChild(b.target), b = new egret.Event("click_start_btn", !0), this.dispatchEvent(b)) : (this.startBtn.scaleX = this.startBtn.scaleY = 1, this.startBtn.y = this.stageH - 350)
  8266. };
  8267. return c
  8268. }(egret.Sprite);
  8269. HomePage.prototype.__class__ = "HomePage";
  8270. var __extends = this.__extends || function(b, c) {
  8271. function d() {
  8272. this.constructor = b
  8273. }
  8274. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8275. d.prototype = c.prototype;
  8276. b.prototype = new d
  8277. },
  8278. InGame = function(b) {
  8279. function c() {
  8280. b.call(this);
  8281. this.yourTime = this.count = this.touchY = this.touchX = this.stageH = this.stageW = 0;
  8282. this.inPower = this.bePress = !1;
  8283. this.space = 40;
  8284. this.speed = 0.1;
  8285. this.scoreNum = this.pcTime = 0;
  8286. this.timeNum = 30;
  8287. this.daCount = 0;
  8288. this.addNum = 100;
  8289. this.secHit = 0;
  8290. this.frameRateSpeed = this.minNum = 5;
  8291. this.myCount = this.maxWidth = this.rectWidth = 0;
  8292. this.link = !0;
  8293. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.ats, this)
  8294. }
  8295. __extends(c, b);
  8296. c.prototype.ats = function(b) {
  8297. this.stageW = this.stage.stageWidth;
  8298. this.stageH = this.stage.stageHeight;
  8299. this.initGameData();
  8300. this.makeReady();
  8301. this.doTimer(null);
  8302. this.bgMusic = RES.getRes("bgSound");
  8303. this.bgMusic.play();
  8304. this.bgMusic.addEventListener("ended", this.rePlay.bind(this))
  8305. };
  8306. c.prototype.creatNuqi = function() {
  8307. this.nuqi1 = XiaobinTool.createBitmapByName("nuqi1_png");
  8308. this.addChild(this.nuqi1);
  8309. this.nuqi1.anchorOffsetX = this.nuqi1.width / 2;
  8310. this.nuqi1.anchorOffsetY = this.nuqi1.height / 2;
  8311. this.nuqi1.x = this.stageW / 2;
  8312. this.nuqi1.y = this.stageH - this.nuqi1.height;
  8313. this.nuqi2 = XiaobinTool.createBitmapByName("nuqi2_png");
  8314. this.addChild(this.nuqi2);
  8315. this.nuqi2.anchorOffsetX = this.nuqi2.width / 2;
  8316. this.nuqi2.anchorOffsetY = this.nuqi2.height / 2;
  8317. this.nuqi2.x = this.stageW / 2;
  8318. this.nuqi2.y = this.stageH - this.nuqi2.height - 15;
  8319. var b = new egret.Rectangle(0, 0, this.secHit, 200);
  8320. this.nuqi2.mask = b
  8321. };
  8322. c.prototype.creatArrow = function() {
  8323. this.arrow = XiaobinTool.createBitmapByName("arrow_png");
  8324. this.addChild(this.arrow);
  8325. this.arrow.x = this.right_hero.x - this.arrow.width / 2;
  8326. this.arrow.y = this.right_hero.y - 300
  8327. };
  8328. c.prototype.creatBar = function() {
  8329. this.bar1 = XiaobinTool.createBitmapByName("t1_png");
  8330. this.addChild(this.bar1);
  8331. this.bar1.x = 220;
  8332. this.bar1.y = 130;
  8333. this.bar2 = XiaobinTool.createBitmapByName("t2_png");
  8334. this.addChild(this.bar2);
  8335. this.bar2.x = this.bar1.x;
  8336. this.bar2.y = this.bar1.y
  8337. };
  8338. c.prototype.creatMiss = function() {
  8339. this.miss = XiaobinTool.createBitmapByName("miss_png");
  8340. this.addChild(this.miss);
  8341. this.miss.alpha = 0;
  8342. this.miss.anchorOffsetX = this.miss.width / 2;
  8343. this.miss.anchorOffsetY = this.miss.height / 2
  8344. };
  8345. c.prototype.showMiss = function(b, a) {
  8346. this.miss.x = b;
  8347. this.miss.y = a - 250;
  8348. this.miss.alpha = 1
  8349. };
  8350. c.prototype.creatScoreTxt = function() {
  8351. var b = new egret.TextField;
  8352. this.addChild(b);
  8353. this.scoreTxt = b;
  8354. this.scoreTxt.visible = !1;
  8355. b.x = this.scoreBg.x + 60;
  8356. b.y = this.scoreBg.y - 10;
  8357. b.size = 50;
  8358. b.textColor = 8926003;
  8359. this.updateScore()
  8360. };
  8361. c.prototype.updateScore = function() {
  8362. this.scoreTxt.text = this.scoreNum.toString();
  8363. this.ss && this.ss.setNum(this.scoreNum)
  8364. };
  8365. c.prototype.creatScoreBg = function() {
  8366. this.scoreBg = XiaobinTool.createBitmapByName("scoreBg_png");
  8367. this.addChild(this.scoreBg);
  8368. this.scoreBg.anchorOffsetX = this.scoreBg.width / 2;
  8369. this.scoreBg.anchorOffsetY = this.scoreBg.height / 2;
  8370. this.scoreBg.x = this.stageW / 2 - 20;
  8371. this.scoreBg.y = 80
  8372. };
  8373. c.prototype.creatTimeTip = function() {
  8374. this.timeTip = XiaobinTool.createBitmapByName("timeTip_png");
  8375. this.addChild(this.timeTip);
  8376. this.timeTip.anchorOffsetX = this.timeTip.width / 2;
  8377. this.timeTip.x = this.stageW / 2;
  8378. this.timeTip.y = 150
  8379. };
  8380. c.prototype.creatTxt = function() {
  8381. var b = new egret.TextField;
  8382. this.addChild(b);
  8383. this.pcTxt = b;
  8384. b.y = 200;
  8385. b.strokeColor = 2236962;
  8386. b.stroke = 4;
  8387. b.visible = !1;
  8388. var a = new egret.TextField;
  8389. this.addChild(a);
  8390. a.y = b.y + b.height + 30;
  8391. this.yourTxt = a;
  8392. a.strokeColor = 2236962;
  8393. a.stroke = 4;
  8394. a.visible = !1;
  8395. b = new egret.TextField;
  8396. this.addChild(b);
  8397. b.y = a.y + a.height + 30;
  8398. this.resultTxt = b;
  8399. b.strokeColor = 2236962;
  8400. b.stroke = 4;
  8401. b.visible = !1;
  8402. a = new egret.TextField;
  8403. this.addChild(a);
  8404. a.y = this.right_hero.y + 15;
  8405. a.x = this.stageW / 2;
  8406. a.size = 45;
  8407. a.text = "";
  8408. this.showTxt = a;
  8409. a.strokeColor = 2236962;
  8410. a.stroke = 4
  8411. };
  8412. c.prototype.makeReady = function() {
  8413. this.timer = new egret.Timer(1E3, 3);
  8414. this.timer.addEventListener(egret.TimerEvent.TIMER, this.doTimer, this);
  8415. this.timer.start()
  8416. };
  8417. c.prototype.doTimer = function(b) {
  8418. //console.log("timer");
  8419. this.count--;
  8420. null != this.numPic && (this.removeChild(this.numPic), this.numPic = null);
  8421. this.creatNumPic();
  8422. 0 == this.count && (this.touchEnabled = !0, this.addEventListener(egret.Event.ENTER_FRAME, this.loop, this), this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this), this.timer.removeEventListener(egret.TimerEvent.TIMER, this.doTimer, this), this.timer = null)
  8423. };
  8424. c.prototype.initGameData = function() {
  8425. this.daCount = this.scoreNum = this.pcTime = this.yourTime = 0;
  8426. this.count = 4;
  8427. this.canPlay = !1;
  8428. this.creatBg();
  8429. this.creatHero();
  8430. this.creatBtns();
  8431. this.makeGameTimer();
  8432. this.makeRePressTimer();
  8433. this.creatScoreBg();
  8434. this.creatScoreTxt();
  8435. var b = new ScoreSixMc;
  8436. this.addChild(b);
  8437. b.x = 250;
  8438. b.y = 100;
  8439. b.setNum(0);
  8440. this.ss = b;
  8441. this.creatMiss();
  8442. this.creatBar();
  8443. this.creatArrow();
  8444. this.creatNuqi();
  8445. this.creatTxt();
  8446. this.creatTimeTip();
  8447. this.ySound1 = RES.getRes("woda");
  8448. this.ySound2 = RES.getRes("woshan");
  8449. this.nogj.visible = !1
  8450. };
  8451. c.prototype.makePlayTimer = function() {
  8452. this.pTimer = new egret.Timer(750, 1);
  8453. this.pTimer.addEventListener(egret.TimerEvent.TIMER, this.playTimer, this)
  8454. };
  8455. c.prototype.makeGameTimer = function() {
  8456. this.gameTimer = new egret.Timer(100);
  8457. this.gameTimer.addEventListener(egret.TimerEvent.TIMER, this.doGameTimer, this)
  8458. };
  8459. c.prototype.makeRePressTimer = function() {
  8460. this.rePressTimer = new egret.Timer(1E3);
  8461. this.rePressTimer.addEventListener(egret.TimerEvent.TIMER, this.doRePressTimer, this);
  8462. this.rePressTimer.start()
  8463. };
  8464. c.prototype.makeRoundTimer = function() {
  8465. this.roundTimer = new egret.Timer(750, 1);
  8466. this.roundTimer.addEventListener(egret.TimerEvent.TIMER, this.doRoundTimer, this)
  8467. };
  8468. c.prototype.doRePressTimer = function(b) {
  8469. this.left_hero.frameRate = this.frameRateSpeed + 10;
  8470. this.right_hero.frameRate = this.frameRateSpeed
  8471. };
  8472. c.prototype.doGameTimer = function(b) {
  8473. this.timeNum -= this.speed;
  8474. b = new egret.Rectangle(0, 0, this.bar2.width / 30 * this.timeNum, 200);
  8475. this.bar2.mask = b;
  8476. 0 >= this.timeNum && (this.makeGameOver(), this.gameTimer.removeEventListener(egret.TimerEvent.TIMER, this.doGameTimer, this))
  8477. };
  8478. c.prototype.doRoundTimer = function(b) {
  8479. this.canPlay = !0;
  8480. this.numPic.visible = !0;
  8481. this.miss.alpha = 0
  8482. };
  8483. c.prototype.playTimer = function(b) {
  8484. // console.log("playTimer");
  8485. this.miss.alpha = 0;
  8486. this.count = 4;
  8487. this.doTimer(null);
  8488. b = 1.3 * Math.random() + 0.2;
  8489. this.timer = new egret.Timer(1E3 * b, 4);
  8490. this.timer.addEventListener(egret.TimerEvent.TIMER, this.doTimer, this);
  8491. this.timer.start();
  8492. this.gjBtn.visible = !0;
  8493. this.gjBtn.touchEnabled = !0;
  8494. this.nogj.visible = !1;
  8495. this.left_hero.gotoAndStop("stand");
  8496. this.right_hero.gotoAndStop("stand")
  8497. };
  8498. c.prototype.creatBtns = function() {
  8499. var b = XiaobinTool.createBitmapByName("gj_btn_png");
  8500. this.addChild(b);
  8501. b.anchorOffsetX = b.width / 2;
  8502. b.x = this.stageW / 2;
  8503. b.y = this.stageH - b.height - 90;
  8504. this.gjBtn = b;
  8505. b.visible = !1;
  8506. var a = XiaobinTool.createBitmapByName("nogj_png");
  8507. this.addChild(a);
  8508. a.anchorOffsetX = a.width / 2;
  8509. a.x = b.x;
  8510. a.y = b.y;
  8511. a.visible = !1;
  8512. this.nogj = a
  8513. };
  8514. c.prototype.creatHero = function() {
  8515. var b = XiaobinTool.creatMovieClip("leftHero_json", "leftHero_png", "stand");
  8516. this.addChild(b);
  8517. b.x = this.stageW / 2 - b.width / 2 + this.space;
  8518. b.y = this.stageH - 360;
  8519. this.left_hero = b;
  8520. var a = XiaobinTool.creatMovieClip("rightHero_json", "rightHero_png", "stand");
  8521. this.addChild(a);
  8522. a.x = this.stageW / 2 + a.width / 2 - this.space;
  8523. a.y = this.stageH - 360;
  8524. this.right_hero = a;
  8525. var c = new egret.Shape;
  8526. this.addChild(c);
  8527. c.touchEnabled = !0;
  8528. b.frameRate = this.minNum;
  8529. a.frameRate = this.minNum
  8530. };
  8531. c.prototype.doRemove = function() {
  8532. this.numPic && this.removeChild(this.numPic)
  8533. };
  8534. c.prototype.creatNumPic = function() {
  8535. 0 >= this.timeNum || (0 == this.count ? (console.log("r"), this.numPic = XiaobinTool.createBitmapByName("go_png"), this.gameTimer.start(), egret.Tween.get(this.numPic).to({
  8536. alpha: 0.01,
  8537. scaleX: 3,
  8538. scaleY: 3
  8539. }, 400, egret.Ease.sineIn).call(this.doRemove, this), this.timeTip && this.removeChild(this.timeTip), this.gameTimer.start()) : this.numPic = XiaobinTool.createBitmapByName("num" + this.count + "_png"), this.addChild(this.numPic), this.numPic.anchorOffsetX = this.numPic.width / 2, this.numPic.anchorOffsetY = this.numPic.height / 2, this.numPic.x = this.stageW / 2, this.numPic.y = 240)
  8540. };
  8541. c.prototype.loop = function(b) {
  8542. !0 == this.inPower && (this.frameRateSpeed = 30, this.left_hero.frameRate = this.frameRateSpeed, this.right_hero.frameRate = this.frameRateSpeed);
  8543. this.frameRateSpeed -= 0.12;
  8544. this.frameRateSpeed < this.minNum && (this.frameRateSpeed = this.minNum, this.left_hero.gotoAndStop("stand"), this.right_hero.gotoAndStop("stand"));
  8545. this.frameRateSpeed > this.minNum && (this.myCount++, 30 <= this.myCount && (this.creatScore(), this.myCount = 0));
  8546. if (!1 == this.inPower) {
  8547. var a;
  8548. !1 == this.gjBtn.visible && (0 < this.rectWidth && (this.rectWidth -= 2), this.rectWidth += this.frameRateSpeed - 5, a = this.rectWidth / 15, b = new egret.Rectangle(0, 0, a, 200), this.nuqi2.mask = b);
  8549. a >= this.nuqi2.width && (this.gjBtn.visible = !0)
  8550. }
  8551. };
  8552. c.prototype.creatScore = function() {
  8553. var b;
  8554. if (!0 == this.inPower) {
  8555. b = new ScoreSixMc2;
  8556. this.addChild(b);
  8557. var a = 1.5 + 1.5 * Math.random();
  8558. b.setNum(20 * this.secHit * a)
  8559. } else b = new ScoreSixMc, this.addChild(b), b.setNum(20 * this.secHit);
  8560. b.x = this.left_hero.x + 50 * Math.random() - 100 - b.width / 2;
  8561. b.y = this.left_hero.y - 200;
  8562. this.scoreNum += 20 * this.secHit;
  8563. this.scoreTxt.text = this.scoreNum.toString();
  8564. this.updateScore();
  8565. egret.Tween.get(b).to({
  8566. y: b.y - 100,
  8567. alpha: 50
  8568. }, 500).call(this.doRemoveScore, this, [b])
  8569. };
  8570. c.prototype.doRemoveScore = function(b) {
  8571. b && b.parent && b.parent.removeChild(b)
  8572. };
  8573. c.prototype.rePlay = function() {
  8574. this.bgMusic.load();
  8575. this.bgMusic.play()
  8576. };
  8577. c.prototype.makeGameOver = function() {
  8578. this.right_hero.gotoAndStop("stand");
  8579. var mescore = this.scoreNum;
  8580. var mefont = "分";
  8581. var melevel = "";
  8582. window.score = this.scoreNum;
  8583. //updateShare(window.score);
  8584. //Play68.setRankingScoreDesc(window.score);
  8585. GameOverPanel.showScore = this.scoreNum;
  8586. this.gameOverPanel = new GameOverPanel;
  8587. this.addChild(this.gameOverPanel);
  8588. null != this.arrow && (this.removeChild(this.arrow), this.arrow = null);
  8589. this.removeEventListener(egret.Event.ENTER_FRAME, this.loop, this);
  8590. this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this)
  8591. };
  8592. c.prototype.onTouchBegin = function(b) {
  8593. this.gjBtn.hitTestPoint(b.stageX, b.stageY) && (this.gjBtn.scaleX = this.gjBtn.scaleY = 0.95, this.gjBtn.y = this.stageH - this.gjBtn.height + 10 - 150, this.left_hero.gotoAndPlay("ai"), this.right_hero.gotoAndPlay("da"));
  8594. if (this.right_hero.hitTestPoint(b.stageX, b.stageY) || 300 < b.stageY && 700 > b.stageY)!0 == this.inPower ? (this.frameRateSpeed = 30, this.left_hero.frameRate = this.frameRateSpeed, this.right_hero.frameRate = this.frameRateSpeed) : (this.secHit++, this.r_status = "da", this.frameRateSpeed == this.minNum && (this.right_hero.gotoAndPlay(this.r_status), this.left_hero.gotoAndPlay("ai")), this.frameRateSpeed += 1.5, 30 < this.frameRateSpeed && (this.frameRateSpeed = 30))
  8595. };
  8596. c.prototype.addScore = function(b) {
  8597. this.daCount++;
  8598. this.scoreNum += b;
  8599. this.addNum *= 2
  8600. };
  8601. c.prototype.doTt = function(b) {
  8602. this.maxWidth -= this.nuqi2.width / 50;
  8603. b = new egret.Rectangle(0, 0, this.maxWidth, 200);
  8604. this.nuqi2.mask = b;
  8605. //console.log(this.maxWidth);
  8606. 0 >= this.maxWidth && (this.inPower = !1, this.rectWidth = 0)
  8607. };
  8608. c.prototype.onTouchEnd = function(b) {
  8609. this.gjBtn.scaleX = this.gjBtn.scaleY = 1;
  8610. this.gjBtn.y = this.stageH - this.gjBtn.height - 150;
  8611. this.touchX = b.stageX;
  8612. this.touchY = b.stageY;
  8613. this.gjBtn.hitTestPoint(this.touchX, this.touchY) && !0 == this.gjBtn.visible && (b = new egret.Timer(100, 50), b.addEventListener(egret.TimerEvent.TIMER, this.doTt, this), b.start(), this.maxWidth = this.nuqi2.width, this.doTt(null), this.inPower = !0, this.gjBtn.visible = !1, this.frameRateSpeed = 30, this.left_hero.frameRate = this.frameRateSpeed, this.right_hero.frameRate = this.frameRateSpeed, this.left_hero.gotoAndPlay("ai"), this.right_hero.gotoAndPlay("da"));
  8614. 0.5 < Math.random() ? this.l_status = "duo" : this.l_status = "da"
  8615. };
  8616. c.prototype.creatBg = function() {
  8617. this.bg = XiaobinTool.createBitmapByName("bg_jpg");
  8618. this.addChild(this.bg)
  8619. };
  8620. c.prototype.onTouchMove = function(b) {
  8621. this.touchX = b.stageX;
  8622. this.touchY = b.stageY
  8623. };
  8624. return c
  8625. }(egret.Sprite);
  8626. InGame.prototype.__class__ = "InGame";
  8627. var __extends = this.__extends || function(b, c) {
  8628. function d() {
  8629. this.constructor = b
  8630. }
  8631. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8632. d.prototype = c.prototype;
  8633. b.prototype = new d
  8634. },
  8635. LoadingUI = function(b) {
  8636. function c() {
  8637. b.call(this);
  8638. this.createView()
  8639. }
  8640. __extends(c, b);
  8641. c.prototype.createView = function() {
  8642. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8643. RES.loadConfig("resource/resource.json" + (window.VER ? '?' + window.VER : ''), "resource/");
  8644. this.textField = new egret.TextField
  8645. };
  8646. c.prototype.setProgress = function(b, a) {
  8647. this.textField.text = "加载中" + Math.floor(b / a * 100) + "%"
  8648. };
  8649. c.prototype.onConfigComplete = function(b) {
  8650. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8651. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8652. RES.loadGroup("loading")
  8653. };
  8654. c.prototype.onResourceLoadComplete = function(b) {
  8655. "loading" == b.groupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), this.createPic(), this.createText(), this.createShape())
  8656. };
  8657. c.prototype.createShape = function() {
  8658. this.shape = new egret.Shape;
  8659. this.addChild(this.shape)
  8660. };
  8661. c.prototype.createText = function() {
  8662. this.addChild(this.textField);
  8663. this.textField.y = 480;
  8664. this.textField.width = 640;
  8665. this.textField.height = 100;
  8666. this.textField.size = 25;
  8667. this.textField.textColor = 16777215;
  8668. this.textField.textAlign = "center"
  8669. };
  8670. c.prototype.createPic = function() {
  8671. this.pic = XiaobinTool.createBitmapByName("bg_jpg");
  8672. this.addChild(this.pic);
  8673. this.logo = XiaobinTool.createBitmapByName("logo_png");
  8674. this.addChild(this.logo);
  8675. this.logo.x = 320 - this.logo.width / 2;
  8676. this.logo.y = 100;
  8677. this.hw_logo = XiaobinTool.createBitmapByName("hw_logo_png");
  8678. this.addChild(this.hw_logo);
  8679. this.hw_logo.x = 320 - this.hw_logo.width / 2;
  8680. this.hw_logo.y = 960 - this.hw_logo.height - 20
  8681. };
  8682. c.prototype.createMc = function() {
  8683. this.mc = XiaobinTool.creatMovieClip("hero_json", "hero_png", "wait");
  8684. this.addChild(this.mc)
  8685. };
  8686. return c
  8687. }(egret.Sprite);
  8688. LoadingUI.prototype.__class__ = "LoadingUI";
  8689. var __extends = this.__extends || function(b, c) {
  8690. function d() {
  8691. this.constructor = b
  8692. }
  8693. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8694. d.prototype = c.prototype;
  8695. b.prototype = new d
  8696. },
  8697. Main = function(b) {
  8698. function c() {
  8699. b.call(this);
  8700. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8701. }
  8702. __extends(c, b);
  8703. c.prototype.onAddToStage = function(b) {
  8704. this.loadingView = new LoadingUI;
  8705. this.stage.addChild(this.loadingView);
  8706. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8707. RES.loadConfig("resource/resource.json" + (window.VER ? '?' + window.VER : ''), "resource/")
  8708. };
  8709. c.prototype.onConfigComplete = function(b) {
  8710. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8711. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8712. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  8713. RES.loadGroup("preload")
  8714. };
  8715. c.prototype.onResourceLoadComplete = function(b) {
  8716. "preload" == b.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  8717. };
  8718. c.prototype.onResourceProgress = function(b) {
  8719. "preload" == b.groupName && this.loadingView.setProgress(b.itemsLoaded, b.itemsTotal)
  8720. };
  8721. c.prototype.createGameScene = function() {
  8722. null == this.homepage && (this.homepage = new HomePage);
  8723. this.addChild(this.homepage);
  8724. this.logo = XiaobinTool.createBitmapByName("logo_png");
  8725. this.addChild(this.logo);
  8726. this.logo.x = 320 - this.logo.width / 2;
  8727. this.logo.y = 100;
  8728. this.wanfa = XiaobinTool.createBitmapByName("wanfa_png");
  8729. this.addChild(this.wanfa);
  8730. this.wanfa.x = 320 - this.wanfa.width / 2;
  8731. this.wanfa.y = 360;
  8732. this.addEventListener("click_start_btn", this.createIngame, this);
  8733. this.addEventListener("click_replay_btn", this.doReplay, this);
  8734. this.timer = new egret.Timer(200, 1);
  8735. this.timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.createIngame, this)
  8736. };
  8737. c.prototype.doReplay = function() {
  8738. null != this.ingame && (this.removeChild(this.ingame), this.ingame = null);
  8739. this.timer.start()
  8740. };
  8741. c.prototype.createIngame = function() {
  8742. //console.log("createIngame");
  8743. null != this.logo && (this.removeChild(this.logo), this.logo = null);
  8744. null != this.wanfa && (this.removeChild(this.wanfa), this.wanfa = null);
  8745. null == this.ingame && (this.ingame = new InGame, this.addChild(this.ingame))
  8746. };
  8747. return c
  8748. }(egret.DisplayObjectContainer);
  8749. Main.prototype.__class__ = "Main";