game-min.js 410 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312
  1. var egret;
  2. (function(b) {
  3. b.egret_string_code = {};
  4. b.egret_string_code[-1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  5. b.egret_string_code[1E3] = "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";
  6. b.egret_string_code[1001] = "\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";
  7. b.egret_string_code[1002] =
  8. "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
  9. b.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  10. b.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  11. b.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  12. b.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  13. b.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  14. b.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  15. b.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  16. b.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  17. b.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  18. b.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  19. b.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  20. b.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  21. b.egret_string_code[1015] = "xml not found!";
  22. b.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  23. b.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  24. b.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  25. b.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  26. b.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  27. b.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  28. b.egret_string_code[1022] = "{0} ArgumentError";
  29. b.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  30. b.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  31. b.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  32. b.egret_string_code[1026] =
  33. "EncodingError! The code point {0} could not be encoded.";
  34. b.egret_string_code[1027] = "DecodingError";
  35. b.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\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";
  36. b.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  37. b.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  38. b.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  39. b.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  40. b.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  41. b.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  42. b.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  43. b.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  44. b.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  45. b.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  46. b.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  47. b.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  48. b.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  49. b.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  50. b.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  51. b.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  52. b.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  53. b.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
  54. b.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  55. b.egret_string_code[4001] = "Abstract class can not be instantiated!";
  56. b.egret_string_code[4002] = "Unnamed data!";
  57. b.egret_string_code[4003] = "Nonsupport version!";
  58. b.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  59. b.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  60. b.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
  61. })(egret ||
  62. (egret = {}));
  63. (function(b) {
  64. function c(a) {
  65. for (var d = [], l = 1; l < arguments.length; l++) d[l - 1] = arguments[l];
  66. if (l = b.egret_string_code[a])
  67. for (var m = d.length, e = 0; e < m; e++) l = l.replace("{" + e + "}", d[e]);
  68. return l
  69. }
  70. var e = function() {
  71. function a() {}
  72. a.fatal = function(d, a) {
  73. void 0 === a && (a = null);
  74. b.Logger.traceToConsole("Fatal", d, a);
  75. throw Error(b.Logger.getTraceCode("Fatal", d, a));
  76. };
  77. a.info = function(d, a) {
  78. void 0 === a && (a = null);
  79. b.Logger.traceToConsole("Info", d, a)
  80. };
  81. a.warning = function(d, a) {
  82. void 0 === a && (a = null);
  83. b.Logger.traceToConsole("Warning", d,
  84. a)
  85. };
  86. a.fatalWithErrorId = function(d) {
  87. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  88. l.unshift(d);
  89. (l = c.apply(null, l)) ? a.fatal(l): a.warning(c(-1, d))
  90. };
  91. a.infoWithErrorId = function(d) {
  92. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  93. l.unshift(d);
  94. (l = c.apply(null, l)) ? a.info(l): a.warning(c(-1, d))
  95. };
  96. a.warningWithErrorId = function(d) {
  97. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  98. l.unshift(d);
  99. (l = c.apply(null, l)) ? a.warning(l): a.warning(c(-1, d))
  100. };
  101. a.traceToConsole = function(d, a,
  102. m) {
  103. console.log(b.Logger.getTraceCode(d, a, m))
  104. };
  105. a.getTraceCode = function(d, a, b) {
  106. return "[" + d + "]" + a + (null == b ? "" : ":" + b)
  107. };
  108. return a
  109. }();
  110. b.Logger = e;
  111. e.prototype.__class__ = "egret.Logger";
  112. b.getString = c
  113. })(egret || (egret = {}));
  114. (function(b) {
  115. var c = function() {
  116. function b() {
  117. this._hashCode = b.hashCount++
  118. }
  119. Object.defineProperty(b.prototype, "hashCode", {
  120. get: function() {
  121. return this._hashCode
  122. },
  123. enumerable: !0,
  124. configurable: !0
  125. });
  126. b.hashCount = 1;
  127. return b
  128. }();
  129. b.HashObject = c;
  130. c.prototype.__class__ = "egret.HashObject"
  131. })(egret || (egret = {}));
  132. var __extends = this.__extends || function(b, c) {
  133. function e() {
  134. this.constructor = b
  135. }
  136. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  137. e.prototype = c.prototype;
  138. b.prototype = new e
  139. };
  140. (function(b) {
  141. var c = function(b) {
  142. function a(d) {
  143. void 0 === d && (d = 300);
  144. b.call(this);
  145. this.objectPool = [];
  146. this._length = 0;
  147. 1 > d && (d = 1);
  148. this.autoDisposeTime = d;
  149. this.frameCount = 0
  150. }
  151. __extends(a, b);
  152. a.prototype._checkFrame = function() {
  153. this.frameCount--;
  154. 0 >= this.frameCount && this.dispose()
  155. };
  156. Object.defineProperty(a.prototype, "length", {
  157. get: function() {
  158. return this._length
  159. },
  160. enumerable: !0,
  161. configurable: !0
  162. });
  163. a.prototype.push = function(d) {
  164. var l = this.objectPool; - 1 == l.indexOf(d) && (l.push(d), d.__recycle && d.__recycle(), this._length++,
  165. 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  166. };
  167. a.prototype.pop = function() {
  168. if (0 == this._length) return null;
  169. this._length--;
  170. return this.objectPool.pop()
  171. };
  172. a.prototype.dispose = function() {
  173. 0 < this._length && (this.objectPool = [], this._length = 0);
  174. this.frameCount = 0;
  175. var d = a._callBackList,
  176. l = d.indexOf(this); - 1 != l && d.splice(l, 1)
  177. };
  178. a._callBackList = [];
  179. return a
  180. }(b.HashObject);
  181. b.Recycler = c;
  182. c.prototype.__class__ = "egret.Recycler"
  183. })(egret || (egret = {}));
  184. (function(b) {
  185. b.__START_TIME;
  186. b.getTimer = function() {
  187. return Date.now() - b.__START_TIME
  188. }
  189. })(egret || (egret = {}));
  190. (function(b) {
  191. b.__callLaterFunctionList = [];
  192. b.__callLaterThisList = [];
  193. b.__callLaterArgsList = [];
  194. b.callLater = function(c, e) {
  195. for (var a = [], d = 2; d < arguments.length; d++) a[d - 2] = arguments[d];
  196. b.__callLaterFunctionList.push(c);
  197. b.__callLaterThisList.push(e);
  198. b.__callLaterArgsList.push(a)
  199. };
  200. b.__callAsyncFunctionList = [];
  201. b.__callAsyncThisList = [];
  202. b.__callAsyncArgsList = [];
  203. b.__callAsync = function(c, e) {
  204. for (var a = [], d = 2; d < arguments.length; d++) a[d - 2] = arguments[d];
  205. b.__callAsyncFunctionList.push(c);
  206. b.__callAsyncThisList.push(e);
  207. b.__callAsyncArgsList.push(a)
  208. }
  209. })(egret || (egret = {}));
  210. (function(b) {
  211. var c = function() {
  212. function e() {}
  213. e.prototype.call = function(a) {
  214. this.callback && this.callback.call(this.thisObject, a)
  215. };
  216. e.prototype.dispose = function() {
  217. this.thisObject = this.callback = null;
  218. e.__freeList.push(this)
  219. };
  220. e.push = function(a, d) {
  221. var l;
  222. l = e.__freeList.length ? e.__freeList.pop() : new b.RenderCommand;
  223. l.callback = a;
  224. l.thisObject = d;
  225. b.MainContext.__DRAW_COMMAND_LIST.push(l)
  226. };
  227. e.__freeList = [];
  228. return e
  229. }();
  230. b.RenderCommand = c;
  231. c.prototype.__class__ = "egret.RenderCommand"
  232. })(egret || (egret = {}));
  233. __extends = this.__extends || function(b, c) {
  234. function e() {
  235. this.constructor = b
  236. }
  237. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  238. e.prototype = c.prototype;
  239. b.prototype = new e
  240. };
  241. (function(b) {
  242. var c = function(e) {
  243. function a(d, a, b) {
  244. void 0 === a && (a = !1);
  245. void 0 === b && (b = !1);
  246. e.call(this);
  247. this.data = null;
  248. this._type = "";
  249. this._cancelable = this._bubbles = !1;
  250. this._eventPhase = 2;
  251. this._target = this._currentTarget = null;
  252. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  253. this.isNew = !0;
  254. this._type = d;
  255. this._bubbles = a;
  256. this._cancelable = b
  257. }
  258. __extends(a, e);
  259. Object.defineProperty(a.prototype, "type", {
  260. get: function() {
  261. return this._type
  262. },
  263. enumerable: !0,
  264. configurable: !0
  265. });
  266. Object.defineProperty(a.prototype,
  267. "bubbles", {
  268. get: function() {
  269. return this._bubbles
  270. },
  271. enumerable: !0,
  272. configurable: !0
  273. });
  274. Object.defineProperty(a.prototype, "cancelable", {
  275. get: function() {
  276. return this._cancelable
  277. },
  278. enumerable: !0,
  279. configurable: !0
  280. });
  281. Object.defineProperty(a.prototype, "eventPhase", {
  282. get: function() {
  283. return this._eventPhase
  284. },
  285. enumerable: !0,
  286. configurable: !0
  287. });
  288. Object.defineProperty(a.prototype, "currentTarget", {
  289. get: function() {
  290. return this._currentTarget
  291. },
  292. enumerable: !0,
  293. configurable: !0
  294. });
  295. Object.defineProperty(a.prototype, "target", {
  296. get: function() {
  297. return this._target
  298. },
  299. enumerable: !0,
  300. configurable: !0
  301. });
  302. a.prototype.isDefaultPrevented = function() {
  303. return this._isDefaultPrevented
  304. };
  305. a.prototype.preventDefault = function() {
  306. this._cancelable && (this._isDefaultPrevented = !0)
  307. };
  308. a.prototype.stopPropagation = function() {
  309. this._bubbles && (this._isPropagationStopped = !0)
  310. };
  311. a.prototype.stopImmediatePropagation = function() {
  312. this._bubbles && (this._isPropagationImmediateStopped = !0)
  313. };
  314. a.prototype._reset = function() {
  315. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped =
  316. this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  317. };
  318. a.prototype.__recycle = function() {
  319. this.data = this._target = this._currentTarget = null
  320. };
  321. a._dispatchByTarget = function(d, a, m, e, c, f) {
  322. void 0 === c && (c = !1);
  323. void 0 === f && (f = !1);
  324. var h = d.eventRecycler;
  325. h || (h = d.eventRecycler = new b.Recycler);
  326. var n = h.pop();
  327. n ? n._type = m : n = new d(m);
  328. n._bubbles = c;
  329. n._cancelable = f;
  330. if (e)
  331. for (var p in e) n[p] = e[p], null !== n[p] && (e[p] = null);
  332. d = a.dispatchEvent(n);
  333. h.push(n);
  334. return d
  335. };
  336. a._getPropertyData = function(d) {
  337. var a =
  338. d._props;
  339. a || (a = d._props = {});
  340. return a
  341. };
  342. a.dispatchEvent = function(d, l, b, e) {
  343. void 0 === b && (b = !1);
  344. var c = a._getPropertyData(a);
  345. e && (c.data = e);
  346. a._dispatchByTarget(a, d, l, c, b)
  347. };
  348. a.ADDED_TO_STAGE = "addedToStage";
  349. a.REMOVED_FROM_STAGE = "removedFromStage";
  350. a.ADDED = "added";
  351. a.REMOVED = "removed";
  352. a.COMPLETE = "complete";
  353. a.LOOP_COMPLETE = "loopcomplete";
  354. a.ENTER_FRAME = "enterFrame";
  355. a.RENDER = "render";
  356. a.FINISH_RENDER = "finishRender";
  357. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  358. a.LEAVE_STAGE = "leaveStage";
  359. a.RESIZE = "resize";
  360. a.CHANGE =
  361. "change";
  362. a.ACTIVATE = "activate";
  363. a.DEACTIVATE = "deactivate";
  364. a.CLOSE = "close";
  365. a.CONNECT = "connect";
  366. return a
  367. }(b.HashObject);
  368. b.Event = c;
  369. c.prototype.__class__ = "egret.Event"
  370. })(egret || (egret = {}));
  371. __extends = this.__extends || function(b, c) {
  372. function e() {
  373. this.constructor = b
  374. }
  375. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  376. e.prototype = c.prototype;
  377. b.prototype = new e
  378. };
  379. (function(b) {
  380. var c = function(b) {
  381. function a(d, a, m) {
  382. void 0 === a && (a = !1);
  383. void 0 === m && (m = !1);
  384. b.call(this, d, a, m);
  385. this._status = 0
  386. }
  387. __extends(a, b);
  388. Object.defineProperty(a.prototype, "status", {
  389. get: function() {
  390. return this._status
  391. },
  392. enumerable: !0,
  393. configurable: !0
  394. });
  395. a.dispatchHTTPStatusEvent = function(d, l) {
  396. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  397. a.httpStatusEvent._status = l;
  398. d.dispatchEvent(a.httpStatusEvent)
  399. };
  400. a.HTTP_STATUS = "httpStatus";
  401. a.httpStatusEvent = null;
  402. return a
  403. }(b.Event);
  404. b.HTTPStatusEvent =
  405. c;
  406. c.prototype.__class__ = "egret.HTTPStatusEvent"
  407. })(egret || (egret = {}));
  408. __extends = this.__extends || function(b, c) {
  409. function e() {
  410. this.constructor = b
  411. }
  412. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  413. e.prototype = c.prototype;
  414. b.prototype = new e
  415. };
  416. (function(b) {
  417. var c = function(e) {
  418. function a(d, a, b) {
  419. void 0 === a && (a = !1);
  420. void 0 === b && (b = !1);
  421. e.call(this, d, a, b)
  422. }
  423. __extends(a, e);
  424. a.dispatchIOErrorEvent = function(d) {
  425. b.Event._dispatchByTarget(a, d, a.IO_ERROR)
  426. };
  427. a.IO_ERROR = "ioError";
  428. return a
  429. }(b.Event);
  430. b.IOErrorEvent = c;
  431. c.prototype.__class__ = "egret.IOErrorEvent"
  432. })(egret || (egret = {}));
  433. __extends = this.__extends || function(b, c) {
  434. function e() {
  435. this.constructor = b
  436. }
  437. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  438. e.prototype = c.prototype;
  439. b.prototype = new e
  440. };
  441. (function(b) {
  442. var c = function(e) {
  443. function a(d, a, b, k, c, f, h, n, p, q) {
  444. void 0 === a && (a = !0);
  445. void 0 === b && (b = !0);
  446. void 0 === k && (k = 0);
  447. void 0 === c && (c = 0);
  448. void 0 === f && (f = 0);
  449. void 0 === h && (h = !1);
  450. void 0 === n && (n = !1);
  451. void 0 === q && (q = !1);
  452. e.call(this, d, a, b);
  453. this._stageY = this._stageX = 0;
  454. this.touchPointID = NaN;
  455. this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
  456. this.touchPointID = k;
  457. this._stageX = c;
  458. this._stageY = f;
  459. this.ctrlKey = h;
  460. this.altKey = n;
  461. this.touchDown = q
  462. }
  463. __extends(a, e);
  464. Object.defineProperty(a.prototype, "stageX", {
  465. get: function() {
  466. return this._stageX
  467. },
  468. enumerable: !0,
  469. configurable: !0
  470. });
  471. Object.defineProperty(a.prototype, "stageY", {
  472. get: function() {
  473. return this._stageY
  474. },
  475. enumerable: !0,
  476. configurable: !0
  477. });
  478. Object.defineProperty(a.prototype, "localX", {
  479. get: function() {
  480. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  481. },
  482. enumerable: !0,
  483. configurable: !0
  484. });
  485. Object.defineProperty(a.prototype, "localY", {
  486. get: function() {
  487. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  488. },
  489. enumerable: !0,
  490. configurable: !0
  491. });
  492. a.dispatchTouchEvent = function(d, l, m, e, c, f, h, n, p) {
  493. void 0 === m && (m = 0);
  494. void 0 === e && (e = 0);
  495. void 0 === c && (c = 0);
  496. void 0 === f && (f = !1);
  497. void 0 === h && (h = !1);
  498. void 0 === n && (n = !1);
  499. void 0 === p && (p = !1);
  500. var q = b.Event._getPropertyData(a);
  501. q.touchPointID = m;
  502. q._stageX = e;
  503. q._stageY = c;
  504. q.ctrlKey = f;
  505. q.altKey = h;
  506. q.shiftKey = n;
  507. q.touchDown = p;
  508. b.Event._dispatchByTarget(a, d, l, q, !0, !0)
  509. };
  510. a.TOUCH_TAP = "touchTap";
  511. a.TOUCH_MOVE = "touchMove";
  512. a.TOUCH_BEGIN = "touchBegin";
  513. a.TOUCH_END = "touchEnd";
  514. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  515. a.TOUCH_ROLL_OUT =
  516. "touchRollOut";
  517. a.TOUCH_ROLL_OVER = "touchRollOver";
  518. a.TOUCH_OUT = "touchOut";
  519. a.TOUCH_OVER = "touchOver";
  520. return a
  521. }(b.Event);
  522. b.TouchEvent = c;
  523. c.prototype.__class__ = "egret.TouchEvent"
  524. })(egret || (egret = {}));
  525. __extends = this.__extends || function(b, c) {
  526. function e() {
  527. this.constructor = b
  528. }
  529. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  530. e.prototype = c.prototype;
  531. b.prototype = new e
  532. };
  533. (function(b) {
  534. var c = function(e) {
  535. function a(d, a, b) {
  536. void 0 === a && (a = !1);
  537. void 0 === b && (b = !1);
  538. e.call(this, d, a, b)
  539. }
  540. __extends(a, e);
  541. a.dispatchTimerEvent = function(d, l) {
  542. b.Event._dispatchByTarget(a, d, l)
  543. };
  544. a.TIMER = "timer";
  545. a.TIMER_COMPLETE = "timerComplete";
  546. return a
  547. }(b.Event);
  548. b.TimerEvent = c;
  549. c.prototype.__class__ = "egret.TimerEvent"
  550. })(egret || (egret = {}));
  551. __extends = this.__extends || function(b, c) {
  552. function e() {
  553. this.constructor = b
  554. }
  555. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  556. e.prototype = c.prototype;
  557. b.prototype = new e
  558. };
  559. (function(b) {
  560. var c = function(e) {
  561. function a(d, a, b, k) {
  562. void 0 === a && (a = !1);
  563. void 0 === b && (b = !1);
  564. void 0 === k && (k = "");
  565. e.call(this, d, a, b);
  566. this.text = k
  567. }
  568. __extends(a, e);
  569. a.dispatchTextEvent = function(d, l, m) {
  570. var e = b.Event._getPropertyData(a);
  571. e.text = m;
  572. b.Event._dispatchByTarget(a, d, l, e)
  573. };
  574. a.LINK = "link";
  575. return a
  576. }(b.Event);
  577. b.TextEvent = c;
  578. c.prototype.__class__ = "egret.TextEvent"
  579. })(egret || (egret = {}));
  580. __extends = this.__extends || function(b, c) {
  581. function e() {
  582. this.constructor = b
  583. }
  584. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  585. e.prototype = c.prototype;
  586. b.prototype = new e
  587. };
  588. (function(b) {
  589. var c = function(e) {
  590. function a(d, a, b, k, c) {
  591. void 0 === a && (a = !1);
  592. void 0 === b && (b = !1);
  593. void 0 === k && (k = 0);
  594. void 0 === c && (c = 0);
  595. e.call(this, d, a, b);
  596. this.bytesTotal = this.bytesLoaded = 0;
  597. this.bytesLoaded = k;
  598. this.bytesTotal = c
  599. }
  600. __extends(a, e);
  601. a.dispatchProgressEvent = function(d, l, m, e) {
  602. void 0 === m && (m = 0);
  603. void 0 === e && (e = 0);
  604. b.Event._dispatchByTarget(a, d, l, {
  605. bytesLoaded: m,
  606. bytesTotal: e
  607. })
  608. };
  609. a.PROGRESS = "progress";
  610. a.SOCKET_DATA = "socketData";
  611. return a
  612. }(b.Event);
  613. b.ProgressEvent = c;
  614. c.prototype.__class__ = "egret.ProgressEvent"
  615. })(egret ||
  616. (egret = {}));
  617. (function(b) {
  618. var c = function() {
  619. function b() {}
  620. b.CAPTURING_PHASE = 1;
  621. b.AT_TARGET = 2;
  622. b.BUBBLING_PHASE = 3;
  623. return b
  624. }();
  625. b.EventPhase = c;
  626. c.prototype.__class__ = "egret.EventPhase"
  627. })(egret || (egret = {}));
  628. __extends = this.__extends || function(b, c) {
  629. function e() {
  630. this.constructor = b
  631. }
  632. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  633. e.prototype = c.prototype;
  634. b.prototype = new e
  635. };
  636. (function(b) {
  637. var c = function(e) {
  638. function a(d) {
  639. void 0 === d && (d = null);
  640. e.call(this);
  641. this._captureEventsMap = this._eventsMap = this._eventTarget = null;
  642. this._eventTarget = d ? d : this
  643. }
  644. __extends(a, e);
  645. a.prototype.addEventListener = function(d, a, m, e, c) {
  646. void 0 === e && (e = !1);
  647. void 0 === c && (c = 0);
  648. "undefined" === typeof e && (e = !1);
  649. "undefined" === typeof c && (c = 0);
  650. a || b.Logger.fatalWithErrorId(1010);
  651. e ? (this._captureEventsMap || (this._captureEventsMap = {}), e = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), e = this._eventsMap);
  652. var f = e[d];
  653. f || (f = e[d] = []);
  654. this._insertEventBin(f, a, m, c)
  655. };
  656. a.prototype._insertEventBin = function(d, a, b, e, c) {
  657. void 0 === c && (c = void 0);
  658. for (var f = -1, h = d.length, n = 0; n < h; n++) {
  659. var p = d[n];
  660. if (p.listener === a && p.thisObject === b && p.display === c) return !1; - 1 == f && p.priority < e && (f = n)
  661. }
  662. a = {
  663. listener: a,
  664. thisObject: b,
  665. priority: e
  666. };
  667. c && (a.display = c); - 1 != f ? d.splice(f, 0, a) : d.push(a);
  668. return !0
  669. };
  670. a.prototype.removeEventListener = function(d, a, b, e) {
  671. void 0 === e && (e = !1);
  672. if (e = e ? this._captureEventsMap : this._eventsMap) {
  673. var c = e[d];
  674. c && (this._removeEventBin(c,
  675. a, b), 0 == c.length && delete e[d])
  676. }
  677. };
  678. a.prototype._removeEventBin = function(d, a, b, e, c) {
  679. void 0 === e && (e = void 0);
  680. void 0 === c && (c = 0);
  681. for (var f = d.length; c < f; c++) {
  682. var h = d[c];
  683. if (h.listener === a && h.thisObject === b && h.display == e) return d.splice(c, 1), !0
  684. }
  685. return !1
  686. };
  687. a.prototype.hasEventListener = function(d) {
  688. return this._eventsMap && this._eventsMap[d] || this._captureEventsMap && this._captureEventsMap[d]
  689. };
  690. a.prototype.willTrigger = function(d) {
  691. return this.hasEventListener(d)
  692. };
  693. a.prototype.dispatchEvent = function(d) {
  694. d._reset();
  695. d._target =
  696. this._eventTarget;
  697. d._currentTarget = this._eventTarget;
  698. return this._notifyListener(d)
  699. };
  700. a.prototype._notifyListener = function(d) {
  701. var a = 1 == d._eventPhase ? this._captureEventsMap : this._eventsMap;
  702. if (!a) return !0;
  703. a = a[d._type];
  704. if (!a) return !0;
  705. var b = a.length;
  706. if (0 == b) return !0;
  707. for (var a = a.concat(), e = 0; e < b; e++) {
  708. var c = a[e];
  709. c.listener.call(c.thisObject, d);
  710. if (d._isPropagationImmediateStopped) break
  711. }
  712. return !d._isDefaultPrevented
  713. };
  714. a.prototype.dispatchEventWith = function(d, a, m) {
  715. void 0 === a && (a = !1);
  716. b.Event.dispatchEvent(this,
  717. d, a, m)
  718. };
  719. return a
  720. }(b.HashObject);
  721. b.EventDispatcher = c;
  722. c.prototype.__class__ = "egret.EventDispatcher"
  723. })(egret || (egret = {}));
  724. __extends = this.__extends || function(b, c) {
  725. function e() {
  726. this.constructor = b
  727. }
  728. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  729. e.prototype = c.prototype;
  730. b.prototype = new e
  731. };
  732. (function(b) {
  733. var c = function(e) {
  734. function a() {
  735. e.call(this);
  736. this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
  737. this.reuseEvent = new b.Event("")
  738. }
  739. __extends(a, e);
  740. a.prototype.run = function() {
  741. b.Ticker.getInstance().run();
  742. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  743. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  744. this.touchContext.run();
  745. this._profileInstance = b.Profiler.getInstance()
  746. };
  747. a.prototype.renderLoop =
  748. function(d) {
  749. if (0 < b.__callLaterFunctionList.length) {
  750. var l = b.__callLaterFunctionList;
  751. b.__callLaterFunctionList = [];
  752. var m = b.__callLaterThisList;
  753. b.__callLaterThisList = [];
  754. var e = b.__callLaterArgsList;
  755. b.__callLaterArgsList = []
  756. }
  757. d = this.stage;
  758. var c = a.cachedEvent;
  759. c._type = b.Event.RENDER;
  760. this.dispatchEvent(c);
  761. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  762. l && this.doCallLaterList(l, m, e);
  763. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  764. l = this.rendererContext;
  765. l.onRenderStart();
  766. l.clearScreen();
  767. a.__DRAW_COMMAND_LIST = [];
  768. a._renderLoopPhase = "updateTransform";
  769. d._updateTransform();
  770. a._renderLoopPhase = "draw";
  771. c._type = b.Event.FINISH_UPDATE_TRANSFORM;
  772. this.dispatchEvent(c);
  773. a.__use_new_draw ? this._draw(l) : d._draw(l);
  774. c._type = b.Event.FINISH_RENDER;
  775. this.dispatchEvent(c);
  776. this._profileInstance._isRunning && this._profileInstance._drawProfiler();
  777. l.onRenderFinish()
  778. };
  779. a.prototype._draw = function(d) {
  780. for (var l = a.__DRAW_COMMAND_LIST, b = l.length, e = 0; e < b; e++) {
  781. var c = l[e];
  782. c.call(d);
  783. c.dispose()
  784. }
  785. };
  786. a.prototype.broadcastEnterFrame =
  787. function(d) {
  788. d = this.reuseEvent;
  789. d._type = b.Event.ENTER_FRAME;
  790. this.dispatchEvent(d);
  791. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), m = a.length, e = 0; e < m; e++) {
  792. var c = a[e];
  793. d._target = c.display;
  794. d._currentTarget = c.display;
  795. c.listener.call(c.thisObject, d)
  796. }
  797. a = b.Recycler._callBackList;
  798. for (e = a.length - 1; 0 <= e; e--) a[e]._checkFrame()
  799. };
  800. a.prototype.broadcastRender = function() {
  801. var d = this.reuseEvent;
  802. d._type = b.Event.RENDER;
  803. for (var a = b.DisplayObject._renderCallBackList.concat(), m = a.length, e = 0; e < m; e++) {
  804. var c = a[e],
  805. f =
  806. c.display;
  807. d._target = f;
  808. d._currentTarget = f;
  809. c.listener.call(c.thisObject, d)
  810. }
  811. };
  812. a.prototype.doCallLaterList = function(d, a, b) {
  813. for (var e = d.length, c = 0; c < e; c++) {
  814. var f = d[c];
  815. null != f && f.apply(a[c], b[c])
  816. }
  817. };
  818. a.prototype.doCallAsyncList = function() {
  819. var d = b.__callAsyncFunctionList.concat(),
  820. a = b.__callAsyncThisList.concat(),
  821. m = b.__callAsyncArgsList.concat();
  822. b.__callAsyncFunctionList.length = 0;
  823. b.__callAsyncThisList.length = 0;
  824. for (var e = b.__callAsyncArgsList.length = 0; e < d.length; e++) {
  825. var c = d[e];
  826. null != c && c.apply(a[e], m[e])
  827. }
  828. };
  829. a.deviceType = null;
  830. a.DEVICE_PC = "web";
  831. a.DEVICE_MOBILE = "native";
  832. a.RUNTIME_HTML5 = "runtime_html5";
  833. a.RUNTIME_NATIVE = "runtime_native";
  834. a.__DRAW_COMMAND_LIST = [];
  835. a.__use_new_draw = !0;
  836. a.cachedEvent = new b.Event("");
  837. return a
  838. }(b.EventDispatcher);
  839. b.MainContext = c;
  840. c.prototype.__class__ = "egret.MainContext"
  841. })(egret || (egret = {}));
  842. var testDeviceType = function() {
  843. if (!this.navigator) return !0;
  844. var b = navigator.userAgent.toLowerCase();
  845. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  846. },
  847. testRuntimeType = function() {
  848. return this.navigator ? !0 : !1
  849. };
  850. egret.MainContext.instance = new egret.MainContext;
  851. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  852. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  853. delete testDeviceType;
  854. delete testRuntimeType;
  855. (function(b) {
  856. var c = function() {
  857. function e() {
  858. this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  859. this._txt = null;
  860. this._tick = 0;
  861. this._maxDeltaTime = 500;
  862. this._totalDeltaTime = 0;
  863. this._isRunning = !1
  864. }
  865. e.getInstance = function() {
  866. null == e.instance && (e.instance = new e);
  867. return e.instance
  868. };
  869. e.prototype.stop = function() {
  870. if (this._isRunning) {
  871. this._isRunning = !1;
  872. b.Ticker.getInstance().unregister(this.update, this);
  873. var a = b.MainContext.instance;
  874. a.removeEventListener(b.Event.ENTER_FRAME,
  875. this.onEnterFrame, this);
  876. a.removeEventListener(b.Event.RENDER, this.onStartRender, this);
  877. a.removeEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  878. a.removeEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  879. }
  880. };
  881. e.prototype.run = function() {
  882. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._parent = new b.DisplayObjectContainer);
  883. if (!this._isRunning) {
  884. this._isRunning = !0;
  885. b.Ticker.getInstance().register(this.update, this);
  886. var a =
  887. b.MainContext.instance;
  888. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  889. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  890. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  891. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  892. }
  893. };
  894. e.prototype._drawProfiler = function() {
  895. this._txt._updateTransform();
  896. this._txt._draw(b.MainContext.instance.rendererContext)
  897. };
  898. e.prototype._setTxtFontSize = function(a) {
  899. this._txt.size = a
  900. };
  901. e.prototype.onEnterFrame =
  902. function(a) {
  903. this._lastTime = b.getTimer()
  904. };
  905. e.prototype.onStartRender = function(a) {
  906. a = b.getTimer();
  907. this._logicPerformanceCost = a - this._lastTime;
  908. this._lastTime = a
  909. };
  910. e.prototype.onFinishUpdateTransform = function(a) {
  911. a = b.getTimer();
  912. this._updateTransformPerformanceCost = a - this._lastTime;
  913. this._lastTime = a
  914. };
  915. e.prototype.onFinishRender = function(a) {
  916. a = b.getTimer();
  917. this._renderPerformanceCost = a - this._lastTime;
  918. this._lastTime = a
  919. };
  920. e.prototype.update = function(a) {
  921. this._tick++;
  922. this._totalDeltaTime += a;
  923. if (this._totalDeltaTime >=
  924. this._maxDeltaTime) {
  925. a = (this._preDrawCount - 3).toString();
  926. var d = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  927. this._txt.text = "draw:" + a + "\ncost:" + d + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  928. this._tick = this._totalDeltaTime = 0
  929. }
  930. this._preDrawCount = 0
  931. };
  932. e.prototype.onDrawImage = function() {
  933. this._preDrawCount++
  934. };
  935. return e
  936. }();
  937. b.Profiler = c;
  938. c.prototype.__class__ = "egret.Profiler"
  939. })(egret || (egret = {}));
  940. __extends = this.__extends || function(b, c) {
  941. function e() {
  942. this.constructor = b
  943. }
  944. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  945. e.prototype = c.prototype;
  946. b.prototype = new e
  947. };
  948. (function(b) {
  949. var c = function(e) {
  950. function a() {
  951. e.call(this);
  952. this._timeScale = 1;
  953. this._paused = !1;
  954. this._callIndex = -1;
  955. this.callBackList = [];
  956. null != a.instance && b.Logger.fatalWithErrorId(1002)
  957. }
  958. __extends(a, e);
  959. a.prototype.run = function() {
  960. b.__START_TIME = (new Date).getTime();
  961. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  962. };
  963. a.prototype.update = function(d) {
  964. if (!this._paused) {
  965. d *= this._timeScale;
  966. d *= this._timeScale;
  967. this._callList = this.callBackList.concat();
  968. for (this._callIndex = 0; this._callIndex < this._callList.length; this._callIndex++) {
  969. var a =
  970. this._callList[this._callIndex];
  971. a.listener.call(a.thisObject, d)
  972. }
  973. this._callIndex = -1;
  974. this._callList = null
  975. }
  976. };
  977. a.prototype.register = function(d, a, b) {
  978. void 0 === b && (b = 0);
  979. this._insertEventBin(this.callBackList, d, a, b)
  980. };
  981. a.prototype.unregister = function(d, a) {
  982. this._removeEventBin(this.callBackList, d, a);
  983. this._callList && -1 < this._callIndex && this._removeEventBin(this._callList, d, a, null, this._callIndex + 1)
  984. };
  985. a.prototype.setTimeout = function(d, a, m) {
  986. for (var e = [], c = 3; c < arguments.length; c++) e[c - 3] = arguments[c];
  987. b.Logger.warningWithErrorId(1003);
  988. b.setTimeout.apply(null, [d, a, m].concat(e))
  989. };
  990. a.prototype.setTimeScale = function(d) {
  991. this._timeScale = d
  992. };
  993. a.prototype.getTimeScale = function() {
  994. return this._timeScale
  995. };
  996. a.prototype.pause = function() {
  997. this._paused = !0
  998. };
  999. a.prototype.resume = function() {
  1000. this._paused = !1
  1001. };
  1002. a.getInstance = function() {
  1003. null == a.instance && (a.instance = new a);
  1004. return a.instance
  1005. };
  1006. return a
  1007. }(b.EventDispatcher);
  1008. b.Ticker = c;
  1009. c.prototype.__class__ = "egret.Ticker"
  1010. })(egret || (egret = {}));
  1011. (function(b) {
  1012. var c = function() {
  1013. function b() {}
  1014. b.LEFT = "left";
  1015. b.RIGHT = "right";
  1016. b.CENTER = "center";
  1017. b.JUSTIFY = "justify";
  1018. b.CONTENT_JUSTIFY = "contentJustify";
  1019. return b
  1020. }();
  1021. b.HorizontalAlign = c;
  1022. c.prototype.__class__ = "egret.HorizontalAlign"
  1023. })(egret || (egret = {}));
  1024. (function(b) {
  1025. var c = function() {
  1026. function b() {}
  1027. b.TOP = "top";
  1028. b.BOTTOM = "bottom";
  1029. b.MIDDLE = "middle";
  1030. b.JUSTIFY = "justify";
  1031. b.CONTENT_JUSTIFY = "contentJustify";
  1032. return b
  1033. }();
  1034. b.VerticalAlign = c;
  1035. c.prototype.__class__ = "egret.VerticalAlign"
  1036. })(egret || (egret = {}));
  1037. __extends = this.__extends || function(b, c) {
  1038. function e() {
  1039. this.constructor = b
  1040. }
  1041. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1042. e.prototype = c.prototype;
  1043. b.prototype = new e
  1044. };
  1045. (function(b) {
  1046. var c = function(e) {
  1047. function a(d, a) {
  1048. void 0 === a && (a = 0);
  1049. e.call(this);
  1050. this._currentCount = 0;
  1051. this._running = !1;
  1052. this.lastTime = 0;
  1053. this.delay = d;
  1054. this.repeatCount = a
  1055. }
  1056. __extends(a, e);
  1057. Object.defineProperty(a.prototype, "currentCount", {
  1058. get: function() {
  1059. return this._currentCount
  1060. },
  1061. enumerable: !0,
  1062. configurable: !0
  1063. });
  1064. Object.defineProperty(a.prototype, "running", {
  1065. get: function() {
  1066. return this._running
  1067. },
  1068. enumerable: !0,
  1069. configurable: !0
  1070. });
  1071. a.prototype.reset = function() {
  1072. this.stop();
  1073. this._currentCount = 0
  1074. };
  1075. a.prototype.start = function() {
  1076. this._running ||
  1077. (this.lastTime = b.getTimer(), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  1078. };
  1079. a.prototype.stop = function() {
  1080. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  1081. };
  1082. a.prototype.onEnterFrame = function(d) {
  1083. d = b.getTimer();
  1084. d - this.lastTime > this.delay && (this.lastTime = d, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this,
  1085. b.TimerEvent.TIMER_COMPLETE)))
  1086. };
  1087. return a
  1088. }(b.EventDispatcher);
  1089. b.Timer = c;
  1090. c.prototype.__class__ = "egret.Timer"
  1091. })(egret || (egret = {}));
  1092. (function(b) {
  1093. function c(b) {
  1094. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  1095. if (b.hasOwnProperty("__class__")) return b.__class__;
  1096. var a = b.constructor.toString(),
  1097. d = a.indexOf("("),
  1098. a = a.substring(9, d);
  1099. Object.defineProperty(b, "__class__", {
  1100. value: a,
  1101. enumerable: !1,
  1102. writable: !0
  1103. });
  1104. return a
  1105. }
  1106. b.getQualifiedClassName = c;
  1107. b.getQualifiedSuperclassName = function(b) {
  1108. b = b.prototype ? b.prototype : Object.getPrototypeOf(b);
  1109. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  1110. var a = Object.getPrototypeOf(b);
  1111. if (null == a) return null;
  1112. a = c(a.constructor);
  1113. if (!a) return null;
  1114. Object.defineProperty(b, "__superclass__", {
  1115. value: a,
  1116. enumerable: !1,
  1117. writable: !0
  1118. });
  1119. return a
  1120. }
  1121. })(egret || (egret = {}));
  1122. (function(b) {
  1123. var c = {};
  1124. b.getDefinitionByName = function(b) {
  1125. if (!b) return null;
  1126. var a = c[b];
  1127. if (a) return a;
  1128. for (var d = b.split("."), l = d.length, a = __global, m = 0; m < l; m++)
  1129. if (a = a[d[m]], !a) return null;
  1130. return c[b] = a
  1131. }
  1132. })(egret || (egret = {}));
  1133. var __global = __global || this;
  1134. (function(b) {
  1135. function c(d) {
  1136. for (var a in e) {
  1137. var b = e[a];
  1138. b.delay -= d;
  1139. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete e[a])
  1140. }
  1141. }
  1142. var e = {},
  1143. a = 0;
  1144. b.setTimeout = function(d, l, m) {
  1145. for (var k = [], g = 3; g < arguments.length; g++) k[g - 3] = arguments[g];
  1146. k = {
  1147. listener: d,
  1148. thisObject: l,
  1149. delay: m,
  1150. params: k
  1151. };
  1152. 0 == a && b.Ticker.getInstance().register(c, null);
  1153. a++;
  1154. e[a] = k;
  1155. return a
  1156. };
  1157. b.clearTimeout = function(d) {
  1158. delete e[d]
  1159. }
  1160. })(egret || (egret = {}));
  1161. (function(b) {
  1162. b.hasDefinition = function(c) {
  1163. return b.getDefinitionByName(c) ? !0 : !1
  1164. }
  1165. })(egret || (egret = {}));
  1166. (function(b) {
  1167. b.toColorString = function(b) {
  1168. if (isNaN(b) || 0 > b) b = 0;
  1169. 16777215 < b && (b = 16777215);
  1170. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  1171. return "#" + b
  1172. }
  1173. })(egret || (egret = {}));
  1174. __extends = this.__extends || function(b, c) {
  1175. function e() {
  1176. this.constructor = b
  1177. }
  1178. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1179. e.prototype = c.prototype;
  1180. b.prototype = new e
  1181. };
  1182. (function(b) {
  1183. var c = function(e) {
  1184. function a(d, a, b, c, g, f) {
  1185. void 0 === d && (d = 1);
  1186. void 0 === a && (a = 0);
  1187. void 0 === b && (b = 0);
  1188. void 0 === c && (c = 1);
  1189. void 0 === g && (g = 0);
  1190. void 0 === f && (f = 0);
  1191. e.call(this);
  1192. this.a = d;
  1193. this.b = a;
  1194. this.c = b;
  1195. this.d = c;
  1196. this.tx = g;
  1197. this.ty = f
  1198. }
  1199. __extends(a, e);
  1200. a.prototype.prepend = function(d, a, b, e, c, f) {
  1201. var h = this.tx;
  1202. if (1 != d || 0 != a || 0 != b || 1 != e) {
  1203. var n = this.a,
  1204. p = this.c;
  1205. this.a = n * d + this.b * b;
  1206. this.b = n * a + this.b * e;
  1207. this.c = p * d + this.d * b;
  1208. this.d = p * a + this.d * e
  1209. }
  1210. this.tx = h * d + this.ty * b + c;
  1211. this.ty = h * a + this.ty * e + f;
  1212. return this
  1213. };
  1214. a.prototype.append =
  1215. function(d, a, b, e, c, f) {
  1216. var h = this.a,
  1217. n = this.b,
  1218. p = this.c,
  1219. q = this.d;
  1220. if (1 != d || 0 != a || 0 != b || 1 != e) this.a = d * h + a * p, this.b = d * n + a * q, this.c = b * h + e * p, this.d = b * n + e * q;
  1221. this.tx = c * h + f * p + this.tx;
  1222. this.ty = c * n + f * q + this.ty;
  1223. return this
  1224. };
  1225. a.prototype.prependTransform = function(d, a, m, e, c, f, h, n, p) {
  1226. if (c % 360) {
  1227. var q = b.NumberUtils.cos(c);
  1228. c = b.NumberUtils.sin(c)
  1229. } else q = 1, c = 0; if (n || p) this.tx -= n, this.ty -= p;
  1230. f || h ? (this.prepend(q * m, c * m, -c * e, q * e, 0, 0), this.prepend(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f),
  1231. d, a)) : this.prepend(q * m, c * m, -c * e, q * e, d, a);
  1232. return this
  1233. };
  1234. a.prototype.appendTransform = function(d, a, m, e, c, f, h, n, p) {
  1235. if (c % 360) {
  1236. var q = b.NumberUtils.cos(c);
  1237. c = b.NumberUtils.sin(c)
  1238. } else q = 1, c = 0;
  1239. f || h ? (this.append(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), d, a), this.append(q * m, c * m, -c * e, q * e, 0, 0)) : this.append(q * m, c * m, -c * e, q * e, d, a);
  1240. if (n || p) this.tx -= n * this.a + p * this.c, this.ty -= n * this.b + p * this.d;
  1241. return this
  1242. };
  1243. a.prototype.rotate = function(d) {
  1244. var a = Math.cos(d);
  1245. d = Math.sin(d);
  1246. var b =
  1247. this.a,
  1248. e = this.c,
  1249. c = this.tx;
  1250. this.a = b * a - this.b * d;
  1251. this.b = b * d + this.b * a;
  1252. this.c = e * a - this.d * d;
  1253. this.d = e * d + this.d * a;
  1254. this.tx = c * a - this.ty * d;
  1255. this.ty = c * d + this.ty * a;
  1256. return this
  1257. };
  1258. a.prototype.skew = function(d, a) {
  1259. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(d), b.NumberUtils.cos(d), 0, 0);
  1260. return this
  1261. };
  1262. a.prototype.scale = function(d, a) {
  1263. this.a *= d;
  1264. this.d *= a;
  1265. this.c *= d;
  1266. this.b *= a;
  1267. this.tx *= d;
  1268. this.ty *= a;
  1269. return this
  1270. };
  1271. a.prototype.translate = function(d, a) {
  1272. this.tx += d;
  1273. this.ty += a;
  1274. return this
  1275. };
  1276. a.prototype.identity =
  1277. function() {
  1278. this.a = this.d = 1;
  1279. this.b = this.c = this.tx = this.ty = 0;
  1280. return this
  1281. };
  1282. a.prototype.identityMatrix = function(d) {
  1283. this.a = d.a;
  1284. this.b = d.b;
  1285. this.c = d.c;
  1286. this.d = d.d;
  1287. this.tx = d.tx;
  1288. this.ty = d.ty;
  1289. return this
  1290. };
  1291. a.prototype.invert = function() {
  1292. var d = this.a,
  1293. a = this.b,
  1294. b = this.c,
  1295. e = this.d,
  1296. c = this.tx,
  1297. f = d * e - a * b;
  1298. this.a = e / f;
  1299. this.b = -a / f;
  1300. this.c = -b / f;
  1301. this.d = d / f;
  1302. this.tx = (b * this.ty - e * c) / f;
  1303. this.ty = -(d * this.ty - a * c) / f;
  1304. return this
  1305. };
  1306. a.transformCoords = function(d, a, m) {
  1307. var e = b.Point.identity;
  1308. e.x = d.a * a + d.c * m + d.tx;
  1309. e.y = d.d * m + d.b * a + d.ty;
  1310. return e
  1311. };
  1312. a.prototype.toArray = function(d) {
  1313. this.array || (this.array = new Float32Array(9));
  1314. d ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1315. this.array[8] = 1;
  1316. return this.array
  1317. };
  1318. a.identity = new a;
  1319. a.DEG_TO_RAD = Math.PI / 180;
  1320. return a
  1321. }(b.HashObject);
  1322. b.Matrix = c;
  1323. c.prototype.__class__ = "egret.Matrix"
  1324. })(egret || (egret = {}));
  1325. __extends = this.__extends || function(b, c) {
  1326. function e() {
  1327. this.constructor = b
  1328. }
  1329. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1330. e.prototype = c.prototype;
  1331. b.prototype = new e
  1332. };
  1333. (function(b) {
  1334. var c = function(b) {
  1335. function a(d, a) {
  1336. void 0 === d && (d = 0);
  1337. void 0 === a && (a = 0);
  1338. b.call(this);
  1339. this.x = d;
  1340. this.y = a
  1341. }
  1342. __extends(a, b);
  1343. a.prototype.clone = function() {
  1344. return new a(this.x, this.y)
  1345. };
  1346. a.prototype.equals = function(d) {
  1347. return this.x == d.x && this.y == d.y
  1348. };
  1349. a.distance = function(d, a) {
  1350. return Math.sqrt((d.x - a.x) * (d.x - a.x) + (d.y - a.y) * (d.y - a.y))
  1351. };
  1352. a.identity = new a(0, 0);
  1353. return a
  1354. }(b.HashObject);
  1355. b.Point = c;
  1356. c.prototype.__class__ = "egret.Point"
  1357. })(egret || (egret = {}));
  1358. __extends = this.__extends || function(b, c) {
  1359. function e() {
  1360. this.constructor = b
  1361. }
  1362. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1363. e.prototype = c.prototype;
  1364. b.prototype = new e
  1365. };
  1366. (function(b) {
  1367. var c = function(b) {
  1368. function a(d, a, m, c) {
  1369. void 0 === d && (d = 0);
  1370. void 0 === a && (a = 0);
  1371. void 0 === m && (m = 0);
  1372. void 0 === c && (c = 0);
  1373. b.call(this);
  1374. this.x = d;
  1375. this.y = a;
  1376. this.width = m;
  1377. this.height = c
  1378. }
  1379. __extends(a, b);
  1380. Object.defineProperty(a.prototype, "right", {
  1381. get: function() {
  1382. return this.x + this.width
  1383. },
  1384. set: function(d) {
  1385. this.width = d - this.x
  1386. },
  1387. enumerable: !0,
  1388. configurable: !0
  1389. });
  1390. Object.defineProperty(a.prototype, "bottom", {
  1391. get: function() {
  1392. return this.y + this.height
  1393. },
  1394. set: function(d) {
  1395. this.height = d - this.y
  1396. },
  1397. enumerable: !0,
  1398. configurable: !0
  1399. });
  1400. a.prototype.initialize = function(d, a, b, e) {
  1401. this.x = d;
  1402. this.y = a;
  1403. this.width = b;
  1404. this.height = e;
  1405. return this
  1406. };
  1407. a.prototype.contains = function(d, a) {
  1408. return this.x <= d && this.x + this.width >= d && this.y <= a && this.y + this.height >= a
  1409. };
  1410. a.prototype.intersects = function(d) {
  1411. return Math.max(this.x, d.x) <= Math.min(this.right, d.right) && Math.max(this.y, d.y) <= Math.min(this.bottom, d.bottom)
  1412. };
  1413. a.prototype.setEmpty = function() {
  1414. this.height = this.width = this.y = this.x = 0
  1415. };
  1416. a.prototype.clone = function() {
  1417. return new a(this.x, this.y, this.width, this.height)
  1418. };
  1419. a.prototype.containsPoint = function(d) {
  1420. return this.x < d.x && this.x + this.width > d.x && this.y < d.y && this.y + this.height > d.y ? !0 : !1
  1421. };
  1422. a.identity = new a(0, 0, 0, 0);
  1423. return a
  1424. }(b.HashObject);
  1425. b.Rectangle = c;
  1426. c.prototype.__class__ = "egret.Rectangle"
  1427. })(egret || (egret = {}));
  1428. __extends = this.__extends || function(b, c) {
  1429. function e() {
  1430. this.constructor = b
  1431. }
  1432. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1433. e.prototype = c.prototype;
  1434. b.prototype = new e
  1435. };
  1436. (function(b) {
  1437. var c = function(e) {
  1438. function a() {
  1439. e.call(this);
  1440. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1441. this._xmlDict = {};
  1442. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1443. }
  1444. __extends(a, e);
  1445. a.getInstance = function() {
  1446. a._instance || (a._instance = new a);
  1447. return a._instance
  1448. };
  1449. a.prototype.parserXML = function(d) {
  1450. for (var a = 0;
  1451. "\n" == d.charAt(a) || "\t" == d.charAt(a) || "\r" == d.charAt(a) || " " == d.charAt(a);) a++;
  1452. 0 != a && (d = d.substring(a, d.length));
  1453. this._isSupportDOMParser ?
  1454. a = this._parser.parseFromString(d, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(d));
  1455. null == a && b.Logger.infoWithErrorId(1015);
  1456. return a
  1457. };
  1458. a._instance = null;
  1459. return a
  1460. }(b.HashObject);
  1461. b.SAXParser = c;
  1462. c.prototype.__class__ = "egret.SAXParser"
  1463. })(egret || (egret = {}));
  1464. __extends = this.__extends || function(b, c) {
  1465. function e() {
  1466. this.constructor = b
  1467. }
  1468. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1469. e.prototype = c.prototype;
  1470. b.prototype = new e
  1471. };
  1472. (function(b) {
  1473. var c = function(d) {
  1474. function l() {
  1475. d.call(this);
  1476. this._designHeight = this._designWidth = 0;
  1477. this._scaleY = this._scaleX = 1;
  1478. this._stageHeight = this._stageWidth = this._offSetY = 0
  1479. }
  1480. __extends(l, d);
  1481. l.getInstance = function() {
  1482. null == l.instance && (a.initialize(), l.instance = new l);
  1483. return l.instance
  1484. };
  1485. l.prototype.setDesignSize = function(d, a, l) {
  1486. this._designWidth = d;
  1487. this._designHeight = a;
  1488. l && (b.Logger.warningWithErrorId(1001), this._setResolutionPolicy(l))
  1489. };
  1490. l.prototype._setResolutionPolicy = function(d) {
  1491. this._resolutionPolicy =
  1492. d;
  1493. d.init(this);
  1494. d._apply(this, this._designWidth, this._designHeight)
  1495. };
  1496. l.prototype.getScaleX = function() {
  1497. return this._scaleX
  1498. };
  1499. l.prototype.getScaleY = function() {
  1500. return this._scaleY
  1501. };
  1502. l.prototype.getOffSetY = function() {
  1503. return this._offSetY
  1504. };
  1505. l.canvas_name = "egretCanvas";
  1506. l.canvas_div_name = "gameDiv";
  1507. return l
  1508. }(b.HashObject);
  1509. b.StageDelegate = c;
  1510. c.prototype.__class__ = "egret.StageDelegate";
  1511. var e = function() {
  1512. function d(a, l) {
  1513. this._containerStrategy = a;
  1514. this._contentStrategy = l
  1515. }
  1516. d.prototype.init = function(d) {
  1517. this._containerStrategy.init(d);
  1518. this._contentStrategy.init(d)
  1519. };
  1520. d.prototype._apply = function(d, a, l) {
  1521. this._containerStrategy._apply(d, a, l);
  1522. this._contentStrategy._apply(d, a, l)
  1523. };
  1524. return d
  1525. }();
  1526. b.ResolutionPolicy = e;
  1527. e.prototype.__class__ = "egret.ResolutionPolicy";
  1528. var a = function() {
  1529. function a() {}
  1530. a.initialize = function() {
  1531. a.EQUAL_TO_FRAME = new d
  1532. };
  1533. a.prototype.init = function(d) {};
  1534. a.prototype._apply = function(d, a, l) {};
  1535. a.prototype._setupContainer = function() {
  1536. var d = document.body,
  1537. a;
  1538. d && (a = d.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight ||
  1539. "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")
  1540. };
  1541. return a
  1542. }();
  1543. b.ContainerStrategy = a;
  1544. a.prototype.__class__ = "egret.ContainerStrategy";
  1545. var d = function(d) {
  1546. function a() {
  1547. d.apply(this, arguments)
  1548. }
  1549. __extends(a,
  1550. d);
  1551. a.prototype._apply = function(d) {
  1552. this._setupContainer()
  1553. };
  1554. return a
  1555. }(a);
  1556. b.EqualToFrame = d;
  1557. d.prototype.__class__ = "egret.EqualToFrame";
  1558. e = function() {
  1559. function d() {}
  1560. d.prototype.init = function(d) {};
  1561. d.prototype._apply = function(d, a, l) {};
  1562. d.prototype.setEgretSize = function(d, a, l, m, e, p) {
  1563. void 0 === p && (p = 0);
  1564. b.StageDelegate.getInstance()._stageWidth = Math.round(d);
  1565. b.StageDelegate.getInstance()._stageHeight = Math.round(a);
  1566. d = document.getElementById(c.canvas_div_name);
  1567. d.style.width = l + "px";
  1568. d.style.height = m + "px";
  1569. d.style.top =
  1570. p + "px"
  1571. };
  1572. d.prototype._getClientWidth = function() {
  1573. return document.documentElement.clientWidth
  1574. };
  1575. d.prototype._getClientHeight = function() {
  1576. return document.documentElement.clientHeight
  1577. };
  1578. return d
  1579. }();
  1580. b.ContentStrategy = e;
  1581. e.prototype.__class__ = "egret.ContentStrategy";
  1582. var l = function(d) {
  1583. function a(l) {
  1584. void 0 === l && (l = 0);
  1585. d.call(this);
  1586. this.minWidth = NaN;
  1587. this.minWidth = l
  1588. }
  1589. __extends(a, d);
  1590. a.prototype._apply = function(d, a, l) {
  1591. a = this._getClientWidth();
  1592. var b = this._getClientHeight(),
  1593. m = b / l,
  1594. e = a / m,
  1595. c = 1;
  1596. 0 != this.minWidth && (c = Math.min(1,
  1597. e / this.minWidth));
  1598. this.setEgretSize(e / c, l, a, b * c);
  1599. d._scaleX = m * c;
  1600. d._scaleY = m * c
  1601. };
  1602. return a
  1603. }(e);
  1604. b.FixedHeight = l;
  1605. l.prototype.__class__ = "egret.FixedHeight";
  1606. l = function(d) {
  1607. function a(l) {
  1608. void 0 === l && (l = 0);
  1609. d.call(this);
  1610. this.minHeight = NaN;
  1611. this.minHeight = l
  1612. }
  1613. __extends(a, d);
  1614. a.prototype._apply = function(d, a, l) {
  1615. l = this._getClientWidth();
  1616. var b = this._getClientHeight(),
  1617. m = l / a,
  1618. e = b / m,
  1619. c = 1;
  1620. 0 != this.minHeight && (c = Math.min(1, e / this.minHeight));
  1621. this.setEgretSize(a, e / c, l * c, b, l * (1 - c) / 2);
  1622. d._scaleX = m * c;
  1623. d._scaleY = m * c
  1624. };
  1625. return a
  1626. }(e);
  1627. b.FixedWidth =
  1628. l;
  1629. l.prototype.__class__ = "egret.FixedWidth";
  1630. l = function(d) {
  1631. function a(l, b) {
  1632. d.call(this);
  1633. this.width = l;
  1634. this.height = b
  1635. }
  1636. __extends(a, d);
  1637. a.prototype._apply = function(d, a, l) {
  1638. l = this.width;
  1639. var b = this.height,
  1640. m = l / a;
  1641. this.setEgretSize(a, b / m, l, b);
  1642. d._scaleX = m;
  1643. d._scaleY = m
  1644. };
  1645. return a
  1646. }(e);
  1647. b.FixedSize = l;
  1648. l.prototype.__class__ = "egret.FixedSize";
  1649. l = function(d) {
  1650. function a() {
  1651. d.call(this)
  1652. }
  1653. __extends(a, d);
  1654. a.prototype._apply = function(d, a, l) {
  1655. this.setEgretSize(a, l, a, l, Math.floor((a - a) / 2));
  1656. d._scaleX = 1;
  1657. d._scaleY = 1
  1658. };
  1659. return a
  1660. }(e);
  1661. b.NoScale =
  1662. l;
  1663. l.prototype.__class__ = "egret.NoScale";
  1664. l = function(d) {
  1665. function a() {
  1666. d.call(this)
  1667. }
  1668. __extends(a, d);
  1669. a.prototype._apply = function(d, a, l) {
  1670. var b = this._getClientWidth(),
  1671. m = this._getClientHeight(),
  1672. e = b,
  1673. c = m,
  1674. k = e / a < c / l ? e / a : c / l,
  1675. e = a * k,
  1676. c = l * k,
  1677. b = Math.floor((b - e) / 2);
  1678. d._offSetY = Math.floor((m - c) / 2);
  1679. this.setEgretSize(a, l / 1, 1 * e, c, b, d._offSetY);
  1680. d._scaleX = 1 * k;
  1681. d._scaleY = 1 * k
  1682. };
  1683. return a
  1684. }(e);
  1685. b.ShowAll = l;
  1686. l.prototype.__class__ = "egret.ShowAll";
  1687. e = function(d) {
  1688. function a() {
  1689. d.call(this)
  1690. }
  1691. __extends(a, d);
  1692. a.prototype._apply = function(d, a, l) {
  1693. var b =
  1694. this._getClientWidth(),
  1695. m = this._getClientHeight(),
  1696. b = b / a,
  1697. m = m / l;
  1698. this.setEgretSize(a, l, a * b, l * m);
  1699. d._scaleX = b;
  1700. d._scaleY = m
  1701. };
  1702. return a
  1703. }(e);
  1704. b.FullScreen = e;
  1705. e.prototype.__class__ = "egret.FullScreen"
  1706. })(egret || (egret = {}));
  1707. __extends = this.__extends || function(b, c) {
  1708. function e() {
  1709. this.constructor = b
  1710. }
  1711. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1712. e.prototype = c.prototype;
  1713. b.prototype = new e
  1714. };
  1715. (function(b) {
  1716. var c = function(e) {
  1717. function a() {
  1718. e.call(this);
  1719. this._originalData = {};
  1720. this._drawAreaList = []
  1721. }
  1722. __extends(a, e);
  1723. a.getInstance = function() {
  1724. null == a.instance && (a.instance = new a);
  1725. return a.instance
  1726. };
  1727. a.prototype.addDrawArea = function(d) {
  1728. this._drawAreaList.push(d)
  1729. };
  1730. a.prototype.clearDrawArea = function() {
  1731. this._drawAreaList = []
  1732. };
  1733. a.prototype.drawImage = function(d, l, m, e, c, f, h, n, p, q, r) {
  1734. void 0 === r && (r = void 0);
  1735. h = h || 0;
  1736. n = n || 0;
  1737. var t = l._texture_to_render;
  1738. if (null != t && 0 != f && 0 != c && 0 != p && 0 != q) {
  1739. var s = b.MainContext.instance.rendererContext._texture_scale_factor;
  1740. c /= s;
  1741. f /= s;
  1742. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1743. s = b.DisplayObject.getTransformBounds(l._getSize(a.identityRectangle), l._worldTransform);
  1744. l._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1745. s = this._originalData;
  1746. s.sourceX = m;
  1747. s.sourceY = e;
  1748. s.sourceWidth = c;
  1749. s.sourceHeight = f;
  1750. s.destX = h;
  1751. s.destY = n;
  1752. s.destWidth = p;
  1753. s.destHeight = q;
  1754. for (var u = this.getDrawAreaList(), w = 0; w < u.length; w++)
  1755. if (!this.ignoreRender(l, u[w], s.destX, s.destY)) {
  1756. d.drawImage(t, m, e, c, f, h, n, p, q, r);
  1757. break
  1758. }
  1759. } else d.drawImage(t, m, e, c, f, h, n, p, q, r)
  1760. }
  1761. };
  1762. a.prototype.ignoreRender = function(d, a, b, e) {
  1763. var c = d._worldBounds;
  1764. b *= d._worldTransform.a;
  1765. e *= d._worldTransform.d;
  1766. return c.x + c.width + b <= a.x || c.x + b >= a.x + a.width || c.y + c.height + e <= a.y || c.y + e >= a.y + a.height ? !0 : !1
  1767. };
  1768. a.prototype.getDrawAreaList = function() {
  1769. var d;
  1770. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  1771. this.onResize, this)), d = this._defaultDrawAreaList) : d = this._drawAreaList;
  1772. return d
  1773. };
  1774. a.prototype.onResize = function() {
  1775. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1776. this._defaultDrawAreaList = null
  1777. };
  1778. a.identityRectangle = new b.Rectangle;
  1779. return a
  1780. }(b.HashObject);
  1781. b.RenderFilter = c;
  1782. c.prototype.__class__ = "egret.RenderFilter"
  1783. })(egret || (egret = {}));
  1784. (function(b) {
  1785. var c = function() {
  1786. function e() {}
  1787. e.mapClass = function(a, d, l) {
  1788. void 0 === l && (l = "");
  1789. a = this.getKey(a) + "#" + l;
  1790. this.mapClassDic[a] = d
  1791. };
  1792. e.getKey = function(a) {
  1793. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1794. };
  1795. e.mapValue = function(a, d, l) {
  1796. void 0 === l && (l = "");
  1797. a = this.getKey(a) + "#" + l;
  1798. this.mapValueDic[a] = d
  1799. };
  1800. e.hasMapRule = function(a, d) {
  1801. void 0 === d && (d = "");
  1802. var l = this.getKey(a) + "#" + d;
  1803. return this.mapValueDic[l] || this.mapClassDic[l] ? !0 : !1
  1804. };
  1805. e.getInstance = function(a, d) {
  1806. void 0 === d && (d = "");
  1807. var l = this.getKey(a) + "#" +
  1808. d;
  1809. if (this.mapValueDic[l]) return this.mapValueDic[l];
  1810. var m = this.mapClassDic[l];
  1811. if (m) return m = new m, this.mapValueDic[l] = m, delete this.mapClassDic[l], m;
  1812. throw Error(b.getString(1028, l));
  1813. };
  1814. e.mapClassDic = {};
  1815. e.mapValueDic = {};
  1816. return e
  1817. }();
  1818. b.Injector = c;
  1819. c.prototype.__class__ = "egret.Injector"
  1820. })(egret || (egret = {}));
  1821. (function(b) {
  1822. var c = function() {
  1823. return function() {
  1824. this.type = null
  1825. }
  1826. }();
  1827. b.Filter = c;
  1828. c.prototype.__class__ = "egret.Filter"
  1829. })(egret || (egret = {}));
  1830. __extends = this.__extends || function(b, c) {
  1831. function e() {
  1832. this.constructor = b
  1833. }
  1834. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1835. e.prototype = c.prototype;
  1836. b.prototype = new e
  1837. };
  1838. (function(b) {
  1839. var c = function(b) {
  1840. function a(d, a) {
  1841. b.call(this);
  1842. this.blurX = d;
  1843. this.blurY = a;
  1844. this.type = "blur"
  1845. }
  1846. __extends(a, b);
  1847. return a
  1848. }(b.Filter);
  1849. b.BlurFilter = c;
  1850. c.prototype.__class__ = "egret.BlurFilter"
  1851. })(egret || (egret = {}));
  1852. (function(b) {
  1853. var c = function() {
  1854. function b() {}
  1855. b.NORMAL = "normal";
  1856. b.ADD = "add";
  1857. b.ERASE = "erase";
  1858. b.ERASE_REVERSE = "erase_reverse";
  1859. return b
  1860. }();
  1861. b.BlendMode = c;
  1862. c.prototype.__class__ = "egret.BlendMode"
  1863. })(egret || (egret = {}));
  1864. __extends = this.__extends || function(b, c) {
  1865. function e() {
  1866. this.constructor = b
  1867. }
  1868. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1869. e.prototype = c.prototype;
  1870. b.prototype = new e
  1871. };
  1872. (function(b) {
  1873. var c = function(e) {
  1874. function a() {
  1875. e.call(this);
  1876. this.__hack_local_matrix = null;
  1877. this._sizeDirty = this._normalDirty = !0;
  1878. this._parent = this._texture_to_render = this.name = this._sizeChangeCallTarget = this._sizeChangeCallBack = null;
  1879. this._y = this._x = 0;
  1880. this._scaleY = this._scaleX = 1;
  1881. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1882. this._visible = !0;
  1883. this._rotation = 0;
  1884. this._alpha = 1;
  1885. this._skewY = this._skewX = 0;
  1886. this._touchEnabled = !1;
  1887. this._scrollRect = this.blendMode = null;
  1888. this._explicitHeight = this._explicitWidth =
  1889. NaN;
  1890. this._hasHeightSet = this._hasWidthSet = !1;
  1891. this._worldBounds = this.mask = null;
  1892. this.worldAlpha = 1;
  1893. this.needDraw = this._isContainer = !1;
  1894. this._hitTestPointTexture = null;
  1895. this._rectH = this._rectW = 0;
  1896. this._stage = null;
  1897. this._cacheAsBitmap = !1;
  1898. this.renderTexture = null;
  1899. this._cacheDirty = !1;
  1900. this._filter = this._colorTransform = null;
  1901. this._worldTransform = new b.Matrix;
  1902. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1903. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1904. }
  1905. __extends(a, e);
  1906. a.prototype._setDirty = function() {
  1907. this._normalDirty = !0
  1908. };
  1909. a.prototype.getDirty =
  1910. function() {
  1911. return this._normalDirty || this._sizeDirty
  1912. };
  1913. a.prototype._setParentSizeDirty = function() {
  1914. var d = this._parent;
  1915. !d || d._hasWidthSet || d._hasHeightSet || d._setSizeDirty()
  1916. };
  1917. a.prototype._setSizeDirty = function() {
  1918. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == this._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
  1919. };
  1920. a.prototype._clearDirty = function() {
  1921. this._normalDirty = !1
  1922. };
  1923. a.prototype._clearSizeDirty = function() {
  1924. this._sizeDirty = !1
  1925. };
  1926. Object.defineProperty(a.prototype, "parent", {
  1927. get: function() {
  1928. return this._parent
  1929. },
  1930. enumerable: !0,
  1931. configurable: !0
  1932. });
  1933. a.prototype._parentChanged = function(d) {
  1934. this._parent = d
  1935. };
  1936. Object.defineProperty(a.prototype, "x", {
  1937. get: function() {
  1938. return this._x
  1939. },
  1940. set: function(d) {
  1941. this._setX(d)
  1942. },
  1943. enumerable: !0,
  1944. configurable: !0
  1945. });
  1946. a.prototype._setX = function(d) {
  1947. b.NumberUtils.isNumber(d) && this._x != d && (this._x = d, this._setDirty(),
  1948. this._setParentSizeDirty())
  1949. };
  1950. Object.defineProperty(a.prototype, "y", {
  1951. get: function() {
  1952. return this._y
  1953. },
  1954. set: function(d) {
  1955. this._setY(d)
  1956. },
  1957. enumerable: !0,
  1958. configurable: !0
  1959. });
  1960. a.prototype._setY = function(d) {
  1961. b.NumberUtils.isNumber(d) && this._y != d && (this._y = d, this._setDirty(), this._setParentSizeDirty())
  1962. };
  1963. Object.defineProperty(a.prototype, "scaleX", {
  1964. get: function() {
  1965. return this._scaleX
  1966. },
  1967. set: function(d) {
  1968. b.NumberUtils.isNumber(d) && this._scaleX != d && (this._scaleX = d, this._setDirty(), this._setParentSizeDirty())
  1969. },
  1970. enumerable: !0,
  1971. configurable: !0
  1972. });
  1973. Object.defineProperty(a.prototype, "scaleY", {
  1974. get: function() {
  1975. return this._scaleY
  1976. },
  1977. set: function(d) {
  1978. b.NumberUtils.isNumber(d) && this._scaleY != d && (this._scaleY = d, this._setDirty(), this._setParentSizeDirty())
  1979. },
  1980. enumerable: !0,
  1981. configurable: !0
  1982. });
  1983. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1984. get: function() {
  1985. return this._anchorOffsetX
  1986. },
  1987. set: function(d) {
  1988. b.NumberUtils.isNumber(d) && this._anchorOffsetX != d && (this._anchorOffsetX = d, this._setDirty(), this._setParentSizeDirty())
  1989. },
  1990. enumerable: !0,
  1991. configurable: !0
  1992. });
  1993. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1994. get: function() {
  1995. return this._anchorOffsetY
  1996. },
  1997. set: function(d) {
  1998. b.NumberUtils.isNumber(d) && this._anchorOffsetY != d && (this._anchorOffsetY = d, this._setDirty(), this._setParentSizeDirty())
  1999. },
  2000. enumerable: !0,
  2001. configurable: !0
  2002. });
  2003. Object.defineProperty(a.prototype, "anchorX", {
  2004. get: function() {
  2005. return this._anchorX
  2006. },
  2007. set: function(d) {
  2008. this._setAnchorX(d)
  2009. },
  2010. enumerable: !0,
  2011. configurable: !0
  2012. });
  2013. a.prototype._setAnchorX = function(d) {
  2014. b.NumberUtils.isNumber(d) && this._anchorX != d && (this._anchorX =
  2015. d, this._setDirty(), this._setParentSizeDirty())
  2016. };
  2017. Object.defineProperty(a.prototype, "anchorY", {
  2018. get: function() {
  2019. return this._anchorY
  2020. },
  2021. set: function(d) {
  2022. this._setAnchorY(d)
  2023. },
  2024. enumerable: !0,
  2025. configurable: !0
  2026. });
  2027. a.prototype._setAnchorY = function(d) {
  2028. b.NumberUtils.isNumber(d) && this._anchorY != d && (this._anchorY = d, this._setDirty(), this._setParentSizeDirty())
  2029. };
  2030. Object.defineProperty(a.prototype, "visible", {
  2031. get: function() {
  2032. return this._visible
  2033. },
  2034. set: function(d) {
  2035. this._setVisible(d)
  2036. },
  2037. enumerable: !0,
  2038. configurable: !0
  2039. });
  2040. a.prototype._setVisible =
  2041. function(d) {
  2042. this._visible != d && (this._visible = d, this._setSizeDirty())
  2043. };
  2044. Object.defineProperty(a.prototype, "rotation", {
  2045. get: function() {
  2046. return this._rotation
  2047. },
  2048. set: function(d) {
  2049. b.NumberUtils.isNumber(d) && this._rotation != d && (this._rotation = d, this._setDirty(), this._setParentSizeDirty())
  2050. },
  2051. enumerable: !0,
  2052. configurable: !0
  2053. });
  2054. Object.defineProperty(a.prototype, "alpha", {
  2055. get: function() {
  2056. return this._alpha
  2057. },
  2058. set: function(d) {
  2059. b.NumberUtils.isNumber(d) && this._alpha != d && (this._alpha = d, this._setDirty(), this._setCacheDirty())
  2060. },
  2061. enumerable: !0,
  2062. configurable: !0
  2063. });
  2064. Object.defineProperty(a.prototype, "skewX", {
  2065. get: function() {
  2066. return this._skewX
  2067. },
  2068. set: function(d) {
  2069. b.NumberUtils.isNumber(d) && this._skewX != d && (this._skewX = d, this._setDirty(), this._setParentSizeDirty())
  2070. },
  2071. enumerable: !0,
  2072. configurable: !0
  2073. });
  2074. Object.defineProperty(a.prototype, "skewY", {
  2075. get: function() {
  2076. return this._skewY
  2077. },
  2078. set: function(d) {
  2079. b.NumberUtils.isNumber(d) && this._skewY != d && (this._skewY = d, this._setDirty(), this._setParentSizeDirty())
  2080. },
  2081. enumerable: !0,
  2082. configurable: !0
  2083. });
  2084. Object.defineProperty(a.prototype,
  2085. "touchEnabled", {
  2086. get: function() {
  2087. return this._touchEnabled
  2088. },
  2089. set: function(d) {
  2090. this._setTouchEnabled(d)
  2091. },
  2092. enumerable: !0,
  2093. configurable: !0
  2094. });
  2095. a.prototype._setTouchEnabled = function(d) {
  2096. this._touchEnabled = d
  2097. };
  2098. Object.defineProperty(a.prototype, "scrollRect", {
  2099. get: function() {
  2100. return this._scrollRect
  2101. },
  2102. set: function(d) {
  2103. this._setScrollRect(d)
  2104. },
  2105. enumerable: !0,
  2106. configurable: !0
  2107. });
  2108. a.prototype._setScrollRect = function(d) {
  2109. this._scrollRect = d;
  2110. this._setSizeDirty()
  2111. };
  2112. Object.defineProperty(a.prototype, "measuredWidth", {
  2113. get: function() {
  2114. return this._measureBounds().width
  2115. },
  2116. enumerable: !0,
  2117. configurable: !0
  2118. });
  2119. Object.defineProperty(a.prototype, "measuredHeight", {
  2120. get: function() {
  2121. return this._measureBounds().height
  2122. },
  2123. enumerable: !0,
  2124. configurable: !0
  2125. });
  2126. Object.defineProperty(a.prototype, "explicitWidth", {
  2127. get: function() {
  2128. return this._explicitWidth
  2129. },
  2130. enumerable: !0,
  2131. configurable: !0
  2132. });
  2133. Object.defineProperty(a.prototype, "explicitHeight", {
  2134. get: function() {
  2135. return this._explicitHeight
  2136. },
  2137. enumerable: !0,
  2138. configurable: !0
  2139. });
  2140. Object.defineProperty(a.prototype, "width", {
  2141. get: function() {
  2142. return this._getWidth()
  2143. },
  2144. set: function(d) {
  2145. this._setWidth(d)
  2146. },
  2147. enumerable: !0,
  2148. configurable: !0
  2149. });
  2150. a.prototype._getWidth = function() {
  2151. return this._getSize(b.Rectangle.identity).width
  2152. };
  2153. Object.defineProperty(a.prototype, "height", {
  2154. get: function() {
  2155. return this._getHeight()
  2156. },
  2157. set: function(d) {
  2158. this._setHeight(d)
  2159. },
  2160. enumerable: !0,
  2161. configurable: !0
  2162. });
  2163. a.prototype._getHeight = function() {
  2164. return this._getSize(b.Rectangle.identity).height
  2165. };
  2166. a.prototype._setWidth = function(d) {
  2167. this._setSizeDirty();
  2168. this._setCacheDirty();
  2169. this._explicitWidth = d;
  2170. this._hasWidthSet =
  2171. b.NumberUtils.isNumber(d)
  2172. };
  2173. a.prototype._setHeight = function(d) {
  2174. this._setSizeDirty();
  2175. this._setCacheDirty();
  2176. this._explicitHeight = d;
  2177. this._hasHeightSet = b.NumberUtils.isNumber(d)
  2178. };
  2179. a.prototype._draw = function(d) {
  2180. if (this._visible && !this.drawCacheTexture(d)) {
  2181. var a = b.MainContext.__use_new_draw && this._isContainer;
  2182. this._filter && !a && d.setGlobalFilter(this._filter);
  2183. this._colorTransform && !a && d.setGlobalColorTransform(this._colorTransform.matrix);
  2184. d.setAlpha(this.worldAlpha, this.blendMode);
  2185. d.setTransform(this._worldTransform);
  2186. var m = this.mask || this._scrollRect;
  2187. m && !a && d.pushMask(m);
  2188. this._render(d);
  2189. m && !a && d.popMask();
  2190. this._colorTransform && !a && d.setGlobalColorTransform(null);
  2191. this._filter && !a && d.setGlobalFilter(null)
  2192. }
  2193. this.destroyCacheBounds()
  2194. };
  2195. a.prototype._setGlobalFilter = function(d) {
  2196. d.setGlobalFilter(this._filter)
  2197. };
  2198. a.prototype._removeGlobalFilter = function(d) {
  2199. d.setGlobalFilter(null)
  2200. };
  2201. a.prototype._setGlobalColorTransform = function(d) {
  2202. d.setGlobalColorTransform(this._colorTransform.matrix)
  2203. };
  2204. a.prototype._removeGlobalColorTransform =
  2205. function(d) {
  2206. d.setGlobalColorTransform(null)
  2207. };
  2208. a.prototype._pushMask = function(d) {
  2209. d.setTransform(this._worldTransform);
  2210. var a = this.mask || this._scrollRect;
  2211. a && d.pushMask(a)
  2212. };
  2213. a.prototype._popMask = function(d) {
  2214. d.popMask()
  2215. };
  2216. a.prototype.drawCacheTexture = function(d) {
  2217. if (!1 == this._cacheAsBitmap) return !1;
  2218. var a = this.getBounds(b.Rectangle.identity),
  2219. m = b.MainContext.instance.rendererContext._texture_scale_factor;
  2220. if (this._cacheDirty || null == this._texture_to_render || Math.round(a.width) != Math.round(this._texture_to_render._sourceWidth *
  2221. m) || Math.round(a.height) != Math.round(this._texture_to_render._sourceHeight * m)) this._cacheDirty = !this._makeBitmapCache();
  2222. if (null == this._texture_to_render) return !1;
  2223. var e = this._texture_to_render,
  2224. a = e._offsetX,
  2225. m = e._offsetY,
  2226. c = e._textureWidth,
  2227. e = e._textureHeight;
  2228. this._updateTransform();
  2229. d.setAlpha(this.worldAlpha, this.blendMode);
  2230. d.setTransform(this._worldTransform);
  2231. b.RenderFilter.getInstance().drawImage(d, this, 0, 0, c, e, a, m, c, e);
  2232. return !0
  2233. };
  2234. a.prototype._updateTransform = function() {
  2235. this._visible && (this._calculateWorldTransform(),
  2236. "updateTransform" == b.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || this._cacheAsBitmap) && b.RenderCommand.push(this._draw, this))
  2237. };
  2238. a.prototype._calculateWorldTransform = function() {
  2239. var d = this._worldTransform,
  2240. a = this._parent;
  2241. d.identityMatrix(a._worldTransform);
  2242. this._getMatrix(d);
  2243. var b = this._scrollRect;
  2244. b && d.append(1, 0, 0, 1, -b.x, -b.y);
  2245. this.worldAlpha = a.worldAlpha * this._alpha
  2246. };
  2247. a.prototype._render = function(d) {};
  2248. a.prototype.getBounds = function(d, a) {
  2249. void 0 === a && (a = !0);
  2250. var m = this._measureBounds(),
  2251. e = this._hasWidthSet ? this._explicitWidth : m.width,
  2252. c = this._hasHeightSet ? this._explicitHeight : m.height;
  2253. this._rectW = m.width;
  2254. this._rectH = m.height;
  2255. this._clearSizeDirty();
  2256. var f = m.x,
  2257. m = m.y,
  2258. h = 0,
  2259. n = 0;
  2260. a && (0 != this._anchorX || 0 != this._anchorY ? (h = e * this._anchorX, n = c * this._anchorY) : (h = this._anchorOffsetX, n = this._anchorOffsetY));
  2261. this._cacheBounds.initialize(f - h, m - n, e, c);
  2262. e = this._cacheBounds;
  2263. d || (d = new b.Rectangle);
  2264. return d.initialize(e.x, e.y, e.width, e.height)
  2265. };
  2266. a.prototype.destroyCacheBounds = function() {
  2267. this._cacheBounds.x =
  2268. 0;
  2269. this._cacheBounds.y = 0;
  2270. this._cacheBounds.width = 0;
  2271. this._cacheBounds.height = 0
  2272. };
  2273. a.prototype._getConcatenatedMatrix = function() {
  2274. for (var d = a.identityMatrixForGetConcatenated.identity(), l = this; null != l;) {
  2275. if (0 != l._anchorX || 0 != l._anchorY) {
  2276. var m = l._getSize(b.Rectangle.identity);
  2277. d.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, m.width * l._anchorX, m.height * l._anchorY)
  2278. } else d.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
  2279. l._scrollRect && d.prepend(1, 0, 0, 1, -l._scrollRect.x, -l._scrollRect.y);
  2280. l = l._parent
  2281. }
  2282. return d
  2283. };
  2284. a.prototype.localToGlobal = function(d, a, m) {
  2285. void 0 === d && (d = 0);
  2286. void 0 === a && (a = 0);
  2287. var e = this._getConcatenatedMatrix();
  2288. e.append(1, 0, 0, 1, d, a);
  2289. m || (m = new b.Point);
  2290. m.x = e.tx;
  2291. m.y = e.ty;
  2292. return m
  2293. };
  2294. a.prototype.globalToLocal = function(d, a, m) {
  2295. void 0 === d && (d = 0);
  2296. void 0 === a && (a = 0);
  2297. var e = this._getConcatenatedMatrix();
  2298. e.invert();
  2299. e.append(1, 0, 0, 1, d, a);
  2300. m || (m = new b.Point);
  2301. m.x = e.tx;
  2302. m.y = e.ty;
  2303. return m
  2304. };
  2305. a.prototype.hitTest = function(d, a, m) {
  2306. void 0 ===
  2307. m && (m = !1);
  2308. if (!this._visible || !m && !this._touchEnabled) return null;
  2309. m = this.getBounds(b.Rectangle.identity, !1);
  2310. d -= m.x;
  2311. a -= m.y;
  2312. return 0 <= d && d < m.width && 0 <= a && a < m.height ? this.mask || this._scrollRect ? this._scrollRect && d > this._scrollRect.x && a > this._scrollRect.y && d < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= d && d < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
  2313. };
  2314. a.prototype.hitTestPoint = function(d,
  2315. a, m) {
  2316. d = this.globalToLocal(d, a);
  2317. return m ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), m = this._hitTestPointTexture, m.drawToTexture(this), 0 != m.getPixel32(d.x - this._hitTestPointTexture._offsetX, d.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(d.x, d.y, !0)
  2318. };
  2319. a.prototype._getMatrix = function(d) {
  2320. d || (d = b.Matrix.identity.identity());
  2321. var a, m;
  2322. m = this._getOffsetPoint();
  2323. a = m.x;
  2324. m = m.y;
  2325. var e = this.__hack_local_matrix;
  2326. e ? (d.append(e.a, e.b, e.c, e.d, e.tx, e.ty), d.append(1, 0, 0, 1, -a, -m)) : d.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, m);
  2327. return d
  2328. };
  2329. a.prototype._getSize = function(d) {
  2330. if (this._hasHeightSet && this._hasWidthSet) return this._clearSizeDirty(), d.initialize(0, 0, this._explicitWidth, this._explicitHeight);
  2331. this._measureSize(d);
  2332. this._hasWidthSet && (d.width = this._explicitWidth);
  2333. this._hasHeightSet && (d.height = this._explicitHeight);
  2334. return d
  2335. };
  2336. a.prototype._measureSize = function(d) {
  2337. this._sizeDirty ? (d = this._measureBounds(), this._rectW =
  2338. d.width, this._rectH = d.height, this._clearSizeDirty()) : (d.width = this._rectW, d.height = this._rectH);
  2339. d.x = 0;
  2340. d.y = 0;
  2341. return d
  2342. };
  2343. a.prototype._measureBounds = function() {
  2344. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2345. };
  2346. a.prototype._getOffsetPoint = function() {
  2347. var d = this._anchorOffsetX,
  2348. a = this._anchorOffsetY;
  2349. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity), d = this._anchorX * a.width, a = this._anchorY * a.height;
  2350. var m = b.Point.identity;
  2351. m.x = d;
  2352. m.y = a;
  2353. return m
  2354. };
  2355. a.prototype._onAddToStage = function() {
  2356. this._stage =
  2357. b.MainContext.instance.stage;
  2358. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2359. };
  2360. a.prototype._onRemoveFromStage = function() {
  2361. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2362. };
  2363. Object.defineProperty(a.prototype, "stage", {
  2364. get: function() {
  2365. return this._stage
  2366. },
  2367. enumerable: !0,
  2368. configurable: !0
  2369. });
  2370. a.prototype.addEventListener = function(d, l, m, c, g) {
  2371. void 0 === c && (c = !1);
  2372. void 0 === g && (g = 0);
  2373. e.prototype.addEventListener.call(this, d, l, m, c, g);
  2374. ((c = d == b.Event.ENTER_FRAME) || d == b.Event.RENDER) && this._insertEventBin(c ?
  2375. a._enterFrameCallBackList : a._renderCallBackList, l, m, g, this)
  2376. };
  2377. a.prototype.removeEventListener = function(d, l, m, c) {
  2378. void 0 === c && (c = !1);
  2379. e.prototype.removeEventListener.call(this, d, l, m, c);
  2380. ((c = d == b.Event.ENTER_FRAME) || d == b.Event.RENDER) && this._removeEventBin(c ? a._enterFrameCallBackList : a._renderCallBackList, l, m, this)
  2381. };
  2382. a.prototype.dispatchEvent = function(d) {
  2383. if (!d._bubbles) return e.prototype.dispatchEvent.call(this, d);
  2384. for (var a = [], b = this; b;) a.push(b), b = b._parent;
  2385. d._reset();
  2386. this._dispatchPropagationEvent(d, a);
  2387. return !d._isDefaultPrevented
  2388. };
  2389. a.prototype._dispatchPropagationEvent = function(d, a, b) {
  2390. b = a.length;
  2391. for (var e = 1, c = b - 1; 0 <= c; c--) {
  2392. var f = a[c];
  2393. d._currentTarget = f;
  2394. d._target = this;
  2395. d._eventPhase = e;
  2396. f._notifyListener(d);
  2397. if (d._isPropagationStopped || d._isPropagationImmediateStopped) return
  2398. }
  2399. f = a[0];
  2400. d._currentTarget = f;
  2401. d._target = this;
  2402. d._eventPhase = 2;
  2403. f._notifyListener(d);
  2404. if (!d._isPropagationStopped && !d._isPropagationImmediateStopped)
  2405. for (e = 3, c = 1; c < b && (f = a[c], d._currentTarget = f, d._target = this, d._eventPhase = e, f._notifyListener(d), !d._isPropagationStopped && !d._isPropagationImmediateStopped); c++);
  2406. };
  2407. a.prototype.willTrigger = function(d) {
  2408. for (var a = this; a;) {
  2409. if (a.hasEventListener(d)) return !0;
  2410. a = a._parent
  2411. }
  2412. return !1
  2413. };
  2414. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2415. get: function() {
  2416. return this._cacheAsBitmap
  2417. },
  2418. set: function(d) {
  2419. (this._cacheAsBitmap = d) ? b.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2420. },
  2421. enumerable: !0,
  2422. configurable: !0
  2423. });
  2424. a.prototype._makeBitmapCache = function() {
  2425. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2426. var d = this.renderTexture.drawToTexture(this);
  2427. this._texture_to_render = d ? this.renderTexture : null;
  2428. return d
  2429. };
  2430. a.prototype._setCacheDirty = function(d) {
  2431. void 0 === d && (d = !0);
  2432. this._cacheDirty = d
  2433. };
  2434. a.getTransformBounds = function(d, a) {
  2435. var b = d.x,
  2436. e = d.y,
  2437. c = d.width,
  2438. f = d.height;
  2439. (b || e) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -e);
  2440. var h = c * a.a,
  2441. c = c * a.b,
  2442. n = f * a.c,
  2443. f = f * a.d,
  2444. p = a.tx,
  2445. q = a.ty,
  2446. r = p,
  2447. t = p,
  2448. s = q,
  2449. u = q;
  2450. (b = h + p) < r ? r = b : b > t && (t = b);
  2451. (b = h + n + p) < r ? r = b : b > t && (t = b);
  2452. (b = n + p) < r ? r = b : b > t && (t = b);
  2453. (e = c + q) < s ? s = e : e > u && (u = e);
  2454. (e = c + f + q) < s ? s = e : e > u && (u = e);
  2455. (e = f +
  2456. q) < s ? s = e : e > u && (u = e);
  2457. return d.initialize(r, s, t - r, u - s)
  2458. };
  2459. Object.defineProperty(a.prototype, "colorTransform", {
  2460. get: function() {
  2461. return this._colorTransform
  2462. },
  2463. set: function(d) {
  2464. this._colorTransform = d
  2465. },
  2466. enumerable: !0,
  2467. configurable: !0
  2468. });
  2469. Object.defineProperty(a.prototype, "filter", {
  2470. get: function() {
  2471. return this._filter
  2472. },
  2473. set: function(d) {
  2474. this._filter = d
  2475. },
  2476. enumerable: !0,
  2477. configurable: !0
  2478. });
  2479. a.identityMatrixForGetConcatenated = new b.Matrix;
  2480. a._enterFrameCallBackList = [];
  2481. a._renderCallBackList = [];
  2482. return a
  2483. }(b.EventDispatcher);
  2484. b.DisplayObject =
  2485. c;
  2486. c.prototype.__class__ = "egret.DisplayObject";
  2487. c = function() {
  2488. function b() {
  2489. this.matrix = null
  2490. }
  2491. b.prototype.updateColor = function(a, d, l, b, e, c, f, h) {};
  2492. return b
  2493. }();
  2494. b.ColorTransform = c;
  2495. c.prototype.__class__ = "egret.ColorTransform"
  2496. })(egret || (egret = {}));
  2497. __extends = this.__extends || function(b, c) {
  2498. function e() {
  2499. this.constructor = b
  2500. }
  2501. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2502. e.prototype = c.prototype;
  2503. b.prototype = new e
  2504. };
  2505. (function(b) {
  2506. var c = function(e) {
  2507. function a() {
  2508. e.call(this);
  2509. this._touchChildren = !0;
  2510. this._children = [];
  2511. this._isContainer = !0
  2512. }
  2513. __extends(a, e);
  2514. Object.defineProperty(a.prototype, "touchChildren", {
  2515. get: function() {
  2516. return this._touchChildren
  2517. },
  2518. set: function(d) {
  2519. this._touchChildren = d
  2520. },
  2521. enumerable: !0,
  2522. configurable: !0
  2523. });
  2524. Object.defineProperty(a.prototype, "numChildren", {
  2525. get: function() {
  2526. return this._children.length
  2527. },
  2528. enumerable: !0,
  2529. configurable: !0
  2530. });
  2531. a.prototype.setChildIndex = function(d, a) {
  2532. this.doSetChildIndex(d, a)
  2533. };
  2534. a.prototype.doSetChildIndex =
  2535. function(d, a) {
  2536. var e = this._children.indexOf(d);
  2537. 0 > e && b.Logger.fatalWithErrorId(1006);
  2538. this._children.splice(e, 1);
  2539. 0 > a || this._children.length <= a ? this._children.push(d) : this._children.splice(a, 0, d)
  2540. };
  2541. a.prototype.addChild = function(d) {
  2542. var a = this._children.length;
  2543. d._parent == this && a--;
  2544. return this._doAddChild(d, a)
  2545. };
  2546. a.prototype.addChildAt = function(d, a) {
  2547. return this._doAddChild(d, a)
  2548. };
  2549. a.prototype._doAddChild = function(d, l, e) {
  2550. void 0 === e && (e = !0);
  2551. if (d == this) return d;
  2552. if (0 > l || l > this._children.length) return b.Logger.fatalWithErrorId(1007),
  2553. d;
  2554. var c = d._parent;
  2555. if (c == this) return this.doSetChildIndex(d, l), d;
  2556. if (c) {
  2557. var g = c._children.indexOf(d);
  2558. 0 <= g && c._doRemoveChild(g)
  2559. }
  2560. this._children.splice(l, 0, d);
  2561. d._parentChanged(this);
  2562. e && d.dispatchEventWith(b.Event.ADDED, !0);
  2563. if (this._stage)
  2564. for (d._onAddToStage(), l = a.__EVENT__ADD_TO_STAGE_LIST; 0 < l.length;) c = l.shift(), e && c.dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2565. d._setDirty();
  2566. this._setSizeDirty();
  2567. return d
  2568. };
  2569. a.prototype.removeChild = function(d) {
  2570. d = this._children.indexOf(d);
  2571. if (0 <= d) return this._doRemoveChild(d);
  2572. b.Logger.fatalWithErrorId(1008);
  2573. return null
  2574. };
  2575. a.prototype.removeChildAt = function(d) {
  2576. if (0 <= d && d < this._children.length) return this._doRemoveChild(d);
  2577. b.Logger.fatalWithErrorId(1007);
  2578. return null
  2579. };
  2580. a.prototype._doRemoveChild = function(d, l) {
  2581. void 0 === l && (l = !0);
  2582. var e = this._children,
  2583. c = e[d];
  2584. l && c.dispatchEventWith(b.Event.REMOVED, !0);
  2585. if (this._stage) {
  2586. c._onRemoveFromStage();
  2587. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2588. var f = g.shift();
  2589. l && f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2590. f._stage = null
  2591. }
  2592. }
  2593. c._parentChanged(null);
  2594. e.splice(d, 1);
  2595. this._setSizeDirty();
  2596. return c
  2597. };
  2598. a.prototype.getChildAt = function(d) {
  2599. if (0 <= d && d < this._children.length) return this._children[d];
  2600. b.Logger.fatalWithErrorId(1007);
  2601. return null
  2602. };
  2603. a.prototype.contains = function(d) {
  2604. for (; d;) {
  2605. if (d == this) return !0;
  2606. d = d._parent
  2607. }
  2608. return !1
  2609. };
  2610. a.prototype.swapChildrenAt = function(d, a) {
  2611. 0 <= d && d < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(d, a) : b.Logger.fatalWithErrorId(1007)
  2612. };
  2613. a.prototype.swapChildren = function(d, a) {
  2614. var e = this._children.indexOf(d),
  2615. c =
  2616. this._children.indexOf(a); - 1 == e || -1 == c ? b.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(e, c)
  2617. };
  2618. a.prototype._swapChildrenAt = function(d, a) {
  2619. if (d != a) {
  2620. var b = this._children,
  2621. e = b[d];
  2622. b[d] = b[a];
  2623. b[a] = e
  2624. }
  2625. };
  2626. a.prototype.getChildIndex = function(d) {
  2627. return this._children.indexOf(d)
  2628. };
  2629. a.prototype.removeChildren = function() {
  2630. for (var d = this._children.length - 1; 0 <= d; d--) this._doRemoveChild(d)
  2631. };
  2632. a.prototype._updateTransform = function() {
  2633. if (this._visible) {
  2634. this._filter && b.RenderCommand.push(this._setGlobalFilter, this);
  2635. this._colorTransform &&
  2636. b.RenderCommand.push(this._setGlobalColorTransform, this);
  2637. var d = this.mask || this._scrollRect;
  2638. d && b.RenderCommand.push(this._pushMask, this);
  2639. e.prototype._updateTransform.call(this);
  2640. if (!this._cacheAsBitmap || !this._texture_to_render)
  2641. for (var a = 0, m = this._children, c = m.length; a < c; a++) m[a]._updateTransform();
  2642. d && b.RenderCommand.push(this._popMask, this);
  2643. this._colorTransform && b.RenderCommand.push(this._removeGlobalColorTransform, this);
  2644. this._filter && b.RenderCommand.push(this._removeGlobalFilter, this)
  2645. }
  2646. };
  2647. a.prototype._render =
  2648. function(d) {
  2649. if (!b.MainContext.__use_new_draw)
  2650. for (var a = 0, e = this._children, c = e.length; a < c; a++) e[a]._draw(d)
  2651. };
  2652. a.prototype._measureBounds = function() {
  2653. for (var d = 0, a = 0, e = 0, c = 0, g = this._children, f = g.length, h = 0; h < f; h++) {
  2654. var n = g[h];
  2655. if (n._visible) {
  2656. var p = n.getBounds(b.Rectangle.identity, !1),
  2657. q = p.x,
  2658. r = p.y,
  2659. t = p.width,
  2660. p = p.height,
  2661. n = n._getMatrix(),
  2662. n = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(q, r, t, p), n),
  2663. q = n.x,
  2664. r = n.y,
  2665. t = n.width + n.x,
  2666. n = n.height + n.y;
  2667. if (q < d || 0 == h) d = q;
  2668. if (t > a || 0 == h) a = t;
  2669. if (r < e || 0 == h) e =
  2670. r;
  2671. if (n > c || 0 == h) c = n
  2672. }
  2673. }
  2674. return b.Rectangle.identity.initialize(d, e, a - d, c - e)
  2675. };
  2676. a.prototype.hitTest = function(d, a, m) {
  2677. void 0 === m && (m = !1);
  2678. var c;
  2679. if (!this._visible) return null;
  2680. if (this._scrollRect) {
  2681. if (d < this._scrollRect.x || a < this._scrollRect.y || d > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2682. } else if (this.mask && (this.mask.x > d || d > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  2683. for (var g = this._children, f = this._touchChildren,
  2684. h = g.length - 1; 0 <= h; h--) {
  2685. var n = g[h],
  2686. p = n._getMatrix(),
  2687. q = n._scrollRect;
  2688. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2689. p.invert();
  2690. p = b.Matrix.transformCoords(p, d, a);
  2691. if (n = n.hitTest(p.x, p.y, !0)) {
  2692. if (!f) return this;
  2693. if (n._touchEnabled && f) return n;
  2694. c = this
  2695. }
  2696. }
  2697. return c ? c : this._texture_to_render ? e.prototype.hitTest.call(this, d, a, m) : null
  2698. };
  2699. a.prototype._onAddToStage = function() {
  2700. e.prototype._onAddToStage.call(this);
  2701. for (var d = this._children.length, a = 0; a < d; a++) this._children[a]._onAddToStage()
  2702. };
  2703. a.prototype._onRemoveFromStage = function() {
  2704. e.prototype._onRemoveFromStage.call(this);
  2705. for (var d = this._children, a = d.length, b = 0; b < a; b++) d[b]._onRemoveFromStage()
  2706. };
  2707. a.prototype.getChildByName = function(d) {
  2708. for (var a = this._children, b = a.length, e, c = 0; c < b; c++)
  2709. if (e = a[c], e.name == d) return e;
  2710. return null
  2711. };
  2712. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2713. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2714. return a
  2715. }(b.DisplayObject);
  2716. b.DisplayObjectContainer = c;
  2717. c.prototype.__class__ = "egret.DisplayObjectContainer"
  2718. })(egret || (egret = {}));
  2719. (function(b) {
  2720. var c = function() {
  2721. function b() {}
  2722. b.NO_BORDER = "noBorder";
  2723. b.NO_SCALE = "noScale";
  2724. b.SHOW_ALL = "showAll";
  2725. b.EXACT_FIT = "exactFit";
  2726. return b
  2727. }();
  2728. b.StageScaleMode = c;
  2729. c.prototype.__class__ = "egret.StageScaleMode"
  2730. })(egret || (egret = {}));
  2731. __extends = this.__extends || function(b, c) {
  2732. function e() {
  2733. this.constructor = b
  2734. }
  2735. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2736. e.prototype = c.prototype;
  2737. b.prototype = new e
  2738. };
  2739. (function(b) {
  2740. var c = function(e) {
  2741. function a(d, a) {
  2742. void 0 === d && (d = 480);
  2743. void 0 === a && (a = 800);
  2744. e.call(this);
  2745. this._changeSizeDispatchFlag = !0;
  2746. this._scaleMode = "";
  2747. this._stageHeight = this._stageWidth = NaN;
  2748. this.touchEnabled = !0;
  2749. this._stage = this;
  2750. this._stageWidth = d;
  2751. this._stageHeight = a
  2752. }
  2753. __extends(a, e);
  2754. a.prototype.invalidate = function() {
  2755. a._invalidateRenderFlag = !0
  2756. };
  2757. Object.defineProperty(a.prototype, "scaleMode", {
  2758. get: function() {
  2759. return this._scaleMode
  2760. },
  2761. set: function(d) {
  2762. this._scaleMode != d && (this._scaleMode = d, this.setResolutionPolicy())
  2763. },
  2764. enumerable: !0,
  2765. configurable: !0
  2766. });
  2767. a.prototype.changeSize = function() {
  2768. this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(b.Event.RESIZE))
  2769. };
  2770. a.prototype.setResolutionPolicy = function() {
  2771. var d = a.SCALE_MODE_ENUM[this._scaleMode];
  2772. if (!d) throw Error(b.getString(1024));
  2773. var l = new b.EqualToFrame,
  2774. d = new b.ResolutionPolicy(l, d);
  2775. b.StageDelegate.getInstance()._setResolutionPolicy(d);
  2776. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2777. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2778. };
  2779. Object.defineProperty(a.prototype, "stageWidth", {
  2780. get: function() {
  2781. return this._stageWidth
  2782. },
  2783. enumerable: !0,
  2784. configurable: !0
  2785. });
  2786. Object.defineProperty(a.prototype, "stageHeight", {
  2787. get: function() {
  2788. return this._stageHeight
  2789. },
  2790. enumerable: !0,
  2791. configurable: !0
  2792. });
  2793. a.prototype.hitTest = function(d, a, e) {
  2794. if (!this._touchEnabled) return null;
  2795. var c;
  2796. if (!this._touchChildren) return this;
  2797. e = this._children;
  2798. for (var g = e.length - 1; 0 <= g; g--) {
  2799. c = e[g];
  2800. var f = c._getMatrix(),
  2801. h = c._scrollRect;
  2802. h && f.append(1, 0, 0, 1, -h.x, -h.y);
  2803. f.invert();
  2804. f = b.Matrix.transformCoords(f,
  2805. d, a);
  2806. if ((c = c.hitTest(f.x, f.y, !0)) && c._touchEnabled) return c
  2807. }
  2808. return this
  2809. };
  2810. a.prototype.getBounds = function(d) {
  2811. d || (d = new b.Rectangle);
  2812. return d.initialize(0, 0, this._stageWidth, this._stageHeight)
  2813. };
  2814. a.prototype._updateTransform = function() {
  2815. for (var d = 0, a = this._children.length; d < a; d++) this._children[d]._updateTransform()
  2816. };
  2817. Object.defineProperty(a.prototype, "focus", {
  2818. get: function() {
  2819. return null
  2820. },
  2821. enumerable: !0,
  2822. configurable: !0
  2823. });
  2824. a.registerScaleMode = function(d, l, e) {
  2825. a.SCALE_MODE_ENUM[d] && !e ? b.Logger.warningWithErrorId(1009,
  2826. d) : a.SCALE_MODE_ENUM[d] = l
  2827. };
  2828. a._invalidateRenderFlag = !1;
  2829. a.SCALE_MODE_ENUM = {};
  2830. return a
  2831. }(b.DisplayObjectContainer);
  2832. b.Stage = c;
  2833. c.prototype.__class__ = "egret.Stage"
  2834. })(egret || (egret = {}));
  2835. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
  2836. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
  2837. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
  2838. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen;
  2839. __extends = this.__extends || function(b, c) {
  2840. function e() {
  2841. this.constructor = b
  2842. }
  2843. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2844. e.prototype = c.prototype;
  2845. b.prototype = new e
  2846. };
  2847. (function(b) {
  2848. var c = function(e) {
  2849. function a(d) {
  2850. void 0 === d && (d = null);
  2851. e.call(this);
  2852. this._lastTouchPosition = new b.Point(0, 0);
  2853. this._touchStartPosition = new b.Point(0, 0);
  2854. this._scrollStarted = !1;
  2855. this._lastTouchTime = 0;
  2856. this._lastTouchEvent = null;
  2857. this._velocitys = [];
  2858. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  2859. this._vScrollTween = this._hScrollTween = null;
  2860. this.scrollBeginThreshold = 10;
  2861. this.scrollSpeed = 1;
  2862. this._content = null;
  2863. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2864. this._scrollTop = this._scrollLeft =
  2865. 0;
  2866. this._vCanScroll = this._hCanScroll = !1;
  2867. this.touchBeginTimer = this.delayTouchBeginEvent = null;
  2868. this.touchEnabled = !0;
  2869. d && this.setContent(d)
  2870. }
  2871. __extends(a, e);
  2872. a.prototype.setContent = function(d) {
  2873. this._content !== d && (this.removeContent(), d && (this._content = d, e.prototype.addChild.call(this, d), this._addEvents()))
  2874. };
  2875. a.prototype.removeContent = function() {
  2876. this._content && (this._removeEvents(), e.prototype.removeChildAt.call(this, 0));
  2877. this._content = null
  2878. };
  2879. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2880. get: function() {
  2881. return this._verticalScrollPolicy
  2882. },
  2883. set: function(d) {
  2884. d != this._verticalScrollPolicy && (this._verticalScrollPolicy = d)
  2885. },
  2886. enumerable: !0,
  2887. configurable: !0
  2888. });
  2889. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2890. get: function() {
  2891. return this._horizontalScrollPolicy
  2892. },
  2893. set: function(d) {
  2894. d != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = d)
  2895. },
  2896. enumerable: !0,
  2897. configurable: !0
  2898. });
  2899. Object.defineProperty(a.prototype, "scrollLeft", {
  2900. get: function() {
  2901. return this._scrollLeft
  2902. },
  2903. set: function(d) {
  2904. d != this._scrollLeft && (this._scrollLeft = d, this._validatePosition(!1, !0), this._updateContentPosition())
  2905. },
  2906. enumerable: !0,
  2907. configurable: !0
  2908. });
  2909. Object.defineProperty(a.prototype, "scrollTop", {
  2910. get: function() {
  2911. return this._scrollTop
  2912. },
  2913. set: function(d) {
  2914. d != this._scrollTop && (this._scrollTop = d, this._validatePosition(!0, !1), this._updateContentPosition())
  2915. },
  2916. enumerable: !0,
  2917. configurable: !0
  2918. });
  2919. a.prototype.setScrollPosition = function(d, a, b) {
  2920. void 0 === b && (b = !1);
  2921. if (!b || 0 != d || 0 != a)
  2922. if (b || this._scrollTop != d || this._scrollLeft != a) {
  2923. if (b) {
  2924. b = this._isOnTheEdge(!0);
  2925. var e = this._isOnTheEdge(!1);
  2926. this._scrollTop +=
  2927. b ? d / 2 : d;
  2928. this._scrollLeft += e ? a / 2 : a
  2929. } else this._scrollTop = d, this._scrollLeft = a;
  2930. this._validatePosition(!0, !0);
  2931. this._updateContentPosition()
  2932. }
  2933. };
  2934. a.prototype._isOnTheEdge = function(d) {
  2935. void 0 === d && (d = !0);
  2936. var a = this._scrollTop,
  2937. b = this._scrollLeft;
  2938. return d ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2939. };
  2940. a.prototype._validatePosition = function(d, a) {
  2941. void 0 === d && (d = !1);
  2942. void 0 === a && (a = !1);
  2943. if (d) {
  2944. var b = this.height,
  2945. e = this._getContentHeight();
  2946. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2947. this._scrollTop =
  2948. Math.min(this._scrollTop, e > b ? e - b / 2 : b / 2)
  2949. }
  2950. a && (b = this.width, e = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, e > b ? e - b / 2 : b / 2))
  2951. };
  2952. a.prototype._setWidth = function(d) {
  2953. this._explicitWidth != d && (e.prototype._setWidth.call(this, d), this._updateContentPosition())
  2954. };
  2955. a.prototype._setHeight = function(d) {
  2956. this._explicitHeight != d && (e.prototype._setHeight.call(this, d), this._updateContentPosition())
  2957. };
  2958. a.prototype._updateContentPosition = function() {
  2959. var d =
  2960. this.getBounds(b.Rectangle.identity);
  2961. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, d.width, d.height);
  2962. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2963. };
  2964. a.prototype._checkScrollPolicy = function() {
  2965. var d = this.__checkScrollPolicy(this._horizontalScrollPolicy, this._getContentWidth(), this.width);
  2966. this._hCanScroll = d;
  2967. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2968. this._vCanScroll = a;
  2969. return d || a
  2970. };
  2971. a.prototype.__checkScrollPolicy = function(d, a, b) {
  2972. return "on" ==
  2973. d ? !0 : "off" == d ? !1 : a > b
  2974. };
  2975. a.prototype._addEvents = function() {
  2976. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2977. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2978. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2979. };
  2980. a.prototype._removeEvents = function() {
  2981. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2982. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2983. this.removeEventListener(b.TouchEvent.TOUCH_END,
  2984. this._onTouchEndCapture, this, !0)
  2985. };
  2986. a.prototype._onTouchBegin = function(d) {
  2987. !d._isDefaultPrevented && this._checkScrollPolicy() && (this._touchStartPosition.x = d.stageX, this._touchStartPosition.y = d.stageY, (this._isHTweenPlaying || this._isVTweenPlaying) && this._onScrollFinished(), 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,
  2988. this._onEnterFrame, this), this._logTouchEvent(d), d.preventDefault())
  2989. };
  2990. a.prototype._onTouchBeginCapture = function(d) {
  2991. var a = this._checkScrollPolicy();
  2992. if (a) {
  2993. for (var e = d.target; e != this;) {
  2994. if ("_checkScrollPolicy" in e && (a = e._checkScrollPolicy())) return;
  2995. e = e.parent
  2996. }
  2997. d.stopPropagation();
  2998. this.delayTouchBeginEvent = this.cloneTouchEvent(d);
  2999. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100, 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  3000. this.touchBeginTimer.start();
  3001. this._onTouchBegin(d)
  3002. }
  3003. };
  3004. a.prototype._onTouchEndCapture = function(d) {
  3005. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  3006. };
  3007. a.prototype._onTouchBeginTimer = function() {
  3008. this.touchBeginTimer.stop();
  3009. var d = this.delayTouchBeginEvent;
  3010. this.delayTouchBeginEvent = null;
  3011. this.stage && this.dispatchPropagationEvent(d)
  3012. };
  3013. a.prototype.dispatchPropagationEvent = function(d) {
  3014. for (var a = [], b = d._target, e = 0; b;) b == this && (e = a.length), a.push(b), b = b.parent;
  3015. b = a.slice(0, e);
  3016. b = b.reverse();
  3017. a = b.concat(a);
  3018. this._dispatchPropagationEvent(d, a,
  3019. e)
  3020. };
  3021. a.prototype._dispatchPropagationEvent = function(d, a, b) {
  3022. for (var e = a.length, c = 0; c < e; c++) {
  3023. var f = a[c];
  3024. d._currentTarget = f;
  3025. d._eventPhase = c < b ? 1 : c == b ? 2 : 3;
  3026. f._notifyListener(d);
  3027. if (d._isPropagationStopped || d._isPropagationImmediateStopped) break
  3028. }
  3029. };
  3030. a.prototype._onTouchMove = function(d) {
  3031. if (this._lastTouchPosition.x != d.stageX || this._lastTouchPosition.y != d.stageY) {
  3032. if (!this._scrollStarted) {
  3033. var a = d.stageX - this._touchStartPosition.x,
  3034. b = d.stageY - this._touchStartPosition.y;
  3035. if (Math.sqrt(a * a + b * b) < this.scrollBeginThreshold) {
  3036. this._logTouchEvent(d);
  3037. return
  3038. }
  3039. }
  3040. this._scrollStarted = !0;
  3041. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  3042. this.touchChildren = !1;
  3043. a = this._getPointChange(d);
  3044. this.setScrollPosition(a.y, a.x, !0);
  3045. this._calcVelocitys(d);
  3046. this._logTouchEvent(d)
  3047. }
  3048. };
  3049. a.prototype._onTouchEnd = function(d) {
  3050. this.touchChildren = !0;
  3051. this._scrollStarted = !1;
  3052. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  3053. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd,
  3054. this);
  3055. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  3056. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  3057. this._moveAfterTouchEnd()
  3058. };
  3059. a.prototype._onEnterFrame = function(d) {
  3060. d = b.getTimer();
  3061. 100 < d - this._lastTouchTime && 300 > d - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  3062. };
  3063. a.prototype._logTouchEvent = function(d) {
  3064. this._lastTouchPosition.x = d.stageX;
  3065. this._lastTouchPosition.y = d.stageY;
  3066. this._lastTouchEvent = this.cloneTouchEvent(d);
  3067. this._lastTouchTime = b.getTimer()
  3068. };
  3069. a.prototype._getPointChange = function(d) {
  3070. return {
  3071. x: !1 === this._hCanScroll ? 0 : this._lastTouchPosition.x - d.stageX,
  3072. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - d.stageY
  3073. }
  3074. };
  3075. a.prototype._calcVelocitys = function(d) {
  3076. var a = b.getTimer();
  3077. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  3078. else {
  3079. var e = this._getPointChange(d),
  3080. a = a - this._lastTouchTime;
  3081. e.x /= a;
  3082. e.y /= a;
  3083. this._velocitys.push(e);
  3084. 5 < this._velocitys.length && this._velocitys.shift();
  3085. this._lastTouchPosition.x = d.stageX;
  3086. this._lastTouchPosition.y =
  3087. d.stageY
  3088. }
  3089. };
  3090. a.prototype._getContentWidth = function() {
  3091. return this._content.explicitWidth || this._content.width
  3092. };
  3093. a.prototype._getContentHeight = function() {
  3094. return this._content.explicitHeight || this._content.height
  3095. };
  3096. a.prototype.getMaxScrollLeft = function() {
  3097. var d = this._getContentWidth() - this.width;
  3098. return Math.max(0, d)
  3099. };
  3100. a.prototype.getMaxScrollTop = function() {
  3101. var d = this._getContentHeight() - this.height;
  3102. return Math.max(0, d)
  3103. };
  3104. a.prototype._moveAfterTouchEnd = function() {
  3105. if (0 != this._velocitys.length) {
  3106. for (var d = 0, b =
  3107. 0, e = 0, c = 0; c < this._velocitys.length; c++) var g = this._velocitys[c],
  3108. f = a.weight[c],
  3109. d = d + g.x * f,
  3110. b = b + g.y * f,
  3111. e = e + f;
  3112. this._velocitys.length = 0;
  3113. 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
  3114. d = d / e * this.scrollSpeed;
  3115. b = b / e * this.scrollSpeed;
  3116. g = Math.abs(d);
  3117. e = Math.abs(b);
  3118. f = this.getMaxScrollLeft();
  3119. c = this.getMaxScrollTop();
  3120. d = 0.02 < g ? this.getAnimationDatas(d, this._scrollLeft, f) : {
  3121. position: this._scrollLeft,
  3122. duration: 1
  3123. };
  3124. b = 0.02 < e ? this.getAnimationDatas(b, this._scrollTop, c) : {
  3125. position: this._scrollTop,
  3126. duration: 1
  3127. };
  3128. this.setScrollLeft(d.position,
  3129. d.duration);
  3130. this.setScrollTop(b.position, b.duration)
  3131. }
  3132. };
  3133. a.prototype._onTweenFinished = function(d) {
  3134. d == this._vScrollTween && (this._isVTweenPlaying = !1);
  3135. d == this._hScrollTween && (this._isHTweenPlaying = !1);
  3136. !1 == this._isHTweenPlaying && !1 == this._isVTweenPlaying && this._onScrollFinished()
  3137. };
  3138. a.prototype._onScrollStarted = function() {};
  3139. a.prototype._onScrollFinished = function() {
  3140. b.Tween.removeTweens(this);
  3141. this._vScrollTween = this._hScrollTween = null;
  3142. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  3143. this.dispatchEvent(new b.Event(b.Event.COMPLETE))
  3144. };
  3145. a.prototype.setScrollTop = function(d, a) {
  3146. void 0 === a && (a = 0);
  3147. var e = Math.min(this.getMaxScrollTop(), Math.max(d, 0));
  3148. if (0 == a) return this.scrollTop = e, null;
  3149. var c = b.Tween.get(this).to({
  3150. scrollTop: d
  3151. }, a, b.Ease.quartOut);
  3152. e != d && c.to({
  3153. scrollTop: e
  3154. }, 300, b.Ease.quintOut);
  3155. this._isVTweenPlaying = !0;
  3156. this._vScrollTween = c;
  3157. c.call(this._onTweenFinished, this, [c]);
  3158. this._isHTweenPlaying || this._onScrollStarted();
  3159. return c
  3160. };
  3161. a.prototype.setScrollLeft = function(d, a) {
  3162. void 0 === a && (a = 0);
  3163. var e = Math.min(this.getMaxScrollLeft(), Math.max(d,
  3164. 0));
  3165. if (0 == a) return this.scrollLeft = e, null;
  3166. var c = b.Tween.get(this).to({
  3167. scrollLeft: d
  3168. }, a, b.Ease.quartOut);
  3169. e != d && c.to({
  3170. scrollLeft: e
  3171. }, 300, b.Ease.quintOut);
  3172. this._isHTweenPlaying = !0;
  3173. this._hScrollTween = c;
  3174. c.call(this._onTweenFinished, this, [c]);
  3175. this._isVTweenPlaying || this._onScrollStarted();
  3176. return c
  3177. };
  3178. a.prototype.getAnimationDatas = function(d, a, b) {
  3179. var e = Math.abs(d),
  3180. c = 0,
  3181. f = a + 500 * d;
  3182. if (0 > f || f > b)
  3183. for (f = a; Infinity != Math.abs(d) && 0.02 < Math.abs(d);) f += d, d = 0 > f || f > b ? 0.998 * d * 0.95 : 0.998 * d, c++;
  3184. else c = 500 * -Math.log(0.02 / e);
  3185. return {
  3186. position: Math.min(b + 50, Math.max(f, -50)),
  3187. duration: c
  3188. }
  3189. };
  3190. a.prototype.cloneTouchEvent = function(d) {
  3191. var a = new b.TouchEvent(d._type, d._bubbles, d.cancelable);
  3192. a.touchPointID = d.touchPointID;
  3193. a._stageX = d._stageX;
  3194. a._stageY = d._stageY;
  3195. a.ctrlKey = d.ctrlKey;
  3196. a.altKey = d.altKey;
  3197. a.shiftKey = d.shiftKey;
  3198. a.touchDown = d.touchDown;
  3199. a._isDefaultPrevented = !1;
  3200. a._target = d._target;
  3201. return a
  3202. };
  3203. a.prototype.throwNotSupportedError = function() {
  3204. throw Error(b.getString(1023));
  3205. };
  3206. a.prototype.addChild = function(d) {
  3207. this.throwNotSupportedError();
  3208. return null
  3209. };
  3210. a.prototype.addChildAt = function(d, a) {
  3211. this.throwNotSupportedError();
  3212. return null
  3213. };
  3214. a.prototype.removeChild = function(d) {
  3215. this.throwNotSupportedError();
  3216. return null
  3217. };
  3218. a.prototype.removeChildAt = function(d) {
  3219. this.throwNotSupportedError();
  3220. return null
  3221. };
  3222. a.prototype.setChildIndex = function(d, a) {
  3223. this.throwNotSupportedError()
  3224. };
  3225. a.prototype.swapChildren = function(d, a) {
  3226. this.throwNotSupportedError()
  3227. };
  3228. a.prototype.swapChildrenAt = function(d, a) {
  3229. this.throwNotSupportedError()
  3230. };
  3231. a.prototype.hitTest = function(d, a, c) {
  3232. void 0 ===
  3233. c && (c = !1);
  3234. var k = e.prototype.hitTest.call(this, d, a, c);
  3235. return k ? k : b.DisplayObject.prototype.hitTest.call(this, d, a, c)
  3236. };
  3237. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3238. return a
  3239. }(b.DisplayObjectContainer);
  3240. b.ScrollView = c;
  3241. c.prototype.__class__ = "egret.ScrollView"
  3242. })(egret || (egret = {}));
  3243. (function(b) {
  3244. var c = function() {
  3245. function b() {}
  3246. b.REPEAT = "repeat";
  3247. b.SCALE = "scale";
  3248. return b
  3249. }();
  3250. b.BitmapFillMode = c;
  3251. c.prototype.__class__ = "egret.BitmapFillMode"
  3252. })(egret || (egret = {}));
  3253. __extends = this.__extends || function(b, c) {
  3254. function e() {
  3255. this.constructor = b
  3256. }
  3257. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3258. e.prototype = c.prototype;
  3259. b.prototype = new e
  3260. };
  3261. (function(b) {
  3262. var c = function(e) {
  3263. function a(d) {
  3264. e.call(this);
  3265. this.scale9Grid = this._texture = null;
  3266. this.fillMode = "scale";
  3267. d && (this._texture = d, this._setSizeDirty());
  3268. this.needDraw = !0
  3269. }
  3270. __extends(a, e);
  3271. Object.defineProperty(a.prototype, "texture", {
  3272. get: function() {
  3273. return this._texture
  3274. },
  3275. set: function(d) {
  3276. d != this._texture && (this._setSizeDirty(), this._texture = d)
  3277. },
  3278. enumerable: !0,
  3279. configurable: !0
  3280. });
  3281. a.prototype._render = function(d) {
  3282. var b = this._texture;
  3283. b ? (this._texture_to_render = b, a._drawBitmap(d, this._hasWidthSet ? this._explicitWidth :
  3284. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  3285. };
  3286. a._drawBitmap = function(d, b, e, c) {
  3287. var g = c._texture_to_render;
  3288. if (g) {
  3289. var f = g._textureWidth,
  3290. h = g._textureHeight;
  3291. if ("scale" == c.fillMode) {
  3292. var n = c.scale9Grid || g.scale9Grid;
  3293. if (n && f - n.width < b && h - n.height < e) a.drawScale9GridImage(d, c, n, b, e);
  3294. else {
  3295. var n = g._offsetX,
  3296. p = g._offsetY,
  3297. q = g._bitmapWidth || f,
  3298. r = g._bitmapHeight || h;
  3299. b /= f;
  3300. n = Math.round(n * b);
  3301. b = Math.round(q * b);
  3302. e /= h;
  3303. p = Math.round(p * e);
  3304. e = Math.round(r * e);
  3305. a.renderFilter.drawImage(d,
  3306. c, g._bitmapX, g._bitmapY, q, r, n, p, b, e)
  3307. }
  3308. } else a.drawRepeatImage(d, c, b, e, c.fillMode)
  3309. }
  3310. };
  3311. a.drawRepeatImage = function(d, a, e, c, g) {
  3312. var f = a._texture_to_render;
  3313. if (f) {
  3314. var h = f._textureWidth,
  3315. n = f._textureHeight,
  3316. p = f._bitmapX,
  3317. q = f._bitmapY,
  3318. h = f._bitmapWidth || h,
  3319. n = f._bitmapHeight || n,
  3320. r = f._offsetX,
  3321. f = f._offsetY;
  3322. b.RenderFilter.getInstance().drawImage(d, a, p, q, h, n, r, f, e, c, g)
  3323. }
  3324. };
  3325. a.drawScale9GridImage = function(d, a, e, c, g) {
  3326. var f = b.MainContext.instance.rendererContext._texture_scale_factor,
  3327. h = a._texture_to_render;
  3328. if (h && e) {
  3329. var n = h._textureWidth,
  3330. p = h._textureHeight,
  3331. q = h._bitmapX,
  3332. r = h._bitmapY,
  3333. t = h._bitmapWidth || n,
  3334. s = h._bitmapHeight || p;
  3335. c -= n - t;
  3336. g -= p - s;
  3337. if (!d.drawImageScale9(h, q, r, t, s, h._offsetX, h._offsetY, c, g, e)) {
  3338. n = h._offsetX / f;
  3339. p = h._offsetY / f;
  3340. h = b.RenderFilter.getInstance();
  3341. e = b.Rectangle.identity.initialize(e.x - Math.round(n), e.y - Math.round(n), e.width, e.height);
  3342. n = Math.round(n);
  3343. p = Math.round(p);
  3344. e.y == e.bottom && (e.bottom < s ? e.bottom++ : e.y--);
  3345. e.x == e.right && (e.right < t ? e.right++ : e.x--);
  3346. var u = q + e.x / f,
  3347. w = q + e.right / f,
  3348. v = t - e.right,
  3349. y = r + e.y / f,
  3350. f = r + e.bottom / f,
  3351. x = s - e.bottom,
  3352. z = n + e.x,
  3353. A = p + e.y,
  3354. s = g - (s - e.bottom),
  3355. t = c - (t - e.right);
  3356. h.drawImage(d, a, q, r, e.x, e.y, n, p, e.x, e.y);
  3357. h.drawImage(d, a, u, r, e.width, e.y, z, p, t - e.x, e.y);
  3358. h.drawImage(d, a, w, r, v, e.y, n + t, p, c - t, e.y);
  3359. h.drawImage(d, a, q, y, e.x, e.height, n, A, e.x, s - e.y);
  3360. h.drawImage(d, a, u, y, e.width, e.height, z, A, t - e.x, s - e.y);
  3361. h.drawImage(d, a, w, y, v, e.height, n + t, A, c - t, s - e.y);
  3362. h.drawImage(d, a, q, f, e.x, x, n, p + s, e.x, g - s);
  3363. h.drawImage(d, a, u, f, e.width, x, z, p + s, t - e.x, g - s);
  3364. h.drawImage(d, a, w, f, v, x, n + t, p + s, c - t, g - s)
  3365. }
  3366. }
  3367. };
  3368. a.prototype._measureBounds = function() {
  3369. var d =
  3370. this._texture;
  3371. return d ? b.Rectangle.identity.initialize(0, 0, d._textureWidth, d._textureHeight) : e.prototype._measureBounds.call(this)
  3372. };
  3373. a.renderFilter = b.RenderFilter.getInstance();
  3374. return a
  3375. }(b.DisplayObject);
  3376. b.Bitmap = c;
  3377. c.prototype.__class__ = "egret.Bitmap"
  3378. })(egret || (egret = {}));
  3379. __extends = this.__extends || function(b, c) {
  3380. function e() {
  3381. this.constructor = b
  3382. }
  3383. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3384. e.prototype = c.prototype;
  3385. b.prototype = new e
  3386. };
  3387. (function(b) {
  3388. var c = function(e) {
  3389. function a() {
  3390. e.call(this);
  3391. this._text = "";
  3392. this._textChanged = !1;
  3393. this._font = null;
  3394. this._fontChanged = !1;
  3395. this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = 0;
  3396. this.textLinesChange = !0;
  3397. this._lineHeights = [];
  3398. this.needDraw = this.cacheAsBitmap = !0
  3399. }
  3400. __extends(a, e);
  3401. Object.defineProperty(a.prototype, "text", {
  3402. get: function() {
  3403. return this._text
  3404. },
  3405. set: function(d) {
  3406. this._text != d && (this._textChanged = !0, this._text = d, this._setSizeDirty())
  3407. },
  3408. enumerable: !0,
  3409. configurable: !0
  3410. });
  3411. Object.defineProperty(a.prototype,
  3412. "font", {
  3413. get: function() {
  3414. return this._font
  3415. },
  3416. set: function(d) {
  3417. this._font != d && (this._font = d, this._fontChanged = !0, this._setSizeDirty())
  3418. },
  3419. enumerable: !0,
  3420. configurable: !0
  3421. });
  3422. a.prototype._setSizeDirty = function() {
  3423. e.prototype._setSizeDirty.call(this);
  3424. this.textLinesChange = !0
  3425. };
  3426. a.prototype._render = function(d) {
  3427. var l = this._getTextLines(),
  3428. e = l.length;
  3429. if (0 != e) {
  3430. for (var c = this._font, g = c._getFirstCharHeight(), g = Math.ceil(g * a.EMPTY_FACTOR), f = 0, h = this._hasHeightSet ? this._explicitHeight : Number.POSITIVE_INFINITY, n = this._lineHeights,
  3431. p = 0; p < e; p++) {
  3432. var q = n[p];
  3433. if (0 < p && f + q > h) break;
  3434. for (var r = l[p], t = r.length, s = 0, u = 0; u < t; u++) {
  3435. var w = r.charAt(u),
  3436. v = c.getTexture(w);
  3437. if (v) {
  3438. var w = v._bitmapWidth || v._textureWidth,
  3439. y = v._bitmapHeight || v._textureHeight;
  3440. this._texture_to_render = v;
  3441. b.RenderFilter.getInstance().drawImage(d, this, v._bitmapX, v._bitmapY, w, y, s + v._offsetX, f + v._offsetY, w, y);
  3442. s += v._textureWidth
  3443. } else " " == w ? s += g : b.Logger.warningWithErrorId(1011, w)
  3444. }
  3445. f += q
  3446. }
  3447. this._texture_to_render = null
  3448. }
  3449. };
  3450. a.prototype._measureBounds = function() {
  3451. return 0 == this._getTextLines().length ?
  3452. b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY)
  3453. };
  3454. a.prototype._getTextLines = function() {
  3455. if (!this.textLinesChange) return this._textLines;
  3456. var d = [];
  3457. this._textLines = d;
  3458. this.textLinesChange = !1;
  3459. var l = [];
  3460. this._lineHeights = l;
  3461. if (!this._text || !this._font) return d;
  3462. for (var e = 0, c = 0, g = 0, f = 0, h = this._hasWidthSet, n = this._hasWidthSet ? this._explicitWidth : Number.POSITIVE_INFINITY, p = this._font,
  3463. q = p._getFirstCharHeight(), r = Math.ceil(q * a.EMPTY_FACTOR), t = this._text.split(/(?:\r\n|\r|\n)/), s = t.length, u = !0, w = 0; w < s; w++) {
  3464. for (var v = t[w], y = v.length, x = 0, z = 0, A = !0, C = 0; C < y; C++) {
  3465. var B = v.charAt(C),
  3466. E, F = 0,
  3467. G = 0,
  3468. D = p.getTexture(B);
  3469. if (D) B = D._textureWidth, E = D._textureHeight, F = D._offsetX, G = D._offsetY;
  3470. else if (" " == B) B = r, E = q;
  3471. else {
  3472. b.Logger.warningWithErrorId(1011, B);
  3473. A && (A = !1);
  3474. continue
  3475. }
  3476. A && (A = !1, g = Math.min(F, g));
  3477. u && (f = Math.min(G, f));
  3478. h && 0 < C && z + B > n ? (d.push(v.substring(0, C)), l.push(x), c += x, e = Math.max(z, e), v = v.substring(C),
  3479. y = v.length, C = 0, z = B, x = E) : (z += B, x = Math.max(E, x))
  3480. }
  3481. u && (u = !1);
  3482. d.push(v);
  3483. l.push(x);
  3484. c += x;
  3485. e = Math.max(z, e)
  3486. }
  3487. this._textWidth = e;
  3488. this._textHeight = c;
  3489. this._textOffsetX = g;
  3490. this._textOffsetY = f;
  3491. return d
  3492. };
  3493. a.EMPTY_FACTOR = 0.33;
  3494. return a
  3495. }(b.DisplayObject);
  3496. b.BitmapText = c;
  3497. c.prototype.__class__ = "egret.BitmapText"
  3498. })(egret || (egret = {}));
  3499. (function(b) {
  3500. var c = function() {
  3501. function e() {
  3502. this.fillStyleColor = this.strokeStyleColor = this.renderContext = this.commandQueue = this.canvasContext = null;
  3503. this._dirty = !1;
  3504. this.lineY = this.lineX = 0;
  3505. this._firstCheck = !0;
  3506. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3507. this.commandQueue = []
  3508. }
  3509. e.prototype.beginFill = function(a, d) {};
  3510. e.prototype._setStyle = function(a) {};
  3511. e.prototype.drawRect = function(a, d, b, e) {
  3512. this.checkRect(a, d, b, e)
  3513. };
  3514. e.prototype.drawCircle = function(a, d, b) {
  3515. this.checkRect(a - b, d - b, 2 * b, 2 *
  3516. b)
  3517. };
  3518. e.prototype.drawRoundRect = function(a, d, b, e, c, g) {
  3519. this.checkRect(a, d, b, e)
  3520. };
  3521. e.prototype.drawEllipse = function(a, d, b, e) {
  3522. this.checkRect(a - b, d - e, 2 * b, 2 * e)
  3523. };
  3524. e.prototype.lineStyle = function(a, d, b, e, c, g, f, h) {};
  3525. e.prototype.lineTo = function(a, d) {
  3526. this.checkPoint(a, d)
  3527. };
  3528. e.prototype.curveTo = function(a, d, b, e) {
  3529. this.checkPoint(a, d);
  3530. this.checkPoint(b, e)
  3531. };
  3532. e.prototype.moveTo = function(a, d) {
  3533. this.checkPoint(a, d)
  3534. };
  3535. e.prototype.clear = function() {
  3536. this._maxY = this._maxX = this._minY = this._minX = 0;
  3537. this._firstCheck = !0
  3538. };
  3539. e.prototype.endFill =
  3540. function() {};
  3541. e.prototype._draw = function(a) {};
  3542. e.prototype.checkRect = function(a, d, b, e) {
  3543. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = d, this._maxX = a + b, this._maxY = d + e) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, d), this._maxX = Math.max(this._maxX, a + b), this._maxY = Math.max(this._maxY, d + e))
  3544. };
  3545. e.prototype.checkPoint = function(a, d) {
  3546. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = d, this._maxX = a, this._maxY = d) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY,
  3547. d), this._maxX = Math.max(this._maxX, a), this._maxY = Math.max(this._maxY, d));
  3548. this._lastX = a;
  3549. this._lastY = d
  3550. };
  3551. e.prototype._measureBounds = function() {
  3552. return b.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
  3553. };
  3554. return e
  3555. }();
  3556. b.Graphics = c;
  3557. c.prototype.__class__ = "egret.Graphics";
  3558. (function() {
  3559. return function(b, a, d) {
  3560. this.method = b;
  3561. this.thisObject = a;
  3562. this.args = d
  3563. }
  3564. })().prototype.__class__ = "egret.Command"
  3565. })(egret || (egret = {}));
  3566. __extends = this.__extends || function(b, c) {
  3567. function e() {
  3568. this.constructor = b
  3569. }
  3570. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3571. e.prototype = c.prototype;
  3572. b.prototype = new e
  3573. };
  3574. (function(b) {
  3575. var c = function(e) {
  3576. function a() {
  3577. e.call(this);
  3578. this._graphics = null
  3579. }
  3580. __extends(a, e);
  3581. Object.defineProperty(a.prototype, "graphics", {
  3582. get: function() {
  3583. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3584. return this._graphics
  3585. },
  3586. enumerable: !0,
  3587. configurable: !0
  3588. });
  3589. a.prototype._render = function(d) {
  3590. this._graphics && this._graphics._draw(d)
  3591. };
  3592. a.prototype._measureBounds = function() {
  3593. var d = this._graphics;
  3594. return d ? d._measureBounds() : e.prototype._measureBounds.call(this)
  3595. };
  3596. return a
  3597. }(b.DisplayObject);
  3598. b.Shape =
  3599. c;
  3600. c.prototype.__class__ = "egret.Shape"
  3601. })(egret || (egret = {}));
  3602. __extends = this.__extends || function(b, c) {
  3603. function e() {
  3604. this.constructor = b
  3605. }
  3606. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3607. e.prototype = c.prototype;
  3608. b.prototype = new e
  3609. };
  3610. (function(b) {
  3611. var c = function(e) {
  3612. function a() {
  3613. e.call(this);
  3614. this._graphics = null
  3615. }
  3616. __extends(a, e);
  3617. Object.defineProperty(a.prototype, "graphics", {
  3618. get: function() {
  3619. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3620. return this._graphics
  3621. },
  3622. enumerable: !0,
  3623. configurable: !0
  3624. });
  3625. a.prototype._render = function(d) {
  3626. this._graphics && this._graphics._draw(d);
  3627. e.prototype._render.call(this, d)
  3628. };
  3629. a.prototype._measureBounds = function() {
  3630. for (var d = 0, a = 0, e = 0, c = 0, g = this._children.length, f = 0; f < g; f++) {
  3631. var h = this._children[f];
  3632. if (h._visible) {
  3633. var n = h.getBounds(b.Rectangle.identity, !1),
  3634. p = n.x,
  3635. q = n.y,
  3636. r = n.width,
  3637. n = n.height,
  3638. h = h._getMatrix(),
  3639. h = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p, q, r, n), h),
  3640. p = h.x,
  3641. q = h.y,
  3642. r = h.width + h.x,
  3643. h = h.height + h.y;
  3644. if (p < d || 0 == f) d = p;
  3645. if (r > a || 0 == f) a = r;
  3646. if (q < e || 0 == f) e = q;
  3647. if (h > c || 0 == f) c = h
  3648. }
  3649. }
  3650. if (this._graphics) {
  3651. g = this._graphics._measureBounds();
  3652. p = g.x;
  3653. q = g.y;
  3654. r = g.width + g.x;
  3655. h = g.height + g.y;
  3656. if (p < d || 0 == f) d = p;
  3657. if (r > a || 0 == f) a = r;
  3658. if (q < e || 0 == f) e = q;
  3659. if (h > c || 0 == f) c = h
  3660. }
  3661. return b.Rectangle.identity.initialize(d,
  3662. e, a - d, c - e)
  3663. };
  3664. a.prototype.hitTest = function(d, a, c) {
  3665. void 0 === c && (c = !1);
  3666. var k = e.prototype.hitTest.call(this, d, a, c);
  3667. return k ? k : this._graphics ? b.DisplayObject.prototype.hitTest.call(this, d, a, c) : null
  3668. };
  3669. return a
  3670. }(b.DisplayObjectContainer);
  3671. b.Sprite = c;
  3672. c.prototype.__class__ = "egret.Sprite"
  3673. })(egret || (egret = {}));
  3674. __extends = this.__extends || function(b, c) {
  3675. function e() {
  3676. this.constructor = b
  3677. }
  3678. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3679. e.prototype = c.prototype;
  3680. b.prototype = new e
  3681. };
  3682. (function(b) {
  3683. var c = function(e) {
  3684. function a() {
  3685. e.call(this);
  3686. this._inputEnabled = !1;
  3687. this._type = "";
  3688. this._inputUtils = null;
  3689. this._text = "";
  3690. this._displayAsPassword = !1;
  3691. this._fontFamily = a.default_fontFamily;
  3692. this._size = 30;
  3693. this._bold = this._italic = !1;
  3694. this._textColorString = "#FFFFFF";
  3695. this._textColor = 16777215;
  3696. this._strokeColorString = "#000000";
  3697. this._stroke = this._strokeColor = 0;
  3698. this._textAlign = "left";
  3699. this._verticalAlign = "top";
  3700. this._maxChars = 0;
  3701. this._scrollV = -1;
  3702. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3703. this._isFlow =
  3704. this._multiline = !1;
  3705. this._textArr = [];
  3706. this._isArrayChanged = !1;
  3707. this._textMaxHeight = this._textMaxWidth = 0;
  3708. this._linesArr = [];
  3709. this.needDraw = !0
  3710. }
  3711. __extends(a, e);
  3712. a.prototype.isInput = function() {
  3713. return this._type == b.TextFieldType.INPUT
  3714. };
  3715. a.prototype._setTouchEnabled = function(d) {
  3716. e.prototype._setTouchEnabled.call(this, d);
  3717. this.isInput() && (this._inputEnabled = !0)
  3718. };
  3719. Object.defineProperty(a.prototype, "type", {
  3720. get: function() {
  3721. return this._type
  3722. },
  3723. set: function(d) {
  3724. this._setType(d)
  3725. },
  3726. enumerable: !0,
  3727. configurable: !0
  3728. });
  3729. a.prototype._setType =
  3730. function(d) {
  3731. this._type != d && (this._type = d, this._type == b.TextFieldType.INPUT ? (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3732. };
  3733. Object.defineProperty(a.prototype, "text", {
  3734. get: function() {
  3735. return this._getText()
  3736. },
  3737. set: function(d) {
  3738. this._setText(d)
  3739. },
  3740. enumerable: !0,
  3741. configurable: !0
  3742. });
  3743. a.prototype._getText = function() {
  3744. return this._type == b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3745. };
  3746. a.prototype._setSizeDirty = function() {
  3747. e.prototype._setSizeDirty.call(this);
  3748. this._isArrayChanged = !0
  3749. };
  3750. a.prototype._setTextDirty = function() {
  3751. this._setSizeDirty()
  3752. };
  3753. a.prototype._setBaseText = function(d) {
  3754. null == d && (d = "");
  3755. this._isFlow = !1;
  3756. this._text != d && (this._setTextDirty(), this._text = d, d = "", d = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3757. text: d
  3758. }]))
  3759. };
  3760. a.prototype._setText = function(d) {
  3761. null == d && (d = "");
  3762. this._setBaseText(d);
  3763. this._inputUtils && this._inputUtils._setText(this._text)
  3764. };
  3765. Object.defineProperty(a.prototype, "displayAsPassword", {
  3766. get: function() {
  3767. return this._displayAsPassword
  3768. },
  3769. set: function(d) {
  3770. this._setDisplayAsPassword(d)
  3771. },
  3772. enumerable: !0,
  3773. configurable: !0
  3774. });
  3775. a.prototype._setDisplayAsPassword = function(d) {
  3776. this._displayAsPassword != d && (this._displayAsPassword = d, this._setTextDirty(), d = "", d = this._displayAsPassword ? this.changeToPassText(this._text) : this._text,
  3777. this.setMiddleStyle([{
  3778. text: d
  3779. }]))
  3780. };
  3781. Object.defineProperty(a.prototype, "fontFamily", {
  3782. get: function() {
  3783. return this._fontFamily
  3784. },
  3785. set: function(d) {
  3786. this._setFontFamily(d)
  3787. },
  3788. enumerable: !0,
  3789. configurable: !0
  3790. });
  3791. a.prototype._setFontFamily = function(d) {
  3792. this._fontFamily != d && (this._setTextDirty(), this._fontFamily = d)
  3793. };
  3794. Object.defineProperty(a.prototype, "size", {
  3795. get: function() {
  3796. return this._size
  3797. },
  3798. set: function(d) {
  3799. this._setSize(d)
  3800. },
  3801. enumerable: !0,
  3802. configurable: !0
  3803. });
  3804. a.prototype._setSize = function(d) {
  3805. this._size != d && (this._setTextDirty(),
  3806. this._size = d)
  3807. };
  3808. Object.defineProperty(a.prototype, "italic", {
  3809. get: function() {
  3810. return this._italic
  3811. },
  3812. set: function(d) {
  3813. this._setItalic(d)
  3814. },
  3815. enumerable: !0,
  3816. configurable: !0
  3817. });
  3818. a.prototype._setItalic = function(d) {
  3819. this._italic != d && (this._setTextDirty(), this._italic = d)
  3820. };
  3821. Object.defineProperty(a.prototype, "bold", {
  3822. get: function() {
  3823. return this._bold
  3824. },
  3825. set: function(d) {
  3826. this._setBold(d)
  3827. },
  3828. enumerable: !0,
  3829. configurable: !0
  3830. });
  3831. a.prototype._setBold = function(d) {
  3832. this._bold != d && (this._setTextDirty(), this._bold = d)
  3833. };
  3834. Object.defineProperty(a.prototype,
  3835. "textColor", {
  3836. get: function() {
  3837. return this._textColor
  3838. },
  3839. set: function(d) {
  3840. this._setTextColor(d)
  3841. },
  3842. enumerable: !0,
  3843. configurable: !0
  3844. });
  3845. a.prototype._setTextColor = function(d) {
  3846. this._textColor != d && (this._setTextDirty(), this._textColor = d, this._textColorString = b.toColorString(d))
  3847. };
  3848. Object.defineProperty(a.prototype, "strokeColor", {
  3849. get: function() {
  3850. return this._strokeColor
  3851. },
  3852. set: function(d) {
  3853. this._setStrokeColor(d)
  3854. },
  3855. enumerable: !0,
  3856. configurable: !0
  3857. });
  3858. a.prototype._setStrokeColor = function(d) {
  3859. this._strokeColor != d && (this._setTextDirty(),
  3860. this._strokeColor = d, this._strokeColorString = b.toColorString(d))
  3861. };
  3862. Object.defineProperty(a.prototype, "stroke", {
  3863. get: function() {
  3864. return this._stroke
  3865. },
  3866. set: function(d) {
  3867. this._setStroke(d)
  3868. },
  3869. enumerable: !0,
  3870. configurable: !0
  3871. });
  3872. a.prototype._setStroke = function(d) {
  3873. this._stroke != d && (this._setTextDirty(), this._stroke = d)
  3874. };
  3875. Object.defineProperty(a.prototype, "textAlign", {
  3876. get: function() {
  3877. return this._textAlign
  3878. },
  3879. set: function(d) {
  3880. this._setTextAlign(d)
  3881. },
  3882. enumerable: !0,
  3883. configurable: !0
  3884. });
  3885. a.prototype._setTextAlign = function(d) {
  3886. this._textAlign !=
  3887. d && (this._setTextDirty(), this._textAlign = d)
  3888. };
  3889. Object.defineProperty(a.prototype, "verticalAlign", {
  3890. get: function() {
  3891. return this._verticalAlign
  3892. },
  3893. set: function(d) {
  3894. this._setVerticalAlign(d)
  3895. },
  3896. enumerable: !0,
  3897. configurable: !0
  3898. });
  3899. a.prototype._setVerticalAlign = function(d) {
  3900. this._verticalAlign != d && (this._setTextDirty(), this._verticalAlign = d)
  3901. };
  3902. Object.defineProperty(a.prototype, "maxChars", {
  3903. get: function() {
  3904. return this._maxChars
  3905. },
  3906. set: function(d) {
  3907. this._setMaxChars(d)
  3908. },
  3909. enumerable: !0,
  3910. configurable: !0
  3911. });
  3912. a.prototype._setMaxChars =
  3913. function(d) {
  3914. this._maxChars != d && (this._maxChars = d)
  3915. };
  3916. Object.defineProperty(a.prototype, "scrollV", {
  3917. set: function(d) {
  3918. this._scrollV = d;
  3919. this._setDirty()
  3920. },
  3921. enumerable: !0,
  3922. configurable: !0
  3923. });
  3924. Object.defineProperty(a.prototype, "maxScrollV", {
  3925. get: function() {
  3926. return this._maxScrollV
  3927. },
  3928. enumerable: !0,
  3929. configurable: !0
  3930. });
  3931. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3932. get: function() {
  3933. return 0
  3934. },
  3935. enumerable: !0,
  3936. configurable: !0
  3937. });
  3938. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3939. get: function() {
  3940. return 0
  3941. },
  3942. enumerable: !0,
  3943. configurable: !0
  3944. });
  3945. Object.defineProperty(a.prototype, "caretIndex", {
  3946. get: function() {
  3947. return 0
  3948. },
  3949. enumerable: !0,
  3950. configurable: !0
  3951. });
  3952. a.prototype._setSelection = function(d, a) {};
  3953. Object.defineProperty(a.prototype, "lineSpacing", {
  3954. get: function() {
  3955. return this._lineSpacing
  3956. },
  3957. set: function(d) {
  3958. this._setLineSpacing(d)
  3959. },
  3960. enumerable: !0,
  3961. configurable: !0
  3962. });
  3963. a.prototype._setLineSpacing = function(d) {
  3964. this._lineSpacing != d && (this._setTextDirty(), this._lineSpacing = d)
  3965. };
  3966. a.prototype._getLineHeight = function() {
  3967. return this._lineSpacing + this._size
  3968. };
  3969. Object.defineProperty(a.prototype, "numLines", {
  3970. get: function() {
  3971. return this._numLines
  3972. },
  3973. enumerable: !0,
  3974. configurable: !0
  3975. });
  3976. Object.defineProperty(a.prototype, "multiline", {
  3977. get: function() {
  3978. return this._multiline
  3979. },
  3980. set: function(d) {
  3981. this._setMultiline(d)
  3982. },
  3983. enumerable: !0,
  3984. configurable: !0
  3985. });
  3986. a.prototype._setMultiline = function(d) {
  3987. this._multiline = d;
  3988. this._setDirty()
  3989. };
  3990. a.prototype.setFocus = function() {
  3991. b.Logger.warningWithErrorId(1013)
  3992. };
  3993. a.prototype._onRemoveFromStage = function() {
  3994. e.prototype._onRemoveFromStage.call(this);
  3995. this._removeEvent();
  3996. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3997. };
  3998. a.prototype._onAddToStage = function() {
  3999. e.prototype._onAddToStage.call(this);
  4000. this._addEvent();
  4001. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  4002. };
  4003. a.prototype._updateBaseTransform = function() {
  4004. this._getLinesArr();
  4005. 0 != this._textMaxWidth && e.prototype._updateTransform.call(this)
  4006. };
  4007. a.prototype._updateTransform = function() {
  4008. this._type == b.TextFieldType.INPUT ? this._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() :
  4009. this._updateBaseTransform()
  4010. };
  4011. a.prototype._draw = function(d) {
  4012. 0 != this._textMaxWidth && e.prototype._draw.call(this, d)
  4013. };
  4014. a.prototype._render = function(d) {
  4015. this.drawText(d);
  4016. this._clearDirty()
  4017. };
  4018. a.prototype._measureBounds = function() {
  4019. this._getLinesArr();
  4020. return 0 == this._textMaxWidth ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(0, 0, this._textMaxWidth, this._textMaxHeight + (this._numLines - 1) * this._lineSpacing)
  4021. };
  4022. Object.defineProperty(a.prototype, "textFlow", {
  4023. get: function() {
  4024. return this._textArr
  4025. },
  4026. set: function(d) {
  4027. this._isFlow = !0;
  4028. var a = "";
  4029. null == d && (d = []);
  4030. for (var b = 0; b < d.length; b++) a += d[b].text;
  4031. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(d))
  4032. },
  4033. enumerable: !0,
  4034. configurable: !0
  4035. });
  4036. a.prototype.changeToPassText = function(d) {
  4037. if (this._displayAsPassword) {
  4038. for (var a = "", b = 0, e = d.length; b < e; b++) switch (d.charAt(b)) {
  4039. case "\n":
  4040. a += "\n";
  4041. break;
  4042. case "\r":
  4043. break;
  4044. default:
  4045. a += "*"
  4046. }
  4047. return a
  4048. }
  4049. return d
  4050. };
  4051. a.prototype.setMiddleStyle = function(d) {
  4052. this._isArrayChanged = !0;
  4053. this._textArr = d;
  4054. this._setSizeDirty()
  4055. };
  4056. Object.defineProperty(a.prototype, "textWidth", {
  4057. get: function() {
  4058. return this._textMaxWidth
  4059. },
  4060. enumerable: !0,
  4061. configurable: !0
  4062. });
  4063. Object.defineProperty(a.prototype, "textHeight", {
  4064. get: function() {
  4065. return this._textMaxHeight
  4066. },
  4067. enumerable: !0,
  4068. configurable: !0
  4069. });
  4070. a.prototype.appendText = function(d) {
  4071. this.appendElement({
  4072. text: d
  4073. })
  4074. };
  4075. a.prototype.appendElement = function(d) {
  4076. this._textArr.push(d);
  4077. this.setMiddleStyle(this._textArr)
  4078. };
  4079. a.prototype._getLinesArr = function() {
  4080. if (!this._isArrayChanged) return this._linesArr;
  4081. this._isArrayChanged = !1;
  4082. var d = this._textArr,
  4083. a = b.MainContext.instance.rendererContext;
  4084. this._linesArr = [];
  4085. this._textMaxWidth = this._textMaxHeight = 0;
  4086. if (this._hasWidthSet && 0 == this._explicitWidth) return this._numLines = 0, [{
  4087. width: 0,
  4088. height: 0,
  4089. elements: []
  4090. }];
  4091. var e = this._linesArr,
  4092. c = 0,
  4093. g = 0,
  4094. f = 0,
  4095. h;
  4096. this._isFlow || a.setupFont(this);
  4097. for (var n = 0, p = d.length; n < p; n++) {
  4098. var q = d[n];
  4099. q.style = q.style || {};
  4100. for (var r = q.text.toString().split(/(?:\r\n|\r|\n)/), t = 0, s = r.length; t < s; t++) {
  4101. null == e[f] && (h = {
  4102. width: 0,
  4103. height: 0,
  4104. elements: []
  4105. }, e[f] = h, g = c = 0);
  4106. g = this._type ==
  4107. b.TextFieldType.INPUT ? this._size : Math.max(g, q.style.size || this._size);
  4108. if ("" != r[t]) {
  4109. this._isFlow && a.setupFont(this, q.style);
  4110. var u = a.measureText(r[t]);
  4111. if (this._hasWidthSet)
  4112. if (c + u <= this._explicitWidth) h.elements.push({
  4113. width: u,
  4114. text: r[t],
  4115. style: q.style
  4116. }), c += u;
  4117. else {
  4118. for (var w = 0, v = 0, y = r[t], x = y.length; w < x; w++) {
  4119. u = a.measureText(y.charAt(w));
  4120. if (c + u > this._explicitWidth && 0 != c + w) break;
  4121. v += u;
  4122. c += u
  4123. }
  4124. 0 < w && (h.elements.push({
  4125. width: v,
  4126. text: y.substring(0, w),
  4127. style: q.style
  4128. }), r[t] = y.substring(w));
  4129. t--
  4130. } else c += u, h.elements.push({
  4131. width: u,
  4132. text: r[t],
  4133. style: q.style
  4134. })
  4135. }
  4136. if (t < r.length - 1) {
  4137. h.width = c;
  4138. h.height = g;
  4139. this._textMaxWidth = Math.max(this._textMaxWidth, c);
  4140. this._textMaxHeight += g;
  4141. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = e.length, e;
  4142. f++
  4143. }
  4144. }
  4145. n == d.length - 1 && h && (h.width = c, h.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, c), this._textMaxHeight += g)
  4146. }
  4147. this._numLines = e.length;
  4148. return e
  4149. };
  4150. a.prototype.drawText = function(d) {
  4151. var a = this._getLinesArr();
  4152. if (0 != this._textMaxWidth) {
  4153. var e = this._hasWidthSet ? this._explicitWidth :
  4154. this._textMaxWidth,
  4155. c = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  4156. g = 0,
  4157. f = 0;
  4158. if (this._hasHeightSet)
  4159. if (c < this._explicitHeight) {
  4160. var h = 0;
  4161. this._verticalAlign == b.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (h = 1);
  4162. g += h * (this._explicitHeight - c)
  4163. } else c > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  4164. g = Math.round(g);
  4165. c = 0;
  4166. this._textAlign == b.HorizontalAlign.CENTER ? c = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (c = 1);
  4167. for (var h = 0, n = this._numLines; f <
  4168. n; f++) {
  4169. var p = a[f],
  4170. q = p.height,
  4171. g = g + q / 2;
  4172. if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
  4173. for (var h = Math.round((e - p.width) * c), r = 0, t = p.elements.length; r < t; r++) {
  4174. var s = p.elements[r],
  4175. u = s.style.size || this._size;
  4176. this._type == b.TextFieldType.INPUT ? d.drawText(this, s.text, h, g + (q - u) / 2, s.width) : d.drawText(this, s.text, h, g + (q - u) / 2, s.width, s.style);
  4177. h += s.width
  4178. }
  4179. g += q / 2 + this._lineSpacing
  4180. }
  4181. }
  4182. };
  4183. a.prototype._addEvent = function() {
  4184. this.addEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4185. };
  4186. a.prototype._removeEvent =
  4187. function() {
  4188. this.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4189. };
  4190. a.prototype.onTapHandler = function(d) {
  4191. if (this._type != b.TextFieldType.INPUT && (d = this._getTextElement(d.localX, d.localY), null != d && (d = d.style) && d.href && d.href.match(/^event:/))) {
  4192. var a = d.href.match(/^event:/)[0];
  4193. b.TextEvent.dispatchTextEvent(this, b.TextEvent.LINK, d.href.substring(a.length))
  4194. }
  4195. };
  4196. a.prototype._getTextElement = function(d, a) {
  4197. var b = this._getHit(d, a),
  4198. e = this._getLinesArr();
  4199. return b && e[b.lineIndex] && e[b.lineIndex].elements[b.textElementIndex] ?
  4200. e[b.lineIndex].elements[b.textElementIndex] : null
  4201. };
  4202. a.prototype._getHit = function(d, a) {
  4203. var b = this._getLinesArr();
  4204. if (0 == this._textMaxWidth) return null;
  4205. for (var e = 0, c = 0, f = 0; f < b.length; f++) {
  4206. var h = b[f];
  4207. if (c + h.height >= a) {
  4208. e = f + 1;
  4209. break
  4210. } else c += h.height; if (c + this._lineSpacing > a) return null;
  4211. c += this._lineSpacing
  4212. }
  4213. if (0 === e) return null;
  4214. b = b[e - 1];
  4215. for (f = c = 0; f < b.elements.length; f++)
  4216. if (h = b.elements[f], c + h.width < d) c += h.width;
  4217. else return {
  4218. lineIndex: e - 1,
  4219. textElementIndex: f
  4220. };
  4221. return null
  4222. };
  4223. a.default_fontFamily = "Arial";
  4224. return a
  4225. }(b.DisplayObject);
  4226. b.TextField = c;
  4227. c.prototype.__class__ = "egret.TextField"
  4228. })(egret || (egret = {}));
  4229. (function(b) {
  4230. var c = function() {
  4231. function b() {
  4232. this.resutlArr = []
  4233. }
  4234. b.prototype.parser = function(a) {
  4235. this.stackArray = [];
  4236. this.resutlArr = [];
  4237. for (var d = 0, b = a.length; d < b;) {
  4238. var e = a.indexOf("<", d);
  4239. 0 > e ? (this.addToResultArr(a.substring(d)), d = b) : (this.addToResultArr(a.substring(d, e)), d = a.indexOf(">", e), "/" == a.charAt(e + 1) ? this.stackArray.pop() : this.addToArray(a.substring(e + 1, d)), d += 1)
  4240. }
  4241. return this.resutlArr
  4242. };
  4243. b.prototype.addToResultArr = function(a) {
  4244. if ("" != a) {
  4245. var d = [];
  4246. d.push(["&lt;", "<"]);
  4247. d.push(["&gt;", ">"]);
  4248. d.push(["&amp;",
  4249. "&"
  4250. ]);
  4251. d.push(["&quot;", '"']);
  4252. d.push(["&apos;;", "'"]);
  4253. for (var b = 0; b < d.length; b++) a.replace(new RegExp(d[b][0], "g"), d[b][1]);
  4254. 0 < this.stackArray.length ? this.resutlArr.push({
  4255. text: a,
  4256. style: this.stackArray[this.stackArray.length - 1]
  4257. }) : this.resutlArr.push({
  4258. text: a
  4259. })
  4260. }
  4261. };
  4262. b.prototype.changeStringToObject = function(a) {
  4263. var d = {};
  4264. a = a.replace(/( )+/g, " ").split(" ");
  4265. for (var b = 0; b < a.length; b++) this.addProperty(d, a[b]);
  4266. return d
  4267. };
  4268. b.prototype.addProperty = function(a, d) {
  4269. var b = d.replace(/( )*=( )*/g, "=").split("=");
  4270. b[1] && (b[1] =
  4271. b[1].replace(/(\"|\')/g, ""));
  4272. switch (b[0].toLowerCase()) {
  4273. case "color":
  4274. a.textColor = parseInt(b[1]);
  4275. break;
  4276. case "strokecolor":
  4277. a.strokeColor = parseInt(b[1]);
  4278. break;
  4279. case "stroke":
  4280. a.stroke = parseInt(b[1]);
  4281. break;
  4282. case "b":
  4283. a.bold = "true" == (b[1] || "true");
  4284. break;
  4285. case "i":
  4286. a.italic = "true" == (b[1] || "true");
  4287. break;
  4288. case "size":
  4289. a.size = parseInt(b[1]);
  4290. break;
  4291. case "fontFamily":
  4292. a.fontFamily = b[1];
  4293. break;
  4294. case "href":
  4295. a.href = b[1]
  4296. }
  4297. };
  4298. b.prototype.addToArray = function(a) {
  4299. a = this.changeStringToObject(a);
  4300. if (0 != this.stackArray.length) {
  4301. var d =
  4302. this.stackArray[this.stackArray.length - 1],
  4303. b;
  4304. for (b in d) null == a[b] && (a[b] = d[b])
  4305. }
  4306. this.stackArray.push(a)
  4307. };
  4308. return b
  4309. }();
  4310. b.HtmlTextParser = c;
  4311. c.prototype.__class__ = "egret.HtmlTextParser"
  4312. })(egret || (egret = {}));
  4313. (function(b) {
  4314. var c = function() {
  4315. function b() {}
  4316. b.DYNAMIC = "dynamic";
  4317. b.INPUT = "input";
  4318. return b
  4319. }();
  4320. b.TextFieldType = c;
  4321. c.prototype.__class__ = "egret.TextFieldType"
  4322. })(egret || (egret = {}));
  4323. __extends = this.__extends || function(b, c) {
  4324. function e() {
  4325. this.constructor = b
  4326. }
  4327. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4328. e.prototype = c.prototype;
  4329. b.prototype = new e
  4330. };
  4331. (function(b) {
  4332. var c = function(e) {
  4333. function a(d) {
  4334. e.call(this);
  4335. this.bitmapData = this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
  4336. this._textureMap = {};
  4337. var a = d.bitmapData;
  4338. this.bitmapData = a;
  4339. this._sourceWidth = a.width;
  4340. this._sourceHeight = a.height;
  4341. this._bitmapX = d._bitmapX - d._offsetX;
  4342. this._bitmapY = d._bitmapY - d._offsetY
  4343. }
  4344. __extends(a, e);
  4345. a.prototype.getTexture = function(d) {
  4346. return this._textureMap[d]
  4347. };
  4348. a.prototype.createTexture = function(d, a, e, c, g, f, h, n, p) {
  4349. void 0 === f && (f = 0);
  4350. void 0 === h && (h = 0);
  4351. "undefined" ===
  4352. typeof n && (n = f + c);
  4353. "undefined" === typeof p && (p = h + g);
  4354. var q = new b.Texture,
  4355. r = b.MainContext.instance.rendererContext._texture_scale_factor;
  4356. q._bitmapData = this.bitmapData;
  4357. q._bitmapX = this._bitmapX + a;
  4358. q._bitmapY = this._bitmapY + e;
  4359. q._bitmapWidth = c * r;
  4360. q._bitmapHeight = g * r;
  4361. q._offsetX = f;
  4362. q._offsetY = h;
  4363. q._textureWidth = n * r;
  4364. q._textureHeight = p * r;
  4365. q._sourceWidth = this._sourceWidth;
  4366. q._sourceHeight = this._sourceHeight;
  4367. return this._textureMap[d] = q
  4368. };
  4369. return a
  4370. }(b.HashObject);
  4371. b.SpriteSheet = c;
  4372. c.prototype.__class__ = "egret.SpriteSheet"
  4373. })(egret ||
  4374. (egret = {}));
  4375. __extends = this.__extends || function(b, c) {
  4376. function e() {
  4377. this.constructor = b
  4378. }
  4379. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4380. e.prototype = c.prototype;
  4381. b.prototype = new e
  4382. };
  4383. (function(b) {
  4384. var c = function(e) {
  4385. function a() {
  4386. e.call(this);
  4387. this._isFocus = !1;
  4388. this._text = null;
  4389. this._isFirst = this._isFirst = !0
  4390. }
  4391. __extends(a, e);
  4392. a.prototype.init = function(d) {
  4393. this._text = d;
  4394. this.stageText = b.StageText.create();
  4395. d = this._text.localToGlobal();
  4396. this.stageText._open(d.x, d.y, this._text._explicitWidth, this._text._explicitHeight)
  4397. };
  4398. a.prototype._addStageText = function() {
  4399. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4400. this.stageText._add();
  4401. this.stageText._addListeners();
  4402. this.stageText.addEventListener("blur",
  4403. this.onBlurHandler, this);
  4404. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4405. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4406. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4407. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4408. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)
  4409. };
  4410. a.prototype._removeStageText = function() {
  4411. this.stageText._remove();
  4412. this.stageText._removeListeners();
  4413. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4414. this.stageText.removeEventListener("blur", this.onBlurHandler, this);
  4415. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4416. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4417. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4418. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4419. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE,
  4420. this.onResize, this)
  4421. };
  4422. a.prototype.onResize = function() {
  4423. this._isFirst = !0
  4424. };
  4425. a.prototype._getText = function() {
  4426. return this.stageText._getText()
  4427. };
  4428. a.prototype._setText = function(d) {
  4429. this.stageText._setText(d)
  4430. };
  4431. a.prototype.onFocusHandler = function(d) {
  4432. this.hideText()
  4433. };
  4434. a.prototype.onBlurHandler = function(d) {
  4435. this.showText()
  4436. };
  4437. a.prototype.onMouseDownHandler = function(d) {
  4438. d.stopPropagation();
  4439. this._text._visible && (this._isFirst = !0, this._updateTransform(), this.stageText._show())
  4440. };
  4441. a.prototype.onStageDownHandler = function(d) {
  4442. this.stageText._hide();
  4443. this.showText()
  4444. };
  4445. a.prototype.showText = function() {
  4446. this._isFocus && (this._isFocus = !1, this.resetText())
  4447. };
  4448. a.prototype.hideText = function() {
  4449. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4450. };
  4451. a.prototype.updateTextHandler = function(d) {
  4452. this.resetText();
  4453. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4454. };
  4455. a.prototype.resetText = function() {
  4456. this._text._setBaseText(this.stageText._getText())
  4457. };
  4458. a.prototype._updateTransform = function() {
  4459. var d = this._text._worldTransform.a,
  4460. a = this._text._worldTransform.b,
  4461. e = this._text._worldTransform.c,
  4462. c = this._text._worldTransform.d,
  4463. g = this._text._worldTransform.tx,
  4464. f = this._text._worldTransform.ty;
  4465. this._text._updateBaseTransform();
  4466. var h = this._text._worldTransform;
  4467. if (this._isFirst || d != h.a || a != h.b || e != h.c || c != h.d || g != h.tx || f != h.ty) {
  4468. this._isFirst = !1;
  4469. d = this._text.localToGlobal();
  4470. this.stageText.changePosition(d.x, d.y);
  4471. var n = this;
  4472. b.callLater(function() {
  4473. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  4474. }, this)
  4475. }
  4476. };
  4477. a.prototype._updateProperties = function() {
  4478. var d =
  4479. this._text._stage;
  4480. if (null == d) this.stageText._setVisible(!1);
  4481. else {
  4482. for (var a = this._text, e = a._visible; e;) {
  4483. a = a.parent;
  4484. if (a == d) break;
  4485. e = a._visible
  4486. }
  4487. this.stageText._setVisible(e)
  4488. }
  4489. this.stageText._setMultiline(this._text._multiline);
  4490. this.stageText._setMaxChars(this._text._maxChars);
  4491. this.stageText._setSize(this._text._size);
  4492. this.stageText._setTextColor(this._text._textColorString);
  4493. this.stageText._setTextFontFamily(this._text._fontFamily);
  4494. this.stageText._setBold(this._text._bold);
  4495. this.stageText._setItalic(this._text._italic);
  4496. this.stageText._setTextAlign(this._text._textAlign);
  4497. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4498. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4499. this.stageText._setTextType(this._text._displayAsPassword ? "password" : "text");
  4500. this.stageText._setText(this._text._text);
  4501. this.stageText._resetStageText();
  4502. this._updateTransform()
  4503. };
  4504. return a
  4505. }(b.HashObject);
  4506. b.InputController = c;
  4507. c.prototype.__class__ = "egret.InputController"
  4508. })(egret || (egret = {}));
  4509. __extends = this.__extends || function(b, c) {
  4510. function e() {
  4511. this.constructor = b
  4512. }
  4513. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4514. e.prototype = c.prototype;
  4515. b.prototype = new e
  4516. };
  4517. (function(b) {
  4518. var c = function(b) {
  4519. function a(d, a) {
  4520. b.call(this, d);
  4521. this.firstCharHeight = 0;
  4522. "string" == typeof a ? this.charList = this.parseConfig(a) : a && a.hasOwnProperty("frames") ? this.charList = a.frames : this.charList = {}
  4523. }
  4524. __extends(a, b);
  4525. a.prototype.getTexture = function(d) {
  4526. var a = this._textureMap[d];
  4527. if (!a) {
  4528. a = this.charList[d];
  4529. if (!a) return null;
  4530. a = this.createTexture(d, a.x, a.y, a.w, a.h, a.offX, a.offY, a.sourceW, a.sourceH);
  4531. this._textureMap[d] = a
  4532. }
  4533. return a
  4534. };
  4535. a.prototype._getFirstCharHeight = function() {
  4536. if (0 == this.firstCharHeight)
  4537. for (var d in this.charList) {
  4538. var a =
  4539. this.charList[d];
  4540. if (a) {
  4541. var b = a.sourceH;
  4542. void 0 === b && (b = a.h, void 0 === b && (b = 0), a = a.offY, void 0 === a && (a = 0), b += a);
  4543. if (!(0 >= b)) {
  4544. this.firstCharHeight = b;
  4545. break
  4546. }
  4547. }
  4548. }
  4549. return this.firstCharHeight
  4550. };
  4551. a.prototype.parseConfig = function(d) {
  4552. d = d.split("\r\n").join("\n");
  4553. d = d.split("\n");
  4554. for (var a = this.getConfigByKey(d[3], "count"), b = {}, e = 4; e < 4 + a; e++) {
  4555. var c = d[e],
  4556. f = String.fromCharCode(this.getConfigByKey(c, "id")),
  4557. h = {};
  4558. b[f] = h;
  4559. h.x = this.getConfigByKey(c, "x");
  4560. h.y = this.getConfigByKey(c, "y");
  4561. h.w = this.getConfigByKey(c, "width");
  4562. h.h =
  4563. this.getConfigByKey(c, "height");
  4564. h.offX = this.getConfigByKey(c, "xoffset");
  4565. h.offY = this.getConfigByKey(c, "yoffset")
  4566. }
  4567. return b
  4568. };
  4569. a.prototype.getConfigByKey = function(d, a) {
  4570. for (var b = d.split(" "), e = 0, c = b.length; e < c; e++) {
  4571. var f = b[e];
  4572. if (a == f.substring(0, a.length)) return b = f.substring(a.length + 1), parseInt(b)
  4573. }
  4574. return 0
  4575. };
  4576. return a
  4577. }(b.SpriteSheet);
  4578. b.BitmapFont = c;
  4579. c.prototype.__class__ = "egret.BitmapFont"
  4580. })(egret || (egret = {}));
  4581. __extends = this.__extends || function(b, c) {
  4582. function e() {
  4583. this.constructor = b
  4584. }
  4585. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4586. e.prototype = c.prototype;
  4587. b.prototype = new e
  4588. };
  4589. (function(b) {
  4590. var c = function(e) {
  4591. function a(d) {
  4592. e.call(this);
  4593. this._isAddedToStage = !1;
  4594. this._frames = this._movieClipData = this._textureToRender = null;
  4595. this._totalFrames = 0;
  4596. this._frameLabels = null;
  4597. this._frameIntervalTime = 0;
  4598. this._eventPool = null;
  4599. this._isPlaying = !1;
  4600. this._isStopped = !0;
  4601. this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
  4602. this._setMovieClipData(d);
  4603. this.needDraw = !0
  4604. }
  4605. __extends(a, e);
  4606. a.prototype._init = function() {
  4607. this._reset();
  4608. var d = this._movieClipData;
  4609. d &&
  4610. d._isDataValid() && (this._frames = d.frames, this._totalFrames = d.numFrames, this._frameLabels = d.labels, this._frameIntervalTime = 1E3 / d.frameRate, this._initFrame())
  4611. };
  4612. a.prototype._reset = function() {
  4613. this._frames = null;
  4614. this._playTimes = 0;
  4615. this._isPlaying = !1;
  4616. this.setIsStopped(!0);
  4617. this._currentFrameNum = 0;
  4618. this._nextFrameNum = 1;
  4619. this._passedTime = this._displayedKeyFrameNum = 0;
  4620. this._eventPool = []
  4621. };
  4622. a.prototype._initFrame = function() {
  4623. this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
  4624. };
  4625. a.prototype._render =
  4626. function(d) {
  4627. var b = this._textureToRender;
  4628. if (this._texture_to_render = b) {
  4629. var e = Math.round(b._offsetX),
  4630. c = Math.round(b._offsetY),
  4631. g = b._bitmapWidth || b._textureWidth,
  4632. f = b._bitmapHeight || b._textureHeight,
  4633. h = Math.round(g),
  4634. n = Math.round(f);
  4635. a.renderFilter.drawImage(d, this, b._bitmapX, b._bitmapY, g, f, e, c, h, n)
  4636. }
  4637. };
  4638. a.prototype._measureBounds = function() {
  4639. var d = this._textureToRender;
  4640. return d ? b.Rectangle.identity.initialize(d._offsetX, d._offsetY, d._textureWidth, d._textureHeight) : e.prototype._measureBounds.call(this)
  4641. };
  4642. a.prototype._onAddToStage =
  4643. function() {
  4644. e.prototype._onAddToStage.call(this);
  4645. this._isAddedToStage = !0;
  4646. this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
  4647. };
  4648. a.prototype._onRemoveFromStage = function() {
  4649. e.prototype._onRemoveFromStage.call(this);
  4650. this._isAddedToStage = !1;
  4651. this.setIsStopped(!0)
  4652. };
  4653. a.prototype._getFrameLabelByName = function(d, a) {
  4654. void 0 === a && (a = !1);
  4655. a && (d = d.toLowerCase());
  4656. var b = this._frameLabels;
  4657. if (b)
  4658. for (var e = null, c = 0; c < b.length; c++)
  4659. if (e = b[c], a ? e.name.toLowerCase() === d : e.name === d) return e;
  4660. return null
  4661. };
  4662. a.prototype._getFrameLabelByFrame =
  4663. function(d) {
  4664. var a = this._frameLabels;
  4665. if (a)
  4666. for (var b = null, e = 0; e < a.length; e++)
  4667. if (b = a[e], b.frame === d) return b;
  4668. return null
  4669. };
  4670. a.prototype._getFrameLabelForFrame = function(d) {
  4671. var a = null,
  4672. b = null,
  4673. e = this._frameLabels;
  4674. if (e)
  4675. for (var c = 0; c < e.length; c++) {
  4676. b = e[c];
  4677. if (b.frame > d) break;
  4678. a = b
  4679. }
  4680. return a
  4681. };
  4682. a.prototype.play = function(d) {
  4683. void 0 === d && (d = 0);
  4684. this._isPlaying = !0;
  4685. this.setPlayTimes(d);
  4686. 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
  4687. };
  4688. a.prototype.stop = function() {
  4689. this._isPlaying = !1;
  4690. this.setIsStopped(!0)
  4691. };
  4692. a.prototype.prevFrame =
  4693. function() {
  4694. this.gotoAndStop(this._currentFrameNum - 1)
  4695. };
  4696. a.prototype.nextFrame = function() {
  4697. this.gotoAndStop(this._currentFrameNum + 1)
  4698. };
  4699. a.prototype.gotoAndPlay = function(d, a) {
  4700. void 0 === a && (a = 0);
  4701. if (0 === arguments.length || 2 < arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndPlay()"));
  4702. this.play(a);
  4703. this._gotoFrame(d)
  4704. };
  4705. a.prototype.gotoAndStop = function(d) {
  4706. if (1 != arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndStop()"));
  4707. this.stop();
  4708. this._gotoFrame(d)
  4709. };
  4710. a.prototype._gotoFrame = function(d) {
  4711. var a;
  4712. if ("string" === typeof d) a = this._getFrameLabelByName(d).frame;
  4713. else if (a = parseInt(d + "", 10), a != d) throw Error(b.getString(1022, "Frame Label Not Found"));
  4714. 1 > a ? a = 1 : a > this._totalFrames && (a = this._totalFrames);
  4715. a !== this._nextFrameNum && (this._nextFrameNum = a, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
  4716. };
  4717. a.prototype._advanceTime = function(d) {
  4718. var a = this._frameIntervalTime;
  4719. d = this._passedTime + d;
  4720. this._passedTime = d % a;
  4721. a = d / a;
  4722. if (!(1 > a)) {
  4723. for (; 1 <= a;) {
  4724. a--;
  4725. this._nextFrameNum++;
  4726. if (this._nextFrameNum >
  4727. this._totalFrames)
  4728. if (-1 == this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE), this._nextFrameNum = 1;
  4729. else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE), this._nextFrameNum = 1;
  4730. else {
  4731. this._nextFrameNum = this._totalFrames;
  4732. this._eventPool.push(b.Event.COMPLETE);
  4733. this.stop();
  4734. break
  4735. }
  4736. this._advanceFrame()
  4737. }
  4738. this._constructFrame();
  4739. this._handlePendingEvent()
  4740. }
  4741. };
  4742. a.prototype._advanceFrame = function() {
  4743. this._currentFrameNum = this._nextFrameNum
  4744. };
  4745. a.prototype._constructFrame = function() {
  4746. var d =
  4747. this._currentFrameNum;
  4748. this._displayedKeyFrameNum != d && (this._textureToRender = this._movieClipData.getTextureByFrame(d), this._displayedKeyFrameNum = d)
  4749. };
  4750. a.prototype._handlePendingEvent = function() {
  4751. if (0 != this._eventPool.length) {
  4752. this._eventPool.reverse();
  4753. for (var d = this._eventPool, a = d.length, e = !1, c = !1, g = 0; g < a; g++) {
  4754. var f = d.pop();
  4755. f == b.Event.LOOP_COMPLETE ? c = !0 : f == b.Event.COMPLETE ? e = !0 : this.dispatchEventWith(f)
  4756. }
  4757. c && this.dispatchEventWith(b.Event.LOOP_COMPLETE);
  4758. e && this.dispatchEventWith(b.Event.COMPLETE)
  4759. }
  4760. };
  4761. Object.defineProperty(a.prototype,
  4762. "totalFrames", {
  4763. get: function() {
  4764. return this._totalFrames
  4765. },
  4766. enumerable: !0,
  4767. configurable: !0
  4768. });
  4769. Object.defineProperty(a.prototype, "currentFrame", {
  4770. get: function() {
  4771. return this._currentFrameNum
  4772. },
  4773. enumerable: !0,
  4774. configurable: !0
  4775. });
  4776. Object.defineProperty(a.prototype, "currentFrameLabel", {
  4777. get: function() {
  4778. var d = this._getFrameLabelByFrame(this._currentFrameNum);
  4779. return d && d.name
  4780. },
  4781. enumerable: !0,
  4782. configurable: !0
  4783. });
  4784. Object.defineProperty(a.prototype, "currentLabel", {
  4785. get: function() {
  4786. var d = this._getFrameLabelForFrame(this._currentFrameNum);
  4787. return d ? d.name : null
  4788. },
  4789. enumerable: !0,
  4790. configurable: !0
  4791. });
  4792. Object.defineProperty(a.prototype, "frameRate", {
  4793. get: function() {
  4794. return this.movieClipData.frameRate
  4795. },
  4796. set: function(d) {
  4797. d != this._movieClipData.frameRate && (this._movieClipData.frameRate = d, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
  4798. },
  4799. enumerable: !0,
  4800. configurable: !0
  4801. });
  4802. Object.defineProperty(a.prototype, "isPlaying", {
  4803. get: function() {
  4804. return this._isPlaying
  4805. },
  4806. enumerable: !0,
  4807. configurable: !0
  4808. });
  4809. Object.defineProperty(a.prototype, "movieClipData", {
  4810. get: function() {
  4811. return this._movieClipData
  4812. },
  4813. set: function(d) {
  4814. this._setMovieClipData(d)
  4815. },
  4816. enumerable: !0,
  4817. configurable: !0
  4818. });
  4819. a.prototype._setMovieClipData = function(d) {
  4820. this._movieClipData != d && (this._movieClipData = d, this._init())
  4821. };
  4822. a.prototype.setPlayTimes = function(d) {
  4823. if (0 > d || 1 <= d) this._playTimes = 0 > d ? -1 : Math.floor(d)
  4824. };
  4825. a.prototype.setIsStopped = function(d) {
  4826. this._isStopped != d && ((this._isStopped = d) ? (this._playTimes = 0, b.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, b.Ticker.getInstance().register(this._advanceTime,
  4827. this)))
  4828. };
  4829. a.renderFilter = b.RenderFilter.getInstance();
  4830. return a
  4831. }(b.DisplayObject);
  4832. b.MovieClip = c;
  4833. c.prototype.__class__ = "egret.MovieClip"
  4834. })(egret || (egret = {}));
  4835. __extends = this.__extends || function(b, c) {
  4836. function e() {
  4837. this.constructor = b
  4838. }
  4839. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4840. e.prototype = c.prototype;
  4841. b.prototype = new e
  4842. };
  4843. (function(b) {
  4844. var c = function(b) {
  4845. function a(d, a) {
  4846. b.call(this);
  4847. this._name = d;
  4848. this._frame = a | 0
  4849. }
  4850. __extends(a, b);
  4851. Object.defineProperty(a.prototype, "name", {
  4852. get: function() {
  4853. return this._name
  4854. },
  4855. enumerable: !0,
  4856. configurable: !0
  4857. });
  4858. Object.defineProperty(a.prototype, "frame", {
  4859. get: function() {
  4860. return this._frame
  4861. },
  4862. enumerable: !0,
  4863. configurable: !0
  4864. });
  4865. a.prototype.clone = function() {
  4866. return new a(this._name, this._frame)
  4867. };
  4868. return a
  4869. }(b.EventDispatcher);
  4870. b.FrameLabel = c;
  4871. c.prototype.__class__ = "egret.FrameLabel"
  4872. })(egret || (egret = {}));
  4873. __extends = this.__extends || function(b, c) {
  4874. function e() {
  4875. this.constructor = b
  4876. }
  4877. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4878. e.prototype = c.prototype;
  4879. b.prototype = new e
  4880. };
  4881. (function(b) {
  4882. var c = function(e) {
  4883. function a() {
  4884. e.call(this);
  4885. this._mcData = null;
  4886. this.numFrames = 1;
  4887. this.frames = [];
  4888. this.labels = null;
  4889. this.frameRate = 0;
  4890. this.spriteSheet = this.textureData = null
  4891. }
  4892. __extends(a, e);
  4893. a.prototype._init = function(d, a, b) {
  4894. this.textureData = a;
  4895. this.spriteSheet = b;
  4896. this._setMCData(d)
  4897. };
  4898. a.prototype.getKeyFrameData = function(d) {
  4899. d = this.frames[d - 1];
  4900. d.frame && (d = this.frames[d.frame - 1]);
  4901. return d
  4902. };
  4903. a.prototype.getTextureByFrame = function(d) {
  4904. d = this.getKeyFrameData(d);
  4905. if (d.res) {
  4906. var a = this.getTextureByResName(d.res);
  4907. a._offsetX = d.x | 0;
  4908. a._offsetY = d.y | 0;
  4909. return a
  4910. }
  4911. return null
  4912. };
  4913. a.prototype.getTextureByResName = function(d) {
  4914. var a = this.spriteSheet.getTexture(d);
  4915. a || (a = this.textureData[d], a = this.spriteSheet.createTexture(d, a.x, a.y, a.w, a.h));
  4916. return a
  4917. };
  4918. a.prototype._isDataValid = function() {
  4919. return 0 < this.frames.length
  4920. };
  4921. a.prototype._isTextureValid = function() {
  4922. return null != this.textureData && null != this.spriteSheet
  4923. };
  4924. a.prototype._fillMCData = function(d) {
  4925. this.frameRate = d.frameRate || 24;
  4926. this._fillFramesData(d.frames);
  4927. this._fillFrameLabelsData(d.labels)
  4928. };
  4929. a.prototype._fillFramesData = function(d) {
  4930. for (var a = this.frames, b = d ? d.length : 0, e, c = 0; c < b; c++)
  4931. if (e = d[c], a.push(e), e.duration) {
  4932. var f = parseInt(e.duration);
  4933. if (1 < f) {
  4934. e = a.length;
  4935. for (var h = 1; h < f; h++) a.push({
  4936. frame: e
  4937. })
  4938. }
  4939. }
  4940. this.numFrames = a.length
  4941. };
  4942. a.prototype._fillFrameLabelsData = function(a) {
  4943. if (a) {
  4944. var e = a.length;
  4945. if (0 < e) {
  4946. this.labels = [];
  4947. for (var c = 0; c < e; c++) {
  4948. var k = a[c];
  4949. this.labels.push(new b.FrameLabel(k.name, k.frame))
  4950. }
  4951. }
  4952. }
  4953. };
  4954. Object.defineProperty(a.prototype, "mcData", {
  4955. get: function() {
  4956. return this._mcData
  4957. },
  4958. set: function(a) {
  4959. this._setMCData(a)
  4960. },
  4961. enumerable: !0,
  4962. configurable: !0
  4963. });
  4964. a.prototype._setMCData = function(a) {
  4965. this._mcData != a && (this._mcData = a) && this._fillMCData(a)
  4966. };
  4967. return a
  4968. }(b.HashObject);
  4969. b.MovieClipData = c;
  4970. c.prototype.__class__ = "egret.MovieClipData"
  4971. })(egret || (egret = {}));
  4972. __extends = this.__extends || function(b, c) {
  4973. function e() {
  4974. this.constructor = b
  4975. }
  4976. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4977. e.prototype = c.prototype;
  4978. b.prototype = new e
  4979. };
  4980. (function(b) {
  4981. var c = function(e) {
  4982. function a(a, b) {
  4983. e.call(this);
  4984. this.enableCache = !0;
  4985. this._mcDataCache = {};
  4986. this._mcDataSet = a;
  4987. this.setTexture(b)
  4988. }
  4989. __extends(a, e);
  4990. a.prototype.clearCache = function() {
  4991. this._mcDataCache = {}
  4992. };
  4993. a.prototype.generateMovieClipData = function(a) {
  4994. void 0 === a && (a = "");
  4995. if ("" == a && this._mcDataSet)
  4996. for (a in this._mcDataSet.mc) break;
  4997. if ("" == a) return null;
  4998. var e = this._findFromCache(a, this._mcDataCache);
  4999. e || (e = new b.MovieClipData, this._fillData(a, e, this._mcDataCache));
  5000. return e
  5001. };
  5002. a.prototype._findFromCache =
  5003. function(a, b) {
  5004. return this.enableCache && b[a] ? b[a] : null
  5005. };
  5006. a.prototype._fillData = function(a, b, e) {
  5007. if (this._mcDataSet) {
  5008. var c = this._mcDataSet.mc[a];
  5009. c && (b._init(c, this._mcDataSet.res, this._spriteSheet), this.enableCache && (e[a] = b))
  5010. }
  5011. };
  5012. Object.defineProperty(a.prototype, "mcDataSet", {
  5013. get: function() {
  5014. return this._mcDataSet
  5015. },
  5016. set: function(a) {
  5017. this._mcDataSet = a
  5018. },
  5019. enumerable: !0,
  5020. configurable: !0
  5021. });
  5022. Object.defineProperty(a.prototype, "texture", {
  5023. set: function(a) {
  5024. this.setTexture(a)
  5025. },
  5026. enumerable: !0,
  5027. configurable: !0
  5028. });
  5029. Object.defineProperty(a.prototype,
  5030. "spriteSheet", {
  5031. get: function() {
  5032. return this._spriteSheet
  5033. },
  5034. enumerable: !0,
  5035. configurable: !0
  5036. });
  5037. a.prototype.setTexture = function(a) {
  5038. this._spriteSheet = a ? new b.SpriteSheet(a) : null
  5039. };
  5040. return a
  5041. }(b.EventDispatcher);
  5042. b.MovieClipDataFactory = c;
  5043. c.prototype.__class__ = "egret.MovieClipDataFactory"
  5044. })(egret || (egret = {}));
  5045. __extends = this.__extends || function(b, c) {
  5046. function e() {
  5047. this.constructor = b
  5048. }
  5049. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5050. e.prototype = c.prototype;
  5051. b.prototype = new e
  5052. };
  5053. (function(b) {
  5054. var c = function(b) {
  5055. function a() {
  5056. b.call(this);
  5057. this._scaleY = this._scaleX = 1;
  5058. this._size = 30;
  5059. this._color = "#FFFFFF";
  5060. this._fontFamily = "Arial";
  5061. this._italic = this._bold = !1;
  5062. this._textAlign = "left";
  5063. this._multiline = this._visible = !1;
  5064. this._maxChars = 0
  5065. }
  5066. __extends(a, b);
  5067. a.prototype._getText = function() {
  5068. return null
  5069. };
  5070. a.prototype._setText = function(a) {};
  5071. a.prototype._setTextType = function(a) {};
  5072. a.prototype._getTextType = function() {
  5073. return null
  5074. };
  5075. a.prototype._open = function(a, b, e, c) {};
  5076. a.prototype._show = function() {};
  5077. a.prototype._add =
  5078. function() {};
  5079. a.prototype._remove = function() {};
  5080. a.prototype._hide = function() {};
  5081. a.prototype._addListeners = function() {};
  5082. a.prototype._removeListeners = function() {};
  5083. a.prototype._setScale = function(a, b) {
  5084. this._scaleX = a;
  5085. this._scaleY = b
  5086. };
  5087. a.prototype.changePosition = function(a, b) {};
  5088. a.prototype._setSize = function(a) {
  5089. this._size = a
  5090. };
  5091. a.prototype._setTextColor = function(a) {
  5092. this._color = a
  5093. };
  5094. a.prototype._setTextFontFamily = function(a) {
  5095. this._fontFamily = a
  5096. };
  5097. a.prototype._setBold = function(a) {
  5098. this._bold = a
  5099. };
  5100. a.prototype._setItalic =
  5101. function(a) {
  5102. this._italic = a
  5103. };
  5104. a.prototype._setTextAlign = function(a) {
  5105. this._textAlign = a
  5106. };
  5107. a.prototype._setVisible = function(a) {
  5108. this._visible = a
  5109. };
  5110. a.prototype._setWidth = function(a) {};
  5111. a.prototype._setHeight = function(a) {};
  5112. a.prototype._setMultiline = function(a) {
  5113. this._multiline = a
  5114. };
  5115. a.prototype._setMaxChars = function(a) {
  5116. this._maxChars = a
  5117. };
  5118. a.prototype._resetStageText = function() {};
  5119. a.create = function() {
  5120. return null
  5121. };
  5122. return a
  5123. }(b.EventDispatcher);
  5124. b.StageText = c;
  5125. c.prototype.__class__ = "egret.StageText"
  5126. })(egret || (egret = {}));
  5127. (function(b) {
  5128. var c = function() {
  5129. function b() {}
  5130. b.GET = "get";
  5131. b.POST = "post";
  5132. return b
  5133. }();
  5134. b.URLRequestMethod = c;
  5135. c.prototype.__class__ = "egret.URLRequestMethod"
  5136. })(egret || (egret = {}));
  5137. (function(b) {
  5138. var c = function() {
  5139. function b() {}
  5140. b.BINARY = "binary";
  5141. b.TEXT = "text";
  5142. b.VARIABLES = "variables";
  5143. b.TEXTURE = "texture";
  5144. b.SOUND = "sound";
  5145. return b
  5146. }();
  5147. b.URLLoaderDataFormat = c;
  5148. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  5149. })(egret || (egret = {}));
  5150. __extends = this.__extends || function(b, c) {
  5151. function e() {
  5152. this.constructor = b
  5153. }
  5154. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5155. e.prototype = c.prototype;
  5156. b.prototype = new e
  5157. };
  5158. (function(b) {
  5159. var c = function(b) {
  5160. function a(a) {
  5161. void 0 === a && (a = null);
  5162. b.call(this);
  5163. this.variables = null;
  5164. null !== a && this.decode(a)
  5165. }
  5166. __extends(a, b);
  5167. a.prototype.decode = function(a) {
  5168. this.variables || (this.variables = {});
  5169. a = a.split("+").join(" ");
  5170. for (var b, e = /[?&]?([^=]+)=([^&]*)/g; b = e.exec(a);) {
  5171. var c = decodeURIComponent(b[1]);
  5172. b = decodeURIComponent(b[2]);
  5173. if (!1 == c in this.variables) this.variables[c] = b;
  5174. else {
  5175. var g = this.variables[c];
  5176. g instanceof Array ? g.push(b) : this.variables[c] = [g, b]
  5177. }
  5178. }
  5179. };
  5180. a.prototype.toString = function() {
  5181. if (!this.variables) return "";
  5182. var a = this.variables,
  5183. b = [],
  5184. e;
  5185. for (e in a) b.push(this.encodeValue(e, a[e]));
  5186. return b.join("&")
  5187. };
  5188. a.prototype.encodeValue = function(a, b) {
  5189. return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5190. };
  5191. a.prototype.encodeArray = function(a, b) {
  5192. return a ? 0 == b.length ? encodeURIComponent(a) + "=" : b.map(function(b) {
  5193. return encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5194. }).join("&") : ""
  5195. };
  5196. return a
  5197. }(b.HashObject);
  5198. b.URLVariables = c;
  5199. c.prototype.__class__ = "egret.URLVariables"
  5200. })(egret || (egret = {}));
  5201. (function(b) {
  5202. var c = function() {
  5203. return function(b, a) {
  5204. this.value = this.name = "";
  5205. this.name = b;
  5206. this.value = a
  5207. }
  5208. }();
  5209. b.URLRequestHeader = c;
  5210. c.prototype.__class__ = "egret.URLRequestHeader"
  5211. })(egret || (egret = {}));
  5212. __extends = this.__extends || function(b, c) {
  5213. function e() {
  5214. this.constructor = b
  5215. }
  5216. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5217. e.prototype = c.prototype;
  5218. b.prototype = new e
  5219. };
  5220. (function(b) {
  5221. var c = function(e) {
  5222. function a(a) {
  5223. void 0 === a && (a = null);
  5224. e.call(this);
  5225. this.data = null;
  5226. this.method = b.URLRequestMethod.GET;
  5227. this.url = "";
  5228. this.url = a
  5229. }
  5230. __extends(a, e);
  5231. return a
  5232. }(b.HashObject);
  5233. b.URLRequest = c;
  5234. c.prototype.__class__ = "egret.URLRequest"
  5235. })(egret || (egret = {}));
  5236. __extends = this.__extends || function(b, c) {
  5237. function e() {
  5238. this.constructor = b
  5239. }
  5240. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5241. e.prototype = c.prototype;
  5242. b.prototype = new e
  5243. };
  5244. (function(b) {
  5245. var c = function(e) {
  5246. function a(a) {
  5247. void 0 === a && (a = null);
  5248. e.call(this);
  5249. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  5250. this._request = this.data = null;
  5251. this._status = -1;
  5252. a && this.load(a)
  5253. }
  5254. __extends(a, e);
  5255. a.prototype.load = function(a) {
  5256. this._request = a;
  5257. this.data = null;
  5258. b.MainContext.instance.netContext.proceed(this)
  5259. };
  5260. a.prototype.__recycle = function() {
  5261. this.data = this._request = null
  5262. };
  5263. return a
  5264. }(b.EventDispatcher);
  5265. b.URLLoader = c;
  5266. c.prototype.__class__ = "egret.URLLoader"
  5267. })(egret || (egret = {}));
  5268. __extends = this.__extends || function(b, c) {
  5269. function e() {
  5270. this.constructor = b
  5271. }
  5272. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5273. e.prototype = c.prototype;
  5274. b.prototype = new e
  5275. };
  5276. (function(b) {
  5277. var c = function(e) {
  5278. function a() {
  5279. e.call(this);
  5280. this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
  5281. this._bitmapData = null
  5282. }
  5283. __extends(a, e);
  5284. Object.defineProperty(a.prototype, "textureWidth", {
  5285. get: function() {
  5286. return this._textureWidth
  5287. },
  5288. enumerable: !0,
  5289. configurable: !0
  5290. });
  5291. Object.defineProperty(a.prototype, "textureHeight", {
  5292. get: function() {
  5293. return this._textureHeight
  5294. },
  5295. enumerable: !0,
  5296. configurable: !0
  5297. });
  5298. Object.defineProperty(a.prototype, "bitmapData", {
  5299. get: function() {
  5300. return this._bitmapData
  5301. },
  5302. enumerable: !0,
  5303. configurable: !0
  5304. });
  5305. a.prototype._setBitmapData = function(a) {
  5306. var e = b.MainContext.instance.rendererContext._texture_scale_factor;
  5307. this._bitmapData = a;
  5308. this._sourceWidth = a.width;
  5309. this._sourceHeight = a.height;
  5310. this._textureWidth = this._sourceWidth * e;
  5311. this._textureHeight = this._sourceHeight * e;
  5312. this._bitmapWidth = this._textureWidth;
  5313. this._bitmapHeight = this._textureHeight;
  5314. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY =
  5315. 0
  5316. };
  5317. a.prototype.getPixel32 = function(a, b) {
  5318. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  5319. };
  5320. return a
  5321. }(b.HashObject);
  5322. b.Texture = c;
  5323. c.prototype.__class__ = "egret.Texture"
  5324. })(egret || (egret = {}));
  5325. __extends = this.__extends || function(b, c) {
  5326. function e() {
  5327. this.constructor = b
  5328. }
  5329. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5330. e.prototype = c.prototype;
  5331. b.prototype = new e
  5332. };
  5333. (function(b) {
  5334. var c = function(e) {
  5335. function a() {
  5336. e.call(this)
  5337. }
  5338. __extends(a, e);
  5339. a.prototype.init = function() {
  5340. this._bitmapData = document.createElement("canvas");
  5341. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  5342. };
  5343. a.prototype.drawToTexture = function(d, e, c) {
  5344. var k = e || d.getBounds(b.Rectangle.identity);
  5345. if (0 == k.width || 0 == k.height) return !1;
  5346. this._bitmapData || this.init();
  5347. var g = k.x,
  5348. f = k.y;
  5349. e = k.width;
  5350. var k = k.height,
  5351. h = b.MainContext.instance.rendererContext._texture_scale_factor,
  5352. k = k / h;
  5353. e = Math.round(e /
  5354. h);
  5355. k = Math.round(k);
  5356. this.setSize(e, k);
  5357. this.begin();
  5358. d._worldTransform.identity();
  5359. d._worldTransform.a = 1 / h;
  5360. d._worldTransform.d = 1 / h;
  5361. c && (d._worldTransform.a *= c, d._worldTransform.d *= c);
  5362. c = d._anchorOffsetX;
  5363. var n = d._anchorOffsetY;
  5364. if (0 != d._anchorX || 0 != d._anchorY) c = d._anchorX * e, n = d._anchorY * k;
  5365. this._offsetX = g + c;
  5366. this._offsetY = f + n;
  5367. d._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  5368. d.worldAlpha = 1;
  5369. if (d instanceof b.DisplayObjectContainer)
  5370. for (g = d._children, f = 0, c = g.length; f < c; f++) g[f]._updateTransform();
  5371. this.renderContext.setTransform(d._worldTransform);
  5372. g = b.RenderFilter.getInstance();
  5373. f = g._drawAreaList.concat();
  5374. g._drawAreaList.length = 0;
  5375. this.renderContext.clearScreen();
  5376. this.renderContext.onRenderStart();
  5377. b.RendererContext.deleteTexture(this);
  5378. d._filter && this.renderContext.setGlobalFilter(d._filter);
  5379. d._colorTransform && this.renderContext.setGlobalColorTransform(d._colorTransform.matrix);
  5380. (c = d.mask || d._scrollRect) && this.renderContext.pushMask(c);
  5381. n = b.MainContext.__use_new_draw;
  5382. b.MainContext.__use_new_draw = !1;
  5383. d._render(this.renderContext);
  5384. b.MainContext.__use_new_draw = n;
  5385. c && this.renderContext.popMask();
  5386. d._colorTransform && this.renderContext.setGlobalColorTransform(null);
  5387. d._filter && this.renderContext.setGlobalFilter(null);
  5388. a.identityRectangle.width = e;
  5389. a.identityRectangle.height = k;
  5390. g.addDrawArea(a.identityRectangle);
  5391. this.renderContext.onRenderFinish();
  5392. g._drawAreaList = f;
  5393. this._sourceWidth = e;
  5394. this._sourceHeight = k;
  5395. this._textureWidth = this._sourceWidth * h;
  5396. this._textureHeight = this._sourceHeight * h;
  5397. this.end();
  5398. return !0
  5399. };
  5400. a.prototype.setSize = function(a, b) {
  5401. var e = this._bitmapData;
  5402. e.width = a;
  5403. e.height = b;
  5404. e.style.width = a + "px";
  5405. e.style.height = b + "px";
  5406. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
  5407. };
  5408. a.prototype.begin = function() {};
  5409. a.prototype.end = function() {};
  5410. a.prototype.dispose = function() {
  5411. this._bitmapData && (this.renderContext = this._bitmapData = null)
  5412. };
  5413. a.identityRectangle = new b.Rectangle;
  5414. return a
  5415. }(b.Texture);
  5416. b.RenderTexture = c;
  5417. c.prototype.__class__ = "egret.RenderTexture"
  5418. })(egret ||
  5419. (egret = {}));
  5420. __extends = this.__extends || function(b, c) {
  5421. function e() {
  5422. this.constructor = b
  5423. }
  5424. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5425. e.prototype = c.prototype;
  5426. b.prototype = new e
  5427. };
  5428. (function(b) {
  5429. var c = function(e) {
  5430. function a() {
  5431. e.call(this);
  5432. this.renderCost = 0;
  5433. this._texture_scale_factor = 1;
  5434. this.profiler = b.Profiler.getInstance();
  5435. a.blendModesForGL || a.initBlendMode()
  5436. }
  5437. __extends(a, e);
  5438. Object.defineProperty(a.prototype, "texture_scale_factor", {
  5439. get: function() {
  5440. return this._texture_scale_factor
  5441. },
  5442. set: function(a) {
  5443. this._setTextureScaleFactor(a)
  5444. },
  5445. enumerable: !0,
  5446. configurable: !0
  5447. });
  5448. a.prototype._setTextureScaleFactor = function(a) {
  5449. this._texture_scale_factor = a
  5450. };
  5451. a.prototype.clearScreen = function() {};
  5452. a.prototype.clearRect =
  5453. function(a, b, e, c) {};
  5454. a.prototype.drawImage = function(a, b, e, c, g, f, h, n, p, q) {
  5455. this.profiler.onDrawImage()
  5456. };
  5457. a.prototype.drawImageScale9 = function(a, b, e, c, g, f, h, n, p, q) {
  5458. return !1
  5459. };
  5460. a.prototype._addOneDraw = function() {
  5461. this.profiler.onDrawImage()
  5462. };
  5463. a.prototype.setTransform = function(a) {};
  5464. a.prototype.setAlpha = function(a, b) {};
  5465. a.prototype.setupFont = function(a, b) {};
  5466. a.prototype.measureText = function(a) {
  5467. return 0
  5468. };
  5469. a.prototype.drawText = function(a, b, e, c, g, f) {
  5470. this.profiler.onDrawImage()
  5471. };
  5472. a.prototype.strokeRect = function(a, b,
  5473. e, c, g) {};
  5474. a.prototype.pushMask = function(a) {};
  5475. a.prototype.popMask = function() {};
  5476. a.prototype.onRenderStart = function() {};
  5477. a.prototype.onRenderFinish = function() {};
  5478. a.prototype.setGlobalColorTransform = function(a) {};
  5479. a.prototype.setGlobalFilter = function(a) {};
  5480. a.createRendererContext = function(a) {
  5481. return null
  5482. };
  5483. a.deleteTexture = function(a) {
  5484. var e = b.MainContext.instance.rendererContext.gl;
  5485. if (a = a._bitmapData) {
  5486. var c = a.webGLTexture;
  5487. if (c && e)
  5488. for (var k in c) e.deleteTexture(c[k]);
  5489. a.webGLTexture = null
  5490. }
  5491. };
  5492. a.initBlendMode = function() {
  5493. a.blendModesForGL = {};
  5494. a.blendModesForGL[b.BlendMode.NORMAL] = [1, 771];
  5495. a.blendModesForGL[b.BlendMode.ADD] = [770, 1];
  5496. a.blendModesForGL[b.BlendMode.ERASE] = [0, 771];
  5497. a.blendModesForGL[b.BlendMode.ERASE_REVERSE] = [0, 770]
  5498. };
  5499. a.registerBlendModeForGL = function(d, e, c, k) {
  5500. a.blendModesForGL[d] && !k ? b.Logger.warningWithErrorId(1005, d) : a.blendModesForGL[d] = [e, c]
  5501. };
  5502. a.imageSmoothingEnabled = !0;
  5503. a.blendModesForGL = null;
  5504. return a
  5505. }(b.HashObject);
  5506. b.RendererContext = c;
  5507. c.prototype.__class__ = "egret.RendererContext"
  5508. })(egret || (egret = {}));
  5509. (function(b) {
  5510. var c = function() {
  5511. function b() {}
  5512. b.MOUSE = "mouse";
  5513. b.TOUCH = "touch";
  5514. b.mode = "touch";
  5515. return b
  5516. }();
  5517. b.InteractionMode = c;
  5518. c.prototype.__class__ = "egret.InteractionMode"
  5519. })(egret || (egret = {}));
  5520. __extends = this.__extends || function(b, c) {
  5521. function e() {
  5522. this.constructor = b
  5523. }
  5524. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5525. e.prototype = c.prototype;
  5526. b.prototype = new e
  5527. };
  5528. (function(b) {
  5529. var c = function(e) {
  5530. function a() {
  5531. e.call(this);
  5532. this._currentTouchTarget = {};
  5533. this.maxTouches = 2;
  5534. this.touchDownTarget = {};
  5535. this.touchingIdentifiers = [];
  5536. this.lastTouchY = this.lastTouchX = -1
  5537. }
  5538. __extends(a, e);
  5539. a.prototype.run = function() {};
  5540. a.prototype.getTouchData = function(a, b, e) {
  5541. var c = this._currentTouchTarget[a];
  5542. null == c && (c = {}, this._currentTouchTarget[a] = c);
  5543. c.stageX = b;
  5544. c.stageY = e;
  5545. c.identifier = a;
  5546. return c
  5547. };
  5548. a.prototype.dispatchEvent = function(a, e) {
  5549. b.TouchEvent.dispatchTouchEvent(e.target, a, e.identifier, e.stageX,
  5550. e.stageY, !1, !1, !1, !0 == this.touchDownTarget[e.identifier])
  5551. };
  5552. a.prototype.onTouchBegan = function(a, e, c) {
  5553. if (this.touchingIdentifiers.length != this.maxTouches) {
  5554. var k = b.MainContext.instance.stage.hitTest(a, e);
  5555. k && (a = this.getTouchData(c, a, e), this.touchDownTarget[c] = !0, a.target = k, a.beginTarget = k, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  5556. this.touchingIdentifiers.push(c)
  5557. }
  5558. };
  5559. a.prototype.onTouchMove = function(a, e, c) {
  5560. if (-1 != this.touchingIdentifiers.indexOf(c) && (a != this.lastTouchX || e != this.lastTouchY)) {
  5561. this.lastTouchX =
  5562. a;
  5563. this.lastTouchY = e;
  5564. var k = b.MainContext.instance.stage.hitTest(a, e);
  5565. k && (a = this.getTouchData(c, a, e), a.target = k, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  5566. }
  5567. };
  5568. a.prototype.onTouchEnd = function(a, e, c) {
  5569. var k = this.touchingIdentifiers.indexOf(c); - 1 != k && (this.touchingIdentifiers.splice(k, 1), k = b.MainContext.instance.stage.hitTest(a, e)) && (a = this.getTouchData(c, a, e), delete this.touchDownTarget[c], c = a.beginTarget, a.target = k, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), c == k ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  5570. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  5571. };
  5572. return a
  5573. }(b.HashObject);
  5574. b.TouchContext = c;
  5575. c.prototype.__class__ = "egret.TouchContext"
  5576. })(egret || (egret = {}));
  5577. __extends = this.__extends || function(b, c) {
  5578. function e() {
  5579. this.constructor = b
  5580. }
  5581. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5582. e.prototype = c.prototype;
  5583. b.prototype = new e
  5584. };
  5585. (function(b) {
  5586. var c = function(e) {
  5587. function a() {
  5588. e.call(this)
  5589. }
  5590. __extends(a, e);
  5591. a.prototype.proceed = function(a) {};
  5592. a._getUrl = function(a) {
  5593. var e = a.url; - 1 == e.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (e = e + "?" + a.data.toString());
  5594. return e
  5595. };
  5596. a.prototype.getChangeList = function() {
  5597. return []
  5598. };
  5599. return a
  5600. }(b.HashObject);
  5601. b.NetContext = c;
  5602. c.prototype.__class__ = "egret.NetContext"
  5603. })(egret || (egret = {}));
  5604. __extends = this.__extends || function(b, c) {
  5605. function e() {
  5606. this.constructor = b
  5607. }
  5608. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5609. e.prototype = c.prototype;
  5610. b.prototype = new e
  5611. };
  5612. (function(b) {
  5613. var c = function(b) {
  5614. function a() {
  5615. b.call(this);
  5616. this.frameRate = 60
  5617. }
  5618. __extends(a, b);
  5619. a.prototype.executeMainLoop = function(a, b) {};
  5620. return a
  5621. }(b.HashObject);
  5622. b.DeviceContext = c;
  5623. c.prototype.__class__ = "egret.DeviceContext"
  5624. })(egret || (egret = {}));
  5625. (function(b) {
  5626. var c = function() {
  5627. function b() {}
  5628. b.call = function(a, d) {};
  5629. b.addCallback = function(a, d) {};
  5630. return b
  5631. }();
  5632. b.ExternalInterface = c;
  5633. c.prototype.__class__ = "egret.ExternalInterface"
  5634. })(egret || (egret = {}));
  5635. __extends = this.__extends || function(b, c) {
  5636. function e() {
  5637. this.constructor = b
  5638. }
  5639. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5640. e.prototype = c.prototype;
  5641. b.prototype = new e
  5642. };
  5643. (function(b) {
  5644. var c = function(e) {
  5645. function a() {
  5646. e.call(this);
  5647. this.trans = null;
  5648. this.ua = navigator.userAgent.toLowerCase();
  5649. this.trans = this._getTrans()
  5650. }
  5651. __extends(a, e);
  5652. a.getInstance = function() {
  5653. null == a.instance && (a.instance = new a);
  5654. return a.instance
  5655. };
  5656. Object.defineProperty(a.prototype, "isMobile", {
  5657. get: function() {
  5658. b.Logger.warningWithErrorId(1E3);
  5659. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  5660. },
  5661. enumerable: !0,
  5662. configurable: !0
  5663. });
  5664. a.prototype._getHeader = function(a) {
  5665. if ("transform" in a) return "";
  5666. for (var b = ["webkit",
  5667. "ms", "Moz", "O"
  5668. ], e = 0; e < b.length; e++)
  5669. if (b[e] + "Transform" in a) return b[e];
  5670. return ""
  5671. };
  5672. a.prototype._getTrans = function() {
  5673. var a = document.createElement("div").style,
  5674. a = this._getHeader(a);
  5675. return "" == a ? "transform" : a + "Transform"
  5676. };
  5677. a.prototype.$new = function(a) {
  5678. return this.$(document.createElement(a))
  5679. };
  5680. a.prototype.$ = function(d) {
  5681. var e = document;
  5682. if (d = d instanceof HTMLElement ? d : e.querySelector(d)) d.find = d.find || this.$, d.hasClass = d.hasClass || function(a) {
  5683. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  5684. }, d.addClass =
  5685. d.addClass || function(a) {
  5686. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  5687. return this
  5688. }, d.removeClass = d.removeClass || function(a) {
  5689. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  5690. return this
  5691. }, d.remove = d.remove || function() {}, d.appendTo = d.appendTo || function(a) {
  5692. a.appendChild(this);
  5693. return this
  5694. }, d.prependTo = d.prependTo || function(a) {
  5695. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  5696. return this
  5697. }, d.transforms = d.transforms || function() {
  5698. this.style[a.getInstance().trans] =
  5699. a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  5700. return this
  5701. }, d.position = d.position || {
  5702. x: 0,
  5703. y: 0
  5704. }, d.rotation = d.rotation || 0, d.scale = d.scale || {
  5705. x: 1,
  5706. y: 1
  5707. }, d.skew = d.skew || {
  5708. x: 0,
  5709. y: 0
  5710. }, d.translates = function(a, d) {
  5711. this.position.x = a;
  5712. this.position.y = d - b.MainContext.instance.stage.stageHeight;
  5713. this.transforms();
  5714. return this
  5715. }, d.rotate = function(a) {
  5716. this.rotation = a;
  5717. this.transforms();
  5718. return this
  5719. }, d.resize = function(a, d) {
  5720. this.scale.x =
  5721. a;
  5722. this.scale.y = d;
  5723. this.transforms();
  5724. return this
  5725. }, d.setSkew = function(a, d) {
  5726. this.skew.x = a;
  5727. this.skew.y = d;
  5728. this.transforms();
  5729. return this
  5730. };
  5731. return d
  5732. };
  5733. a.prototype.translate = function(a) {
  5734. return "translate(" + a.x + "px, " + a.y + "px) "
  5735. };
  5736. a.prototype.rotate = function(a) {
  5737. return "rotate(" + a + "deg) "
  5738. };
  5739. a.prototype.scale = function(a) {
  5740. return "scale(" + a.x + ", " + a.y + ") "
  5741. };
  5742. a.prototype.skew = function(a) {
  5743. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5744. };
  5745. return a
  5746. }(b.HashObject);
  5747. b.Browser = c;
  5748. c.prototype.__class__ = "egret.Browser"
  5749. })(egret || (egret = {}));
  5750. (function(b) {
  5751. (function(b) {
  5752. b.getItem = function(b) {
  5753. return null
  5754. };
  5755. b.setItem = function(b, a) {
  5756. return !1
  5757. };
  5758. b.removeItem = function(b) {};
  5759. b.clear = function() {}
  5760. })(b.localStorage || (b.localStorage = {}))
  5761. })(egret || (egret = {}));
  5762. (function(b) {
  5763. var c = function() {
  5764. function e() {}
  5765. e.parse = function(a) {
  5766. a = b.SAXParser.getInstance().parserXML(a);
  5767. if (!a || !a.childNodes) return null;
  5768. for (var d = a.childNodes.length, c = !1, m = 0; m < d; m++) {
  5769. var k = a.childNodes[m];
  5770. if (1 == k.nodeType) {
  5771. c = !0;
  5772. break
  5773. }
  5774. }
  5775. return c ? e.parseNode(k) : null
  5776. };
  5777. e.parseNode = function(a) {
  5778. if (!a || 1 != a.nodeType) return null;
  5779. var d = {};
  5780. d.localName = a.localName;
  5781. d.name = a.nodeName;
  5782. a.namespaceURI && (d.namespace = a.namespaceURI);
  5783. a.prefix && (d.prefix = a.prefix);
  5784. for (var b = a.attributes, c = b.length, k = 0; k < c; k++) {
  5785. var g =
  5786. b[k],
  5787. f = g.name;
  5788. 0 != f.indexOf("xmlns:") && (d["$" + f] = g.value)
  5789. }
  5790. b = a.childNodes;
  5791. c = b.length;
  5792. for (k = 0; k < c; k++)
  5793. if (g = e.parseNode(b[k])) d.children || (d.children = []), g.parent = d, d.children.push(g);
  5794. !d.children && (a = a.textContent.trim()) && (d.text = a);
  5795. return d
  5796. };
  5797. e.findChildren = function(a, d, b) {
  5798. b ? b.length = 0 : b = [];
  5799. e.findByPath(a, d, b);
  5800. return b
  5801. };
  5802. e.findByPath = function(a, d, b) {
  5803. var c = d.indexOf("."),
  5804. k; - 1 == c ? (k = d, c = !0) : (k = d.substring(0, c), d = d.substring(c + 1), c = !1);
  5805. if (a = a.children)
  5806. for (var g = a.length, f = 0; f < g; f++) {
  5807. var h = a[f];
  5808. h.localName ==
  5809. k && (c ? b.push(h) : e.findByPath(h, d, b))
  5810. }
  5811. };
  5812. e.getAttributes = function(a, d) {
  5813. d ? d.length = 0 : d = [];
  5814. for (var b in a) "$" == b.charAt(0) && d.push(b.substring(1));
  5815. return d
  5816. };
  5817. return e
  5818. }();
  5819. b.XML = c;
  5820. c.prototype.__class__ = "egret.XML"
  5821. })(egret || (egret = {}));
  5822. (function(b) {
  5823. var c = function() {
  5824. function a() {}
  5825. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5826. a.BIG_ENDIAN = "BIG_ENDIAN";
  5827. return a
  5828. }();
  5829. b.Endian = c;
  5830. c.prototype.__class__ = "egret.Endian";
  5831. var e = function() {
  5832. function a(a) {
  5833. this.BUFFER_EXT_SIZE = 0;
  5834. this.EOF_code_point = this.EOF_byte = -1;
  5835. this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
  5836. this.endian = c.BIG_ENDIAN
  5837. }
  5838. a.prototype._setArrayBuffer = function(a) {
  5839. this.write_position = a.byteLength;
  5840. this.data = new DataView(a);
  5841. this._position = 0
  5842. };
  5843. a.prototype.setArrayBuffer = function(a) {};
  5844. Object.defineProperty(a.prototype,
  5845. "buffer", {
  5846. get: function() {
  5847. return this.data.buffer
  5848. },
  5849. set: function(a) {
  5850. this.data = new DataView(a)
  5851. },
  5852. enumerable: !0,
  5853. configurable: !0
  5854. });
  5855. Object.defineProperty(a.prototype, "dataView", {
  5856. get: function() {
  5857. return this.data
  5858. },
  5859. set: function(a) {
  5860. this.data = a;
  5861. this.write_position = a.byteLength
  5862. },
  5863. enumerable: !0,
  5864. configurable: !0
  5865. });
  5866. Object.defineProperty(a.prototype, "bufferOffset", {
  5867. get: function() {
  5868. return this.data.byteOffset
  5869. },
  5870. enumerable: !0,
  5871. configurable: !0
  5872. });
  5873. Object.defineProperty(a.prototype, "position", {
  5874. get: function() {
  5875. return this._position
  5876. },
  5877. set: function(a) {
  5878. this._position < a && !this.validate(a - this._position) || (this._position = a, this.write_position = a > this.write_position ? a : this.write_position)
  5879. },
  5880. enumerable: !0,
  5881. configurable: !0
  5882. });
  5883. Object.defineProperty(a.prototype, "length", {
  5884. get: function() {
  5885. return this.write_position
  5886. },
  5887. set: function(a) {
  5888. this.validateBuffer(a)
  5889. },
  5890. enumerable: !0,
  5891. configurable: !0
  5892. });
  5893. Object.defineProperty(a.prototype, "bytesAvailable", {
  5894. get: function() {
  5895. return this.data.byteLength - this._position
  5896. },
  5897. enumerable: !0,
  5898. configurable: !0
  5899. });
  5900. a.prototype.clear =
  5901. function() {
  5902. this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
  5903. };
  5904. a.prototype.readBoolean = function() {
  5905. return this.validate(a.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
  5906. };
  5907. a.prototype.readByte = function() {
  5908. return this.validate(a.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
  5909. };
  5910. a.prototype.readBytes = function(d, b, e) {
  5911. void 0 === b && (b = 0);
  5912. void 0 === e && (e = 0);
  5913. if (0 == e) e = this.bytesAvailable;
  5914. else if (!this.validate(e)) return null;
  5915. d ? d.validateBuffer(e) : d = new a(new ArrayBuffer(e));
  5916. for (var c =
  5917. 0; c < e; c++) d.data.setUint8(c + b, this.data.getUint8(this.position++))
  5918. };
  5919. a.prototype.readDouble = function() {
  5920. if (!this.validate(a.SIZE_OF_FLOAT64)) return null;
  5921. var d = this.data.getFloat64(this.position, this.endian == c.LITTLE_ENDIAN);
  5922. this.position += a.SIZE_OF_FLOAT64;
  5923. return d
  5924. };
  5925. a.prototype.readFloat = function() {
  5926. if (!this.validate(a.SIZE_OF_FLOAT32)) return null;
  5927. var d = this.data.getFloat32(this.position, this.endian == c.LITTLE_ENDIAN);
  5928. this.position += a.SIZE_OF_FLOAT32;
  5929. return d
  5930. };
  5931. a.prototype.readInt = function() {
  5932. if (!this.validate(a.SIZE_OF_INT32)) return null;
  5933. var d = this.data.getInt32(this.position, this.endian == c.LITTLE_ENDIAN);
  5934. this.position += a.SIZE_OF_INT32;
  5935. return d
  5936. };
  5937. a.prototype.readMultiByte = function(a, b) {
  5938. return this.validate(a) ? "" : null
  5939. };
  5940. a.prototype.readShort = function() {
  5941. if (!this.validate(a.SIZE_OF_INT16)) return null;
  5942. var d = this.data.getInt16(this.position, this.endian == c.LITTLE_ENDIAN);
  5943. this.position += a.SIZE_OF_INT16;
  5944. return d
  5945. };
  5946. a.prototype.readUnsignedByte = function() {
  5947. return this.validate(a.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
  5948. };
  5949. a.prototype.readUnsignedInt =
  5950. function() {
  5951. if (!this.validate(a.SIZE_OF_UINT32)) return null;
  5952. var d = this.data.getUint32(this.position, this.endian == c.LITTLE_ENDIAN);
  5953. this.position += a.SIZE_OF_UINT32;
  5954. return d
  5955. };
  5956. a.prototype.readUnsignedShort = function() {
  5957. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5958. var d = this.data.getUint16(this.position, this.endian == c.LITTLE_ENDIAN);
  5959. this.position += a.SIZE_OF_UINT16;
  5960. return d
  5961. };
  5962. a.prototype.readUTF = function() {
  5963. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5964. var d = this.data.getUint16(this.position, this.endian ==
  5965. c.LITTLE_ENDIAN);
  5966. this.position += a.SIZE_OF_UINT16;
  5967. return 0 < d ? this.readUTFBytes(d) : ""
  5968. };
  5969. a.prototype.readUTFBytes = function(a) {
  5970. if (!this.validate(a)) return null;
  5971. var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
  5972. this.position += a;
  5973. return this.decodeUTF8(b)
  5974. };
  5975. a.prototype.writeBoolean = function(d) {
  5976. this.validateBuffer(a.SIZE_OF_BOOLEAN);
  5977. this.data.setUint8(this.position++, d ? 1 : 0)
  5978. };
  5979. a.prototype.writeByte = function(d) {
  5980. this.validateBuffer(a.SIZE_OF_INT8);
  5981. this.data.setInt8(this.position++, d)
  5982. };
  5983. a.prototype.writeBytes =
  5984. function(a, b, e) {
  5985. void 0 === b && (b = 0);
  5986. void 0 === e && (e = 0);
  5987. if (!(0 > b || 0 > e) && (e = 0 == e ? a.length - b : Math.min(a.length - b, e), 0 < e)) {
  5988. this.validateBuffer(e);
  5989. a = new DataView(a.buffer);
  5990. for (var c = b; c < e + b; c++) this.data.setUint8(this.position++, a.getUint8(c))
  5991. }
  5992. };
  5993. a.prototype.writeDouble = function(d) {
  5994. this.validateBuffer(a.SIZE_OF_FLOAT64);
  5995. this.data.setFloat64(this.position, d, this.endian == c.LITTLE_ENDIAN);
  5996. this.position += a.SIZE_OF_FLOAT64
  5997. };
  5998. a.prototype.writeFloat = function(d) {
  5999. this.validateBuffer(a.SIZE_OF_FLOAT32);
  6000. this.data.setFloat32(this.position,
  6001. d, this.endian == c.LITTLE_ENDIAN);
  6002. this.position += a.SIZE_OF_FLOAT32
  6003. };
  6004. a.prototype.writeInt = function(d) {
  6005. this.validateBuffer(a.SIZE_OF_INT32);
  6006. this.data.setInt32(this.position, d, this.endian == c.LITTLE_ENDIAN);
  6007. this.position += a.SIZE_OF_INT32
  6008. };
  6009. a.prototype.writeShort = function(d) {
  6010. this.validateBuffer(a.SIZE_OF_INT16);
  6011. this.data.setInt16(this.position, d, this.endian == c.LITTLE_ENDIAN);
  6012. this.position += a.SIZE_OF_INT16
  6013. };
  6014. a.prototype.writeUnsignedInt = function(d) {
  6015. this.validateBuffer(a.SIZE_OF_UINT32);
  6016. this.data.setUint32(this.position,
  6017. d, this.endian == c.LITTLE_ENDIAN);
  6018. this.position += a.SIZE_OF_UINT32
  6019. };
  6020. a.prototype.writeUTF = function(d) {
  6021. d = this.encodeUTF8(d);
  6022. var b = d.length;
  6023. this.validateBuffer(a.SIZE_OF_UINT16 + b);
  6024. this.data.setUint16(this.position, b, this.endian === c.LITTLE_ENDIAN);
  6025. this.position += a.SIZE_OF_UINT16;
  6026. this._writeUint8Array(d, !1)
  6027. };
  6028. a.prototype.writeUTFBytes = function(a) {
  6029. this._writeUint8Array(this.encodeUTF8(a))
  6030. };
  6031. a.prototype.toString = function() {
  6032. return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
  6033. };
  6034. a.prototype._writeUint8Array =
  6035. function(a, b) {
  6036. void 0 === b && (b = !0);
  6037. b && this.validateBuffer(this.position + a.length);
  6038. for (var e = 0; e < a.length; e++) this.data.setUint8(this.position++, a[e])
  6039. };
  6040. a.prototype.validate = function(a) {
  6041. if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return !0;
  6042. throw b.getString(1025);
  6043. };
  6044. a.prototype.validateBuffer = function(a) {
  6045. this.write_position = a > this.write_position ? a : this.write_position;
  6046. a += this._position;
  6047. this.data.byteLength < a && (a = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)), a.set(new Uint8Array(this.data.buffer)),
  6048. this.buffer = a.buffer)
  6049. };
  6050. a.prototype.encodeUTF8 = function(a) {
  6051. var b = 0;
  6052. a = this.stringToCodePoints(a);
  6053. for (var e = []; a.length > b;) {
  6054. var c = a[b++];
  6055. if (this.inRange(c, 55296, 57343)) this.encoderError(c);
  6056. else if (this.inRange(c, 0, 127)) e.push(c);
  6057. else {
  6058. var g, f;
  6059. this.inRange(c, 128, 2047) ? (g = 1, f = 192) : this.inRange(c, 2048, 65535) ? (g = 2, f = 224) : this.inRange(c, 65536, 1114111) && (g = 3, f = 240);
  6060. for (e.push(this.div(c, Math.pow(64, g)) + f); 0 < g;) {
  6061. var h = this.div(c, Math.pow(64, g - 1));
  6062. e.push(128 + h % 64);
  6063. g -= 1
  6064. }
  6065. }
  6066. }
  6067. return new Uint8Array(e)
  6068. };
  6069. a.prototype.decodeUTF8 =
  6070. function(a) {
  6071. for (var b = 0, e = "", c, g = 0, f = 0, h = 0, n = 0; a.length > b;) {
  6072. c = a[b++];
  6073. if (c === this.EOF_byte) c = 0 !== f ? this.decoderError(!1) : this.EOF_code_point;
  6074. else if (0 === f) this.inRange(c, 0, 127) || (this.inRange(c, 194, 223) ? (f = 1, n = 128, g = c - 192) : this.inRange(c, 224, 239) ? (f = 2, n = 2048, g = c - 224) : this.inRange(c, 240, 244) ? (f = 3, n = 65536, g = c - 240) : this.decoderError(!1), g *= Math.pow(64, f), c = null);
  6075. else if (this.inRange(c, 128, 191))
  6076. if (h += 1, g += (c - 128) * Math.pow(64, f - h), h !== f) c = null;
  6077. else {
  6078. var p = g,
  6079. q = n,
  6080. n = h = f = g = 0;
  6081. c = this.inRange(p, q, 1114111) && !this.inRange(p,
  6082. 55296, 57343) ? p : this.decoderError(!1, c)
  6083. } else n = h = f = g = 0, b--, c = this.decoderError(!1, c);
  6084. null !== c && c !== this.EOF_code_point && (65535 >= c ? 0 < c && (e += String.fromCharCode(c)) : (c -= 65536, e += String.fromCharCode(55296 + (c >> 10 & 1023)), e += String.fromCharCode(56320 + (c & 1023))))
  6085. }
  6086. return e
  6087. };
  6088. a.prototype.encoderError = function(a) {
  6089. throw b.getString(1026, a);
  6090. };
  6091. a.prototype.decoderError = function(a, e) {
  6092. if (a) throw b.getString(1027);
  6093. return e || 65533
  6094. };
  6095. a.prototype.inRange = function(a, b, e) {
  6096. return b <= a && a <= e
  6097. };
  6098. a.prototype.div = function(a, b) {
  6099. return Math.floor(a /
  6100. b)
  6101. };
  6102. a.prototype.stringToCodePoints = function(a) {
  6103. for (var b = [], e = 0, c = a.length; e < a.length;) {
  6104. var g = a.charCodeAt(e);
  6105. if (this.inRange(g, 55296, 57343))
  6106. if (this.inRange(g, 56320, 57343)) b.push(65533);
  6107. else if (e === c - 1) b.push(65533);
  6108. else {
  6109. var f = a.charCodeAt(e + 1);
  6110. this.inRange(f, 56320, 57343) ? (g &= 1023, f &= 1023, e += 1, b.push(65536 + (g << 10) + f)) : b.push(65533)
  6111. } else b.push(g);
  6112. e += 1
  6113. }
  6114. return b
  6115. };
  6116. a.SIZE_OF_BOOLEAN = 1;
  6117. a.SIZE_OF_INT8 = 1;
  6118. a.SIZE_OF_INT16 = 2;
  6119. a.SIZE_OF_INT32 = 4;
  6120. a.SIZE_OF_UINT8 = 1;
  6121. a.SIZE_OF_UINT16 = 2;
  6122. a.SIZE_OF_UINT32 = 4;
  6123. a.SIZE_OF_FLOAT32 =
  6124. 4;
  6125. a.SIZE_OF_FLOAT64 = 8;
  6126. return a
  6127. }();
  6128. b.ByteArray = e;
  6129. e.prototype.__class__ = "egret.ByteArray"
  6130. })(egret || (egret = {}));
  6131. __extends = this.__extends || function(b, c) {
  6132. function e() {
  6133. this.constructor = b
  6134. }
  6135. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6136. e.prototype = c.prototype;
  6137. b.prototype = new e
  6138. };
  6139. (function(b) {
  6140. var c = function(e) {
  6141. function a(a, b, c) {
  6142. e.call(this);
  6143. this._target = null;
  6144. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  6145. this._actions = this._steps = this.pluginData = null;
  6146. this.paused = !1;
  6147. this.duration = 0;
  6148. this._prevPos = -1;
  6149. this.position = null;
  6150. this._stepPosition = this._prevPosition = 0;
  6151. this.passive = !1;
  6152. this.initialize(a, b, c)
  6153. }
  6154. __extends(a, e);
  6155. a.get = function(d, b, e, c) {
  6156. void 0 === b && (b = null);
  6157. void 0 === e && (e = null);
  6158. void 0 === c && (c = !1);
  6159. c && a.removeTweens(d);
  6160. return new a(d, b, e)
  6161. };
  6162. a.removeTweens = function(d) {
  6163. if (d.tween_count) {
  6164. for (var b =
  6165. a._tweens, e = b.length - 1; 0 <= e; e--) b[e]._target == d && (b[e].paused = !0, b.splice(e, 1));
  6166. d.tween_count = 0
  6167. }
  6168. };
  6169. a.pauseTweens = function(a) {
  6170. if (a.tween_count)
  6171. for (var e = b.Tween._tweens, c = e.length - 1; 0 <= c; c--) e[c]._target == a && (e[c].paused = !0)
  6172. };
  6173. a.resumeTweens = function(a) {
  6174. if (a.tween_count)
  6175. for (var e = b.Tween._tweens, c = e.length - 1; 0 <= c; c--) e[c]._target == a && (e[c].paused = !1)
  6176. };
  6177. a.tick = function(d, b) {
  6178. void 0 === b && (b = !1);
  6179. for (var e = a._tweens.concat(), c = e.length - 1; 0 <= c; c--) {
  6180. var g = e[c];
  6181. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
  6182. 1 : d)
  6183. }
  6184. };
  6185. a._register = function(d, e) {
  6186. var c = d._target,
  6187. k = a._tweens;
  6188. if (e) c && (c.tween_count = 0 < c.tween_count ? c.tween_count + 1 : 1), k.push(d), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  6189. else
  6190. for (c && c.tween_count--, c = k.length; c--;)
  6191. if (k[c] == d) {
  6192. k.splice(c, 1);
  6193. break
  6194. }
  6195. };
  6196. a.removeAllTweens = function() {
  6197. for (var d = a._tweens, b = 0, e = d.length; b < e; b++) {
  6198. var c = d[b];
  6199. c.paused = !0;
  6200. c._target.tweenjs_count = 0
  6201. }
  6202. d.length = 0
  6203. };
  6204. a.prototype.initialize = function(d, b, e) {
  6205. this._target = d;
  6206. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  6207. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(d));
  6208. this.pluginData = e || {};
  6209. this._curQueueProps = {};
  6210. this._initQueueProps = {};
  6211. this._steps = [];
  6212. this._actions = [];
  6213. b && b.paused ? this.paused = !0 : a._register(this, !0);
  6214. b && null != b.position && this.setPosition(b.position, a.NONE)
  6215. };
  6216. a.prototype.setPosition = function(a, b) {
  6217. void 0 === b && (b = 1);
  6218. 0 > a && (a = 0);
  6219. var e = a,
  6220. c = !1;
  6221. e >= this.duration && (this.loop ? e %= this.duration : (e = this.duration, c = !0));
  6222. if (e == this._prevPos) return c;
  6223. var g = this._prevPos;
  6224. this.position = this._prevPos = e;
  6225. this._prevPosition = a;
  6226. if (this._target)
  6227. if (c) this._updateTargetProps(null, 1);
  6228. else if (0 < this._steps.length) {
  6229. for (var f = 0, h = this._steps.length; f < h && !(this._steps[f].t > e); f++);
  6230. f = this._steps[f - 1];
  6231. this._updateTargetProps(f, (this._stepPosition = e - f.t) / f.d)
  6232. }
  6233. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(e, e) : 1 == b && e < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, e, !0)) : this._runActions(g, e));
  6234. c && this.setPaused(!0);
  6235. this.dispatchEventWith("change");
  6236. return c
  6237. };
  6238. a.prototype._runActions = function(a, b, e) {
  6239. void 0 === e && (e = !1);
  6240. var c = a,
  6241. g = b,
  6242. f = -1,
  6243. h = this._actions.length,
  6244. n = 1;
  6245. a > b && (c = b, g = a, f = h, h = n = -1);
  6246. for (;
  6247. (f += n) != h;) {
  6248. b = this._actions[f];
  6249. var p = b.t;
  6250. (p == g || p > c && p < g || e && p == a) && b.f.apply(b.o, b.p)
  6251. }
  6252. };
  6253. a.prototype._updateTargetProps = function(d, b) {
  6254. var e, c, g, f;
  6255. if (d || 1 != b) {
  6256. if (this.passive = !!d.v) return;
  6257. d.e && (b = d.e(b, 0, 1, 1));
  6258. e = d.p0;
  6259. c = d.p1
  6260. } else this.passive = !1, e = c = this._curQueueProps;
  6261. for (var h in this._initQueueProps) {
  6262. null == (g = e[h]) && (e[h] = g = this._initQueueProps[h]);
  6263. null ==
  6264. (f = c[h]) && (c[h] = f = g);
  6265. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f : g : g + (f - g) * b;
  6266. var n = !1;
  6267. if (f = a._plugins[h])
  6268. for (var p = 0, q = f.length; p < q; p++) {
  6269. var r = f[p].tween(this, h, g, e, c, b, !!d && e == c, !d);
  6270. r == a.IGNORE ? n = !0 : g = r
  6271. }
  6272. n || (this._target[h] = g)
  6273. }
  6274. };
  6275. a.prototype.setPaused = function(d) {
  6276. this.paused = d;
  6277. a._register(this, !d);
  6278. return this
  6279. };
  6280. a.prototype._cloneProps = function(a) {
  6281. var b = {},
  6282. e;
  6283. for (e in a) b[e] = a[e];
  6284. return b
  6285. };
  6286. a.prototype._addStep = function(a) {
  6287. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  6288. return this
  6289. };
  6290. a.prototype._appendQueueProps = function(d) {
  6291. var b, e, c, g, f, h;
  6292. for (h in d)
  6293. if (void 0 === this._initQueueProps[h]) {
  6294. e = this._target[h];
  6295. if (b = a._plugins[h])
  6296. for (c = 0, g = b.length; c < g; c++) e = b[c].init(this, h, e);
  6297. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === e ? null : e
  6298. }
  6299. for (h in d) {
  6300. e = this._curQueueProps[h];
  6301. if (b = a._plugins[h])
  6302. for (f = f || {}, c = 0, g = b.length; c < g; c++) b[c].step && b[c].step(this, h, e, d[h], f);
  6303. this._curQueueProps[h] = d[h]
  6304. }
  6305. f && this._appendQueueProps(f);
  6306. return this._curQueueProps
  6307. };
  6308. a.prototype._addAction = function(a) {
  6309. a.t =
  6310. this.duration;
  6311. this._actions.push(a);
  6312. return this
  6313. };
  6314. a.prototype._set = function(a, b) {
  6315. for (var e in a) b[e] = a[e]
  6316. };
  6317. a.prototype.wait = function(a, b) {
  6318. if (null == a || 0 >= a) return this;
  6319. var e = this._cloneProps(this._curQueueProps);
  6320. return this._addStep({
  6321. d: a,
  6322. p0: e,
  6323. p1: e,
  6324. v: b
  6325. })
  6326. };
  6327. a.prototype.to = function(a, b, e) {
  6328. void 0 === e && (e = void 0);
  6329. if (isNaN(b) || 0 > b) b = 0;
  6330. return this._addStep({
  6331. d: b || 0,
  6332. p0: this._cloneProps(this._curQueueProps),
  6333. e: e,
  6334. p1: this._cloneProps(this._appendQueueProps(a))
  6335. })
  6336. };
  6337. a.prototype.call = function(a, b, e) {
  6338. void 0 === b && (b = void 0);
  6339. void 0 === e && (e = void 0);
  6340. return this._addAction({
  6341. f: a,
  6342. p: e ? e : [],
  6343. o: b ? b : this._target
  6344. })
  6345. };
  6346. a.prototype.set = function(a, b) {
  6347. void 0 === b && (b = null);
  6348. return this._addAction({
  6349. f: this._set,
  6350. o: this,
  6351. p: [a, b ? b : this._target]
  6352. })
  6353. };
  6354. a.prototype.play = function(a) {
  6355. a || (a = this);
  6356. return this.call(a.setPaused, a, [!1])
  6357. };
  6358. a.prototype.pause = function(a) {
  6359. a || (a = this);
  6360. return this.call(a.setPaused, a, [!0])
  6361. };
  6362. a.prototype.tick = function(a) {
  6363. this.paused || this.setPosition(this._prevPosition + a)
  6364. };
  6365. a.NONE = 0;
  6366. a.LOOP = 1;
  6367. a.REVERSE = 2;
  6368. a._tweens = [];
  6369. a.IGNORE = {};
  6370. a._plugins = {};
  6371. a._inited = !1;
  6372. return a
  6373. }(b.EventDispatcher);
  6374. b.Tween = c;
  6375. c.prototype.__class__ = "egret.Tween"
  6376. })(egret || (egret = {}));
  6377. (function(b) {
  6378. var c = function() {
  6379. function e() {
  6380. b.Logger.fatalWithErrorId(1014)
  6381. }
  6382. e.get = function(a) {
  6383. -1 > a && (a = -1);
  6384. 1 < a && (a = 1);
  6385. return function(d) {
  6386. return 0 == a ? d : 0 > a ? d * (d * -a + 1 + a) : d * ((2 - d) * a + (1 - a))
  6387. }
  6388. };
  6389. e.getPowIn = function(a) {
  6390. return function(d) {
  6391. return Math.pow(d, a)
  6392. }
  6393. };
  6394. e.getPowOut = function(a) {
  6395. return function(d) {
  6396. return 1 - Math.pow(1 - d, a)
  6397. }
  6398. };
  6399. e.getPowInOut = function(a) {
  6400. return function(d) {
  6401. return 1 > (d *= 2) ? 0.5 * Math.pow(d, a) : 1 - 0.5 * Math.abs(Math.pow(2 - d, a))
  6402. }
  6403. };
  6404. e.sineIn = function(a) {
  6405. return 1 - Math.cos(a * Math.PI / 2)
  6406. };
  6407. e.sineOut = function(a) {
  6408. return Math.sin(a *
  6409. Math.PI / 2)
  6410. };
  6411. e.sineInOut = function(a) {
  6412. return -0.5 * (Math.cos(Math.PI * a) - 1)
  6413. };
  6414. e.getBackIn = function(a) {
  6415. return function(d) {
  6416. return d * d * ((a + 1) * d - a)
  6417. }
  6418. };
  6419. e.getBackOut = function(a) {
  6420. return function(d) {
  6421. return --d * d * ((a + 1) * d + a) + 1
  6422. }
  6423. };
  6424. e.getBackInOut = function(a) {
  6425. a *= 1.525;
  6426. return function(d) {
  6427. return 1 > (d *= 2) ? 0.5 * d * d * ((a + 1) * d - a) : 0.5 * ((d -= 2) * d * ((a + 1) * d + a) + 2)
  6428. }
  6429. };
  6430. e.circIn = function(a) {
  6431. return -(Math.sqrt(1 - a * a) - 1)
  6432. };
  6433. e.circOut = function(a) {
  6434. return Math.sqrt(1 - --a * a)
  6435. };
  6436. e.circInOut = function(a) {
  6437. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 *
  6438. (Math.sqrt(1 - (a -= 2) * a) + 1)
  6439. };
  6440. e.bounceIn = function(a) {
  6441. return 1 - e.bounceOut(1 - a)
  6442. };
  6443. e.bounceOut = function(a) {
  6444. 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
  6445. };
  6446. e.bounceInOut = function(a) {
  6447. return 0.5 > a ? 0.5 * e.bounceIn(2 * a) : 0.5 * e.bounceOut(2 * a - 1) + 0.5
  6448. };
  6449. e.getElasticIn = function(a, d) {
  6450. var b = 2 * Math.PI;
  6451. return function(e) {
  6452. if (0 == e || 1 == e) return e;
  6453. var c = d / b * Math.asin(1 / a);
  6454. return -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - c) * b / d))
  6455. }
  6456. };
  6457. e.getElasticOut =
  6458. function(a, d) {
  6459. var b = 2 * Math.PI;
  6460. return function(e) {
  6461. if (0 == e || 1 == e) return e;
  6462. var c = d / b * Math.asin(1 / a);
  6463. return a * Math.pow(2, -10 * e) * Math.sin((e - c) * b / d) + 1
  6464. }
  6465. };
  6466. e.getElasticInOut = function(a, d) {
  6467. var b = 2 * Math.PI;
  6468. return function(e) {
  6469. var c = d / b * Math.asin(1 / a);
  6470. return 1 > (e *= 2) ? -0.5 * a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - c) * b / d) : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - c) * b / d) * 0.5 + 1
  6471. }
  6472. };
  6473. e.quadIn = e.getPowIn(2);
  6474. e.quadOut = e.getPowOut(2);
  6475. e.quadInOut = e.getPowInOut(2);
  6476. e.cubicIn = e.getPowIn(3);
  6477. e.cubicOut = e.getPowOut(3);
  6478. e.cubicInOut = e.getPowInOut(3);
  6479. e.quartIn = e.getPowIn(4);
  6480. e.quartOut = e.getPowOut(4);
  6481. e.quartInOut = e.getPowInOut(4);
  6482. e.quintIn = e.getPowIn(5);
  6483. e.quintOut = e.getPowOut(5);
  6484. e.quintInOut = e.getPowInOut(5);
  6485. e.backIn = e.getBackIn(1.7);
  6486. e.backOut = e.getBackOut(1.7);
  6487. e.backInOut = e.getBackInOut(1.7);
  6488. e.elasticIn = e.getElasticIn(1, 0.3);
  6489. e.elasticOut = e.getElasticOut(1, 0.3);
  6490. e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
  6491. return e
  6492. }();
  6493. b.Ease = c;
  6494. c.prototype.__class__ = "egret.Ease"
  6495. })(egret || (egret = {}));
  6496. (function(b) {
  6497. var c = function() {
  6498. function b() {
  6499. this.path = "";
  6500. this.audio = null;
  6501. this.type = b.EFFECT
  6502. }
  6503. b.prototype.play = function(a) {
  6504. void 0 === a && (a = !1);
  6505. var d = this.audio;
  6506. d && (isNaN(d.duration) || (d.currentTime = 0), d.loop = a, d.play())
  6507. };
  6508. b.prototype.pause = function() {
  6509. var a = this.audio;
  6510. a && a.pause()
  6511. };
  6512. b.prototype.load = function() {
  6513. var a = this.audio;
  6514. a && a.load()
  6515. };
  6516. b.prototype.addEventListener = function(a, d) {
  6517. this.audio && this.audio.addEventListener(a, d, !1)
  6518. };
  6519. b.prototype.removeEventListener = function(a, d) {
  6520. this.audio && this.audio.removeEventListener(a,
  6521. d, !1)
  6522. };
  6523. b.prototype.setVolume = function(a) {
  6524. var d = this.audio;
  6525. d && (d.volume = a)
  6526. };
  6527. b.prototype.getVolume = function() {
  6528. return this.audio ? this.audio.volume : 0
  6529. };
  6530. b.prototype.preload = function(a) {
  6531. this.type = a
  6532. };
  6533. b.prototype._setAudio = function(a) {
  6534. this.audio = a
  6535. };
  6536. b.MUSIC = "music";
  6537. b.EFFECT = "effect";
  6538. return b
  6539. }();
  6540. b.Sound = c;
  6541. c.prototype.__class__ = "egret.Sound"
  6542. })(egret || (egret = {}));
  6543. (function(b) {
  6544. var c = function() {
  6545. function b() {}
  6546. b.isNumber = function(a) {
  6547. return "number" === typeof a && !isNaN(a)
  6548. };
  6549. b.sin = function(a) {
  6550. a = Math.round(a);
  6551. a %= 360;
  6552. 0 > a && (a += 360);
  6553. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  6554. };
  6555. b.cos = function(a) {
  6556. a = Math.round(a);
  6557. a %= 360;
  6558. 0 > a && (a += 360);
  6559. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  6560. };
  6561. return b
  6562. }();
  6563. b.NumberUtils = c;
  6564. c.prototype.__class__ = "egret.NumberUtils"
  6565. })(egret ||
  6566. (egret = {}));
  6567. for (var egret_sin_map = {}, egret_cos_map = {}, i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD), egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  6568. Function.prototype.bind || (Function.prototype.bind = function(b) {
  6569. if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
  6570. var c = Array.prototype.slice.call(arguments, 1),
  6571. e = this,
  6572. a = function() {},
  6573. d = function() {
  6574. return e.apply(this instanceof a && b ? this : b, c.concat(Array.prototype.slice.call(arguments)))
  6575. };
  6576. a.prototype = this.prototype;
  6577. d.prototype = new a;
  6578. return d
  6579. });
  6580. __extends = this.__extends || function(b, c) {
  6581. function e() {
  6582. this.constructor = b
  6583. }
  6584. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6585. e.prototype = c.prototype;
  6586. b.prototype = new e
  6587. };
  6588. (function(b) {
  6589. var c = function(e) {
  6590. function a(d) {
  6591. void 0 === d && (d = 60);
  6592. e.call(this);
  6593. this.frameRate = d;
  6594. this._time = 0;
  6595. this._requestAnimationId = NaN;
  6596. this._isActivate = !0;
  6597. 60 == d && (a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame ||
  6598. window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6599. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6600. return window.setTimeout(a, 1E3 / d)
  6601. });
  6602. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6603. return window.clearTimeout(a)
  6604. });
  6605. a.instance = this;
  6606. this.registerListener()
  6607. }
  6608. __extends(a, e);
  6609. a.prototype.enterFrame = function() {
  6610. var d = a.instance,
  6611. e = a._thisObject,
  6612. c = a._callback,
  6613. k = b.getTimer(),
  6614. g = k - d._time;
  6615. d._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6616. c.call(e, g);
  6617. d._time = k
  6618. };
  6619. a.prototype.executeMainLoop = function(d, b) {
  6620. a._callback = d;
  6621. a._thisObject = b;
  6622. this.enterFrame()
  6623. };
  6624. a.prototype.reset = function() {
  6625. var d = a.instance;
  6626. d._requestAnimationId && (d._time = b.getTimer(), a.cancelAnimationFrame.call(window, d._requestAnimationId), d.enterFrame())
  6627. };
  6628. a.prototype.registerListener = function() {
  6629. var d = this,
  6630. e = function() {
  6631. d._isActivate && (d._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6632. },
  6633. c = function() {
  6634. d._isActivate || (d._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6635. },
  6636. k = function() {
  6637. document[g] ? e() : c()
  6638. };
  6639. window.addEventListener("focus", c, !1);
  6640. window.addEventListener("blur", e, !1);
  6641. var g, f;
  6642. "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 ?
  6643. (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6644. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", c, !1), window.addEventListener("pagehide", e, !1));
  6645. g && f && document.addEventListener(f, k, !1)
  6646. };
  6647. a.instance = null;
  6648. a.requestAnimationFrame = null;
  6649. a.cancelAnimationFrame = null;
  6650. a._thisObject = null;
  6651. a._callback = null;
  6652. return a
  6653. }(b.DeviceContext);
  6654. b.HTML5DeviceContext = c;
  6655. c.prototype.__class__ = "egret.HTML5DeviceContext"
  6656. })(egret ||
  6657. (egret = {}));
  6658. var egret_html5_localStorage;
  6659. (function(b) {
  6660. b.getItem = function(b) {
  6661. return window.localStorage.getItem(b)
  6662. };
  6663. b.setItem = function(b, e) {
  6664. try {
  6665. return window.localStorage.setItem(b, e), !0
  6666. } catch (a) {
  6667. return egret.Logger.infoWithErrorId(1018, b, e), !1
  6668. }
  6669. };
  6670. b.removeItem = function(b) {
  6671. window.localStorage.removeItem(b)
  6672. };
  6673. b.clear = function() {
  6674. window.localStorage.clear()
  6675. };
  6676. b.init = function() {
  6677. for (var c in b) egret.localStorage[c] = b[c]
  6678. }
  6679. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6680. egret_html5_localStorage.init();
  6681. __extends = this.__extends || function(b, c) {
  6682. function e() {
  6683. this.constructor = b
  6684. }
  6685. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6686. e.prototype = c.prototype;
  6687. b.prototype = new e
  6688. };
  6689. (function(b) {
  6690. var c = function(e) {
  6691. function a(a, b) {
  6692. void 0 === b && (b = !0);
  6693. e.call(this);
  6694. this.useCacheCanvas = b;
  6695. this.canvas = a || this.createCanvas();
  6696. this.canvasContext = this.canvas.getContext("2d");
  6697. b ? (this._cacheCanvas = document.createElement("canvas"), this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height, this.drawCanvasContext = this._cacheCanvasContext = this._cacheCanvas.getContext("2d")) : this.drawCanvasContext = this.canvasContext;
  6698. this.onResize();
  6699. var c = this.drawCanvasContext.setTransform,
  6700. k = this;
  6701. this.drawCanvasContext.setTransform = function(a, d, b, e, l, q) {
  6702. k._matrixA = a;
  6703. k._matrixB = d;
  6704. k._matrixC = b;
  6705. k._matrixD = e;
  6706. k._matrixTx = l;
  6707. k._matrixTy = q;
  6708. c.call(k.drawCanvasContext, a, d, b, e, l, q)
  6709. };
  6710. this._matrixA = 1;
  6711. this._matrixC = this._matrixB = 0;
  6712. this._matrixD = 1;
  6713. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6714. this.initBlendMode()
  6715. }
  6716. __extends(a, e);
  6717. a.prototype.createCanvas = function() {
  6718. var a = b.Browser.getInstance().$("#egretCanvas");
  6719. if (!a) {
  6720. var e = document.getElementById(b.StageDelegate.canvas_div_name),
  6721. a = b.Browser.getInstance().$new("canvas");
  6722. a.id = "egretCanvas";
  6723. e.appendChild(a)
  6724. }
  6725. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  6726. return a
  6727. };
  6728. a.prototype.onResize = function() {
  6729. if (this.canvas) {
  6730. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6731. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6732. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6733. this.canvas.style.width = a.style.width;
  6734. this.canvas.style.height = a.style.height;
  6735. this.useCacheCanvas && (this._cacheCanvas.width =
  6736. this.canvas.width, this._cacheCanvas.height = this.canvas.height);
  6737. this.drawCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6738. this.drawCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6739. this.drawCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6740. this.drawCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6741. }
  6742. };
  6743. a.prototype.clearScreen = function() {
  6744. for (var a = b.RenderFilter.getInstance().getDrawAreaList(),
  6745. e = 0, c = a.length; e < c; e++) {
  6746. var k = a[e];
  6747. this.clearRect(k.x, k.y, k.width, k.height)
  6748. }
  6749. a = b.MainContext.instance.stage;
  6750. this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  6751. this.renderCost = 0
  6752. };
  6753. a.prototype.clearRect = function(a, b, e, c) {
  6754. this.canvasContext.clearRect(a, b, e, c)
  6755. };
  6756. a.prototype.drawImage = function(a, c, m, k, g, f, h, n, p, q) {
  6757. void 0 === q && (q = void 0);
  6758. var r = a._bitmapData;
  6759. f += this._transformTx;
  6760. h += this._transformTy;
  6761. var t = b.getTimer();
  6762. void 0 === q ? this.drawCanvasContext.drawImage(r, c, m, k,
  6763. g, f, h, n, p) : this.drawRepeatImage(a, c, m, k, g, f, h, n, p, q);
  6764. e.prototype.drawImage.call(this, a, c, m, k, g, f, h, n, p, q);
  6765. this.renderCost += b.getTimer() - t
  6766. };
  6767. a.prototype.drawRepeatImage = function(a, e, c, k, g, f, h, n, p, q) {
  6768. if (void 0 === a.pattern) {
  6769. var r = b.MainContext.instance.rendererContext._texture_scale_factor,
  6770. t = a._bitmapData,
  6771. s = t;
  6772. if (t.width != k || t.height != g || 1 != r) s = document.createElement("canvas"), s.width = k * r, s.height = g * r, s.getContext("2d").drawImage(t, e, c, k, g, 0, 0, k * r, g * r);
  6773. e = this.drawCanvasContext.createPattern(s, q);
  6774. a.pattern =
  6775. e
  6776. }
  6777. this.drawCanvasContext.fillStyle = a.pattern;
  6778. this.drawCanvasContext.translate(f, h);
  6779. this.drawCanvasContext.fillRect(0, 0, n, p);
  6780. this.drawCanvasContext.translate(-f, -h)
  6781. };
  6782. a.prototype.setTransform = function(a) {
  6783. 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 &&
  6784. this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  6785. };
  6786. a.prototype.setAlpha = function(a, e) {
  6787. this.drawCanvasContext.globalAlpha = a;
  6788. e ? (this.blendValue = this.blendModes[e], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
  6789. };
  6790. a.prototype.initBlendMode = function() {
  6791. this.blendModes = {};
  6792. this.blendModes[b.BlendMode.NORMAL] =
  6793. "source-over";
  6794. this.blendModes[b.BlendMode.ADD] = "lighter";
  6795. this.blendModes[b.BlendMode.ERASE] = "destination-out";
  6796. this.blendModes[b.BlendMode.ERASE_REVERSE] = "destination-in"
  6797. };
  6798. a.prototype.setupFont = function(a, b) {
  6799. void 0 === b && (b = null);
  6800. b = b || {};
  6801. var e = null == b.size ? a._size : b.size,
  6802. c = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  6803. g = this.drawCanvasContext,
  6804. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  6805. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  6806. g.font = f + (e + "px " + c);
  6807. g.textAlign = "left";
  6808. g.textBaseline =
  6809. "middle"
  6810. };
  6811. a.prototype.measureText = function(a) {
  6812. return this.drawCanvasContext.measureText(a).width
  6813. };
  6814. a.prototype.drawText = function(a, c, m, k, g, f) {
  6815. void 0 === f && (f = null);
  6816. this.setupFont(a, f);
  6817. f = f || {};
  6818. var h;
  6819. h = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6820. var n;
  6821. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6822. var p;
  6823. p = null != f.stroke ? f.stroke : a._stroke;
  6824. var q = this.drawCanvasContext;
  6825. q.fillStyle = h;
  6826. q.strokeStyle = n;
  6827. p && (q.lineWidth = 2 * p, q.strokeText(c, m + this._transformTx, k +
  6828. this._transformTy, g || 65535));
  6829. q.fillText(c, m + this._transformTx, k + this._transformTy, g || 65535);
  6830. e.prototype.drawText.call(this, a, c, m, k, g, f)
  6831. };
  6832. a.prototype.strokeRect = function(a, b, e, c, g) {
  6833. this.drawCanvasContext.strokeStyle = g;
  6834. this.drawCanvasContext.strokeRect(a, b, e, c)
  6835. };
  6836. a.prototype.pushMask = function(a) {
  6837. this.drawCanvasContext.save();
  6838. this.drawCanvasContext.beginPath();
  6839. this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6840. this.drawCanvasContext.clip();
  6841. this.drawCanvasContext.closePath()
  6842. };
  6843. a.prototype.popMask = function() {
  6844. this.drawCanvasContext.restore();
  6845. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6846. };
  6847. a.prototype.onRenderStart = function() {
  6848. this.drawCanvasContext.save()
  6849. };
  6850. a.prototype.onRenderFinish = function() {
  6851. this.drawCanvasContext.restore();
  6852. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6853. if (this.useCacheCanvas)
  6854. for (var a = this._cacheCanvas.width, e = this._cacheCanvas.height, c = b.RenderFilter.getInstance().getDrawAreaList(), k = 0, g = c.length; k < g; k++) {
  6855. var f = c[k],
  6856. h = f.x,
  6857. n = f.y,
  6858. p = f.width,
  6859. f = f.height;
  6860. h + p > a && (p = a - h);
  6861. n + f > e && (f = e - n);
  6862. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, h, n, p, f, h, n, p, f)
  6863. }
  6864. };
  6865. return a
  6866. }(b.RendererContext);
  6867. b.HTML5CanvasRenderer = c;
  6868. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6869. })(egret || (egret = {}));
  6870. var egret_h5_graphics;
  6871. (function(b) {
  6872. b.beginFill = function(b, a) {
  6873. void 0 === a && (a = 1);
  6874. var d = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6875. this.fillStyleColor = d;
  6876. this._pushCommand(new c(this._setStyle, this, [d]))
  6877. };
  6878. b.drawRect = function(b, a, d, l) {
  6879. this._pushCommand(new c(function(a, d, b, e) {
  6880. var c = this.renderContext;
  6881. this.canvasContext.beginPath();
  6882. this.canvasContext.rect(c._transformTx + a, c._transformTy + d, b, e);
  6883. this.canvasContext.closePath()
  6884. }, this, [b, a, d, l]));
  6885. this._fill();
  6886. this.checkRect(b, a, d, l)
  6887. };
  6888. b.drawCircle = function(b, a, d) {
  6889. this._pushCommand(new c(function(a,
  6890. d, b) {
  6891. var e = this.renderContext;
  6892. this.canvasContext.beginPath();
  6893. this.canvasContext.arc(e._transformTx + a, e._transformTy + d, b, 0, 2 * Math.PI);
  6894. this.canvasContext.closePath()
  6895. }, this, [b, a, d]));
  6896. this._fill();
  6897. this.checkRect(b - d, a - d, 2 * d, 2 * d)
  6898. };
  6899. b.drawRoundRect = function(b, a, d, l, m, k) {
  6900. this._pushCommand(new c(function(a, d, b, e, c, l) {
  6901. var m = this.renderContext;
  6902. a = m._transformTx + a;
  6903. d = m._transformTy + d;
  6904. c /= 2;
  6905. l = l ? l / 2 : c;
  6906. b = a + b;
  6907. e = d + e;
  6908. m = e - l;
  6909. this.canvasContext.beginPath();
  6910. this.canvasContext.moveTo(b, m);
  6911. this.canvasContext.quadraticCurveTo(b,
  6912. e, b - c, e);
  6913. this.canvasContext.lineTo(a + c, e);
  6914. this.canvasContext.quadraticCurveTo(a, e, a, e - l);
  6915. this.canvasContext.lineTo(a, d + l);
  6916. this.canvasContext.quadraticCurveTo(a, d, a + c, d);
  6917. this.canvasContext.lineTo(b - c, d);
  6918. this.canvasContext.quadraticCurveTo(b, d, b, d + l);
  6919. this.canvasContext.lineTo(b, m);
  6920. this.canvasContext.closePath()
  6921. }, this, [b, a, d, l, m, k]));
  6922. this._fill();
  6923. this.checkRect(b, a, d, l)
  6924. };
  6925. b.drawEllipse = function(b, a, d, l) {
  6926. this._pushCommand(new c(function(a, d, b, e) {
  6927. var c = this.renderContext;
  6928. this.canvasContext.save();
  6929. a = c._transformTx +
  6930. a;
  6931. d = c._transformTy + d;
  6932. var c = b > e ? b : e,
  6933. l = b / c;
  6934. e /= c;
  6935. this.canvasContext.scale(l, e);
  6936. this.canvasContext.beginPath();
  6937. this.canvasContext.moveTo((a + b) / l, d / e);
  6938. this.canvasContext.arc(a / l, d / e, c, 0, 2 * Math.PI);
  6939. this.canvasContext.closePath();
  6940. this.canvasContext.restore();
  6941. this.canvasContext.stroke()
  6942. }, this, [b, a, d, l]));
  6943. this._fill();
  6944. this.checkRect(b - d, a - l, 2 * d, 2 * l)
  6945. };
  6946. b.lineStyle = function(b, a, d, l, m, k, g, f) {
  6947. void 0 === b && (b = NaN);
  6948. void 0 === a && (a = 0);
  6949. void 0 === d && (d = 1);
  6950. void 0 === l && (l = !1);
  6951. void 0 === m && (m = "normal");
  6952. void 0 === k && (k = null);
  6953. void 0 === g && (g = null);
  6954. void 0 === f && (f = 3);
  6955. this.strokeStyleColor && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand));
  6956. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + d + ")";
  6957. this._pushCommand(new c(function(a, d) {
  6958. this.canvasContext.lineWidth = a;
  6959. this.canvasContext.strokeStyle = d;
  6960. this.canvasContext.beginPath()
  6961. }, this, [b, a]));
  6962. this.moveTo(this.lineX, this.lineY)
  6963. };
  6964. b.lineTo = function(b, a) {
  6965. this._pushCommand(new c(function(a, b) {
  6966. var e = this.renderContext;
  6967. this.canvasContext.lineTo(e._transformTx +
  6968. a, e._transformTy + b)
  6969. }, this, [b, a]));
  6970. this.checkPoint(this.lineX, this.lineY);
  6971. this.lineX = b;
  6972. this.lineY = a;
  6973. this.checkPoint(b, a)
  6974. };
  6975. b.curveTo = function(b, a, d, l) {
  6976. this._pushCommand(new c(function(a, d, b, e) {
  6977. var c = this.renderContext;
  6978. this.canvasContext.quadraticCurveTo(c._transformTx + a, c._transformTy + d, c._transformTx + b, c._transformTy + e)
  6979. }, this, [b, a, d, l]));
  6980. this.checkPoint(this.lineX, this.lineY);
  6981. this.lineX = d;
  6982. this.lineY = l;
  6983. this.checkPoint(b, a);
  6984. this.checkPoint(d, l)
  6985. };
  6986. b.moveTo = function(b, a) {
  6987. this._pushCommand(new c(function(a,
  6988. b) {
  6989. var e = this.renderContext;
  6990. this.canvasContext.moveTo(e._transformTx + a, e._transformTy + b)
  6991. }, this, [b, a]))
  6992. };
  6993. b.clear = function() {
  6994. this.lineY = this.lineX = this.commandQueue.length = 0;
  6995. this.fillStyleColor = this.strokeStyleColor = null;
  6996. this._dirty = !1;
  6997. this._maxY = this._maxX = this._minY = this._minX = 0;
  6998. this._firstCheck = !0
  6999. };
  7000. b.createEndFillCommand = function() {
  7001. this.endFillCommand || (this.endFillCommand = new c(function() {
  7002. this.canvasContext.fill();
  7003. this.canvasContext.closePath()
  7004. }, this, null))
  7005. };
  7006. b.endFill = function() {
  7007. null != this.fillStyleColor &&
  7008. this._fill()
  7009. };
  7010. b._fill = function() {
  7011. this.fillStyleColor && (this.createEndFillCommand(), this._pushCommand(this.endFillCommand), this.fillStyleColor = null)
  7012. };
  7013. b.createEndLineCommand = function() {
  7014. this.endLineCommand || (this.endLineCommand = new c(function() {
  7015. this.canvasContext.stroke();
  7016. this.canvasContext.closePath()
  7017. }, this, null))
  7018. };
  7019. b._pushCommand = function(b) {
  7020. this.commandQueue.push(b);
  7021. this._dirty = !0
  7022. };
  7023. b._draw = function(b) {
  7024. var a = this.commandQueue.length;
  7025. if (0 != a) {
  7026. this.renderContext = b;
  7027. b = this.canvasContext = this.renderContext.drawCanvasContext;
  7028. b.save();
  7029. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand), a = this.commandQueue.length);
  7030. for (var d = 0; d < a; d++) {
  7031. var c = this.commandQueue[d];
  7032. c.method.apply(c.thisObject, c.args)
  7033. }
  7034. b.restore();
  7035. this._dirty = !1
  7036. }
  7037. };
  7038. var c = function() {
  7039. return function(b, a, d) {
  7040. this.method = b;
  7041. this.thisObject = a;
  7042. this.args = d
  7043. }
  7044. }();
  7045. c.prototype.__class__ = "egret_h5_graphics.Command";
  7046. b._setStyle = function(b) {
  7047. this.canvasContext.fillStyle = b;
  7048. this.canvasContext.beginPath()
  7049. };
  7050. b.init = function() {
  7051. for (var e in b) egret.Graphics.prototype[e] = b[e];
  7052. egret.RendererContext.createRendererContext = function(a) {
  7053. return new egret.HTML5CanvasRenderer(a, !1)
  7054. }
  7055. }
  7056. })(egret_h5_graphics || (egret_h5_graphics = {}));
  7057. egret_h5_graphics.init();
  7058. __extends = this.__extends || function(b, c) {
  7059. function e() {
  7060. this.constructor = b
  7061. }
  7062. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7063. e.prototype = c.prototype;
  7064. b.prototype = new e
  7065. };
  7066. (function(b) {
  7067. var c = function(e) {
  7068. function a(a) {
  7069. e.call(this);
  7070. this.glID = this.gl = this.canvas = null;
  7071. this.size = 2E3;
  7072. this.vertices = null;
  7073. this.vertSize = 5;
  7074. this.indices = null;
  7075. this.projectionY = this.projectionX = NaN;
  7076. this.shaderManager = null;
  7077. this.contextLost = !1;
  7078. this.glContextId = 0;
  7079. this.currentBlendMode = "";
  7080. this.currentBaseTexture = null;
  7081. this.currentBatchSize = 0;
  7082. this.worldTransform = null;
  7083. this.worldAlpha = 1;
  7084. this.maskList = [];
  7085. this.maskDataFreeList = [];
  7086. this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints =
  7087. this.filterType = this.colorTransformMatrix = null;
  7088. this.graphicsStyle = {};
  7089. this.canvas = a || this.createCanvas();
  7090. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7091. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  7092. this.html5Canvas = document.createElement("canvas");
  7093. this.canvasContext = new b.HTML5CanvasRenderer(this.html5Canvas);
  7094. this.onResize();
  7095. this.projectionX = this.canvas.width / 2;
  7096. this.projectionY = -this.canvas.height / 2;
  7097. a = 6 * this.size;
  7098. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7099. this.indices = new Uint16Array(a);
  7100. for (var c = 0, m = 0; c < a; c += 6, m += 4) this.indices[c + 0] = m + 0, this.indices[c + 1] = m + 1, this.indices[c + 2] = m + 2, this.indices[c + 3] = m + 0, this.indices[c + 4] = m + 2, this.indices[c + 5] = m + 3;
  7101. this.initWebGL();
  7102. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7103. this.worldTransform = new b.Matrix;
  7104. this.initAll()
  7105. }
  7106. __extends(a, e);
  7107. a.prototype.onRenderFinish = function() {
  7108. this._draw()
  7109. };
  7110. a.prototype.initAll = function() {
  7111. a.isInit || (a.isInit = !0, egret_webgl_graphics.init(),
  7112. b.TextField.prototype._makeBitmapCache = function() {
  7113. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  7114. var a = this.getBounds(b.Rectangle.identity);
  7115. if (0 == a.width || 0 == a.height) return this._texture_to_render = null, !1;
  7116. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.renderContext = b.RendererContext.createRendererContext(this._bitmapData));
  7117. var e = a.width,
  7118. a = a.height,
  7119. c = b.MainContext.instance.rendererContext._texture_scale_factor,
  7120. a = a / c,
  7121. e = Math.round(e / c),
  7122. a = Math.round(a),
  7123. k = this._bitmapData;
  7124. k.width = e;
  7125. k.height = a;
  7126. k.style.width = e + "px";
  7127. k.style.height = a + "px";
  7128. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e, this.renderContext._cacheCanvas.height = a);
  7129. this._worldTransform.identity();
  7130. this._worldTransform.a = 1 / c;
  7131. this._worldTransform.d = 1 / c;
  7132. this.renderContext.setTransform(this._worldTransform);
  7133. this.worldAlpha = 1;
  7134. var k = b.RenderFilter.getInstance(),
  7135. g = k._drawAreaList.concat();
  7136. k._drawAreaList.length = 0;
  7137. this.renderContext.clearScreen();
  7138. this.renderContext.onRenderStart();
  7139. b.RendererContext.deleteTexture(this.renderTexture);
  7140. this._colorTransform && this.renderContext.setGlobalColorTransform(this._colorTransform.matrix);
  7141. var f = this.mask || this._scrollRect;
  7142. f && this.renderContext.pushMask(f);
  7143. this._render(this.renderContext);
  7144. f && this.renderContext.popMask();
  7145. this._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7146. b.RenderTexture.identityRectangle.width = e;
  7147. b.RenderTexture.identityRectangle.height = a;
  7148. k.addDrawArea(b.RenderTexture.identityRectangle);
  7149. this.renderContext.onRenderFinish();
  7150. k._drawAreaList = g;
  7151. this.renderTexture._bitmapData =
  7152. this._bitmapData;
  7153. this.renderTexture._sourceWidth = e;
  7154. this.renderTexture._sourceHeight = a;
  7155. this.renderTexture._textureWidth = this.renderTexture._sourceWidth * c;
  7156. this.renderTexture._textureHeight = this.renderTexture._sourceHeight * c;
  7157. this._texture_to_render = this.renderTexture;
  7158. return !0
  7159. }, b.TextField.prototype._draw = function(a) {
  7160. this.getDirty() && (this._texture_to_render = this.renderTexture, this._cacheAsBitmap = !0);
  7161. b.DisplayObject.prototype._draw.call(this, a)
  7162. }, b.RenderTexture.prototype.init = function() {
  7163. this._bitmapData =
  7164. document.createElement("canvas");
  7165. this.canvasContext = this._bitmapData.getContext("2d");
  7166. this._webglBitmapData = document.createElement("canvas");
  7167. this.renderContext = new b.WebGLRenderer(this._webglBitmapData)
  7168. }, b.RenderTexture.prototype.setSize = function(a, e) {
  7169. if (this._webglBitmapData) {
  7170. var c = this._webglBitmapData;
  7171. c.width = a;
  7172. c.height = e;
  7173. c.style.width = a + "px";
  7174. c.style.height = e + "px";
  7175. this.renderContext.projectionX = a / 2;
  7176. this.renderContext.projectionY = -e / 2;
  7177. this.renderContext.viewportScale = b.MainContext.instance.rendererContext._texture_scale_factor
  7178. }
  7179. },
  7180. b.RenderTexture.prototype.end = function() {}, b.RenderTexture.prototype.drawToTexture = function(a, e, c) {
  7181. var k = e || a.getBounds(b.Rectangle.identity);
  7182. if (0 == k.width || 0 == k.height || e && (0 == e.width || 0 == e.height)) return !1;
  7183. "undefined" == typeof c && (c = 1);
  7184. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.canvasContext = this._bitmapData.getContext("2d"), b.RenderTexture.WebGLCanvas || (b.RenderTexture.WebGLCanvas = document.createElement("canvas"), b.RenderTexture.WebGLRenderer = new b.WebGLRenderer(b.RenderTexture.WebGLCanvas)),
  7185. this._webglBitmapData = b.RenderTexture.WebGLCanvas, this.renderContext = b.RenderTexture.WebGLRenderer);
  7186. var g = k.x,
  7187. f = k.y;
  7188. e = k.width;
  7189. var k = k.height,
  7190. k = k / c,
  7191. h = b.MainContext.instance.rendererContext._texture_scale_factor;
  7192. e = Math.round(e / c);
  7193. k = Math.round(k);
  7194. this.setSize(e, k);
  7195. var n = this._bitmapData,
  7196. p = e / h * c,
  7197. q = k / h * c;
  7198. n.width = p;
  7199. n.height = q;
  7200. n.style.width = p + "px";
  7201. n.style.height = q + "px";
  7202. this.begin();
  7203. a._worldTransform.identity();
  7204. n = a._anchorOffsetX;
  7205. p = a._anchorOffsetY;
  7206. if (0 != a._anchorX || 0 != a._anchorY) n = a._anchorX * e, p = a._anchorY *
  7207. k;
  7208. this._offsetX = g + n;
  7209. this._offsetY = f + p;
  7210. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  7211. a.worldAlpha = 1;
  7212. g = b.MainContext.__use_new_draw;
  7213. b.MainContext.__use_new_draw = !1;
  7214. if (a instanceof b.DisplayObjectContainer)
  7215. for (f = a._children, n = 0, p = f.length; n < p; n++) f[n]._updateTransform();
  7216. this.renderContext.setTransform(a._worldTransform);
  7217. f = b.RenderFilter.getInstance();
  7218. n = f._drawAreaList.concat();
  7219. f._drawAreaList.length = 0;
  7220. p = this.renderContext.gl;
  7221. p.viewport(0, 0, e, k);
  7222. p.bindFramebuffer(p.FRAMEBUFFER, null);
  7223. p.clearColor(0, 0, 0, 0);
  7224. p.clear(p.COLOR_BUFFER_BIT);
  7225. this.renderContext.onRenderStart();
  7226. b.RendererContext.deleteTexture(this);
  7227. a._filter && this.renderContext.setGlobalFilter(a._filter);
  7228. a._colorTransform && this.renderContext.setGlobalColorTransform(a._colorTransform.matrix);
  7229. (p = a.mask || a._scrollRect) && this.renderContext.pushMask(p);
  7230. a._render(this.renderContext);
  7231. this.renderContext._draw();
  7232. b.MainContext.__use_new_draw = g;
  7233. p && this.renderContext.popMask();
  7234. a._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7235. a._filter && this.renderContext.setGlobalFilter(null);
  7236. b.RenderTexture.identityRectangle.width = e;
  7237. b.RenderTexture.identityRectangle.height = k;
  7238. f.addDrawArea(b.RenderTexture.identityRectangle);
  7239. this.renderContext.onRenderFinish();
  7240. f._drawAreaList = n;
  7241. this._sourceWidth = e / h * c;
  7242. this._sourceHeight = k / h * c;
  7243. this._textureWidth = e * c;
  7244. this._textureHeight = k * c;
  7245. this.canvasContext.drawImage(this._webglBitmapData, 0, 0, e, k, 0, 0, this._sourceWidth, this._sourceHeight);
  7246. return !0
  7247. })
  7248. };
  7249. a.prototype.createCanvas = function() {
  7250. var a = b.Browser.getInstance().$("#egretCanvas");
  7251. if (!a) {
  7252. var e = document.getElementById(b.StageDelegate.canvas_div_name),
  7253. a = b.Browser.getInstance().$new("canvas");
  7254. a.id = "egretCanvas";
  7255. e.appendChild(a)
  7256. }
  7257. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  7258. return a
  7259. };
  7260. a.prototype.onResize = function() {
  7261. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7262. this.canvas && (this.canvas.width = b.MainContext.instance.stage.stageWidth, this.canvas.height = b.MainContext.instance.stage.stageHeight, this.canvas.style.width = a.style.width,
  7263. this.canvas.style.height = a.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
  7264. this.html5Canvas && (this.html5Canvas.width = b.MainContext.instance.stage.stageWidth, this.html5Canvas.height = b.MainContext.instance.stage.stageHeight, this.html5Canvas.style.width = a.style.width, this.html5Canvas.style.height = a.style.height)
  7265. };
  7266. a.prototype.handleContextLost = function() {
  7267. this.contextLost = !0
  7268. };
  7269. a.prototype.handleContextRestored = function() {
  7270. this.initWebGL();
  7271. this.shaderManager.setContext(this.gl);
  7272. this.contextLost = !1
  7273. };
  7274. a.prototype.initWebGL = function() {
  7275. for (var d = {}, e, c = ["experimental-webgl", "webgl"], k = 0; k < c.length; k++) {
  7276. try {
  7277. e = this.canvas.getContext(c[k], d)
  7278. } catch (g) {}
  7279. if (e) break
  7280. }
  7281. if (!e) throw Error(b.getString(1021));
  7282. a.glID++;
  7283. this.glID = a.glID;
  7284. this.setContext(e)
  7285. };
  7286. a.prototype.setContext = function(a) {
  7287. this.gl = a;
  7288. a.id = this.glContextId++;
  7289. this.vertexBuffer = a.createBuffer();
  7290. this.indexBuffer = a.createBuffer();
  7291. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7292. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices,
  7293. a.STATIC_DRAW);
  7294. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7295. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7296. a.disable(a.DEPTH_TEST);
  7297. a.disable(a.CULL_FACE);
  7298. a.enable(a.BLEND);
  7299. a.colorMask(!0, !0, !0, !0)
  7300. };
  7301. a.prototype.start = function() {
  7302. if (!this.contextLost) {
  7303. var a = this.gl;
  7304. a.activeTexture(a.TEXTURE0);
  7305. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7306. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7307. var b;
  7308. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : "blur" == this.filterType ?
  7309. this.shaderManager.blurShader : this.shaderManager.defaultShader;
  7310. this.shaderManager.activateShader(b);
  7311. b.syncUniforms();
  7312. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7313. var e = 4 * this.vertSize;
  7314. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, e, 0);
  7315. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, e, 8);
  7316. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, e, 16)
  7317. }
  7318. };
  7319. a.prototype.clearScreen = function() {
  7320. var a = this.gl;
  7321. a.colorMask(!0, !0, !0, !0);
  7322. for (var e = b.RenderFilter.getInstance().getDrawAreaList(),
  7323. c = 0, k = e.length; c < k; c++) {
  7324. var g = e[c];
  7325. a.viewport(g.x, g.y, g.width, g.height);
  7326. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7327. a.clearColor(0, 0, 0, 0);
  7328. a.clear(a.COLOR_BUFFER_BIT)
  7329. }
  7330. e = b.MainContext.instance.stage;
  7331. a.viewport(0, 0, e.stageWidth, e.stageHeight);
  7332. this.renderCost = 0
  7333. };
  7334. a.prototype.setBlendMode = function(a) {
  7335. a || (a = b.BlendMode.NORMAL);
  7336. if (this.currentBlendMode != a) {
  7337. var e = b.RendererContext.blendModesForGL[a];
  7338. e && (this._draw(), this.gl.blendFunc(e[0], e[1]), this.currentBlendMode = a)
  7339. }
  7340. };
  7341. a.prototype.drawRepeatImage = function(a, e,
  7342. c, k, g, f, h, n, p, q) {
  7343. q = b.MainContext.instance.rendererContext._texture_scale_factor;
  7344. k *= q;
  7345. for (g *= q; f < n; f += k)
  7346. for (var r = h; r < p; r += g) {
  7347. var t = Math.min(k, n - f),
  7348. s = Math.min(g, p - r);
  7349. this.drawImage(a, e, c, t / q, s / q, f, r, t, s)
  7350. }
  7351. };
  7352. a.prototype.drawImage = function(a, b, e, c, g, f, h, n, p, q) {
  7353. void 0 === q && (q = void 0);
  7354. if (!this.contextLost)
  7355. if (void 0 !== q) this.drawRepeatImage(a, b, e, c, g, f, h, n, p, q);
  7356. else {
  7357. this.createWebGLTexture(a);
  7358. q = a._bitmapData.webGLTexture[this.glID];
  7359. if (q !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(),
  7360. this.currentBaseTexture = q;
  7361. var r = this.worldTransform,
  7362. t = r.a,
  7363. s = r.b,
  7364. u = r.c,
  7365. w = r.d,
  7366. v = r.tx,
  7367. y = r.ty;
  7368. 0 == f && 0 == h || r.append(1, 0, 0, 1, f, h);
  7369. 1 == c / n && 1 == g / p || r.append(n / c, 0, 0, p / g, 0, 0);
  7370. f = r.a;
  7371. h = r.b;
  7372. n = r.c;
  7373. p = r.d;
  7374. q = r.tx;
  7375. var x = r.ty;
  7376. r.a = t;
  7377. r.b = s;
  7378. r.c = u;
  7379. r.d = w;
  7380. r.tx = v;
  7381. r.ty = y;
  7382. t = a._sourceWidth;
  7383. s = a._sourceHeight;
  7384. a = c;
  7385. r = g;
  7386. b /= t;
  7387. e /= s;
  7388. c /= t;
  7389. g /= s;
  7390. t = this.vertices;
  7391. s = 4 * this.currentBatchSize * this.vertSize;
  7392. u = this.worldAlpha;
  7393. t[s++] = q;
  7394. t[s++] = x;
  7395. t[s++] = b;
  7396. t[s++] = e;
  7397. t[s++] = u;
  7398. t[s++] = f * a + q;
  7399. t[s++] = h * a + x;
  7400. t[s++] = c + b;
  7401. t[s++] = e;
  7402. t[s++] = u;
  7403. t[s++] = f * a + n * r + q;
  7404. t[s++] =
  7405. p * r + h * a + x;
  7406. t[s++] = c + b;
  7407. t[s++] = g + e;
  7408. t[s++] = u;
  7409. t[s++] = n * r + q;
  7410. t[s++] = p * r + x;
  7411. t[s++] = b;
  7412. t[s++] = g + e;
  7413. t[s++] = u;
  7414. this.currentBatchSize++
  7415. }
  7416. };
  7417. a.prototype._draw = function() {
  7418. if (0 != this.currentBatchSize && !this.contextLost) {
  7419. var a = b.getTimer();
  7420. this.start();
  7421. var e = this.gl;
  7422. e.bindTexture(e.TEXTURE_2D, this.currentBaseTexture);
  7423. var c = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  7424. e.bufferSubData(e.ARRAY_BUFFER, 0, c);
  7425. e.drawElements(e.TRIANGLES, 6 * this.currentBatchSize, e.UNSIGNED_SHORT, 0);
  7426. this.currentBatchSize = 0;
  7427. this.renderCost +=
  7428. b.getTimer() - a;
  7429. b.Profiler.getInstance().onDrawImage()
  7430. }
  7431. };
  7432. a.prototype.setTransform = function(a) {
  7433. var b = this.worldTransform;
  7434. b.a = a.a;
  7435. b.b = a.b;
  7436. b.c = a.c;
  7437. b.d = a.d;
  7438. b.tx = a.tx;
  7439. b.ty = a.ty
  7440. };
  7441. a.prototype.setAlpha = function(a, b) {
  7442. this.worldAlpha = a;
  7443. this.setBlendMode(b)
  7444. };
  7445. a.prototype.createWebGLTexture = function(a) {
  7446. a = a._bitmapData;
  7447. a.webGLTexture || (a.webGLTexture = {});
  7448. if (!a.webGLTexture[this.glID]) {
  7449. var b = this.gl;
  7450. a.webGLTexture[this.glID] = b.createTexture();
  7451. b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
  7452. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7453. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
  7454. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7455. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7456. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7457. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7458. b.bindTexture(b.TEXTURE_2D, null)
  7459. }
  7460. };
  7461. a.prototype.pushMask = function(a) {
  7462. this._draw();
  7463. var b = this.gl;
  7464. 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
  7465. a = this.getScissorRect(a);
  7466. this.maskList.push(a);
  7467. this.scissor(a.x, a.y, a.width, a.height)
  7468. };
  7469. a.prototype.getScissorRect = function(a) {
  7470. var e = this.maskList[this.maskList.length - 1],
  7471. c, k, g;
  7472. e ? e.intersects(e) ? (c = Math.max(a.x + this.worldTransform.tx, e.x), k = Math.max(a.y + this.worldTransform.ty, e.y), g = Math.min(a.x + this.worldTransform.tx + a.width, e.x + e.width) - c, a = Math.min(a.y + this.worldTransform.ty + a.height, e.y + e.height) - k) : a = g = k = c = 0 : (c = a.x + this.worldTransform.tx, k = a.y + this.worldTransform.ty, g = a.width, a = a.height);
  7473. (e = this.maskDataFreeList.pop()) ? (e.x = c, e.y = k, e.width =
  7474. g, e.height = a) : e = new b.Rectangle(c, k, g, a);
  7475. return e
  7476. };
  7477. a.prototype.popMask = function() {
  7478. this._draw();
  7479. var a = this.gl,
  7480. b = this.maskList.pop();
  7481. this.maskDataFreeList.push(b);
  7482. b = this.maskList.length;
  7483. 0 != b ? (b = this.maskList[b - 1], (0 < b.width || 0 < b.height) && this.scissor(b.x, b.y, b.width, b.height)) : a.disable(a.SCISSOR_TEST)
  7484. };
  7485. a.prototype.scissor = function(a, e, c, k) {
  7486. var g = this.gl;
  7487. 0 > c && (c = 0);
  7488. 0 > k && (k = 0);
  7489. g.scissor(a, -e + b.MainContext.instance.stage.stageHeight - k, c, k)
  7490. };
  7491. a.prototype.setGlobalColorTransform = function(a) {
  7492. if (this.colorTransformMatrix !=
  7493. a && (this._draw(), this.colorTransformMatrix = a)) {
  7494. a = a.concat();
  7495. var b = this.shaderManager.colorTransformShader;
  7496. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  7497. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7498. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7499. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7500. b.uniforms.matrix.value = a
  7501. }
  7502. };
  7503. a.prototype.setGlobalFilter = function(a) {
  7504. this._draw();
  7505. this.setFilterProperties(a)
  7506. };
  7507. a.prototype.setFilterProperties = function(a) {
  7508. if (a) switch (this.filterType = a.type, a.type) {
  7509. case "blur":
  7510. var b =
  7511. this.shaderManager.blurShader;
  7512. b.uniforms.blur.value.x = a.blurX;
  7513. b.uniforms.blur.value.y = a.blurY
  7514. } else this.filterType = null
  7515. };
  7516. a.prototype.setupFont = function(a, b) {
  7517. void 0 === b && (b = null);
  7518. this.canvasContext.setupFont(a, b)
  7519. };
  7520. a.prototype.measureText = function(a) {
  7521. return this.canvasContext.measureText(a)
  7522. };
  7523. a.prototype.renderGraphics = function(a) {
  7524. this._draw();
  7525. var b = this.gl,
  7526. e = this.shaderManager.primitiveShader;
  7527. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7528. this.updateGraphics(a);
  7529. this.shaderManager.activateShader(e);
  7530. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7531. b.uniformMatrix3fv(e.translationMatrix, !1, this.worldTransform.toArray(!0));
  7532. b.uniform2f(e.projectionVector, this.projectionX, -this.projectionY);
  7533. b.uniform2f(e.offsetVector, 0, 0);
  7534. b.uniform3fv(e.tintColor, [1, 1, 1]);
  7535. b.uniform1f(e.alpha, this.worldAlpha);
  7536. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7537. b.vertexAttribPointer(e.aVertexPosition,
  7538. 2, b.FLOAT, !1, 24, 0);
  7539. b.vertexAttribPointer(e.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7540. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7541. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7542. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7543. };
  7544. a.prototype.updateGraphics = function(a) {
  7545. var b = this.gl;
  7546. this.buildRectangle(a);
  7547. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7548. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7549. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
  7550. this.graphicsIndexBuffer);
  7551. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7552. };
  7553. a.prototype.buildRectangle = function(a) {
  7554. var b = a.x,
  7555. e = a.y,
  7556. c = a.w;
  7557. a = a.h;
  7558. var g = this.graphicsStyle.a,
  7559. f = this.graphicsStyle.r * g,
  7560. h = this.graphicsStyle.g * g,
  7561. n = this.graphicsStyle.b * g,
  7562. p = this.graphicsPoints,
  7563. q = this.graphicsIndices,
  7564. r = p.length / 6;
  7565. p.push(b, e);
  7566. p.push(f, h, n, g);
  7567. p.push(b + c, e);
  7568. p.push(f, h, n, g);
  7569. p.push(b, e + a);
  7570. p.push(f, h, n, g);
  7571. p.push(b + c, e + a);
  7572. p.push(f, h, n, g);
  7573. q.push(r, r, r + 1, r + 2, r + 3, r + 3)
  7574. };
  7575. a.prototype.setGraphicsStyle =
  7576. function(a, b, e, c) {
  7577. this.graphicsStyle.r = a;
  7578. this.graphicsStyle.g = b;
  7579. this.graphicsStyle.b = e;
  7580. this.graphicsStyle.a = c
  7581. };
  7582. a.glID = 0;
  7583. a.isInit = !1;
  7584. return a
  7585. }(b.RendererContext);
  7586. b.WebGLRenderer = c;
  7587. c.prototype.__class__ = "egret.WebGLRenderer"
  7588. })(egret || (egret = {}));
  7589. var egret_webgl_graphics;
  7590. (function(b) {
  7591. b.beginFill = function(b, a) {
  7592. void 0 === a && (a = 1);
  7593. this._pushCommand(new c(this._setStyle, this, [(b >> 16) / 255, ((b & 65280) >> 8) / 255, (b & 255) / 255, a]))
  7594. };
  7595. b.drawRect = function(b, a, d, l) {
  7596. this._pushCommand(new c(function(a) {
  7597. this.renderContext.renderGraphics(a)
  7598. }, this, [{
  7599. x: b,
  7600. y: a,
  7601. w: d,
  7602. h: l
  7603. }]));
  7604. this.checkRect(b, a, d, l)
  7605. };
  7606. b.drawCircle = function(b, a, d) {};
  7607. b.drawRoundRect = function(b, a, d, c, m, k) {};
  7608. b.drawEllipse = function(b, a, d, c) {};
  7609. b.lineStyle = function(b, a, d, c, m, k, g, f) {};
  7610. b.lineTo = function(b, a) {};
  7611. b.curveTo = function(b, a, d,
  7612. c) {};
  7613. b.moveTo = function(b, a) {};
  7614. b.clear = function() {
  7615. this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
  7616. };
  7617. b.endFill = function() {};
  7618. b._pushCommand = function(b) {
  7619. this.commandQueue.push(b)
  7620. };
  7621. b._draw = function(b) {
  7622. var a = this.commandQueue.length;
  7623. if (0 != a)
  7624. for (this.renderContext = b, b = 0; b < a; b++) {
  7625. var d = this.commandQueue[b];
  7626. d.method.apply(d.thisObject, d.args)
  7627. }
  7628. };
  7629. var c = function() {
  7630. return function(b, a, d) {
  7631. this.method = b;
  7632. this.thisObject = a;
  7633. this.args = d
  7634. }
  7635. }();
  7636. c.prototype.__class__ = "egret_webgl_graphics.Command";
  7637. b._setStyle = function(b, a, d, c) {
  7638. this.renderContext.setGraphicsStyle(b, a, d, c)
  7639. };
  7640. b.init = function() {
  7641. for (var e in b) egret.Graphics.prototype[e] = b[e]
  7642. }
  7643. })(egret_webgl_graphics || (egret_webgl_graphics = {}));
  7644. (function(b) {
  7645. var c = function() {
  7646. function e() {}
  7647. e.compileProgram = function(a, d, c) {
  7648. c = e.compileFragmentShader(a, c);
  7649. d = e.compileVertexShader(a, d);
  7650. var m = a.createProgram();
  7651. a.attachShader(m, d);
  7652. a.attachShader(m, c);
  7653. a.linkProgram(m);
  7654. a.getProgramParameter(m, a.LINK_STATUS) || b.Logger.infoWithErrorId(1020);
  7655. return m
  7656. };
  7657. e.compileFragmentShader = function(a, b) {
  7658. return e._compileShader(a, b, a.FRAGMENT_SHADER)
  7659. };
  7660. e.compileVertexShader = function(a, b) {
  7661. return e._compileShader(a, b, a.VERTEX_SHADER)
  7662. };
  7663. e._compileShader = function(a, d, e) {
  7664. e =
  7665. a.createShader(e);
  7666. a.shaderSource(e, d);
  7667. a.compileShader(e);
  7668. return a.getShaderParameter(e, a.COMPILE_STATUS) ? e : (b.Logger.info(a.getShaderInfoLog(e)), null)
  7669. };
  7670. e.checkCanUseWebGL = function() {
  7671. if (void 0 == e.canUseWebGL) try {
  7672. var a = document.createElement("canvas");
  7673. e.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7674. } catch (b) {
  7675. e.canUseWebGL = !1
  7676. }
  7677. return e.canUseWebGL
  7678. };
  7679. return e
  7680. }();
  7681. b.WebGLUtils = c;
  7682. c.prototype.__class__ = "egret.WebGLUtils"
  7683. })(egret || (egret = {}));
  7684. (function(b) {
  7685. var c = function() {
  7686. function e(a) {
  7687. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  7688. this.program = this.gl = null;
  7689. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7690. this.uniforms = null;
  7691. this.gl = a;
  7692. this.init()
  7693. }
  7694. e.prototype.init = function() {
  7695. var a = this.gl,
  7696. d = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7697. a.useProgram(d);
  7698. this.uSampler = a.getUniformLocation(d, "uSampler");
  7699. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  7700. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  7701. this.dimensions = a.getUniformLocation(d, "dimensions");
  7702. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  7703. this.aTextureCoord = a.getAttribLocation(d, "aTextureCoord");
  7704. this.colorAttribute = a.getAttribLocation(d, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7705. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7706. for (var e in this.uniforms) this.uniforms[e].uniformLocation = a.getUniformLocation(d, e);
  7707. this.initUniforms();
  7708. this.program = d
  7709. };
  7710. e.prototype.initUniforms = function() {
  7711. if (this.uniforms) {
  7712. var a = this.gl,
  7713. b, e;
  7714. for (e in this.uniforms) {
  7715. b = this.uniforms[e];
  7716. var c = b.type;
  7717. "mat2" === c || "mat3" === c || "mat4" === c ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === c ? b.glFunc = a.uniformMatrix2fv : "mat3" === c ? b.glFunc = a.uniformMatrix3fv : "mat4" === c && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + c], b.glValueLength = "2f" === c || "2i" === c ? 2 : "3f" === c || "3i" === c ? 3 : "4f" === c || "4i" === c ? 4 : 1)
  7718. }
  7719. }
  7720. };
  7721. e.prototype.syncUniforms = function() {
  7722. if (this.uniforms) {
  7723. var a,
  7724. b = this.gl,
  7725. e;
  7726. for (e in this.uniforms) a = this.uniforms[e], 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, 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)
  7727. }
  7728. };
  7729. return e
  7730. }();
  7731. b.EgretShader = c;
  7732. c.prototype.__class__ = "egret.EgretShader"
  7733. })(egret ||
  7734. (egret = {}));
  7735. __extends = this.__extends || function(b, c) {
  7736. function e() {
  7737. this.constructor = b
  7738. }
  7739. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7740. e.prototype = c.prototype;
  7741. b.prototype = new e
  7742. };
  7743. (function(b) {
  7744. var c = function(b) {
  7745. function a(a) {
  7746. b.call(this, a);
  7747. 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}";
  7748. this.uniforms = {
  7749. matrix: {
  7750. type: "mat4",
  7751. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7752. },
  7753. colorAdd: {
  7754. type: "4f",
  7755. value: {
  7756. x: 0,
  7757. y: 0,
  7758. z: 0,
  7759. w: 0
  7760. }
  7761. }
  7762. };
  7763. this.init()
  7764. }
  7765. __extends(a, b);
  7766. return a
  7767. }(b.EgretShader);
  7768. b.ColorTransformShader = c;
  7769. c.prototype.__class__ = "egret.ColorTransformShader"
  7770. })(egret || (egret = {}));
  7771. __extends = this.__extends || function(b, c) {
  7772. function e() {
  7773. this.constructor = b
  7774. }
  7775. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7776. e.prototype = c.prototype;
  7777. b.prototype = new e
  7778. };
  7779. (function(b) {
  7780. var c = function(b) {
  7781. function a(a) {
  7782. b.call(this, a);
  7783. this.fragmentSrc = "precision mediump float;uniform vec2 blur;uniform sampler2D uSampler;varying vec2 vTextureCoord;void main(){gl_FragColor = vec4(0.0);gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.028 * blur.x, -0.028 * blur.y))) * 0.0044299121055113265;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.024 * blur.x, -0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.020 * blur.x, -0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.016 * blur.x, -0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.012 * blur.x, -0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.008 * blur.x, -0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.004 * blur.x, -0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, vTextureCoord) * 0.159576912161;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.004 * blur.x, 0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.008 * blur.x, 0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.012 * blur.x, 0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.016 * blur.x, 0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.020 * blur.x, 0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.024 * blur.x, 0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.028 * blur.x, 0.028 * blur.y))) * 0.0044299121055113265;}";
  7784. this.uniforms = {
  7785. blur: {
  7786. type: "2f",
  7787. value: {
  7788. x: 2,
  7789. y: 2
  7790. }
  7791. }
  7792. };
  7793. this.init()
  7794. }
  7795. __extends(a, b);
  7796. return a
  7797. }(b.EgretShader);
  7798. b.BlurShader = c;
  7799. c.prototype.__class__ = "egret.BlurShader"
  7800. })(egret || (egret = {}));
  7801. (function(b) {
  7802. var c = function() {
  7803. function e(a) {
  7804. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
  7805. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7806. 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}";
  7807. this.gl = a;
  7808. this.init()
  7809. }
  7810. e.prototype.init = function() {
  7811. var a = this.gl,
  7812. d = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7813. a.useProgram(d);
  7814. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  7815. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  7816. this.tintColor = a.getUniformLocation(d, "tint");
  7817. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  7818. this.colorAttribute = a.getAttribLocation(d, "aColor");
  7819. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7820. this.translationMatrix =
  7821. a.getUniformLocation(d, "translationMatrix");
  7822. this.alpha = a.getUniformLocation(d, "alpha");
  7823. this.program = d
  7824. };
  7825. return e
  7826. }();
  7827. b.PrimitiveShader = c;
  7828. c.prototype.__class__ = "egret.PrimitiveShader"
  7829. })(egret || (egret = {}));
  7830. (function(b) {
  7831. var c = function() {
  7832. function e(a) {
  7833. this.gl = null;
  7834. this.maxAttibs = 10;
  7835. this.attribState = [];
  7836. this.tempAttribState = [];
  7837. this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
  7838. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  7839. this.setContext(a)
  7840. }
  7841. e.prototype.setContext = function(a) {
  7842. this.gl = a;
  7843. this.primitiveShader = new b.PrimitiveShader(a);
  7844. this.defaultShader = new b.EgretShader(a);
  7845. this.colorTransformShader = new b.ColorTransformShader(a);
  7846. this.blurShader =
  7847. new b.BlurShader(a);
  7848. this.activateShader(this.defaultShader)
  7849. };
  7850. e.prototype.activateShader = function(a) {
  7851. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader = a)
  7852. };
  7853. e.prototype.setAttribs = function(a) {
  7854. var b, e;
  7855. e = this.tempAttribState.length;
  7856. for (b = 0; b < e; b++) this.tempAttribState[b] = !1;
  7857. e = a.length;
  7858. for (b = 0; b < e; b++) this.tempAttribState[a[b]] = !0;
  7859. a = this.gl;
  7860. e = this.attribState.length;
  7861. for (b = 0; b < e; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b],
  7862. this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7863. };
  7864. return e
  7865. }();
  7866. b.WebGLShaderManager = c;
  7867. c.prototype.__class__ = "egret.WebGLShaderManager"
  7868. })(egret || (egret = {}));
  7869. __extends = this.__extends || function(b, c) {
  7870. function e() {
  7871. this.constructor = b
  7872. }
  7873. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7874. e.prototype = c.prototype;
  7875. b.prototype = new e
  7876. };
  7877. (function(b) {
  7878. var c = function(e) {
  7879. function a() {
  7880. e.call(this)
  7881. }
  7882. __extends(a, e);
  7883. a.prototype.proceed = function(a) {
  7884. function e() {
  7885. if (4 == k.readyState)
  7886. if (k.status != a._status && (a._status = k.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, k.status)), 400 <= k.status || 0 == k.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7887. else {
  7888. switch (a.dataFormat) {
  7889. case b.URLLoaderDataFormat.TEXT:
  7890. a.data = k.responseText;
  7891. break;
  7892. case b.URLLoaderDataFormat.VARIABLES:
  7893. a.data = new b.URLVariables(k.responseText);
  7894. break;
  7895. case b.URLLoaderDataFormat.BINARY:
  7896. a.data =
  7897. k.response;
  7898. break;
  7899. default:
  7900. a.data = k.responseText
  7901. }
  7902. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7903. }
  7904. }
  7905. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7906. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7907. else {
  7908. var c = a._request,
  7909. k = this.getXHR();
  7910. k.onreadystatechange = e;
  7911. var g = b.NetContext._getUrl(c);
  7912. k.open(c.method, g, !0);
  7913. this.setResponseType(k, a.dataFormat);
  7914. c.method != b.URLRequestMethod.GET && c.data ? c.data instanceof b.URLVariables ? (k.setRequestHeader("Content-Type",
  7915. "application/x-www-form-urlencoded"), k.send(c.data.toString())) : (k.setRequestHeader("Content-Type", "multipart/form-data"), k.send(c.data)) : k.send()
  7916. }
  7917. };
  7918. a.prototype.loadSound = function(a) {
  7919. function e(g) {
  7920. b.clearTimeout(k.__timeoutId);
  7921. k.removeEventListener("canplaythrough", e, !1);
  7922. k.removeEventListener("error", c, !1);
  7923. g = new b.Sound;
  7924. g._setAudio(k);
  7925. a.data = g;
  7926. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7927. }
  7928. function c(g) {
  7929. b.clearTimeout(k.__timeoutId);
  7930. k.removeEventListener("canplaythrough", e, !1);
  7931. k.removeEventListener("error",
  7932. c, !1);
  7933. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7934. }
  7935. var k = new Audio(a._request.url);
  7936. k.__timeoutId = b.setTimeout(e, this, 100);
  7937. k.addEventListener("canplaythrough", e, !1);
  7938. k.addEventListener("error", c, !1);
  7939. k.load()
  7940. };
  7941. a.prototype.getXHR = function() {
  7942. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7943. };
  7944. a.prototype.setResponseType = function(a, e) {
  7945. switch (e) {
  7946. case b.URLLoaderDataFormat.TEXT:
  7947. case b.URLLoaderDataFormat.VARIABLES:
  7948. a.responseType = b.URLLoaderDataFormat.TEXT;
  7949. break;
  7950. case b.URLLoaderDataFormat.BINARY:
  7951. a.responseType =
  7952. "arraybuffer";
  7953. break;
  7954. default:
  7955. a.responseType = e
  7956. }
  7957. };
  7958. a.prototype.loadTexture = function(a) {
  7959. var e = a._request,
  7960. c = new Image;
  7961. c.onload = function(e) {
  7962. c.onerror = null;
  7963. c.onload = null;
  7964. e = new b.Texture;
  7965. e._setBitmapData(c);
  7966. a.data = e;
  7967. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7968. };
  7969. c.onerror = function(e) {
  7970. c.onerror = null;
  7971. c.onload = null;
  7972. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7973. };
  7974. c.src = e.url
  7975. };
  7976. return a
  7977. }(b.NetContext);
  7978. b.HTML5NetContext = c;
  7979. c.prototype.__class__ = "egret.HTML5NetContext"
  7980. })(egret || (egret = {}));
  7981. __extends = this.__extends || function(b, c) {
  7982. function e() {
  7983. this.constructor = b
  7984. }
  7985. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7986. e.prototype = c.prototype;
  7987. b.prototype = new e
  7988. };
  7989. (function(b) {
  7990. var c = function(e) {
  7991. function a() {
  7992. e.call(this);
  7993. this._isTouchDown = !1;
  7994. this.rootDiv = null;
  7995. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7996. }
  7997. __extends(a, e);
  7998. a.prototype.prevent = function(a) {
  7999. a.stopPropagation();
  8000. !0 != a.isScroll && a.preventDefault()
  8001. };
  8002. a.prototype.run = function() {
  8003. var a = this;
  8004. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  8005. a._onTouchBegin(b);
  8006. a.prevent(b)
  8007. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  8008. a._onTouchMove(b);
  8009. a.prevent(b)
  8010. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  8011. a._onTouchEnd(b);
  8012. a.prevent(b)
  8013. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  8014. window.addEventListener("mousedown", function(b) {
  8015. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  8016. });
  8017. window.addEventListener("mouseup", function(b) {
  8018. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() :
  8019. a._onTouchEnd(b));
  8020. a._isTouchDown = !1
  8021. })
  8022. };
  8023. a.prototype.addMouseListener = function() {
  8024. var a = this;
  8025. this.rootDiv.addEventListener("mousedown", function(b) {
  8026. a._onTouchBegin(b)
  8027. });
  8028. this.rootDiv.addEventListener("mousemove", function(b) {
  8029. a._onTouchMove(b)
  8030. });
  8031. this.rootDiv.addEventListener("mouseup", function(b) {
  8032. a._onTouchEnd(b)
  8033. })
  8034. };
  8035. a.prototype.addTouchListener = function() {
  8036. var a = this;
  8037. this.rootDiv.addEventListener("touchstart", function(b) {
  8038. for (var e = b.changedTouches.length, c = 0; c < e; c++) a._onTouchBegin(b.changedTouches[c]);
  8039. a.prevent(b)
  8040. }, !1);
  8041. this.rootDiv.addEventListener("touchmove", function(b) {
  8042. for (var e = b.changedTouches.length, c = 0; c < e; c++) a._onTouchMove(b.changedTouches[c]);
  8043. a.prevent(b)
  8044. }, !1);
  8045. this.rootDiv.addEventListener("touchend", function(b) {
  8046. for (var e = b.changedTouches.length, c = 0; c < e; c++) a._onTouchEnd(b.changedTouches[c]);
  8047. a.prevent(b)
  8048. }, !1);
  8049. this.rootDiv.addEventListener("touchcancel", function(b) {
  8050. for (var e = b.changedTouches.length, c = 0; c < e; c++) a._onTouchEnd(b.changedTouches[c]);
  8051. a.prevent(b)
  8052. }, !1)
  8053. };
  8054. a.prototype.inOutOfCanvas = function(a) {
  8055. var e =
  8056. this.getLocation(this.rootDiv, a);
  8057. a = e.x;
  8058. var e = e.y,
  8059. c = b.MainContext.instance.stage;
  8060. return 0 > a || 0 > e || a > c.stageWidth || e > c.stageHeight ? !0 : !1
  8061. };
  8062. a.prototype.dispatchLeaveStageEvent = function() {
  8063. this.touchingIdentifiers.length = 0;
  8064. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  8065. };
  8066. a.prototype._onTouchBegin = function(a) {
  8067. var b = this.getLocation(this.rootDiv, a),
  8068. e = -1;
  8069. a.hasOwnProperty("identifier") && (e = a.identifier);
  8070. this.onTouchBegan(b.x, b.y, e)
  8071. };
  8072. a.prototype._onTouchMove = function(a) {
  8073. var b = this.getLocation(this.rootDiv,
  8074. a),
  8075. e = -1;
  8076. a.hasOwnProperty("identifier") && (e = a.identifier);
  8077. this.onTouchMove(b.x, b.y, e)
  8078. };
  8079. a.prototype._onTouchEnd = function(a) {
  8080. var b = this.getLocation(this.rootDiv, a),
  8081. e = -1;
  8082. a.hasOwnProperty("identifier") && (e = a.identifier);
  8083. this.onTouchEnd(b.x, b.y, e)
  8084. };
  8085. a.prototype.getLocation = function(a, e) {
  8086. var c = document.documentElement,
  8087. k = window,
  8088. g, f;
  8089. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  8090. g += k.pageXOffset - c.clientLeft;
  8091. f += k.pageYOffset - c.clientTop;
  8092. null != e.pageX ? (c = e.pageX,
  8093. k = e.pageY) : (g -= document.body.scrollLeft, f -= document.body.scrollTop, c = e.clientX, k = e.clientY);
  8094. var h = b.Point.identity;
  8095. h.x = (c - g) / b.StageDelegate.getInstance().getScaleX();
  8096. h.y = (k - f) / b.StageDelegate.getInstance().getScaleY();
  8097. return h
  8098. };
  8099. return a
  8100. }(b.TouchContext);
  8101. b.HTML5TouchContext = c;
  8102. c.prototype.__class__ = "egret.HTML5TouchContext"
  8103. })(egret || (egret = {}));
  8104. __extends = this.__extends || function(b, c) {
  8105. function e() {
  8106. this.constructor = b
  8107. }
  8108. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8109. e.prototype = c.prototype;
  8110. b.prototype = new e
  8111. };
  8112. (function(b) {
  8113. var c = function(e) {
  8114. function a() {
  8115. e.call(this);
  8116. this.inputElement = this.div = null;
  8117. this._hasListeners = !1;
  8118. this._inputType = "";
  8119. this._isShow = !1;
  8120. this.textValue = "";
  8121. this._height = this._width = 0;
  8122. this._styleInfoes = {};
  8123. var d = b.StageDelegate.getInstance().getScaleX(),
  8124. c = b.StageDelegate.getInstance().getScaleY(),
  8125. m = b.Browser.getInstance().$new("div");
  8126. m.position.x = 0;
  8127. m.position.y = 0;
  8128. m.scale.x = d;
  8129. m.scale.y = c;
  8130. m.transforms();
  8131. m.style[a.getTrans("transformOrigin")] = "0% 0% 0px";
  8132. this.div = m;
  8133. c = b.MainContext.instance.stage;
  8134. d = c.stageWidth;
  8135. c = c.stageHeight;
  8136. m = new b.Shape;
  8137. m.width = d;
  8138. m.height = c;
  8139. m.touchEnabled = !0;
  8140. this._shape = m;
  8141. this.getStageDelegateDiv().appendChild(this.div)
  8142. }
  8143. __extends(a, e);
  8144. a.getTrans = function(b) {
  8145. "" == a.header && (a.header = a.getHeader());
  8146. return a.header + b.substring(1, b.length)
  8147. };
  8148. a.getHeader = function() {
  8149. for (var a = document.createElement("div").style, b = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < b.length; e++)
  8150. if (b[e] + "ransform" in a) return b[e];
  8151. return b[0]
  8152. };
  8153. a.prototype.getStageDelegateDiv = function() {
  8154. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8155. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8156. return a
  8157. };
  8158. a.prototype._setMultiline = function(a) {
  8159. e.prototype._setMultiline.call(this, a);
  8160. this.createInput()
  8161. };
  8162. a.prototype.callHandler = function(a) {
  8163. a.stopPropagation()
  8164. };
  8165. a.prototype._add = function() {
  8166. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8167. };
  8168. a.prototype._remove = function() {
  8169. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8170. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8171. };
  8172. a.prototype._addListeners = function() {
  8173. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart", this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8174. };
  8175. a.prototype._removeListeners = function() {
  8176. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown",
  8177. this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  8178. };
  8179. a.prototype.createInput = function() {
  8180. var a = this._multiline ? "textarea" : "input";
  8181. this._inputType != a && (this._inputType = a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {}, a.type =
  8182. "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8183. };
  8184. a.prototype._open = function(a, b, e, c) {};
  8185. a.prototype._setScale = function(a, c) {
  8186. e.prototype._setScale.call(this,
  8187. a, c);
  8188. var m = b.StageDelegate.getInstance().getScaleX(),
  8189. k = b.StageDelegate.getInstance().getScaleY();
  8190. this.div.scale.x = m * a;
  8191. this.div.scale.y = k * c;
  8192. this.div.transforms()
  8193. };
  8194. a.prototype.changePosition = function(a, e) {
  8195. var c = b.StageDelegate.getInstance().getScaleX(),
  8196. k = b.StageDelegate.getInstance().getScaleY();
  8197. this.div.position.x = a * c;
  8198. this.div.position.y = e * k;
  8199. this.div.transforms()
  8200. };
  8201. a.prototype.setStyles = function() {
  8202. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  8203. this.setElementStyle("fontWeight", this._bold ?
  8204. "bold" : "normal");
  8205. this.setElementStyle("textAlign", this._textAlign);
  8206. this.setElementStyle("fontSize", this._size + "px");
  8207. this.setElementStyle("color", "#000000");
  8208. this.setElementStyle("width", this._width + "px");
  8209. this.setElementStyle("height", this._height + "px");
  8210. this.setElementStyle("display", "block")
  8211. };
  8212. a.prototype._show = function() {
  8213. b.MainContext.instance.stage._changeSizeDispatchFlag = !1;
  8214. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8215. this._isShow = !0;
  8216. var a = this._getText();
  8217. this.inputElement.value = a;
  8218. var e = this;
  8219. this.inputElement.oninput = function() {
  8220. e.textValue = e.inputElement.value;
  8221. e.dispatchEvent(new b.Event("updateText"))
  8222. };
  8223. this.setStyles();
  8224. this.inputElement.focus();
  8225. this.inputElement.selectionStart = a.length;
  8226. this.inputElement.selectionEnd = a.length;
  8227. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  8228. };
  8229. a.prototype._hide = function() {
  8230. b.MainContext.instance.stage._changeSizeDispatchFlag = !0;
  8231. if (null != this.inputElement) {
  8232. this._isShow = !1;
  8233. this.inputElement.oninput = function() {};
  8234. this.setElementStyle("border", "none");
  8235. this.setElementStyle("display", "none");
  8236. this.inputElement.value = "";
  8237. this.setElementStyle("width", "0px");
  8238. window.scrollTo(0, 0);
  8239. var a = this;
  8240. b.setTimeout(function() {
  8241. a.inputElement.blur();
  8242. window.scrollTo(0, 0)
  8243. }, this, 50);
  8244. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8245. }
  8246. };
  8247. a.prototype._getText = function() {
  8248. this.textValue || (this.textValue = "");
  8249. return this.textValue
  8250. };
  8251. a.prototype._setText = function(a) {
  8252. this.textValue =
  8253. a;
  8254. this.resetText()
  8255. };
  8256. a.prototype.resetText = function() {
  8257. this.inputElement && (this.inputElement.value = this.textValue)
  8258. };
  8259. a.prototype._setWidth = function(a) {
  8260. this._width = a
  8261. };
  8262. a.prototype._setHeight = function(a) {
  8263. this._height = a
  8264. };
  8265. a.prototype.setElementStyle = function(a, b) {
  8266. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8267. };
  8268. a.header = "";
  8269. return a
  8270. }(b.StageText);
  8271. b.HTML5StageText = c;
  8272. c.prototype.__class__ = "egret.HTML5StageText"
  8273. })(egret || (egret = {}));
  8274. egret.StageText.create = function() {
  8275. return new egret.HTML5StageText
  8276. };
  8277. var __extends = this.__extends || function(b, c) {
  8278. function e() {
  8279. this.constructor = b
  8280. }
  8281. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8282. e.prototype = c.prototype;
  8283. b.prototype = new e
  8284. },
  8285. RES;
  8286. (function(b) {
  8287. var c = function(b) {
  8288. function a(a, c, m) {
  8289. void 0 === c && (c = !1);
  8290. void 0 === m && (m = !1);
  8291. b.call(this, a, c, m);
  8292. this.itemsTotal = this.itemsLoaded = 0;
  8293. this.groupName = "";
  8294. this.resItem = null
  8295. }
  8296. __extends(a, b);
  8297. a.dispatchResourceEvent = function(b, e, c, k, g, f) {
  8298. void 0 === c && (c = "");
  8299. void 0 === k && (k = null);
  8300. void 0 === g && (g = 0);
  8301. void 0 === f && (f = 0);
  8302. var h = egret.Event._getPropertyData(a);
  8303. h.groupName = c;
  8304. h.resItem = k;
  8305. h.itemsLoaded = g;
  8306. h.itemsTotal = f;
  8307. egret.Event._dispatchByTarget(a, b, e, h)
  8308. };
  8309. a.ITEM_LOAD_ERROR = "itemLoadError";
  8310. a.CONFIG_COMPLETE =
  8311. "configComplete";
  8312. a.CONFIG_LOAD_ERROR = "configLoadError";
  8313. a.GROUP_PROGRESS = "groupProgress";
  8314. a.GROUP_COMPLETE = "groupComplete";
  8315. a.GROUP_LOAD_ERROR = "groupLoadError";
  8316. return a
  8317. }(egret.Event);
  8318. b.ResourceEvent = c;
  8319. c.prototype.__class__ = "RES.ResourceEvent"
  8320. })(RES || (RES = {}));
  8321. (function(b) {
  8322. var c = function() {
  8323. function b(a, d, e) {
  8324. this.groupName = "";
  8325. this.data = null;
  8326. this._loaded = !1;
  8327. this.name = a;
  8328. this.url = d;
  8329. this.type = e
  8330. }
  8331. Object.defineProperty(b.prototype, "loaded", {
  8332. get: function() {
  8333. return this.data ? this.data.loaded : this._loaded
  8334. },
  8335. set: function(a) {
  8336. this.data && (this.data.loaded = a);
  8337. this._loaded = a
  8338. },
  8339. enumerable: !0,
  8340. configurable: !0
  8341. });
  8342. b.prototype.toString = function() {
  8343. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  8344. };
  8345. b.TYPE_XML = "xml";
  8346. b.TYPE_IMAGE = "image";
  8347. b.TYPE_BIN =
  8348. "bin";
  8349. b.TYPE_TEXT = "text";
  8350. b.TYPE_JSON = "json";
  8351. b.TYPE_SHEET = "sheet";
  8352. b.TYPE_FONT = "font";
  8353. b.TYPE_SOUND = "sound";
  8354. return b
  8355. }();
  8356. b.ResourceItem = c;
  8357. c.prototype.__class__ = "RES.ResourceItem"
  8358. })(RES || (RES = {}));
  8359. (function(b) {
  8360. var c = function() {
  8361. function e() {
  8362. this.keyMap = {};
  8363. this.groupDic = {};
  8364. b.configInstance = this
  8365. }
  8366. e.prototype.getGroupByName = function(a) {
  8367. var b = [];
  8368. if (!this.groupDic[a]) return b;
  8369. a = this.groupDic[a];
  8370. for (var e = a.length, c = 0; c < e; c++) b.push(this.parseResourceItem(a[c]));
  8371. return b
  8372. };
  8373. e.prototype.getRawGroupByName = function(a) {
  8374. return this.groupDic[a] ? this.groupDic[a] : []
  8375. };
  8376. e.prototype.createGroup = function(a, b, e) {
  8377. void 0 === e && (e = !1);
  8378. if (!e && this.groupDic[a] || !b || 0 == b.length) return !1;
  8379. e = this.groupDic;
  8380. for (var c = [], k = b.length,
  8381. g = 0; g < k; g++) {
  8382. var f = b[g],
  8383. h = e[f];
  8384. if (h)
  8385. for (var f = h.length, n = 0; n < f; n++) {
  8386. var p = h[n]; - 1 == c.indexOf(p) && c.push(p)
  8387. } else(p = this.keyMap[f]) ? -1 == c.indexOf(p) && c.push(p) : egret.Logger.warningWithErrorId(2E3, f)
  8388. }
  8389. if (0 == c.length) return !1;
  8390. this.groupDic[a] = c;
  8391. return !0
  8392. };
  8393. e.prototype.parseConfig = function(a, b) {
  8394. if (a) {
  8395. var e = a.resources;
  8396. if (e)
  8397. for (var c = e.length, k = 0; k < c; k++) {
  8398. var g = e[k],
  8399. f = g.url;
  8400. f && -1 == f.indexOf("://") && (g.url = b + f);
  8401. this.addItemToKeyMap(g)
  8402. }
  8403. if (e = a.groups)
  8404. for (c = e.length, k = 0; k < c; k++) {
  8405. for (var f = e[k], h = [], n = f.keys.split(","),
  8406. p = n.length, q = 0; q < p; q++) g = n[q].trim(), (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
  8407. this.groupDic[f.name] = h
  8408. }
  8409. }
  8410. };
  8411. e.prototype.addSubkey = function(a, b) {
  8412. var e = this.keyMap[b];
  8413. e && !this.keyMap[a] && (this.keyMap[a] = e)
  8414. };
  8415. e.prototype.addItemToKeyMap = function(a) {
  8416. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  8417. if (a.hasOwnProperty("subkeys")) {
  8418. var b = a.subkeys.split(",");
  8419. a.subkeys = b;
  8420. for (var e = b.length, c = 0; c < e; c++) {
  8421. var k = b[c];
  8422. null == this.keyMap[k] && (this.keyMap[k] = a)
  8423. }
  8424. }
  8425. };
  8426. e.prototype.getName = function(a) {
  8427. return (a = this.keyMap[a]) ?
  8428. a.name : ""
  8429. };
  8430. e.prototype.getType = function(a) {
  8431. return (a = this.keyMap[a]) ? a.type : ""
  8432. };
  8433. e.prototype.getRawResourceItem = function(a) {
  8434. return this.keyMap[a]
  8435. };
  8436. e.prototype.getResourceItem = function(a) {
  8437. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  8438. };
  8439. e.prototype.parseResourceItem = function(a) {
  8440. var d = new b.ResourceItem(a.name, a.url, a.type);
  8441. d.data = a;
  8442. return d
  8443. };
  8444. return e
  8445. }();
  8446. b.ResourceConfig = c;
  8447. c.prototype.__class__ = "RES.ResourceConfig"
  8448. })(RES || (RES = {}));
  8449. __extends = this.__extends || function(b, c) {
  8450. function e() {
  8451. this.constructor = b
  8452. }
  8453. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8454. e.prototype = c.prototype;
  8455. b.prototype = new e
  8456. };
  8457. (function(b) {
  8458. var c = function(e) {
  8459. function a() {
  8460. e.call(this);
  8461. this.thread = 2;
  8462. this.loadingCount = 0;
  8463. this.resInstance = this.callBack = null;
  8464. this.groupTotalDic = {};
  8465. this.numLoadedDic = {};
  8466. this.itemListDic = {};
  8467. this.groupErrorDic = {};
  8468. this.retryTimesDic = {};
  8469. this.maxRetryTimes = 3;
  8470. this.failedList = [];
  8471. this.priorityQueue = {};
  8472. this.lazyLoadList = [];
  8473. this.analyzerDic = {};
  8474. this.queueIndex = 0
  8475. }
  8476. __extends(a, e);
  8477. a.prototype.isGroupInLoading = function(a) {
  8478. return void 0 !== this.itemListDic[a]
  8479. };
  8480. a.prototype.loadGroup = function(a, e, c) {
  8481. void 0 === c && (c =
  8482. 0);
  8483. if (!this.itemListDic[e] && e)
  8484. if (a && 0 != a.length) {
  8485. this.priorityQueue[c] ? this.priorityQueue[c].push(e) : this.priorityQueue[c] = [e];
  8486. this.itemListDic[e] = a;
  8487. c = a.length;
  8488. for (var k = 0; k < c; k++) a[k].groupName = e;
  8489. this.groupTotalDic[e] = a.length;
  8490. this.numLoadedDic[e] = 0;
  8491. this.next()
  8492. } else egret.Logger.warningWithErrorId(2001, e), a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR), a.groupName = e, this.dispatchEvent(a)
  8493. };
  8494. a.prototype.loadItem = function(a) {
  8495. this.lazyLoadList.push(a);
  8496. a.groupName = "";
  8497. this.next()
  8498. };
  8499. a.prototype.next =
  8500. function() {
  8501. for (; this.loadingCount < this.thread;) {
  8502. var a = this.getOneResourceItem();
  8503. if (!a) break;
  8504. this.loadingCount++;
  8505. if (a.loaded) this.onItemComplete(a);
  8506. else {
  8507. var e = this.analyzerDic[a.type];
  8508. e || (e = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  8509. e.loadFile(a, this.onItemComplete, this)
  8510. }
  8511. }
  8512. };
  8513. a.prototype.getOneResourceItem = function() {
  8514. if (0 < this.failedList.length) return this.failedList.shift();
  8515. var a = Number.NEGATIVE_INFINITY,
  8516. b;
  8517. for (b in this.priorityQueue) a = Math.max(a, b);
  8518. a = this.priorityQueue[a];
  8519. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  8520. b = a.length;
  8521. for (var e, c = 0; c < b; c++) {
  8522. this.queueIndex >= b && (this.queueIndex = 0);
  8523. e = this.itemListDic[a[this.queueIndex]];
  8524. if (0 < e.length) break;
  8525. this.queueIndex++
  8526. }
  8527. return 0 == e.length ? null : e.shift()
  8528. };
  8529. a.prototype.onItemComplete = function(a) {
  8530. this.loadingCount--;
  8531. var e = a.groupName;
  8532. if (!a.loaded) {
  8533. var c = this.retryTimesDic[a.name] || 1;
  8534. if (c > this.maxRetryTimes) delete this.retryTimesDic[a.name], b.ResourceEvent.dispatchResourceEvent(this.resInstance,
  8535. b.ResourceEvent.ITEM_LOAD_ERROR, e, a);
  8536. else {
  8537. this.retryTimesDic[a.name] = c + 1;
  8538. this.failedList.push(a);
  8539. this.next();
  8540. return
  8541. }
  8542. }
  8543. if (e) {
  8544. this.numLoadedDic[e]++;
  8545. var c = this.numLoadedDic[e],
  8546. k = this.groupTotalDic[e];
  8547. a.loaded || (this.groupErrorDic[e] = !0);
  8548. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, e, a, c, k);
  8549. c == k && (a = this.groupErrorDic[e], this.removeGroupName(e), delete this.groupTotalDic[e], delete this.numLoadedDic[e], delete this.itemListDic[e], delete this.groupErrorDic[e], a ? b.ResourceEvent.dispatchResourceEvent(this,
  8550. b.ResourceEvent.GROUP_LOAD_ERROR, e) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, e))
  8551. } else this.callBack.call(this.resInstance, a);
  8552. this.next()
  8553. };
  8554. a.prototype.removeGroupName = function(a) {
  8555. for (var b in this.priorityQueue) {
  8556. for (var e = this.priorityQueue[b], c = e.length, g = 0, f = !1, c = e.length, h = 0; h < c; h++) {
  8557. if (e[h] == a) {
  8558. e.splice(g, 1);
  8559. f = !0;
  8560. break
  8561. }
  8562. g++
  8563. }
  8564. if (f) {
  8565. 0 == e.length && delete this.priorityQueue[b];
  8566. break
  8567. }
  8568. }
  8569. };
  8570. return a
  8571. }(egret.EventDispatcher);
  8572. b.ResourceLoader = c;
  8573. c.prototype.__class__ = "RES.ResourceLoader"
  8574. })(RES ||
  8575. (RES = {}));
  8576. __extends = this.__extends || function(b, c) {
  8577. function e() {
  8578. this.constructor = b
  8579. }
  8580. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8581. e.prototype = c.prototype;
  8582. b.prototype = new e
  8583. };
  8584. (function(b) {
  8585. var c = function(e) {
  8586. function a() {
  8587. e.call(this);
  8588. this.resourceConfig = null;
  8589. this.resourceConfig = b.configInstance
  8590. }
  8591. __extends(a, e);
  8592. a.prototype.addSubkey = function(a, b) {
  8593. this.resourceConfig.addSubkey(a, b)
  8594. };
  8595. a.prototype.loadFile = function(a, b, e) {};
  8596. a.prototype.getRes = function(a) {};
  8597. a.prototype.destroyRes = function(a) {
  8598. return !1
  8599. };
  8600. a.getStringPrefix = function(a) {
  8601. if (!a) return "";
  8602. var b = a.indexOf(".");
  8603. return -1 != b ? a.substring(0, b) : ""
  8604. };
  8605. a.getStringTail = function(a) {
  8606. if (!a) return "";
  8607. var b = a.indexOf(".");
  8608. return -1 != b ? a.substring(b +
  8609. 1) : ""
  8610. };
  8611. return a
  8612. }(egret.HashObject);
  8613. b.AnalyzerBase = c;
  8614. c.prototype.__class__ = "RES.AnalyzerBase"
  8615. })(RES || (RES = {}));
  8616. __extends = this.__extends || function(b, c) {
  8617. function e() {
  8618. this.constructor = b
  8619. }
  8620. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8621. e.prototype = c.prototype;
  8622. b.prototype = new e
  8623. };
  8624. (function(b) {
  8625. var c = function(b) {
  8626. function a() {
  8627. b.call(this);
  8628. this.fileDic = {};
  8629. this.resItemDic = [];
  8630. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  8631. this.recycler = new egret.Recycler
  8632. }
  8633. __extends(a, b);
  8634. a.prototype.loadFile = function(a, b, e) {
  8635. if (this.fileDic[a.name]) b.call(e, a);
  8636. else {
  8637. var c = this.getLoader();
  8638. this.resItemDic[c.hashCode] = {
  8639. item: a,
  8640. func: b,
  8641. thisObject: e
  8642. };
  8643. c.load(new egret.URLRequest(a.url))
  8644. }
  8645. };
  8646. a.prototype.getLoader = function() {
  8647. var a = this.recycler.pop();
  8648. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  8649. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  8650. a.dataFormat = this._dataFormat;
  8651. return a
  8652. };
  8653. a.prototype.onLoadFinish = function(a) {
  8654. var b = a.target,
  8655. e = this.resItemDic[b.hashCode];
  8656. delete this.resItemDic[b.hashCode];
  8657. var c = e.item,
  8658. g = e.func;
  8659. c.loaded = a.type == egret.Event.COMPLETE;
  8660. c.loaded && this.analyzeData(c, b.data);
  8661. this.recycler.push(b);
  8662. g.call(e.thisObject, c)
  8663. };
  8664. a.prototype.analyzeData = function(a, b) {
  8665. var e = a.name;
  8666. !this.fileDic[e] && b && (this.fileDic[e] = b)
  8667. };
  8668. a.prototype.getRes =
  8669. function(a) {
  8670. return this.fileDic[a]
  8671. };
  8672. a.prototype.hasRes = function(a) {
  8673. return null != this.getRes(a)
  8674. };
  8675. a.prototype.destroyRes = function(a) {
  8676. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8677. };
  8678. return a
  8679. }(b.AnalyzerBase);
  8680. b.BinAnalyzer = c;
  8681. c.prototype.__class__ = "RES.BinAnalyzer"
  8682. })(RES || (RES = {}));
  8683. __extends = this.__extends || function(b, c) {
  8684. function e() {
  8685. this.constructor = b
  8686. }
  8687. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8688. e.prototype = c.prototype;
  8689. b.prototype = new e
  8690. };
  8691. (function(b) {
  8692. var c = function(b) {
  8693. function a() {
  8694. b.call(this);
  8695. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  8696. }
  8697. __extends(a, b);
  8698. a.prototype.analyzeData = function(a, b) {
  8699. var e = a.name;
  8700. !this.fileDic[e] && b && (this.fileDic[e] = b, (e = a.data) && e.scale9grid && (e = e.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(e[0]), parseInt(e[1]), parseInt(e[2]), parseInt(e[3]))))
  8701. };
  8702. return a
  8703. }(b.BinAnalyzer);
  8704. b.ImageAnalyzer = c;
  8705. c.prototype.__class__ = "RES.ImageAnalyzer"
  8706. })(RES || (RES = {}));
  8707. __extends = this.__extends || function(b, c) {
  8708. function e() {
  8709. this.constructor = b
  8710. }
  8711. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8712. e.prototype = c.prototype;
  8713. b.prototype = new e
  8714. };
  8715. (function(b) {
  8716. var c = function(b) {
  8717. function a() {
  8718. b.call(this);
  8719. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8720. }
  8721. __extends(a, b);
  8722. a.prototype.analyzeData = function(a, b) {
  8723. var e = a.name;
  8724. if (!this.fileDic[e] && b) try {
  8725. this.fileDic[e] = JSON.parse(b)
  8726. } catch (c) {
  8727. egret.Logger.warningWithErrorId(1017, a.url, b)
  8728. }
  8729. };
  8730. return a
  8731. }(b.BinAnalyzer);
  8732. b.JsonAnalyzer = c;
  8733. c.prototype.__class__ = "RES.JsonAnalyzer"
  8734. })(RES || (RES = {}));
  8735. __extends = this.__extends || function(b, c) {
  8736. function e() {
  8737. this.constructor = b
  8738. }
  8739. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8740. e.prototype = c.prototype;
  8741. b.prototype = new e
  8742. };
  8743. (function(b) {
  8744. var c = function(b) {
  8745. function a() {
  8746. b.call(this);
  8747. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8748. }
  8749. __extends(a, b);
  8750. return a
  8751. }(b.BinAnalyzer);
  8752. b.TextAnalyzer = c;
  8753. c.prototype.__class__ = "RES.TextAnalyzer"
  8754. })(RES || (RES = {}));
  8755. __extends = this.__extends || function(b, c) {
  8756. function e() {
  8757. this.constructor = b
  8758. }
  8759. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8760. e.prototype = c.prototype;
  8761. b.prototype = new e
  8762. };
  8763. (function(b) {
  8764. var c = function(e) {
  8765. function a() {
  8766. e.call(this);
  8767. this.sheetMap = {};
  8768. this.textureMap = {};
  8769. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8770. }
  8771. __extends(a, e);
  8772. a.prototype.getRes = function(a) {
  8773. var e = this.fileDic[a];
  8774. e || (e = this.textureMap[a]);
  8775. !e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.fileDic[e]) && (a = b.AnalyzerBase.getStringTail(a), e = e.getTexture(a));
  8776. return e
  8777. };
  8778. a.prototype.onLoadFinish = function(a) {
  8779. var b = a.target,
  8780. e = this.resItemDic[b.hashCode];
  8781. delete this.resItemDic[b.hashCode];
  8782. var c = e.item,
  8783. g = e.func;
  8784. c.loaded =
  8785. a.type == egret.Event.COMPLETE;
  8786. if (c.loaded)
  8787. if ("string" == typeof b.data) {
  8788. if (c.loaded = !1, a = this.analyzeConfig(c, b.data)) {
  8789. c.url = a;
  8790. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  8791. this.loadFile(c, g, e.thisObject);
  8792. this._dataFormat = egret.URLLoaderDataFormat.TEXT;
  8793. return
  8794. }
  8795. } else this.analyzeBitmap(c, b.data);
  8796. c.url = c.data.url;
  8797. this.recycler.push(b);
  8798. g.call(e.thisObject, c)
  8799. };
  8800. a.prototype.analyzeConfig = function(a, b) {
  8801. var e = a.name,
  8802. c, g = "";
  8803. try {
  8804. c = JSON.parse(b)
  8805. } catch (f) {
  8806. egret.Logger.warningWithErrorId(1017, a.url, b)
  8807. }
  8808. c && (this.sheetMap[e] =
  8809. c, g = this.getRelativePath(a.url, c.file));
  8810. return g
  8811. };
  8812. a.prototype.analyzeBitmap = function(a, b) {
  8813. var e = a.name;
  8814. if (!this.fileDic[e] && b) {
  8815. var c = this.sheetMap[e];
  8816. delete this.sheetMap[e];
  8817. c = this.parseSpriteSheet(b, c, a.data && a.data.subkeys ? "" : e);
  8818. this.fileDic[e] = c
  8819. }
  8820. };
  8821. a.prototype.getRelativePath = function(a, b) {
  8822. a = a.split("\\").join("/");
  8823. var e = a.lastIndexOf("/");
  8824. return a = -1 != e ? a.substring(0, e + 1) + b : b
  8825. };
  8826. a.prototype.parseSpriteSheet = function(a, b, e) {
  8827. b = b.frames;
  8828. if (!b) return null;
  8829. var c = new egret.SpriteSheet(a),
  8830. g = this.textureMap,
  8831. f;
  8832. for (f in b) {
  8833. var h = b[f];
  8834. a = c.createTexture(f, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH);
  8835. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  8836. null == g[f] && (g[f] = a, e && this.addSubkey(f, e))
  8837. }
  8838. return c
  8839. };
  8840. a.prototype.destroyRes = function(a) {
  8841. var b = this.fileDic[a];
  8842. if (b) {
  8843. delete this.fileDic[a];
  8844. for (var e in b._textureMap) this.textureMap[e] && delete this.textureMap[e];
  8845. return !0
  8846. }
  8847. return !1
  8848. };
  8849. return a
  8850. }(b.BinAnalyzer);
  8851. b.SheetAnalyzer =
  8852. c;
  8853. c.prototype.__class__ = "RES.SheetAnalyzer"
  8854. })(RES || (RES = {}));
  8855. __extends = this.__extends || function(b, c) {
  8856. function e() {
  8857. this.constructor = b
  8858. }
  8859. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8860. e.prototype = c.prototype;
  8861. b.prototype = new e
  8862. };
  8863. (function(b) {
  8864. var c = function(b) {
  8865. function a() {
  8866. b.call(this)
  8867. }
  8868. __extends(a, b);
  8869. a.prototype.analyzeConfig = function(a, b) {
  8870. var e = a.name,
  8871. c, g = "";
  8872. try {
  8873. c = JSON.parse(b)
  8874. } catch (f) {}
  8875. c ? g = this.getRelativePath(a.url, c.file) : (c = b, g = this.getTexturePath(a.url, c));
  8876. this.sheetMap[e] = c;
  8877. return g
  8878. };
  8879. a.prototype.analyzeBitmap = function(a, b) {
  8880. var e = a.name;
  8881. if (!this.fileDic[e] && b) {
  8882. var c = this.sheetMap[e];
  8883. delete this.sheetMap[e];
  8884. c = new egret.BitmapFont(b, c);
  8885. this.fileDic[e] = c
  8886. }
  8887. };
  8888. a.prototype.getTexturePath = function(a, b) {
  8889. var e = "",
  8890. c = b.split("\n")[2],
  8891. g = c.indexOf('file="'); - 1 != g && (c = c.substring(g + 6), g = c.indexOf('"'), e = c.substring(0, g));
  8892. a = a.split("\\").join("/");
  8893. g = a.lastIndexOf("/");
  8894. return a = -1 != g ? a.substring(0, g + 1) + e : e
  8895. };
  8896. a.prototype.destroyRes = function(a) {
  8897. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8898. };
  8899. return a
  8900. }(b.SheetAnalyzer);
  8901. b.FontAnalyzer = c;
  8902. c.prototype.__class__ = "RES.FontAnalyzer"
  8903. })(RES || (RES = {}));
  8904. __extends = this.__extends || function(b, c) {
  8905. function e() {
  8906. this.constructor = b
  8907. }
  8908. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8909. e.prototype = c.prototype;
  8910. b.prototype = new e
  8911. };
  8912. (function(b) {
  8913. var c = function(b) {
  8914. function a() {
  8915. b.call(this);
  8916. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  8917. }
  8918. __extends(a, b);
  8919. a.prototype.analyzeData = function(a, b) {
  8920. var e = a.name;
  8921. !this.fileDic[e] && b && (this.fileDic[e] = b, (e = a.data) && e.soundType ? b.preload(e.soundType) : b.preload(egret.Sound.EFFECT))
  8922. };
  8923. return a
  8924. }(b.BinAnalyzer);
  8925. b.SoundAnalyzer = c;
  8926. c.prototype.__class__ = "RES.SoundAnalyzer"
  8927. })(RES || (RES = {}));
  8928. __extends = this.__extends || function(b, c) {
  8929. function e() {
  8930. this.constructor = b
  8931. }
  8932. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8933. e.prototype = c.prototype;
  8934. b.prototype = new e
  8935. };
  8936. (function(b) {
  8937. var c = function(b) {
  8938. function a() {
  8939. b.call(this);
  8940. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8941. }
  8942. __extends(a, b);
  8943. a.prototype.analyzeData = function(a, b) {
  8944. var e = a.name;
  8945. if (!this.fileDic[e] && b) try {
  8946. var c = egret.XML.parse(b);
  8947. this.fileDic[e] = c
  8948. } catch (g) {}
  8949. };
  8950. return a
  8951. }(b.BinAnalyzer);
  8952. b.XMLAnalyzer = c;
  8953. c.prototype.__class__ = "RES.XMLAnalyzer"
  8954. })(RES || (RES = {}));
  8955. __extends = this.__extends || function(b, c) {
  8956. function e() {
  8957. this.constructor = b
  8958. }
  8959. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8960. e.prototype = c.prototype;
  8961. b.prototype = new e
  8962. };
  8963. (function(b) {
  8964. b.loadConfig = function(a, b, c) {
  8965. void 0 === b && (b = "");
  8966. void 0 === c && (c = "json");
  8967. e.loadConfig(a, b, c)
  8968. };
  8969. b.loadGroup = function(a, b) {
  8970. void 0 === b && (b = 0);
  8971. e.loadGroup(a, b)
  8972. };
  8973. b.isGroupLoaded = function(a) {
  8974. return e.isGroupLoaded(a)
  8975. };
  8976. b.getGroupByName = function(a) {
  8977. return e.getGroupByName(a)
  8978. };
  8979. b.createGroup = function(a, b, c) {
  8980. void 0 === c && (c = !1);
  8981. return e.createGroup(a, b, c)
  8982. };
  8983. b.hasRes = function(a) {
  8984. return e.hasRes(a)
  8985. };
  8986. b.parseConfig = function(a, b) {
  8987. void 0 === b && (b = "");
  8988. e.parseConfig(a, b)
  8989. };
  8990. b.getRes = function(a) {
  8991. return e.getRes(a)
  8992. };
  8993. b.getResAsync = function(a, b, c) {
  8994. e.getResAsync(a, b, c)
  8995. };
  8996. b.getResByUrl = function(a, b, c, m) {
  8997. void 0 === m && (m = "");
  8998. e.getResByUrl(a, b, c, m)
  8999. };
  9000. b.destroyRes = function(a) {
  9001. return e.destroyRes(a)
  9002. };
  9003. b.setMaxLoadingThread = function(a) {
  9004. e.setMaxLoadingThread(a)
  9005. };
  9006. b.setMaxRetryTimes = function(a) {
  9007. e.setMaxRetryTimes(a)
  9008. };
  9009. b.addEventListener = function(a, b, c, m, k) {
  9010. void 0 === m && (m = !1);
  9011. void 0 === k && (k = 0);
  9012. e.addEventListener(a, b, c, m, k)
  9013. };
  9014. b.removeEventListener = function(a, b, c, m) {
  9015. void 0 === m && (m = !1);
  9016. e.removeEventListener(a, b, c, m)
  9017. };
  9018. var c = function(a) {
  9019. function d() {
  9020. a.call(this);
  9021. this.analyzerDic = {};
  9022. this.configItemList = [];
  9023. this.configComplete = this.callLaterFlag = !1;
  9024. this.loadedGroups = [];
  9025. this.groupNameList = [];
  9026. this.asyncDic = {};
  9027. this.init()
  9028. }
  9029. __extends(d, a);
  9030. d.prototype.getAnalyzerByType = function(a) {
  9031. var d = this.analyzerDic[a];
  9032. d || (d = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  9033. return d
  9034. };
  9035. d.prototype.init = function() {
  9036. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  9037. egret.Injector.hasMapRule(b.AnalyzerBase,
  9038. b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  9039. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  9040. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  9041. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase,
  9042. b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  9043. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  9044. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  9045. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  9046. this.resConfig =
  9047. new b.ResourceConfig;
  9048. this.resLoader = new b.ResourceLoader;
  9049. this.resLoader.callBack = this.onResourceItemComp;
  9050. this.resLoader.resInstance = this;
  9051. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  9052. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  9053. };
  9054. d.prototype.loadConfig = function(a, b, d) {
  9055. void 0 === d && (d = "json");
  9056. this.configItemList.push({
  9057. url: a,
  9058. resourceRoot: b,
  9059. type: d
  9060. });
  9061. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  9062. };
  9063. d.prototype.startLoadConfig = function() {
  9064. this.callLaterFlag = !1;
  9065. var a = this.configItemList;
  9066. this.configItemList = [];
  9067. this.loadingConfigList = a;
  9068. for (var e = a.length, c = [], g = 0; g < e; g++) {
  9069. var f = a[g],
  9070. f = new b.ResourceItem(f.url, f.url, f.type);
  9071. c.push(f)
  9072. }
  9073. this.resLoader.loadGroup(c, d.GROUP_CONFIG, Number.MAX_VALUE)
  9074. };
  9075. d.prototype.isGroupLoaded = function(a) {
  9076. return -1 != this.loadedGroups.indexOf(a)
  9077. };
  9078. d.prototype.getGroupByName = function(a) {
  9079. return this.resConfig.getGroupByName(a)
  9080. };
  9081. d.prototype.loadGroup = function(a, d) {
  9082. void 0 ===
  9083. d && (d = 0);
  9084. if (-1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, a);
  9085. else if (!this.resLoader.isGroupInLoading(a))
  9086. if (this.configComplete) {
  9087. var e = this.resConfig.getGroupByName(a);
  9088. this.resLoader.loadGroup(e, a, d)
  9089. } else this.groupNameList.push({
  9090. name: a,
  9091. priority: d
  9092. })
  9093. };
  9094. d.prototype.createGroup = function(a, b, d) {
  9095. void 0 === d && (d = !1);
  9096. if (d) {
  9097. var e = this.loadedGroups.indexOf(a); - 1 != e && this.loadedGroups.splice(e, 1)
  9098. }
  9099. return this.resConfig.createGroup(a, b, d)
  9100. };
  9101. d.prototype.onGroupComp =
  9102. function(a) {
  9103. if (a.groupName == d.GROUP_CONFIG) {
  9104. a = this.loadingConfigList.length;
  9105. for (var e = 0; e < a; e++) {
  9106. var c = this.loadingConfigList[e],
  9107. g = this.getAnalyzerByType(c.type),
  9108. f = g.getRes(c.url);
  9109. g.destroyRes(c.url);
  9110. this.resConfig.parseConfig(f, c.resourceRoot)
  9111. }
  9112. this.configComplete = !0;
  9113. this.loadingConfigList = null;
  9114. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  9115. this.loadDelayGroups()
  9116. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  9117. };
  9118. d.prototype.loadDelayGroups = function() {
  9119. var a =
  9120. this.groupNameList;
  9121. this.groupNameList = [];
  9122. for (var b = a.length, d = 0; d < b; d++) {
  9123. var e = a[d];
  9124. this.loadGroup(e.name, e.priority)
  9125. }
  9126. };
  9127. d.prototype.onGroupError = function(a) {
  9128. a.groupName == d.GROUP_CONFIG ? (this.loadingConfigList = null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  9129. };
  9130. d.prototype.hasRes = function(a) {
  9131. var d = this.resConfig.getType(a);
  9132. return "" == d && (a = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(a), "" == d) ? !1 : !0
  9133. };
  9134. d.prototype.parseConfig = function(a,
  9135. b) {
  9136. this.resConfig.parseConfig(a, b);
  9137. this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
  9138. };
  9139. d.prototype.getRes = function(a) {
  9140. var d = this.resConfig.getType(a);
  9141. return "" == d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(d), "" == d) ? null : this.getAnalyzerByType(d).getRes(a)
  9142. };
  9143. d.prototype.getResAsync = function(a, d, e) {
  9144. var c = this.resConfig.getType(a),
  9145. f = this.resConfig.getName(a);
  9146. if ("" == c && (f = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(f), "" == c)) {
  9147. d.call(e,
  9148. null);
  9149. return
  9150. }(c = this.getAnalyzerByType(c).getRes(a)) ? d.call(e, c): (a = {
  9151. key: a,
  9152. compFunc: d,
  9153. thisObject: e
  9154. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  9155. };
  9156. d.prototype.getResByUrl = function(a, d, e, c) {
  9157. void 0 === c && (c = "");
  9158. if (a) {
  9159. c || (c = this.getTypeByUrl(a));
  9160. var f = this.getAnalyzerByType(c).getRes(a);
  9161. f ? d.call(e, f) : (d = {
  9162. key: a,
  9163. compFunc: d,
  9164. thisObject: e
  9165. }, this.asyncDic[a] ? this.asyncDic[a].push(d) : (this.asyncDic[a] = [d], a = new b.ResourceItem(a,
  9166. a, c), this.resLoader.loadItem(a)))
  9167. } else d.call(e, null)
  9168. };
  9169. d.prototype.getTypeByUrl = function(a) {
  9170. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  9171. switch (a) {
  9172. case b.ResourceItem.TYPE_XML:
  9173. case b.ResourceItem.TYPE_JSON:
  9174. case b.ResourceItem.TYPE_SHEET:
  9175. break;
  9176. case "png":
  9177. case "jpg":
  9178. case "gif":
  9179. case "jpeg":
  9180. case "bmp":
  9181. a = b.ResourceItem.TYPE_IMAGE;
  9182. break;
  9183. case "fnt":
  9184. a = b.ResourceItem.TYPE_FONT;
  9185. break;
  9186. case "txt":
  9187. a = b.ResourceItem.TYPE_TEXT;
  9188. break;
  9189. case "mp3":
  9190. case "ogg":
  9191. case "mpeg":
  9192. case "wav":
  9193. case "m4a":
  9194. case "mp4":
  9195. case "aiff":
  9196. case "wma":
  9197. case "mid":
  9198. a =
  9199. b.ResourceItem.TYPE_SOUND;
  9200. break;
  9201. default:
  9202. a = b.ResourceItem.TYPE_BIN
  9203. }
  9204. return a
  9205. };
  9206. d.prototype.onResourceItemComp = function(a) {
  9207. var b = this.asyncDic[a.name];
  9208. delete this.asyncDic[a.name];
  9209. a = this.getAnalyzerByType(a.type);
  9210. for (var d = b.length, e = 0; e < d; e++) {
  9211. var c = b[e],
  9212. h = a.getRes(c.key);
  9213. c.compFunc.call(c.thisObject, h, c.key)
  9214. }
  9215. };
  9216. d.prototype.destroyRes = function(a) {
  9217. var b = this.resConfig.getRawGroupByName(a);
  9218. if (b) {
  9219. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  9220. a = b.length;
  9221. for (var e = 0; e < a; e++) {
  9222. d = b[e];
  9223. d.loaded = !1;
  9224. var c = this.getAnalyzerByType(d.type);
  9225. c.destroyRes(d.name)
  9226. }
  9227. return !0
  9228. }
  9229. b = this.resConfig.getType(a);
  9230. if ("" == b) return !1;
  9231. d = this.resConfig.getRawResourceItem(a);
  9232. d.loaded = !1;
  9233. c = this.getAnalyzerByType(b);
  9234. return c.destroyRes(a)
  9235. };
  9236. d.prototype.setMaxLoadingThread = function(a) {
  9237. 1 > a && (a = 1);
  9238. this.resLoader.thread = a
  9239. };
  9240. d.prototype.setMaxRetryTimes = function(a) {
  9241. a = Math.max(a, 0);
  9242. this.resLoader.maxRetryTimes = a
  9243. };
  9244. d.GROUP_CONFIG = "RES__CONFIG";
  9245. return d
  9246. }(egret.EventDispatcher);
  9247. c.prototype.__class__ = "RES.Resource";
  9248. var e =
  9249. new c
  9250. })(RES || (RES = {}));
  9251. var __extends = this.__extends || function(b, c) {
  9252. function e() {
  9253. this.constructor = b
  9254. }
  9255. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9256. e.prototype = c.prototype;
  9257. b.prototype = new e
  9258. },
  9259. starlingswf;
  9260. (function(b) {
  9261. var c = function(b) {
  9262. function a() {
  9263. b.apply(this, arguments)
  9264. }
  9265. __extends(a, b);
  9266. a.prototype.getTextField = function(a) {
  9267. return this.getChildByName(a)
  9268. };
  9269. a.prototype.getMovie = function(a) {
  9270. return this.getChildByName(a)
  9271. };
  9272. a.prototype.getSprite = function(a) {
  9273. return this.getChildByName(a)
  9274. };
  9275. a.prototype.getImage = function(a) {
  9276. return this.getChildByName(a)
  9277. };
  9278. return a
  9279. }(egret.DisplayObjectContainer);
  9280. b.SwfSprite = c;
  9281. c.prototype.__class__ = "starlingswf.SwfSprite"
  9282. })(starlingswf || (starlingswf = {}));
  9283. var __extends = this.__extends || function(b, c) {
  9284. function e() {
  9285. this.constructor = b
  9286. }
  9287. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9288. e.prototype = c.prototype;
  9289. b.prototype = new e
  9290. },
  9291. App = function(b) {
  9292. function c() {
  9293. b.call(this);
  9294. this._miniLogoAlign = 1;
  9295. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStageHandler, this)
  9296. }
  9297. __extends(c, b);
  9298. Object.defineProperty(c, "swf", {
  9299. get: function() {
  9300. return c._swf
  9301. },
  9302. enumerable: !0,
  9303. configurable: !0
  9304. });
  9305. Object.defineProperty(c, "stage", {
  9306. get: function() {
  9307. return c._stage
  9308. },
  9309. enumerable: !0,
  9310. configurable: !0
  9311. });
  9312. c.prototype._createLoadingView = function() {
  9313. this.__loadingSkin = c.swf.createSprite("spr_YIA_LOADING_VIEW");
  9314. c._stage.addChild(this.__loadingSkin);
  9315. var b = this.__loadingSkin.getSprite("loadingSpr"),
  9316. a = this.__loadingSkin.getImage("logoImg"),
  9317. d = a.y - 30;
  9318. a.alpha = 0;
  9319. egret.Tween.get(a).to({
  9320. alpha: 1,
  9321. y: d
  9322. }, 800);
  9323. this.__oriLoadingBarWidhth = b.getImage("loadingBar").width;
  9324. b.getImage("loadingBar").scrollRect = new egret.Rectangle(0, 0, 0.1 * this.__oriLoadingBarWidhth, b.getImage("loadingBar").height);
  9325. a.touchEnabled = !0;
  9326. a.addEventListener(egret.TouchEvent.TOUCH_TAP,
  9327. this.onTouchLogoHandler, this);
  9328. b = this.__loadingSkin.getImage("playBtn");
  9329. b.touchEnabled = !1;
  9330. b.alpha = 0;
  9331. this.onStageResizeHandler(null)
  9332. };
  9333. c.prototype.setProgress = function(b, a) {
  9334. this.__loadingSkin.getSprite("loadingSpr").getImage("loadingBar").scrollRect.width = b / a * this.__oriLoadingBarWidhth
  9335. };
  9336. c.prototype.onAddToStageHandler = function(b) {
  9337. if (!c.stage) {
  9338. try {
  9339. eval("OnGameStage").call(this)
  9340. } catch (a) {
  9341. console.log("Can not found function [OnGameStage]")
  9342. }
  9343. c.isDebug && (console.log("DebugModel"), console.log("gamename: " +
  9344. c.gamename), console.log("nameid: " + c.nameid), console.log("AppVersion: " + c.version));
  9345. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStageHandler, this);
  9346. c._stage = this.stage;
  9347. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  9348. RES.loadConfig("resource/resource.json", "resource/");
  9349. c.stage.addEventListener(egret.Event.RESIZE, this.onStageResizeHandler, this)
  9350. }
  9351. };
  9352. c.prototype.onStageResizeHandler = function(b) {
  9353. if (this.__loadingSkin) {
  9354. b = this.__loadingSkin.getImage("bg");
  9355. var a = this.__loadingSkin.getSprite("loadingSpr"),
  9356. d = this.__loadingSkin.getImage("logoImg"),
  9357. l = this.__loadingSkin.getImage("playBtn");
  9358. b.width = c.stage.stageWidth;
  9359. b.height = c.stage.stageHeight;
  9360. d.x = (c.stage.stageWidth - d.width) / 2;
  9361. d.y = (c.stage.stageHeight - d.height) / 2;
  9362. a.x = (c.stage.stageWidth - a.width) / 2;
  9363. a.y = d.y + d.height + 50;
  9364. l.x = (c.stage.stageWidth - l.width) / 2;
  9365. l.y = a.y
  9366. }
  9367. this.__miniLogo && this.alignMiniLogo(this._miniLogoAlign)
  9368. };
  9369. c.prototype.onConfigComplete = function(b) {
  9370. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,
  9371. this.onConfigComplete, this);
  9372. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  9373. RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
  9374. RES.loadGroup("yia_loading")
  9375. };
  9376. c.prototype.onResourceLoadComplete = function(b) {
  9377. if ("yia_loading" == b.groupName) {
  9378. b = RES.getRes("yia_swf");
  9379. var a = RES.getRes("yia"),
  9380. d = new starlingswf.SwfAssetManager;
  9381. d.addSpriteSheet("yia", a);
  9382. c._swf = new starlingswf.Swf(b, d, 24);
  9383. this._createLoadingView();
  9384. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS,
  9385. this.onResourceProgress, this);
  9386. RES.loadGroup("preload")
  9387. } else "preload" == b.groupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.__loadingSkin.getSprite("loadingSpr").visible = !1, b = this.__loadingSkin.getImage("playBtn"), b.touchEnabled = !0, b.visible = !0, egret.Tween.get(b).to({
  9388. alpha: 1
  9389. },
  9390. 800), b.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchPlayHandler, this))
  9391. };
  9392. c.prototype.onTouchLogoHandler = function(b) {
  9393. "logoImg" == b.currentTarget.name ? c.ClickLoadingLogo() : "mini_logo" == b.currentTarget.name ? c.ClickLogo() : b.currentTarget == c.stage && c.ClickLoadingSplash()
  9394. };
  9395. c.prototype.onTouchPlayHandler = function(b) {
  9396. this.__loadingSkin.getImage("logoImg").removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchLogoHandler, this);
  9397. this.__loadingSkin.getImage("playBtn").removeEventListener(egret.TouchEvent.TOUCH_TAP,
  9398. this.onTouchPlayHandler, this);
  9399. this.__loadingSkin.getSprite("loadingSpr").visible = !1;
  9400. this.__loadingSkin.getImage("playBtn").touchEnabled = !1;
  9401. this.__appTimer = new egret.Timer(c.isDebug ? 100 : 5E3);
  9402. this.__appTimer.addEventListener(egret.TimerEvent.TIMER, this.removeSkin, this);
  9403. this.__appTimer.start();
  9404. b = new egret.Timer(10);
  9405. b.addEventListener(egret.TimerEvent.TIMER, this.__removeTimerHandler, this);
  9406. b.start()
  9407. };
  9408. c.prototype.__removeTimerHandler = function(b) {
  9409. b.currentTarget.removeEventListener(egret.TimerEvent.TIMER,
  9410. this.__removeTimerHandler, this);
  9411. var a = this.__loadingSkin.getImage("logoImg");
  9412. b = a.x;
  9413. var a = a.y,
  9414. d = this.__loadingSkin.getImage("playBtn");
  9415. d.touchEnabled = !1;
  9416. egret.Tween.get(d).to({
  9417. alpha: 0
  9418. }, 500).call(this.logoTween, this, [0.9, b, a])
  9419. };
  9420. c.prototype.logoTween = function(b, a, d) {
  9421. if (this.__loadingSkin) {
  9422. var l = this.__loadingSkin.getImage("logoImg"),
  9423. m = a + l.width / l.scaleX * (1 - b) / 2,
  9424. k = d + l.height / l.scaleY * (1 - b) / 2;
  9425. egret.Tween.get(l).to({
  9426. scaleX: b,
  9427. scaleY: b,
  9428. x: m,
  9429. y: k
  9430. }, 1E3).call(this.logoTween, this, [1 == b ? 0.9 : 1, a, d]);
  9431. c.stage.addEventListener(egret.TouchEvent.TOUCH_TAP,
  9432. this.onTouchLogoHandler, this)
  9433. }
  9434. };
  9435. c.prototype.removeSkin = function(b) {
  9436. c.stage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchLogoHandler, this);
  9437. b = this.__loadingSkin.getImage("logoImg");
  9438. egret.Tween.removeTweens(b);
  9439. this.__appTimer.stop();
  9440. this.__appTimer.removeEventListener(egret.TimerEvent.TIMER, this.removeSkin, this);
  9441. this.__appTimer = null;
  9442. this.__loadingSkin && (c.stage.removeChild(this.__loadingSkin), this.__loadingSkin = null);
  9443. b = c.swf.createImage("img_YIA_LOGO");
  9444. this._createMiniLogo(b);
  9445. this.createGameScene()
  9446. };
  9447. c.prototype._createMiniLogo = function(b) {
  9448. this.__miniLogo && (this.__miniLogo.parent.removeChild(this.__miniLogo), this.__miniLogo.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchLogoHandler, this));
  9449. this.__miniLogo = b;
  9450. this.__miniLogo.touchEnabled = !0;
  9451. this.__miniLogo.name = "mini_logo";
  9452. this.stage.addChild(this.__miniLogo);
  9453. this.__miniLogo.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchLogoHandler, this);
  9454. this.alignMiniLogo(this._miniLogoAlign)
  9455. };
  9456. c.prototype.alignMiniLogo = function(b) {
  9457. void 0 ===
  9458. b && (b = 1);
  9459. this._miniLogoAlign = b;
  9460. var a = new egret.Point;
  9461. switch (b) {
  9462. case 0:
  9463. a.x = 10;
  9464. a.y = 10;
  9465. break;
  9466. case 1:
  9467. a.x = 10;
  9468. a.y = c.stage.stageHeight - this.__miniLogo.height * this.__miniLogo.scaleY - 10;
  9469. break;
  9470. case 2:
  9471. a.x = c.stage.stageWidth - this.__miniLogo.width * this.__miniLogo.scaleX - 10;
  9472. a.y = 10;
  9473. break;
  9474. case 3:
  9475. a.x = c.stage.stageWidth - this.__miniLogo.width * this.__miniLogo.scaleX - 10, a.y = c.stage.stageHeight - this.__miniLogo.height * this.__miniLogo.scaleY - 10
  9476. }
  9477. this.__miniLogo.x = a.x;
  9478. this.__miniLogo.y = a.y
  9479. };
  9480. c.prototype.onResourceLoadError =
  9481. function(b) {
  9482. console.warn("Group:" + b.groupName + " \u4e2d\u6709\u52a0\u8f7d\u5931\u8d25\u7684\u9879\u76ee");
  9483. this.onResourceLoadComplete(b)
  9484. };
  9485. c.prototype.onResourceProgress = function(b) {
  9486. "preload" == b.groupName && this.setProgress(b.itemsLoaded, b.itemsTotal)
  9487. };
  9488. c.prototype.createGameScene = function() {
  9489. this._createGameSwf()
  9490. };
  9491. c.prototype._createGameSwf = function() {
  9492. var b = RES.getRes("Game_swf"),
  9493. a = new starlingswf.SwfAssetManager;
  9494. if (RES.hasRes("Game_json")) {
  9495. var d = RES.getRes("Game_json");
  9496. a.addSpriteSheet("Game_json", d)
  9497. }
  9498. var d =
  9499. RES.getGroupByName("preload"),
  9500. l = d.length;
  9501. if (3 < l)
  9502. for (var m = 0; m < l; m++) {
  9503. var k = d[m];
  9504. "Game_json" != k.name && "Game_png" != k.name && "Game_swf" != k.name && a.addTexture(k.name, RES.getRes(k.name))
  9505. }
  9506. c._swf = new starlingswf.Swf(b, a, 24)
  9507. };
  9508. c.OpenUrl = function(b, a) {
  9509. void 0 === a && (a = "_blank");
  9510. window.open(b, a)
  9511. };
  9512. c.SendAnaly = function(b, a, d) {
  9513. console.log("SendAnaly(" + b + "," + a + "," + d + ")");
  9514. try {
  9515. var c = eval("CreateLinksInGame");
  9516. c && c.call(this, b, a, d)
  9517. } catch (m) {
  9518. console.log("Can not found function [CreateLinksInGame].")
  9519. }
  9520. };
  9521. c.ShareToFacebook =
  9522. function(b, a, d) {
  9523. void 0 === d && (d = !0);
  9524. b = d ? "Scored " + b + " in the game " + c.gamename + " and beat " + a + "% of players worldwide!" : "I passed level " + b + " in the game " + c.gamename + " and beat " + a + "% of players worldwide!";
  9525. console.log("ShareToFacebook(" + c.nameid + "," + b + ")");
  9526. try {
  9527. var l = eval("ShareToFacebook");
  9528. l && l.call(this, c.nameid, b)
  9529. } catch (m) {
  9530. console.log("Can not found function [ShareToFacebook].")
  9531. }
  9532. };
  9533. c.ShareToTwitter = function(b, a, d) {
  9534. void 0 === d && (d = !0);
  9535. b = d ? "Scored " + b + " in the game " + c.gamename + " and beat " + a + "%25 of players worldwide!" :
  9536. "I passed level " + b + " in the game " + c.gamename + " and beat " + a + "%25 of players worldwide!";
  9537. console.log("ShareToTwitter(" + c.nameid + "," + b + ")");
  9538. try {
  9539. var l = eval("ShareToTwitter");
  9540. l && l.call(this, c.nameid, b)
  9541. } catch (m) {
  9542. console.log("Can not found function [ShareToTwitter].")
  9543. }
  9544. };
  9545. c.ClickLoadingLogo = function() {
  9546. c.SendAnaly(c.nameid, "loading", "logo")
  9547. };
  9548. c.ClickLoadingSplash = function() {
  9549. c.SendAnaly(c.nameid, "splash", "logo")
  9550. };
  9551. c.ClickLogo = function() {
  9552. c.state == c.PREGAME ? c.SendAnaly(c.nameid, "pregame", "logo") : c.SendAnaly(c.nameid,
  9553. "ingame", "logo")
  9554. };
  9555. c.ClickMore = function() {
  9556. Play68.goHome();
  9557. c.state == c.PREGAME ? c.SendAnaly(c.nameid, "pregame", "moregamesbtn") : c.SendAnaly(c.nameid, "ingame", "moregamesbtn")
  9558. };
  9559. c.OpenHomepage = function(b) {
  9560. void 0 === b && (b = "http://miagame.com");
  9561. c.OpenUrl(b)
  9562. };
  9563. c.Version = function() {
  9564. console.log("App version: " + c.version)
  9565. };
  9566. c.version = "1.0.0";
  9567. c.isDebug = !1;
  9568. c.gamename = "-1";
  9569. c.nameid = "-1";
  9570. c.PREGAME = "pregame";
  9571. c.INGAME = "ingame";
  9572. c.state = c.PREGAME;
  9573. return c
  9574. }(egret.DisplayObjectContainer);
  9575. App.prototype.__class__ = "App";
  9576. var __extends = this.__extends || function(b, c) {
  9577. function e() {
  9578. this.constructor = b
  9579. }
  9580. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9581. e.prototype = c.prototype;
  9582. b.prototype = new e
  9583. },
  9584. Cloud = function(b) {
  9585. function c() {
  9586. b.call(this);
  9587. this._bmp = App.swf.createImage("img_CLOUD");
  9588. this.addChild(this._bmp);
  9589. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStageHandler, this);
  9590. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStageHandler, this)
  9591. }
  9592. __extends(c, b);
  9593. c.prototype.onAddToStageHandler = function(b) {
  9594. this.doTween()
  9595. };
  9596. c.prototype.doTween = function() {
  9597. this.scaleX = this.scaleY = 0.7 * Math.random() + 0.3;
  9598. this.x = Math.random() * this._bmp.width * 2 + App.stage.stageWidth;
  9599. var b = -Math.random() * this._bmp.width * 4 - this._bmp.width;
  9600. egret.Tween.get(this).to({
  9601. x: b
  9602. }, 4E3).call(this.doTween)
  9603. };
  9604. c.prototype.onRemoveFromStageHandler = function(b) {
  9605. egret.Tween.removeTweens(this);
  9606. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStageHandler, this);
  9607. this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStageHandler, this)
  9608. };
  9609. return c
  9610. }(egret.DisplayObjectContainer);
  9611. Cloud.prototype.__class__ = "Cloud";
  9612. var __extends = this.__extends || function(b, c) {
  9613. function e() {
  9614. this.constructor = b
  9615. }
  9616. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9617. e.prototype = c.prototype;
  9618. b.prototype = new e
  9619. },
  9620. Platform = function(b) {
  9621. function c() {
  9622. b.call(this);
  9623. this._bmp = App.swf.createImage("img_PLATFORM");
  9624. this.addChild(this._bmp)
  9625. }
  9626. __extends(c, b);
  9627. return c
  9628. }(egret.DisplayObjectContainer);
  9629. Platform.prototype.__class__ = "Platform";
  9630. (function(b) {
  9631. var c = function() {
  9632. function e(a, d, c) {
  9633. void 0 === c && (c = 24);
  9634. this._swfData = a;
  9635. this._assetManager = d;
  9636. this._createDisplayFuns = {};
  9637. this._createDisplayFuns[e.dataKey_Sprite] = this.createSprite;
  9638. this._createDisplayFuns[e.dataKey_MovieClip] = this.createMovie;
  9639. this._createDisplayFuns[e.dataKey_Image] = this.createImage;
  9640. this._createDisplayFuns[e.dataKey_Scale9] = this.createS9Image;
  9641. this._createDisplayFuns[e.dataKey_ShapeImg] = this.createShapeImage;
  9642. this._createDisplayFuns[e.dataKey_TextField] = this.createTextField;
  9643. this.swfUpdateManager = b.SwfUpdateManager.createSwfUpdateManager(c)
  9644. }
  9645. e.prototype.createSprite = function(a, d, c) {
  9646. void 0 === d && (d = null);
  9647. void 0 === c && (c = null);
  9648. null == c && (c = this._swfData[e.dataKey_Sprite][a]);
  9649. a = new b.SwfSprite;
  9650. for (var m = c.length, k, g, f = 0; f < m; f++) k = c[f], g = this._createDisplayFuns[k[1]], null != g && (g = g.apply(this, [k[0], k]), g.name = k[9], g.x = k[2], g.y = k[3], k[1] != e.dataKey_Scale9 && k[1] != e.dataKey_ShapeImg && (g.scaleX = k[4], g.scaleY = k[5]), g.skewX = k[6], g.skewY = k[7], g.alpha = k[8], a.addChild(g));
  9651. null != d && b.SwfBlendMode.setBlendMode(a,
  9652. d[11]);
  9653. return a
  9654. };
  9655. e.prototype.createMovie = function(a, d) {
  9656. void 0 === d && (d = null);
  9657. var c = this._swfData[e.dataKey_MovieClip][a],
  9658. m = c.objCount,
  9659. k = {},
  9660. g, f, h, n, p;
  9661. for (p in m) {
  9662. f = m[p][0];
  9663. h = m[p][1];
  9664. g = null == k[p] ? [] : k[p];
  9665. for (var q = 0; q < h; q++) n = this._createDisplayFuns[f], null != n && g.push(n.apply(this, [p, null]));
  9666. k[p] = g
  9667. }
  9668. m = new b.SwfMovieClip(c.frames, c.labels, k, this, c.frameEvents);
  9669. m.loop = c.loop;
  9670. null != d && b.SwfBlendMode.setBlendMode(m, d[11]);
  9671. return m
  9672. };
  9673. e.prototype.createImage = function(a, d) {
  9674. void 0 === d && (d = null);
  9675. var c = this._swfData[e.dataKey_Image][a],
  9676. m = this._assetManager.createBitmap(a);
  9677. m.anchorOffsetX = c[0];
  9678. m.anchorOffsetY = c[1];
  9679. null != d && b.SwfBlendMode.setBlendMode(m, d[11]);
  9680. return m
  9681. };
  9682. e.prototype.createS9Image = function(a, d) {
  9683. void 0 === d && (d = null);
  9684. var c = this._swfData[e.dataKey_Scale9][a],
  9685. m = this._assetManager.createBitmap(a);
  9686. m.scale9Grid = new egret.Rectangle(c[0], c[1], c[2], c[3]);
  9687. null != d && (m.width = d[10], m.height = d[11], b.SwfBlendMode.setBlendMode(m, d[13]));
  9688. return m
  9689. };
  9690. e.prototype.createShapeImage = function(a, d) {
  9691. void 0 === d && (d = null);
  9692. var c = this._assetManager.createBitmap(a);
  9693. c.fillMode = egret.BitmapFillMode.REPEAT;
  9694. null != d && (c.width = d[10], c.height = d[11], b.SwfBlendMode.setBlendMode(c, d[13]));
  9695. return c
  9696. };
  9697. e.prototype.createTextField = function(a, d) {
  9698. void 0 === d && (d = null);
  9699. var c = new egret.TextField;
  9700. null != d && (c.width = d[10], c.height = d[11], c.fontFamily = d[12], c.textColor = d[13], c.size = d[14], c.textAlign = d[15], c.text = d[18], b.SwfBlendMode.setBlendMode(c, d[20]));
  9701. return c
  9702. };
  9703. e.dataKey_Sprite = "spr";
  9704. e.dataKey_Image = "img";
  9705. e.dataKey_MovieClip = "mc";
  9706. e.dataKey_TextField = "text";
  9707. e.dataKey_Button = "btn";
  9708. e.dataKey_Scale9 = "s9";
  9709. e.dataKey_ShapeImg = "shapeImg";
  9710. e.dataKey_Component = "comp";
  9711. e.dataKey_Particle = "particle";
  9712. return e
  9713. }();
  9714. b.Swf = c;
  9715. c.prototype.__class__ = "starlingswf.Swf"
  9716. })(starlingswf || (starlingswf = {}));
  9717. (function(b) {
  9718. var c = function() {
  9719. function b() {}
  9720. b.setBlendMode = function(a, d) {
  9721. b.modes[d] && (a.blendMode = d)
  9722. };
  9723. b.modes = {
  9724. normal: !0,
  9725. add: !0
  9726. };
  9727. return b
  9728. }();
  9729. b.SwfBlendMode = c;
  9730. c.prototype.__class__ = "starlingswf.SwfBlendMode"
  9731. })(starlingswf || (starlingswf = {}));
  9732. var __extends = this.__extends || function(b, c) {
  9733. function e() {
  9734. this.constructor = b
  9735. }
  9736. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9737. e.prototype = c.prototype;
  9738. b.prototype = new e
  9739. },
  9740. GameOverPanel = function(b) {
  9741. function c() {
  9742. b.call(this);
  9743. this.score = 0;
  9744. this.panel = App.swf.createSprite("spr_GAMEOVER");
  9745. this.addChild(this.panel);
  9746. var c = this.panel.getImage("bg_mask");
  9747. c.width = 480;
  9748. c.touchEnabled = !0;
  9749. c.height = 800;
  9750. c.alpha = 0.5;
  9751. this.btn_again = this.panel.getImage("btn_again");
  9752. console.log(this.btn_again, "---");
  9753. this.txt_score = this.panel.getTextField("txt_score");
  9754. this.btn_more = this.panel.getImage("more");
  9755. this.btn_more.touchEnabled = !0;
  9756. this.btn_again.touchEnabled = !0;
  9757. this.btn_f = this.panel.getImage("btn_f");
  9758. this.btn_t = this.panel.getImage("btn_t");
  9759. this.btn_f.touchEnabled = this.btn_t.touchEnabled = !0;
  9760. this.btn_f.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onFace, this);
  9761. this.btn_t.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTwitter, this);
  9762. this.shareTxt = this.panel.getTextField("txt_share");
  9763. this.shareTxt._setSize(18);
  9764. this.shareTxt.verticalAlign = egret.VerticalAlign.MIDDLE;
  9765. this.shareTxt.textAlign = egret.HorizontalAlign.CENTER;
  9766. this.shareTxt.text = "\u4f60\u6253\u8d25\u4e86\u5168\u4e16\u754c 99% \u7684\u5bf9\u624b\u3002\u72ec\u4e50\u4e50\u4e0d\u5982\u4f17\u4e50\u4e50\uff0c\u5206\u4eab\u7ed9\u4f60\u7684\u670b\u53cb\u5427\uff01"
  9767. }
  9768. __extends(c, b);
  9769. c.prototype.setScore = function(b) {
  9770. this.txt_score.text = b + " M";
  9771. this.score = b;
  9772. // updateShare(this.score);
  9773. // Play68.setRankingScoreDesc(this.score);
  9774. b = "\u4f60\u6253\u8d25\u4e86\u5168\u4e16\u754c " + Math.min(99, Math.round(100 * Math.sqrt(this.score / 1E4))) + "% \u7684\u5bf9\u624b\u3002\u72ec\u4e50\u4e50\u4e0d\u5982\u4f17\u4e50\u4e50\uff0c\u5206\u4eab\u7ed9\u4f60\u7684\u670b\u53cb\u5427\uff01";
  9775. this.shareTxt.text = b
  9776. };
  9777. c.prototype.onFace = function(b) {
  9778. b = Math.min(99, Math.round(100 * Math.sqrt(this.score /
  9779. 1E4)));
  9780. App.ShareToFacebook(this.score, b);
  9781. };
  9782. c.prototype.onTwitter = function(b) {
  9783. b = Math.min(99, Math.round(100 * Math.sqrt(this.score / 1E4)));
  9784. App.ShareToTwitter(this.score, b);
  9785. };
  9786. return c
  9787. }(egret.DisplayObjectContainer);
  9788. GameOverPanel.prototype.__class__ = "GameOverPanel";
  9789. var __extends = this.__extends || function(b, c) {
  9790. function e() {
  9791. this.constructor = b
  9792. }
  9793. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9794. e.prototype = c.prototype;
  9795. b.prototype = new e
  9796. },
  9797. GameScreen = function(b) {
  9798. function c() {
  9799. b.call(this);
  9800. this.platforms = [];
  9801. this.disHeight = 200;
  9802. this.clouds = [];
  9803. this._score = 0;
  9804. this.container = new egret.Sprite;
  9805. this.addChild(this.container);
  9806. this.cloudContainer = new egret.Sprite;
  9807. this.container.addChild(this.cloudContainer);
  9808. this.bg = App.swf.createImage("img_GAME_BG");
  9809. this.bg.y = App.stage.stageHeight -
  9810. this.bg.height;
  9811. this.container.addChild(this.bg);
  9812. this.character = new Character;
  9813. this.character.x = App.stage.width / 2;
  9814. this.character.y = App.stage.stageHeight - 35;
  9815. this.container.addChild(this.character);
  9816. this.character.pause();
  9817. App.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoveHandler, this);
  9818. App.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchMoveHandler, this);
  9819. App.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchMoveHandler, this);
  9820. this.character.screen = this;
  9821. this.character.platforms =
  9822. this.platforms;
  9823. this.spr_score = App.swf.createSprite("spr_SCORE");
  9824. this.spr_score.x = App.stage.stageWidth - this.spr_score.width - 10;
  9825. this.spr_score.y = 10;
  9826. this.addChild(this.spr_score)
  9827. }
  9828. __extends(c, b);
  9829. c.prototype.setScore = function(b) {
  9830. this._score = b;
  9831. this.spr_score.getTextField("txt_score").text = "" + b + " M"
  9832. };
  9833. c.prototype.getScore = function() {
  9834. return this._score
  9835. };
  9836. c.prototype.gameStart = function() {
  9837. this.createScene();
  9838. this.setScore(0);
  9839. this.character.start()
  9840. };
  9841. c.prototype.gameOver = function() {
  9842. this.character.pause();
  9843. var b =
  9844. new egret.Event(c.GAME_OVER);
  9845. this.dispatchEvent(b)
  9846. };
  9847. c.prototype.createScene = function() {
  9848. var b = new egret.Shape;
  9849. b.graphics.beginFill(16711680, 0);
  9850. b.graphics.drawRect(0, 0, App.stage.stageWidth, 20);
  9851. b.graphics.endFill();
  9852. b.width = App.stage.stageWidth;
  9853. b.height = 20;
  9854. this.container.addChildAt(b, 0);
  9855. b.y = App.stage.stageHeight - 30;
  9856. this.lastY = b.y - this.disHeight / 5;
  9857. this.platforms.push(b);
  9858. for (var b = Math.ceil(App.stage.stageHeight / this.disHeight) + 5, a = 0; a < b; a++) this.addPlatform(), this.addCloud()
  9859. };
  9860. c.prototype.addCloud = function(b) {
  9861. void 0 ===
  9862. b && (b = null);
  9863. b || (b = new Cloud);
  9864. b.y = this.lastY + Math.random() * this.disHeight;
  9865. b.parent || this.cloudContainer.addChildAt(b, 0);
  9866. this.clouds.push(b)
  9867. };
  9868. c.prototype.removeCloud = function() {
  9869. var b = this.clouds[0];
  9870. this.clouds.shift();
  9871. this.addCloud(b)
  9872. };
  9873. c.prototype.addPlatform = function(b) {
  9874. void 0 === b && (b = null);
  9875. b || (b = new Platform);
  9876. b.parent || this.container.addChildAt(b, 3);
  9877. this.platforms.push(b);
  9878. b.x = Math.floor(Math.random() * (App.stage.stageWidth - b.width));
  9879. b.y = this.lastY - this.disHeight;
  9880. this.lastY = b.y;
  9881. return b
  9882. };
  9883. c.prototype.removePlatforms =
  9884. function(b) {
  9885. if (!(0 >= b)) {
  9886. for (var a = 0; a < b; a++) {
  9887. var d = this.platforms[0];
  9888. this.platforms.shift();
  9889. d instanceof Platform ? this.addPlatform(d) : this.container.removeChild(d);
  9890. this.removeCloud()
  9891. }
  9892. this.bg && 0 > this.lastY + 2 * App.stage.stageHeight && (this.container.removeChild(this.bg), this.bg = null)
  9893. }
  9894. };
  9895. c.prototype.onTouchMoveHandler = function(b) {
  9896. this.character.toX = b.stageX
  9897. };
  9898. c.GAME_OVER = "gameOver";
  9899. return c;
  9900. }(egret.DisplayObjectContainer);
  9901. GameScreen.prototype.__class__ = "GameScreen";
  9902. var __extends = this.__extends || function(b, c) {
  9903. function e() {
  9904. this.constructor = b
  9905. }
  9906. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9907. e.prototype = c.prototype;
  9908. b.prototype = new e
  9909. },
  9910. GameStartPanel = function(b) {
  9911. function c() {
  9912. b.call(this);
  9913. this.panel = App.swf.createSprite("spr_GAMESTART");
  9914. this.panel.x = (App.stage.stageWidth - this.panel.width) / 2;
  9915. this.addChild(this.panel);
  9916. this.btn_play = this.panel.getImage("btn_play");
  9917. this.btn_play.touchEnabled = !0;
  9918. this.btn_more = this.panel.getImage("btn_more");
  9919. this.btn_more.touchEnabled = !0
  9920. }
  9921. __extends(c, b);
  9922. return c
  9923. }(egret.DisplayObjectContainer);
  9924. GameStartPanel.prototype.__class__ = "GameStartPanel";
  9925. __extends = this.__extends || function(b, c) {
  9926. function e() {
  9927. this.constructor = b
  9928. }
  9929. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9930. e.prototype = c.prototype;
  9931. b.prototype = new e
  9932. };
  9933. (function(b) {
  9934. var c = function(c) {
  9935. function a(a, b, m, k, g) {
  9936. void 0 === g && (g = null);
  9937. c.call(this);
  9938. this._isPlay = !1;
  9939. this.loop = !0;
  9940. this._completeFunction = null;
  9941. this._hasCompleteListener = !1;
  9942. this._frames = a;
  9943. this._labels = b;
  9944. this._displayObjects = m;
  9945. this._frameEvents = g;
  9946. this._startFrame = 0;
  9947. this._endFrame = this._frames.length - 1;
  9948. this._ownerSwf = k;
  9949. this.setCurrentFrame(0);
  9950. this.play()
  9951. }
  9952. __extends(a, c);
  9953. a.prototype.update = function() {
  9954. if (this._isPlay)
  9955. if (this._currentFrame > this._endFrame) {
  9956. var a = !1;
  9957. this.loop && this._startFrame != this._endFrame ||
  9958. (this._ownerSwf && this.stop(!1), a = !0);
  9959. this._hasCompleteListener && this.dispatchEventWith(egret.Event.COMPLETE);
  9960. a || this.setCurrentFrame(this._startFrame)
  9961. } else this.setCurrentFrame(this._currentFrame), this._currentFrame += 1
  9962. };
  9963. a.prototype.setCurrentFrame = function(a) {
  9964. this._children.length = 0;
  9965. this._currentFrame = a;
  9966. this.__frameInfos = this._frames[this._currentFrame];
  9967. for (var c, e, k = this.__frameInfos.length, g = 0; g < k; g++) {
  9968. a = this.__frameInfos[g];
  9969. c = a[10];
  9970. c = this._displayObjects[a[0]][c];
  9971. c._skewX = a[6];
  9972. c._skewY = a[7];
  9973. c._alpha =
  9974. a[8];
  9975. c.name = a[9];
  9976. c._x = a[2];
  9977. c._y = a[3];
  9978. switch (a[1]) {
  9979. case b.Swf.dataKey_Scale9:
  9980. c.width = a[11];
  9981. c.height = a[12];
  9982. b.SwfBlendMode.setBlendMode(c, a[13]);
  9983. break;
  9984. case b.Swf.dataKey_ShapeImg:
  9985. c.width = a[11];
  9986. c.height = a[12];
  9987. b.SwfBlendMode.setBlendMode(c, a[13]);
  9988. break;
  9989. case b.Swf.dataKey_TextField:
  9990. e = c;
  9991. e.width = a[11];
  9992. e.height = a[12];
  9993. e.fontFamily = a[13];
  9994. e.textColor = a[14];
  9995. e.size = a[15];
  9996. e.textAlign = a[16];
  9997. a[19] && "\r" != a[19] && "" != a[19] && (e.text = a[19]);
  9998. b.SwfBlendMode.setBlendMode(e, a[20]);
  9999. break;
  10000. default:
  10001. c._scaleX = a[4], c._scaleY = a[5],
  10002. b.SwfBlendMode.setBlendMode(c, a[11])
  10003. }
  10004. this._children.push(c);
  10005. c._parent = this
  10006. }
  10007. null != this._frameEvents && null != this._frameEvents[this._currentFrame] && this.dispatchEventWith(this._frameEvents[this._currentFrame])
  10008. };
  10009. a.prototype.getCurrentFrame = function() {
  10010. return this._currentFrame
  10011. };
  10012. a.prototype.play = function() {
  10013. this._isPlay = !0;
  10014. this._ownerSwf.swfUpdateManager.addSwfAnimation(this);
  10015. var a, c, e;
  10016. for (a in this._displayObjects)
  10017. if (0 == a.indexOf(b.Swf.dataKey_MovieClip)) {
  10018. c = this._displayObjects[a];
  10019. e = c.length;
  10020. for (var k =
  10021. 0; k < e; k++) c[k].play()
  10022. }
  10023. };
  10024. a.prototype.stop = function(a) {
  10025. void 0 === a && (a = !0);
  10026. this._isPlay = !1;
  10027. this._ownerSwf.swfUpdateManager.removeSwfAnimation(this);
  10028. if (a) {
  10029. var c, e, k;
  10030. for (c in this._displayObjects)
  10031. if (0 == c.indexOf(b.Swf.dataKey_MovieClip)) {
  10032. e = this._displayObjects[c];
  10033. k = e.length;
  10034. for (var g = 0; g < k; g++) e[g].stop(a)
  10035. }
  10036. }
  10037. };
  10038. a.prototype.gotoAndStop = function(a, b) {
  10039. void 0 === b && (b = !0);
  10040. this.goTo(a);
  10041. this.stop(b)
  10042. };
  10043. a.prototype.gotoAndPlay = function(a) {
  10044. this.goTo(a);
  10045. this.play()
  10046. };
  10047. a.prototype.goTo = function(a) {
  10048. "string" == typeof a ? (a =
  10049. this.getLabelData(a), this._currentLabel = a[0], this._currentFrame = this._startFrame = a[1], this._endFrame = a[2]) : "number" == typeof a && (this._currentFrame = this._startFrame = a, this._endFrame = this._frames.length - 1);
  10050. this.setCurrentFrame(this._currentFrame)
  10051. };
  10052. a.prototype.getLabelData = function(a) {
  10053. for (var b = this._labels.length, c, e = 0; e < b; e++)
  10054. if (c = this._labels[e], c[0] == a) return c;
  10055. return null
  10056. };
  10057. a.prototype.isPlay = function() {
  10058. return this._isPlay
  10059. };
  10060. a.prototype.totalFrames = function() {
  10061. return this._frames.length
  10062. };
  10063. a.prototype.currentLabel =
  10064. function() {
  10065. return this._currentLabel
  10066. };
  10067. a.prototype.labels = function() {
  10068. for (var a = this._labels.length, b = [], c = 0; c < a; c++) b.push(this._labels[c][0]);
  10069. return b
  10070. };
  10071. a.prototype.hasLabel = function(a) {
  10072. return -1 != this.labels().indexOf(a)
  10073. };
  10074. a.prototype.addEventListener = function(a, b, m, k, g) {
  10075. void 0 === k && (k = !1);
  10076. void 0 === g && (g = 0);
  10077. c.prototype.addEventListener.call(this, a, b, m, k, g);
  10078. this._hasCompleteListener = this.hasEventListener(egret.Event.COMPLETE)
  10079. };
  10080. a.prototype.removeEventListener = function(a, b, m, k) {
  10081. void 0 === k && (k = !1);
  10082. c.prototype.removeEventListener.call(this,
  10083. a, b, m, k);
  10084. this._hasCompleteListener = this.hasEventListener(egret.Event.COMPLETE)
  10085. };
  10086. return a
  10087. }(b.SwfSprite);
  10088. b.SwfMovieClip = c;
  10089. c.prototype.__class__ = "starlingswf.SwfMovieClip"
  10090. })(starlingswf || (starlingswf = {}));
  10091. var __extends = this.__extends || function(b, c) {
  10092. function e() {
  10093. this.constructor = b
  10094. }
  10095. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10096. e.prototype = c.prototype;
  10097. b.prototype = new e
  10098. },
  10099. Character = function(b) {
  10100. function c() {
  10101. b.call(this);
  10102. this._isDown = !1;
  10103. this.aSpeed = 0;
  10104. this.maxSpeed = -400;
  10105. this.speed = 0;
  10106. this.fps = 32;
  10107. this.delta = 1;
  10108. this.toX = 0;
  10109. this.isBegin = !0;
  10110. this.maxY = 0;
  10111. this._role = App.swf.createMovie("mc_POU");
  10112. this._role.stop();
  10113. this._role.x = 0;
  10114. this._role.y = 0;
  10115. this.addChild(this._role);
  10116. this.toX = App.stage.stageWidth / 2;
  10117. this.maxY = App.stage.stageHeight -
  10118. 30;
  10119. this.addEventListener(egret.Event.ADDED, this.onAdded, this);
  10120. this.addEventListener(egret.Event.REMOVED, this.onRemoved, this);
  10121. this._role.addEventListener(egret.Event.ENTER_FRAME, this.rolePlay, this)
  10122. }
  10123. __extends(c, b);
  10124. c.prototype.rolePlay = function(b) {
  10125. this._role.getCurrentFrame();
  10126. this._role.getCurrentFrame() == this._role.totalFrames() && this._role.gotoAndStop(0)
  10127. };
  10128. c.prototype.start = function() {
  10129. this.isBegin = !0;
  10130. this._role.play();
  10131. this.addEventListener(egret.Event.ENTER_FRAME, this.onTickHandler, this)
  10132. };
  10133. c.prototype.pause =
  10134. function() {
  10135. this.isBegin = !1;
  10136. this.removeEventListener(egret.Event.ENTER_FRAME, this.onTickHandler, this)
  10137. };
  10138. c.prototype.checkJump = function() {
  10139. if (!(!this.platforms || 0 >= this.platforms.length || 0 > this.speed)) {
  10140. this._isDown || (this._isDown = !0, this._role.gotoAndPlay(14));
  10141. for (var b = this.platforms.length, a = 0, c = 0; c < b; c++) {
  10142. var l = this.platforms[c];
  10143. (new egret.Rectangle(l.x, l.y, l.width, l.height)).contains(this.x, this.y) && (this.y = l.y, this.aSpeed = this.maxSpeed, this.speed = 0, this._isDown = !1, this.delta = Math.floor(this.screen.getScore() /
  10144. 1E3) + 1);
  10145. l.localToGlobal(0, 0).y > App.stage.stageHeight && a++
  10146. }
  10147. this.screen.removePlatforms(a)
  10148. }
  10149. };
  10150. c.prototype.onAdded = function(b) {
  10151. this.start()
  10152. };
  10153. c.prototype.onRemoved = function(b) {
  10154. this.pause()
  10155. };
  10156. c.prototype.onTickHandler = function(b) {
  10157. this.onMove()
  10158. };
  10159. c.prototype.onMove = function() {
  10160. if (this.isBegin) {
  10161. this.aSpeed = (this.aSpeed + c.GRAVITY) / this.fps * this.delta;
  10162. this.speed += this.aSpeed;
  10163. this.y += this.speed;
  10164. if (0 > this.speed) {
  10165. var b = this.localToGlobal(0, 0);
  10166. b.y < App.stage.stageHeight / 2 && (this.screen.container.y += -this.speed, this.screen.setScore(this.screen.getScore() +
  10167. Math.abs(Math.floor(this.speed / 10))))
  10168. }
  10169. this.x != this.toX && (this.x += (this.toX - this.x) / this.fps * 3);
  10170. b = this.localToGlobal(0, 0);
  10171. b.y > App.stage.stageHeight + this._role.height && (this.pause(), this.screen.gameOver());
  10172. this.checkJump()
  10173. }
  10174. };
  10175. c.GRAVITY = 10;
  10176. return c
  10177. }(egret.DisplayObjectContainer);
  10178. Character.prototype.__class__ = "Character";
  10179. var __extends = this.__extends || function(b, c) {
  10180. function e() {
  10181. this.constructor = b
  10182. }
  10183. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10184. e.prototype = c.prototype;
  10185. b.prototype = new e
  10186. },
  10187. Game = function(b) {
  10188. function c() {
  10189. b.call(this);
  10190. c._instance = this;
  10191. this.touchEnabled = !0
  10192. }
  10193. __extends(c, b);
  10194. Object.defineProperty(c, "instance", {
  10195. get: function() {
  10196. return c._instance
  10197. },
  10198. enumerable: !0,
  10199. configurable: !0
  10200. });
  10201. c.prototype.createGameScene = function() {
  10202. b.prototype.createGameScene.call(this);
  10203. var c = App.swf.createImage("img_SKY_BG");
  10204. c.y = App.stage.stageHeight -
  10205. c.height;
  10206. this.addChild(c);
  10207. this.gameStartPanel = new GameStartPanel;
  10208. this.gameStartPanel.x = (App.stage.stageWidth - this.gameStartPanel.width) / 2;
  10209. this.gameStartPanel.y = (App.stage.stageHeight - this.gameStartPanel.height) / 2;
  10210. this.gameStartPanel.btn_play.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHandler, this);
  10211. this.gameStartPanel.btn_more.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHandler, this);
  10212. this.addChild(this.gameStartPanel)
  10213. };
  10214. c.prototype.start = function() {
  10215. App.state = App.INGAME;
  10216. this.gameStartPanel &&
  10217. this.gameStartPanel.parent && this.gameStartPanel.parent.removeChild(this.gameStartPanel);
  10218. this.gameOverPanel && this.gameOverPanel.parent && this.gameOverPanel.parent.removeChild(this.gameOverPanel);
  10219. this.screen2 && (this.screen2.removeEventListener(GameScreen.GAME_OVER, this.onGameOver, this), this.removeChild(this.screen2));
  10220. this.screen2 = new GameScreen;
  10221. this.addChildAt(this.screen2, 1);
  10222. this.screen2.addEventListener(GameScreen.GAME_OVER, this.onGameOver, this);
  10223. this.screen2.gameStart()
  10224. };
  10225. c.prototype.onGameOver = function(b) {
  10226. this.gameOverPanel ||
  10227. (this.gameOverPanel = new GameOverPanel, this.gameOverPanel.btn_again.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHandler, this), this.gameOverPanel.btn_more.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchHandler, this));
  10228. this.gameOverPanel.setScore(this.screen2.getScore());
  10229. this.addChild(this.gameOverPanel)
  10230. };
  10231. c.prototype.onTouchHandler = function(b) {
  10232. this.gameStartPanel && b.currentTarget == this.gameStartPanel.btn_more ? App.ClickMore() : this.gameOverPanel && b.currentTarget == this.gameOverPanel.btn_more ?
  10233. App.ClickMore() : this.gameOverPanel && b.currentTarget == this.gameOverPanel.btn_again ? this.start() : this.gameStartPanel && b.currentTarget == this.gameStartPanel.btn_play && this.start()
  10234. };
  10235. return c
  10236. }(App);
  10237. Game.prototype.__class__ = "Game";
  10238. (function(b) {
  10239. var c = function() {
  10240. function b() {
  10241. this._sheets = {};
  10242. this._textures = {}
  10243. }
  10244. b.prototype.addSpriteSheet = function(a, b) {
  10245. this._sheets[a] = b
  10246. };
  10247. b.prototype.addTexture = function(a, b) {
  10248. this._textures[a] = b
  10249. };
  10250. b.prototype.createBitmap = function(a) {
  10251. var b, c;
  10252. for (c in this._sheets)
  10253. if (b = this._sheets[c], b = b.getTexture(a), null != b) break;
  10254. null == b && (b = this._textures[a]);
  10255. if (null == b) return null;
  10256. a = new egret.Bitmap;
  10257. a.texture = b;
  10258. return a
  10259. };
  10260. return b
  10261. }();
  10262. b.SwfAssetManager = c;
  10263. c.prototype.__class__ = "starlingswf.SwfAssetManager"
  10264. })(starlingswf ||
  10265. (starlingswf = {}));
  10266. (function(b) {
  10267. var c = function() {
  10268. function b() {}
  10269. b.createSwfUpdateManager = function(a) {
  10270. var c = new b;
  10271. c._animations = [];
  10272. c._addQueue = [];
  10273. c._removeQueue = [];
  10274. c._currentTime = 0;
  10275. c.setFps(a);
  10276. egret.Ticker.getInstance().register(c.update, c);
  10277. return c
  10278. };
  10279. b.prototype.setFps = function(a) {
  10280. this._fps = a;
  10281. this._fpsTime = 1E3 / a
  10282. };
  10283. b.prototype.addSwfAnimation = function(a) {
  10284. this._addQueue.push(a)
  10285. };
  10286. b.prototype.removeSwfAnimation = function(a) {
  10287. this._removeQueue.push(a)
  10288. };
  10289. b.prototype.updateAdd = function() {
  10290. for (var a = this._addQueue.length, b, c, e = 0; e <
  10291. a; e++) c = this._addQueue.pop(), b = this._animations.indexOf(c), -1 == b && this._animations.push(c)
  10292. };
  10293. b.prototype.updateRemove = function() {
  10294. for (var a = this._removeQueue.length, b, c = 0; c < a; c++) b = this._removeQueue.pop(), b = this._animations.indexOf(b), -1 != b && this._animations.splice(b, 1)
  10295. };
  10296. b.prototype.update = function(a) {
  10297. this._currentTime += a;
  10298. if (!(this._currentTime < this._fpsTime)) {
  10299. this._currentTime -= this._fpsTime;
  10300. this._currentTime > this._fpsTime && (this._currentTime = 0);
  10301. this.updateRemove();
  10302. this.updateAdd();
  10303. a = this._animations.length;
  10304. for (var b = 0; b < a; b++) this._animations[b].update()
  10305. }
  10306. };
  10307. return b
  10308. }();
  10309. b.SwfUpdateManager = c;
  10310. c.prototype.__class__ = "starlingswf.SwfUpdateManager"
  10311. })(starlingswf || (starlingswf = {}));