game-min.js 313 KB

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