game-min.js 240 KB

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