game-min.js 436 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684
  1. var egret; (function(c) {
  2. c.egret_string_code = {};
  3. c.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  4. c.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";
  5. c.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";
  6. c.egret_string_code[1002] = "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";
  7. c.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  8. c.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  9. c.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  10. c.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  11. c.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  12. c.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  13. c.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  14. c.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  15. c.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  16. c.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  17. c.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  18. c.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  19. c.egret_string_code[1015] = "xml not found!";
  20. c.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  21. c.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  22. c.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  23. c.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  24. c.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  25. c.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  26. c.egret_string_code[1022] = "{0} ArgumentError";
  27. c.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  28. c.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  29. c.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  30. c.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
  31. c.egret_string_code[1027] = "DecodingError";
  32. c.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";
  33. c.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  34. c.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  35. c.egret_string_code[1031] = "setVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume = value\u4ee3\u66ff";
  36. c.egret_string_code[1032] = "getVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume\u4ee3\u66ff";
  37. c.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  38. c.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  39. c.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  40. c.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  41. c.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  42. c.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";
  43. c.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  44. c.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  45. c.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  46. c.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  47. c.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  48. c.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  49. c.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  50. c.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  51. c.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  52. c.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";
  53. c.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  54. c.egret_string_code[4001] = "Abstract class can not be instantiated!";
  55. c.egret_string_code[4002] = "Unnamed data!";
  56. c.egret_string_code[4003] = "Nonsupport version!";
  57. c.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  58. c.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  59. c.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
  60. })(egret || (egret = {})); (function(c) {
  61. c.egret_string_code = {};
  62. c.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  63. c.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";
  64. c.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";
  65. c.egret_string_code[1002] = "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";
  66. c.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  67. c.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  68. c.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  69. c.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  70. c.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  71. c.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  72. c.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  73. c.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  74. c.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  75. c.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  76. c.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  77. c.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  78. c.egret_string_code[1015] = "xml not found!";
  79. c.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  80. c.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  81. c.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  82. c.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  83. c.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  84. c.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  85. c.egret_string_code[1022] = "{0} ArgumentError";
  86. c.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  87. c.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  88. c.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  89. c.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
  90. c.egret_string_code[1027] = "DecodingError";
  91. c.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";
  92. c.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  93. c.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  94. c.egret_string_code[1031] = "setVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume = value\u4ee3\u66ff";
  95. c.egret_string_code[1032] = "getVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume\u4ee3\u66ff";
  96. c.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  97. c.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  98. c.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  99. c.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  100. c.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  101. c.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";
  102. c.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  103. c.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  104. c.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  105. c.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  106. c.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  107. c.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  108. c.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  109. c.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  110. c.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  111. c.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";
  112. c.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  113. c.egret_string_code[4001] = "Abstract class can not be instantiated!";
  114. c.egret_string_code[4002] = "Unnamed data!";
  115. c.egret_string_code[4003] = "Nonsupport version!";
  116. c.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  117. c.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  118. c.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
  119. })(egret || (egret = {}));
  120. var __extends = this.__extends ||
  121. function(c, g) {
  122. function e() {
  123. this.constructor = c
  124. }
  125. for (var d in g) g.hasOwnProperty(d) && (c[d] = g[d]);
  126. e.prototype = g.prototype;
  127. c.prototype = new e
  128. }; (function(c) {
  129. function g(d) {
  130. for (var b = [], a = 1; a < arguments.length; a++) b[a - 1] = arguments[a];
  131. if (a = c.egret_string_code[d]) for (var f = b.length,
  132. v = 0; v < f; v++) a = a.replace("{" + v + "}", b[v]);
  133. return a
  134. }
  135. var e = function() {
  136. function d() {}
  137. d.openLogByType = function(b) {
  138. null == d.logFuncs && (d.logFuncs = {
  139. error: console.error,
  140. debug: console.debug,
  141. warn: console.warn,
  142. info: console.info,
  143. log: console.log
  144. });
  145. switch (b) {
  146. case d.OFF:
  147. console.error = function() {};
  148. case d.ERROR:
  149. console.warn = function() {};
  150. case d.WARN:
  151. console.info = function() {},
  152. console.log = function() {};
  153. case d.INFO:
  154. console.debug = function() {}
  155. }
  156. switch (b) {
  157. case d.ALL:
  158. console.debug = d.logFuncs.debug;
  159. case d.INFO:
  160. console.log = d.logFuncs.log,
  161. console.info = d.logFuncs.info;
  162. case d.WARN:
  163. console.warn = d.logFuncs.warn;
  164. case d.ERROR:
  165. console.error = d.logFuncs.error
  166. }
  167. };
  168. d.fatal = function(b, a) {
  169. void 0 === a && (a = null);
  170. c.Logger.traceToConsole("Fatal", b, a);
  171. throw Error(c.Logger.getTraceCode("Fatal", b, a));
  172. };
  173. d.info = function(b, a) {
  174. void 0 === a && (a = null);
  175. c.Logger.traceToConsole("Info", b, a)
  176. };
  177. d.warning = function(b, a) {
  178. void 0 === a && (a = null);
  179. c.Logger.traceToConsole("Warning", b, a)
  180. };
  181. d.fatalWithErrorId = function(b) {
  182. for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
  183. a.unshift(b); (a = g.apply(null, a)) ? d.fatal(a) : d.warning(g( - 1, b))
  184. };
  185. d.infoWithErrorId = function(b) {
  186. for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
  187. a.unshift(b); (a = g.apply(null, a)) ? d.info(a) : d.warning(g( - 1, b))
  188. };
  189. d.warningWithErrorId = function(b) {
  190. for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
  191. a.unshift(b); (a = g.apply(null, a)) ? d.warning(a) : d.warning(g( - 1, b))
  192. };
  193. d.traceToConsole = function(b, a, f) {
  194. console.log(c.Logger.getTraceCode(b, a, f))
  195. };
  196. d.getTraceCode = function(b, a, f) {
  197. return "[" + b + "]" + a + (null == f ? "": ":" + f)
  198. };
  199. d.ALL = "all";
  200. d.DEBUG = "debug";
  201. d.INFO = "info";
  202. d.WARN = "warn";
  203. d.ERROR = "error";
  204. d.OFF = "off";
  205. return d
  206. } ();
  207. c.Logger = e;
  208. e.prototype.__class__ = "egret.Logger";
  209. c.getString = g
  210. })(egret || (egret = {})); (function(c) {
  211. var g = function() {
  212. function c() {
  213. this._hashCode = c.hashCount++
  214. }
  215. Object.defineProperty(c.prototype, "hashCode", {
  216. get: function() {
  217. return this._hashCode
  218. },
  219. enumerable: !0,
  220. configurable: !0
  221. });
  222. c.hashCount = 1;
  223. return c
  224. } ();
  225. c.HashObject = g;
  226. g.prototype.__class__ = "egret.HashObject"
  227. })(egret || (egret = {})); (function(c) {
  228. var g = function(c) {
  229. function d(a) {
  230. void 0 === a && (a = 300);
  231. c.call(this);
  232. this.objectPool = [];
  233. this._length = 0;
  234. 1 > a && (a = 1);
  235. this.autoDisposeTime = a;
  236. this.frameCount = 0
  237. }
  238. __extends(d, c);
  239. var b = d.prototype;
  240. b._checkFrame = function() {
  241. this.frameCount--;
  242. 0 >= this.frameCount && this.dispose()
  243. };
  244. Object.defineProperty(b, "length", {
  245. get: function() {
  246. return this._length
  247. },
  248. enumerable: !0,
  249. configurable: !0
  250. });
  251. b.push = function(a) {
  252. var f = this.objectPool; - 1 == f.indexOf(a) && (f.push(a), a.__recycle && a.__recycle(), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, d._callBackList.push(this)))
  253. };
  254. b.pop = function() {
  255. if (0 == this._length) return null;
  256. this._length--;
  257. return this.objectPool.pop()
  258. };
  259. b.dispose = function() {
  260. 0 < this._length && (this.objectPool = [], this._length = 0);
  261. this.frameCount = 0;
  262. var a = d._callBackList,
  263. f = a.indexOf(this); - 1 != f && a.splice(f, 1)
  264. };
  265. d._callBackList = [];
  266. return d
  267. } (c.HashObject);
  268. c.Recycler = g;
  269. g.prototype.__class__ = "egret.Recycler"
  270. })(egret || (egret = {})); (function(c) {
  271. c.__START_TIME;
  272. c.getTimer = function() {
  273. return Date.now() - c.__START_TIME
  274. }
  275. })(egret || (egret = {})); (function(c) {
  276. c.__callLaterFunctionList = [];
  277. c.__callLaterThisList = [];
  278. c.__callLaterArgsList = [];
  279. c.callLater = function(g, e) {
  280. for (var d = [], b = 2; b < arguments.length; b++) d[b - 2] = arguments[b];
  281. c.__callLaterFunctionList.push(g);
  282. c.__callLaterThisList.push(e);
  283. c.__callLaterArgsList.push(d)
  284. };
  285. c.__callAsyncFunctionList = [];
  286. c.__callAsyncThisList = [];
  287. c.__callAsyncArgsList = [];
  288. c.__callAsync = function(g, e) {
  289. for (var d = [], b = 2; b < arguments.length; b++) d[b - 2] = arguments[b];
  290. c.__callAsyncFunctionList.push(g);
  291. c.__callAsyncThisList.push(e);
  292. c.__callAsyncArgsList.push(d)
  293. }
  294. })(egret || (egret = {})); (function(c) {
  295. var g = function() {
  296. function e() {}
  297. var d = e.prototype;
  298. d.call = function(b) {
  299. this.callback && this.callback.call(this.thisObject, b)
  300. };
  301. d.dispose = function() {
  302. this.thisObject = this.callback = null;
  303. e.__freeList.push(this)
  304. };
  305. e.push = function(b, a) {
  306. var f;
  307. f = e.__freeList.length ? e.__freeList.pop() : new c.RenderCommand;
  308. f.callback = b;
  309. f.thisObject = a;
  310. c.MainContext.__DRAW_COMMAND_LIST.push(f)
  311. };
  312. e.__freeList = [];
  313. return e
  314. } ();
  315. c.RenderCommand = g;
  316. g.prototype.__class__ = "egret.RenderCommand"
  317. })(egret || (egret = {})); (function(c) {
  318. var g = function(e) {
  319. function d(a, f, b) {
  320. void 0 === f && (f = !1);
  321. void 0 === b && (b = !1);
  322. e.call(this);
  323. this.data = null;
  324. this._type = "";
  325. this._cancelable = this._bubbles = !1;
  326. this._eventPhase = 2;
  327. this._target = this._currentTarget = null;
  328. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  329. this.isNew = !0;
  330. this._type = a;
  331. this._bubbles = f;
  332. this._cancelable = b
  333. }
  334. __extends(d, e);
  335. var b = d.prototype;
  336. Object.defineProperty(b, "type", {
  337. get: function() {
  338. return this._type
  339. },
  340. enumerable: !0,
  341. configurable: !0
  342. });
  343. Object.defineProperty(b, "bubbles", {
  344. get: function() {
  345. return this._bubbles
  346. },
  347. enumerable: !0,
  348. configurable: !0
  349. });
  350. Object.defineProperty(b, "cancelable", {
  351. get: function() {
  352. return this._cancelable
  353. },
  354. enumerable: !0,
  355. configurable: !0
  356. });
  357. Object.defineProperty(b, "eventPhase", {
  358. get: function() {
  359. return this._eventPhase
  360. },
  361. enumerable: !0,
  362. configurable: !0
  363. });
  364. Object.defineProperty(b, "currentTarget", {
  365. get: function() {
  366. return this._currentTarget
  367. },
  368. enumerable: !0,
  369. configurable: !0
  370. });
  371. Object.defineProperty(b, "target", {
  372. get: function() {
  373. return this._target
  374. },
  375. enumerable: !0,
  376. configurable: !0
  377. });
  378. b.isDefaultPrevented = function() {
  379. return this._isDefaultPrevented
  380. };
  381. b.preventDefault = function() {
  382. this._cancelable && (this._isDefaultPrevented = !0)
  383. };
  384. b.stopPropagation = function() {
  385. this._bubbles && (this._isPropagationStopped = !0)
  386. };
  387. b.stopImmediatePropagation = function() {
  388. this._bubbles && (this._isPropagationImmediateStopped = !0)
  389. };
  390. b._reset = function() {
  391. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  392. };
  393. b.__recycle = function() {
  394. this.data = this._target = this._currentTarget = null
  395. };
  396. d._dispatchByTarget = function(a, f, b, d, s, e) {
  397. void 0 === s && (s = !1);
  398. void 0 === e && (e = !1);
  399. var g = a.eventRecycler;
  400. g || (g = a.eventRecycler = new c.Recycler);
  401. var k = g.pop();
  402. k ? k._type = b: k = new a(b);
  403. k._bubbles = s;
  404. k._cancelable = e;
  405. if (d) for (var l in d) k[l] = d[l],
  406. null !== k[l] && (d[l] = null);
  407. a = f.dispatchEvent(k);
  408. g.push(k);
  409. return a
  410. };
  411. d._getPropertyData = function(a) {
  412. var f = a._props;
  413. f || (f = a._props = {});
  414. return f
  415. };
  416. d.dispatchEvent = function(a, f, b, c) {
  417. void 0 === b && (b = !1);
  418. var s = d._getPropertyData(d);
  419. void 0 != c && (s.data = c);
  420. d._dispatchByTarget(d, a, f, s, b)
  421. };
  422. d.ADDED_TO_STAGE = "addedToStage";
  423. d.REMOVED_FROM_STAGE = "removedFromStage";
  424. d.ADDED = "added";
  425. d.REMOVED = "removed";
  426. d.COMPLETE = "complete";
  427. d.LOOP_COMPLETE = "loopcomplete";
  428. d.ENTER_FRAME = "enterFrame";
  429. d.RENDER = "render";
  430. d.FINISH_RENDER = "finishRender";
  431. d.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  432. d.LEAVE_STAGE = "leaveStage";
  433. d.RESIZE = "resize";
  434. d.CHANGE = "change";
  435. d.ACTIVATE = "activate";
  436. d.DEACTIVATE = "deactivate";
  437. d.CLOSE = "close";
  438. d.CONNECT = "connect";
  439. return d
  440. } (c.HashObject);
  441. c.Event = g;
  442. g.prototype.__class__ = "egret.Event"
  443. })(egret || (egret = {})); (function(c) {
  444. var g = function(c) {
  445. function d(b, a, f) {
  446. void 0 === a && (a = !1);
  447. void 0 === f && (f = !1);
  448. c.call(this, b, a, f);
  449. this._status = 0
  450. }
  451. __extends(d, c);
  452. Object.defineProperty(d.prototype, "status", {
  453. get: function() {
  454. return this._status
  455. },
  456. enumerable: !0,
  457. configurable: !0
  458. });
  459. d.dispatchHTTPStatusEvent = function(b, a) {
  460. null == d.httpStatusEvent && (d.httpStatusEvent = new d(d.HTTP_STATUS));
  461. d.httpStatusEvent._status = a;
  462. b.dispatchEvent(d.httpStatusEvent)
  463. };
  464. d.HTTP_STATUS = "httpStatus";
  465. d.httpStatusEvent = null;
  466. return d
  467. } (c.Event);
  468. c.HTTPStatusEvent = g;
  469. g.prototype.__class__ = "egret.HTTPStatusEvent"
  470. })(egret || (egret = {})); (function(c) {
  471. var g = function(c) {
  472. function d(b, a, f) {
  473. void 0 === a && (a = !1);
  474. void 0 === f && (f = !1);
  475. c.call(this, b, a, f)
  476. }
  477. __extends(d, c);
  478. d.SOUND_COMPLETE = "soundComplete";
  479. return d
  480. } (c.Event);
  481. c.SoundEvent = g;
  482. g.prototype.__class__ = "egret.SoundEvent"
  483. })(egret || (egret = {})); (function(c) {
  484. var g = function(c) {
  485. function d(b, a, f) {
  486. void 0 === a && (a = !1);
  487. void 0 === f && (f = !1);
  488. c.call(this, b, a, f)
  489. }
  490. __extends(d, c);
  491. d.FOCUS_IN = "focusIn";
  492. d.FOCUS_OUT = "focusOut";
  493. return d
  494. } (c.Event);
  495. c.FocusEvent = g;
  496. g.prototype.__class__ = "egret.FocusEvent"
  497. })(egret || (egret = {})); (function(c) {
  498. var g = function(e) {
  499. function d(b, a, f) {
  500. void 0 === a && (a = !1);
  501. void 0 === f && (f = !1);
  502. e.call(this, b, a, f)
  503. }
  504. __extends(d, e);
  505. d.dispatchIOErrorEvent = function(b) {
  506. c.Event._dispatchByTarget(d, b, d.IO_ERROR)
  507. };
  508. d.IO_ERROR = "ioError";
  509. return d
  510. } (c.Event);
  511. c.IOErrorEvent = g;
  512. g.prototype.__class__ = "egret.IOErrorEvent"
  513. })(egret || (egret = {})); (function(c) {
  514. var g = function(e) {
  515. function d(a, f, b, c, d, n, g, k, l, m) {
  516. void 0 === f && (f = !0);
  517. void 0 === b && (b = !0);
  518. void 0 === c && (c = 0);
  519. void 0 === d && (d = 0);
  520. void 0 === n && (n = 0);
  521. void 0 === g && (g = !1);
  522. void 0 === k && (k = !1);
  523. void 0 === m && (m = !1);
  524. e.call(this, a, f, b);
  525. this._stageY = this._stageX = 0;
  526. this.touchPointID = NaN;
  527. this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
  528. this.touchPointID = c;
  529. this._stageX = d;
  530. this._stageY = n;
  531. this.ctrlKey = g;
  532. this.altKey = k;
  533. this.touchDown = m
  534. }
  535. __extends(d, e);
  536. var b = d.prototype;
  537. Object.defineProperty(b, "stageX", {
  538. get: function() {
  539. return this._stageX
  540. },
  541. enumerable: !0,
  542. configurable: !0
  543. });
  544. Object.defineProperty(b, "stageY", {
  545. get: function() {
  546. return this._stageY
  547. },
  548. enumerable: !0,
  549. configurable: !0
  550. });
  551. Object.defineProperty(b, "localX", {
  552. get: function() {
  553. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
  554. },
  555. enumerable: !0,
  556. configurable: !0
  557. });
  558. Object.defineProperty(b, "localY", {
  559. get: function() {
  560. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
  561. },
  562. enumerable: !0,
  563. configurable: !0
  564. });
  565. d.dispatchTouchEvent = function(a, f, b, t, s, e, g, k, l) {
  566. void 0 === b && (b = 0);
  567. void 0 === t && (t = 0);
  568. void 0 === s && (s = 0);
  569. void 0 === e && (e = !1);
  570. void 0 === g && (g = !1);
  571. void 0 === k && (k = !1);
  572. void 0 === l && (l = !1);
  573. var m = c.Event._getPropertyData(d);
  574. m.touchPointID = b;
  575. m._stageX = t;
  576. m._stageY = s;
  577. m.ctrlKey = e;
  578. m.altKey = g;
  579. m.shiftKey = k;
  580. m.touchDown = l;
  581. c.Event._dispatchByTarget(d, a, f, m, !0, !0)
  582. };
  583. d.TOUCH_TAP = "touchTap";
  584. d.TOUCH_MOVE = "touchMove";
  585. d.TOUCH_BEGIN = "touchBegin";
  586. d.TOUCH_END = "touchEnd";
  587. d.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  588. d.TOUCH_ROLL_OUT = "touchRollOut";
  589. d.TOUCH_ROLL_OVER = "touchRollOver";
  590. d.TOUCH_OUT = "touchOut";
  591. d.TOUCH_OVER = "touchOver";
  592. return d
  593. } (c.Event);
  594. c.TouchEvent = g;
  595. g.prototype.__class__ = "egret.TouchEvent"
  596. })(egret || (egret = {})); (function(c) {
  597. var g = function(e) {
  598. function d(b, a, f) {
  599. void 0 === a && (a = !1);
  600. void 0 === f && (f = !1);
  601. e.call(this, b, a, f)
  602. }
  603. __extends(d, e);
  604. d.dispatchTimerEvent = function(b, a) {
  605. c.Event._dispatchByTarget(d, b, a)
  606. };
  607. d.TIMER = "timer";
  608. d.TIMER_COMPLETE = "timerComplete";
  609. return d
  610. } (c.Event);
  611. c.TimerEvent = g;
  612. g.prototype.__class__ = "egret.TimerEvent"
  613. })(egret || (egret = {})); (function(c) {
  614. var g = function(e) {
  615. function d(b, a, f, v) {
  616. void 0 === a && (a = !1);
  617. void 0 === f && (f = !1);
  618. void 0 === v && (v = "");
  619. e.call(this, b, a, f);
  620. this.text = v
  621. }
  622. __extends(d, e);
  623. d.dispatchTextEvent = function(b, a, f) {
  624. var v = c.Event._getPropertyData(d);
  625. v.text = f;
  626. c.Event._dispatchByTarget(d, b, a, v)
  627. };
  628. d.LINK = "link";
  629. return d
  630. } (c.Event);
  631. c.TextEvent = g;
  632. g.prototype.__class__ = "egret.TextEvent"
  633. })(egret || (egret = {})); (function(c) {
  634. var g = function(e) {
  635. function d(b, a, f, v, c) {
  636. void 0 === a && (a = !1);
  637. void 0 === f && (f = !1);
  638. void 0 === v && (v = 0);
  639. void 0 === c && (c = 0);
  640. e.call(this, b, a, f);
  641. this.bytesTotal = this.bytesLoaded = 0;
  642. this.bytesLoaded = v;
  643. this.bytesTotal = c
  644. }
  645. __extends(d, e);
  646. d.dispatchProgressEvent = function(b, a, f, v) {
  647. void 0 === f && (f = 0);
  648. void 0 === v && (v = 0);
  649. c.Event._dispatchByTarget(d, b, a, {
  650. bytesLoaded: f,
  651. bytesTotal: v
  652. })
  653. };
  654. d.PROGRESS = "progress";
  655. d.SOCKET_DATA = "socketData";
  656. return d
  657. } (c.Event);
  658. c.ProgressEvent = g;
  659. g.prototype.__class__ = "egret.ProgressEvent"
  660. })(egret || (egret = {})); (function(c) {
  661. var g = function() {
  662. function c() {}
  663. c.CAPTURING_PHASE = 1;
  664. c.AT_TARGET = 2;
  665. c.BUBBLING_PHASE = 3;
  666. return c
  667. } ();
  668. c.EventPhase = g;
  669. g.prototype.__class__ = "egret.EventPhase"
  670. })(egret || (egret = {})); (function(c) {
  671. var g = function(e) {
  672. function d(a) {
  673. void 0 === a && (a = null);
  674. e.call(this);
  675. this._captureEventsMap = this._eventsMap = this._eventTarget = null;
  676. this._eventTarget = a ? a: this
  677. }
  678. __extends(d, e);
  679. var b = d.prototype;
  680. b.addEventListener = function(a, f, b, d, s) {
  681. void 0 === d && (d = !1);
  682. void 0 === s && (s = 0);
  683. "undefined" === typeof d && (d = !1);
  684. "undefined" === typeof s && (s = 0);
  685. f || c.Logger.fatalWithErrorId(1010);
  686. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  687. var e = d[a];
  688. e || (e = d[a] = []);
  689. this._insertEventBin(e, f, b, s)
  690. };
  691. b._insertEventBin = function(a, f, b, c, d) {
  692. void 0 === d && (d = void 0);
  693. for (var e = -1,
  694. g = a.length,
  695. k = 0; k < g; k++) {
  696. var l = a[k];
  697. if (l.listener == f && l.thisObject == b && l.display == d) return ! 1; - 1 == e && l.priority < c && (e = k)
  698. }
  699. f = {
  700. listener: f,
  701. thisObject: b,
  702. priority: c
  703. };
  704. d && (f.display = d); - 1 != e ? a.splice(e, 0, f) : a.push(f);
  705. return ! 0
  706. };
  707. b.removeEventListener = function(a, f, b, c) {
  708. void 0 === c && (c = !1);
  709. if (c = c ? this._captureEventsMap: this._eventsMap) {
  710. var d = c[a];
  711. d && (this._removeEventBin(d, f, b), 0 == d.length && delete c[a])
  712. }
  713. };
  714. b._removeEventBin = function(a, f, b, c, d) {
  715. void 0 === c && (c = void 0);
  716. void 0 === d && (d = 0);
  717. for (var e = a.length; d < e; d++) {
  718. var g = a[d];
  719. if (g.listener == f && g.thisObject == b && g.display == c) return a.splice(d, 1),
  720. !0
  721. }
  722. return ! 1
  723. };
  724. b.hasEventListener = function(a) {
  725. return !! (this._eventsMap && this._eventsMap[a] || this._captureEventsMap && this._captureEventsMap[a])
  726. };
  727. b.willTrigger = function(a) {
  728. return this.hasEventListener(a)
  729. };
  730. b.dispatchEvent = function(a) {
  731. a._reset();
  732. a._target = this._eventTarget;
  733. a._currentTarget = this._eventTarget;
  734. return this._notifyListener(a)
  735. };
  736. b._notifyListener = function(a) {
  737. var f = 1 == a._eventPhase ? this._captureEventsMap: this._eventsMap;
  738. if (!f) return ! 0;
  739. f = f[a._type];
  740. if (!f) return ! 0;
  741. var b = f.length;
  742. if (0 == b) return ! 0;
  743. for (var f = f.concat(), c = 0; c < b; c++) {
  744. var d = f[c];
  745. d.listener.call(d.thisObject, a);
  746. if (a._isPropagationImmediateStopped) break
  747. }
  748. return ! a._isDefaultPrevented
  749. };
  750. b.dispatchEventWith = function(a, f, b) {
  751. void 0 === f && (f = !1);
  752. c.Event.dispatchEvent(this, a, f, b)
  753. };
  754. return d
  755. } (c.HashObject);
  756. c.EventDispatcher = g;
  757. g.prototype.__class__ = "egret.EventDispatcher"
  758. })(egret || (egret = {})); (function(c) {
  759. var g = function(e) {
  760. function d() {
  761. e.call(this);
  762. this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
  763. this.reuseEvent = new c.Event("")
  764. }
  765. __extends(d, e);
  766. var b = d.prototype;
  767. b.run = function() {
  768. c.Ticker.getInstance().run();
  769. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  770. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  771. this.touchContext.run();
  772. this._profileInstance = c.Profiler.getInstance()
  773. };
  774. b.renderLoop = function(a) {
  775. if (0 < c.__callLaterFunctionList.length) {
  776. var f = c.__callLaterFunctionList;
  777. c.__callLaterFunctionList = [];
  778. var b = c.__callLaterThisList;
  779. c.__callLaterThisList = [];
  780. var t = c.__callLaterArgsList;
  781. c.__callLaterArgsList = []
  782. }
  783. a = this.stage;
  784. var e = d.cachedEvent;
  785. e._type = c.Event.RENDER;
  786. this.dispatchEvent(e);
  787. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  788. f && this.doCallLaterList(f, b, t);
  789. 0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
  790. f = this.rendererContext;
  791. f.onRenderStart();
  792. f.clearScreen();
  793. d.__DRAW_COMMAND_LIST = [];
  794. d._renderLoopPhase = "updateTransform";
  795. a._updateTransform();
  796. d._renderLoopPhase = "draw";
  797. e._type = c.Event.FINISH_UPDATE_TRANSFORM;
  798. this.dispatchEvent(e);
  799. d.__use_new_draw ? this._draw(f) : a._draw(f);
  800. e._type = c.Event.FINISH_RENDER;
  801. this.dispatchEvent(e);
  802. this._profileInstance._isRunning && this._profileInstance._drawProfiler(f);
  803. f.onRenderFinish()
  804. };
  805. b._draw = function(a) {
  806. for (var f = d.__DRAW_COMMAND_LIST,
  807. b = f.length,
  808. c = 0; c < b; c++) {
  809. var e = f[c];
  810. e.call(a);
  811. e.dispose()
  812. }
  813. };
  814. b.broadcastEnterFrame = function(a) {
  815. a = this.reuseEvent;
  816. a._type = c.Event.ENTER_FRAME;
  817. this.dispatchEvent(a);
  818. for (var f = c.DisplayObject._enterFrameCallBackList.concat(), b = f.length, d = 0; d < b; d++) {
  819. var e = f[d];
  820. a._target = e.display;
  821. a._currentTarget = e.display;
  822. e.listener.call(e.thisObject, a)
  823. }
  824. f = c.Recycler._callBackList;
  825. for (d = f.length - 1; 0 <= d; d--) f[d]._checkFrame()
  826. };
  827. b.broadcastRender = function() {
  828. var a = this.reuseEvent;
  829. a._type = c.Event.RENDER;
  830. for (var f = c.DisplayObject._renderCallBackList.concat(), b = f.length, d = 0; d < b; d++) {
  831. var e = f[d],
  832. n = e.display;
  833. a._target = n;
  834. a._currentTarget = n;
  835. e.listener.call(e.thisObject, a)
  836. }
  837. };
  838. b.doCallLaterList = function(a, f, b) {
  839. for (var c = a.length,
  840. d = 0; d < c; d++) {
  841. var e = a[d];
  842. null != e && e.apply(f[d], b[d])
  843. }
  844. };
  845. b.doCallAsyncList = function() {
  846. var a = c.__callAsyncFunctionList.concat(),
  847. f = c.__callAsyncThisList.concat(),
  848. b = c.__callAsyncArgsList.concat();
  849. c.__callAsyncFunctionList.length = 0;
  850. c.__callAsyncThisList.length = 0;
  851. for (var d = c.__callAsyncArgsList.length = 0; d < a.length; d++) {
  852. var e = a[d];
  853. null != e && e.apply(f[d], b[d])
  854. }
  855. };
  856. d.deviceType = null;
  857. d.DEVICE_PC = "web";
  858. d.DEVICE_MOBILE = "native";
  859. d.RUNTIME_HTML5 = "runtimeHtml5";
  860. d.RUNTIME_NATIVE = "runtimeNative";
  861. d.__DRAW_COMMAND_LIST = [];
  862. d.__use_new_draw = !0;
  863. d.cachedEvent = new c.Event("");
  864. return d
  865. } (c.EventDispatcher);
  866. c.MainContext = g;
  867. g.prototype.__class__ = "egret.MainContext"
  868. })(egret || (egret = {}));
  869. var testDeviceType = function() {
  870. if (!this.navigator) return ! 0;
  871. var c = navigator.userAgent.toLowerCase();
  872. return - 1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  873. },
  874. testRuntimeType = function() {
  875. return this.navigator ? !0 : !1
  876. };
  877. egret.MainContext.instance = new egret.MainContext;
  878. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC;
  879. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5: egret.MainContext.RUNTIME_NATIVE;
  880. delete testDeviceType;
  881. delete testRuntimeType; (function(c) {
  882. var g = function() {
  883. function e() {
  884. this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  885. this._calculatePreDrawCount = !0;
  886. this._txt = null;
  887. this._tick = 0;
  888. this._maxDeltaTime = 500;
  889. this._totalDeltaTime = 0;
  890. this._isRunning = !1
  891. }
  892. var d = e.prototype;
  893. e.getInstance = function() {
  894. null == e.instance && (e.instance = new e);
  895. return e.instance
  896. };
  897. d.stop = function() {
  898. if (this._isRunning) {
  899. this._isRunning = !1;
  900. c.Ticker.getInstance().unregister(this.update, this);
  901. var b = c.MainContext.instance;
  902. b.removeEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  903. b.removeEventListener(c.Event.RENDER, this.onStartRender, this);
  904. b.removeEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  905. b.removeEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  906. }
  907. };
  908. d.run = function() {
  909. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._DO_Props_._parent = new c.DisplayObjectContainer);
  910. if (!this._isRunning) {
  911. this._isRunning = !0;
  912. c.Ticker.getInstance().register(this.update, this);
  913. var b = c.MainContext.instance;
  914. b.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  915. b.addEventListener(c.Event.RENDER, this.onStartRender, this);
  916. b.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  917. b.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  918. }
  919. };
  920. d._drawProfiler = function(b) {
  921. "_drawWebGL" in b && b._drawWebGL();
  922. this._calculatePreDrawCount = !1;
  923. this._txt._updateTransform();
  924. this._txt._draw(b)
  925. };
  926. d._setTxtFontSize = function(b) {
  927. this._txt.size = b
  928. };
  929. d.onEnterFrame = function(b) {
  930. this._lastTime = c.getTimer()
  931. };
  932. d.onStartRender = function(b) {
  933. b = c.getTimer();
  934. this._logicPerformanceCost = b - this._lastTime;
  935. this._lastTime = b
  936. };
  937. d.onFinishUpdateTransform = function(b) {
  938. b = c.getTimer();
  939. this._updateTransformPerformanceCost = b - this._lastTime;
  940. this._lastTime = b
  941. };
  942. d.onFinishRender = function(b) {
  943. b = c.getTimer();
  944. this._renderPerformanceCost = b - this._lastTime;
  945. this._lastTime = b
  946. };
  947. d.update = function(b) {
  948. this._tick++;
  949. this._totalDeltaTime += b;
  950. if (this._totalDeltaTime >= this._maxDeltaTime) {
  951. b = this._preDrawCount.toString();
  952. var a = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  953. this._txt.text = "draw:" + b + "\ncost:" + a + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  954. this._tick = this._totalDeltaTime = 0
  955. }
  956. this._preDrawCount = 0;
  957. this._calculatePreDrawCount = !0
  958. };
  959. d.onDrawImage = function() {
  960. this._calculatePreDrawCount && this._preDrawCount++
  961. };
  962. return e
  963. } ();
  964. c.Profiler = g;
  965. g.prototype.__class__ = "egret.Profiler"
  966. })(egret || (egret = {})); (function(c) {
  967. var g = function(e) {
  968. function d() {
  969. e.call(this);
  970. this._timeScale = 1;
  971. this._paused = !1;
  972. this._callIndex = -1;
  973. this.callBackList = [];
  974. null != d.instance && c.Logger.fatalWithErrorId(1002)
  975. }
  976. __extends(d, e);
  977. var b = d.prototype;
  978. b.run = function() {
  979. c.__START_TIME = (new Date).getTime();
  980. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  981. };
  982. b.update = function(a) {
  983. if (!this._paused) {
  984. a *= this._timeScale;
  985. a *= this._timeScale;
  986. this._callList = this.callBackList.concat();
  987. for (this._callIndex = 0; this._callIndex < this._callList.length; this._callIndex++) {
  988. var f = this._callList[this._callIndex];
  989. f.listener.call(f.thisObject, a)
  990. }
  991. this._callIndex = -1;
  992. this._callList = null
  993. }
  994. };
  995. b.register = function(a, f, b) {
  996. void 0 === b && (b = 0);
  997. this._insertEventBin(this.callBackList, a, f, b)
  998. };
  999. b.unregister = function(a, f) {
  1000. this._removeEventBin(this.callBackList, a, f);
  1001. this._callList && -1 < this._callIndex && this._removeEventBin(this._callList, a, f, null, this._callIndex + 1)
  1002. };
  1003. b.setTimeout = function(a, f, b) {
  1004. for (var d = [], e = 3; e < arguments.length; e++) d[e - 3] = arguments[e];
  1005. c.Logger.warningWithErrorId(1003);
  1006. c.setTimeout.apply(null, [a, f, b].concat(d))
  1007. };
  1008. b.setTimeScale = function(a) {
  1009. this._timeScale = a
  1010. };
  1011. b.getTimeScale = function() {
  1012. return this._timeScale
  1013. };
  1014. b.pause = function() {
  1015. this._paused = !0
  1016. };
  1017. b.resume = function() {
  1018. this._paused = !1
  1019. };
  1020. d.getInstance = function() {
  1021. null == d.instance && (d.instance = new d);
  1022. return d.instance
  1023. };
  1024. return d
  1025. } (c.EventDispatcher);
  1026. c.Ticker = g;
  1027. g.prototype.__class__ = "egret.Ticker"
  1028. })(egret || (egret = {})); (function(c) {
  1029. var g = function() {
  1030. function c() {}
  1031. c.LEFT = "left";
  1032. c.RIGHT = "right";
  1033. c.CENTER = "center";
  1034. c.JUSTIFY = "justify";
  1035. c.CONTENT_JUSTIFY = "contentJustify";
  1036. return c
  1037. } ();
  1038. c.HorizontalAlign = g;
  1039. g.prototype.__class__ = "egret.HorizontalAlign"
  1040. })(egret || (egret = {})); (function(c) {
  1041. var g = function() {
  1042. function c() {}
  1043. c.TOP = "top";
  1044. c.BOTTOM = "bottom";
  1045. c.MIDDLE = "middle";
  1046. c.JUSTIFY = "justify";
  1047. c.CONTENT_JUSTIFY = "contentJustify";
  1048. return c
  1049. } ();
  1050. c.VerticalAlign = g;
  1051. g.prototype.__class__ = "egret.VerticalAlign"
  1052. })(egret || (egret = {})); (function(c) {
  1053. var g = function(e) {
  1054. function d(a, f) {
  1055. void 0 === f && (f = 0);
  1056. e.call(this);
  1057. this._currentCount = 0;
  1058. this._running = !1;
  1059. this.lastTime = 0;
  1060. this.delay = a;
  1061. this.repeatCount = f
  1062. }
  1063. __extends(d, e);
  1064. var b = d.prototype;
  1065. Object.defineProperty(b, "currentCount", {
  1066. get: function() {
  1067. return this._currentCount
  1068. },
  1069. enumerable: !0,
  1070. configurable: !0
  1071. });
  1072. Object.defineProperty(b, "running", {
  1073. get: function() {
  1074. return this._running
  1075. },
  1076. enumerable: !0,
  1077. configurable: !0
  1078. });
  1079. b.reset = function() {
  1080. this.stop();
  1081. this._currentCount = 0
  1082. };
  1083. b.start = function() {
  1084. this._running || (this.lastTime = c.getTimer(), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  1085. };
  1086. b.stop = function() {
  1087. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  1088. };
  1089. b.onEnterFrame = function(a) {
  1090. a = c.getTimer();
  1091. a - this.lastTime > this.delay && (this.lastTime = a, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  1092. };
  1093. return d
  1094. } (c.EventDispatcher);
  1095. c.Timer = g;
  1096. g.prototype.__class__ = "egret.Timer"
  1097. })(egret || (egret = {})); (function(c) {
  1098. function g(c) {
  1099. c = c.prototype ? c.prototype: Object.getPrototypeOf(c);
  1100. if (c.hasOwnProperty("__class__")) return c.__class__;
  1101. var d = c.constructor.toString(),
  1102. b = d.indexOf("("),
  1103. d = d.substring(9, b);
  1104. Object.defineProperty(c, "__class__", {
  1105. value: d,
  1106. enumerable: !1,
  1107. writable: !0
  1108. });
  1109. return d
  1110. }
  1111. c.getQualifiedClassName = g;
  1112. c.getQualifiedSuperclassName = function(c) {
  1113. c = c.prototype ? c.prototype: Object.getPrototypeOf(c);
  1114. if (c.hasOwnProperty("__superclass__")) return c.__superclass__;
  1115. var d = Object.getPrototypeOf(c);
  1116. if (null == d) return null;
  1117. d = g(d.constructor);
  1118. if (!d) return null;
  1119. Object.defineProperty(c, "__superclass__", {
  1120. value: d,
  1121. enumerable: !1,
  1122. writable: !0
  1123. });
  1124. return d
  1125. }
  1126. })(egret || (egret = {})); (function(c) {
  1127. var g = {};
  1128. c.getDefinitionByName = function(c) {
  1129. if (!c) return null;
  1130. var d = g[c];
  1131. if (d) return d;
  1132. for (var b = c.split("."), a = b.length, d = __global, f = 0; f < a; f++) if (d = d[b[f]], !d) return null;
  1133. return g[c] = d
  1134. }
  1135. })(egret || (egret = {}));
  1136. var __global = __global || this; (function(c) {
  1137. function g(b) {
  1138. for (var a in e) {
  1139. var f = e[a];
  1140. f.delay -= b;
  1141. 0 >= f.delay && (f.listener.apply(f.thisObject, f.params), delete e[a])
  1142. }
  1143. }
  1144. var e = {},
  1145. d = 0;
  1146. c.setTimeout = function(b, a, f) {
  1147. for (var v = [], t = 3; t < arguments.length; t++) v[t - 3] = arguments[t];
  1148. v = {
  1149. listener: b,
  1150. thisObject: a,
  1151. delay: f,
  1152. params: v
  1153. };
  1154. 0 == d && c.Ticker.getInstance().register(g, null);
  1155. d++;
  1156. e[d] = v;
  1157. return d
  1158. };
  1159. c.clearTimeout = function(b) {
  1160. delete e[b]
  1161. }
  1162. })(egret || (egret = {})); (function(c) {
  1163. function g(b) {
  1164. for (var a in e) {
  1165. var f = e[a];
  1166. f.delay -= b;
  1167. 0 >= f.delay && (f.delay = f.originDelay, f.listener.apply(f.thisObject, f.params))
  1168. }
  1169. }
  1170. var e = {},
  1171. d = 0;
  1172. c.setInterval = function(b, a, f) {
  1173. for (var v = [], t = 3; t < arguments.length; t++) v[t - 3] = arguments[t];
  1174. v = {
  1175. listener: b,
  1176. thisObject: a,
  1177. delay: f,
  1178. originDelay: f,
  1179. params: v
  1180. };
  1181. 0 == d && c.Ticker.getInstance().register(g, null);
  1182. d++;
  1183. e[d] = v;
  1184. return d
  1185. };
  1186. c.clearInterval = function(b) {
  1187. delete e[b]
  1188. }
  1189. })(egret || (egret = {})); (function(c) {
  1190. c.hasDefinition = function(g) {
  1191. return c.getDefinitionByName(g) ? !0 : !1
  1192. }
  1193. })(egret || (egret = {})); (function(c) {
  1194. c.toColorString = function(c) {
  1195. if (isNaN(c) || 0 > c) c = 0;
  1196. 16777215 < c && (c = 16777215);
  1197. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  1198. return "#" + c
  1199. }
  1200. })(egret || (egret = {})); (function(c) {
  1201. var g = function(e) {
  1202. function d(a, f, b, c, d, n) {
  1203. void 0 === a && (a = 1);
  1204. void 0 === f && (f = 0);
  1205. void 0 === b && (b = 0);
  1206. void 0 === c && (c = 1);
  1207. void 0 === d && (d = 0);
  1208. void 0 === n && (n = 0);
  1209. e.call(this);
  1210. this.a = a;
  1211. this.b = f;
  1212. this.c = b;
  1213. this.d = c;
  1214. this.tx = d;
  1215. this.ty = n
  1216. }
  1217. __extends(d, e);
  1218. var b = d.prototype;
  1219. b.prepend = function(a, f, b, c, d, e) {
  1220. var g = this.tx;
  1221. if (1 != a || 0 != f || 0 != b || 1 != c) {
  1222. var k = this.a,
  1223. l = this.c;
  1224. this.a = k * a + this.b * b;
  1225. this.b = k * f + this.b * c;
  1226. this.c = l * a + this.d * b;
  1227. this.d = l * f + this.d * c
  1228. }
  1229. this.tx = g * a + this.ty * b + d;
  1230. this.ty = g * f + this.ty * c + e;
  1231. return this
  1232. };
  1233. b.append = function(a, f, b, c, d, e) {
  1234. var g = this.a,
  1235. k = this.b,
  1236. l = this.c,
  1237. m = this.d;
  1238. if (1 != a || 0 != f || 0 != b || 1 != c) this.a = a * g + f * l,
  1239. this.b = a * k + f * m,
  1240. this.c = b * g + c * l,
  1241. this.d = b * k + c * m;
  1242. this.tx = d * g + e * l + this.tx;
  1243. this.ty = d * k + e * m + this.ty;
  1244. return this
  1245. };
  1246. b.prependTransform = function(a, f, b, d, e, n, g, k, l) {
  1247. if (e % 360) {
  1248. var m = c.NumberUtils.cos(e);
  1249. e = c.NumberUtils.sin(e)
  1250. } else m = 1,
  1251. e = 0;
  1252. if (k || l) this.tx -= k,
  1253. this.ty -= l;
  1254. n || g ? (this.prepend(m * b, e * b, -e * d, m * d, 0, 0), this.prepend(c.NumberUtils.cos(g), c.NumberUtils.sin(g), -c.NumberUtils.sin(n), c.NumberUtils.cos(n), a, f)) : this.prepend(m * b, e * b, -e * d, m * d, a, f);
  1255. return this
  1256. };
  1257. b.appendTransform = function(a, f, b, d, e, n, g, k, l) {
  1258. if (e % 360) {
  1259. var m = c.NumberUtils.cos(e);
  1260. e = c.NumberUtils.sin(e)
  1261. } else m = 1,
  1262. e = 0;
  1263. n || g ? (this.append(c.NumberUtils.cos(g), c.NumberUtils.sin(g), -c.NumberUtils.sin(n), c.NumberUtils.cos(n), a, f), this.append(m * b, e * b, -e * d, m * d, 0, 0)) : this.append(m * b, e * b, -e * d, m * d, a, f);
  1264. if (k || l) this.tx -= k * this.a + l * this.c,
  1265. this.ty -= k * this.b + l * this.d;
  1266. return this
  1267. };
  1268. b.rotate = function(a) {
  1269. var f = Math.cos(a);
  1270. a = Math.sin(a);
  1271. var b = this.a,
  1272. c = this.c,
  1273. d = this.tx;
  1274. this.a = b * f - this.b * a;
  1275. this.b = b * a + this.b * f;
  1276. this.c = c * f - this.d * a;
  1277. this.d = c * a + this.d * f;
  1278. this.tx = d * f - this.ty * a;
  1279. this.ty = d * a + this.ty * f;
  1280. return this
  1281. };
  1282. b.skew = function(a, f) {
  1283. this.append(c.NumberUtils.cos(f), c.NumberUtils.sin(f), -c.NumberUtils.sin(a), c.NumberUtils.cos(a), 0, 0);
  1284. return this
  1285. };
  1286. b.scale = function(a, f) {
  1287. this.a *= a;
  1288. this.d *= f;
  1289. this.c *= a;
  1290. this.b *= f;
  1291. this.tx *= a;
  1292. this.ty *= f;
  1293. return this
  1294. };
  1295. b.translate = function(a, f) {
  1296. this.tx += a;
  1297. this.ty += f;
  1298. return this
  1299. };
  1300. b.identity = function() {
  1301. this.a = this.d = 1;
  1302. this.b = this.c = this.tx = this.ty = 0;
  1303. return this
  1304. };
  1305. b.identityMatrix = function(a) {
  1306. this.a = a.a;
  1307. this.b = a.b;
  1308. this.c = a.c;
  1309. this.d = a.d;
  1310. this.tx = a.tx;
  1311. this.ty = a.ty;
  1312. return this
  1313. };
  1314. b.invert = function() {
  1315. var a = this.a,
  1316. f = this.b,
  1317. b = this.c,
  1318. c = this.d,
  1319. d = this.tx,
  1320. e = a * c - f * b;
  1321. this.a = c / e;
  1322. this.b = -f / e;
  1323. this.c = -b / e;
  1324. this.d = a / e;
  1325. this.tx = (b * this.ty - c * d) / e;
  1326. this.ty = -(a * this.ty - f * d) / e;
  1327. return this
  1328. };
  1329. d.transformCoords = function(a, f, b) {
  1330. var d = c.Point.identity;
  1331. d.x = a.a * f + a.c * b + a.tx;
  1332. d.y = a.d * b + a.b * f + a.ty;
  1333. return d
  1334. };
  1335. b.toArray = function(a) {
  1336. this.array || (this.array = new Float32Array(9));
  1337. a ? (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);
  1338. this.array[8] = 1;
  1339. return this.array
  1340. };
  1341. b.setTo = function(a, f, b, c, d, e) {
  1342. this.a = a;
  1343. this.b = f;
  1344. this.c = b;
  1345. this.d = c;
  1346. this.tx = d;
  1347. this.ty = e
  1348. };
  1349. b.copyForm = function(a) {
  1350. this.identityMatrix(a)
  1351. };
  1352. d.identity = new d;
  1353. d.DEG_TO_RAD = Math.PI / 180;
  1354. return d
  1355. } (c.HashObject);
  1356. c.Matrix = g;
  1357. g.prototype.__class__ = "egret.Matrix"
  1358. })(egret || (egret = {})); (function(c) {
  1359. var g = function(c) {
  1360. function d(a, f) {
  1361. void 0 === a && (a = 0);
  1362. void 0 === f && (f = 0);
  1363. c.call(this);
  1364. this.x = a;
  1365. this.y = f
  1366. }
  1367. __extends(d, c);
  1368. var b = d.prototype;
  1369. b.clone = function() {
  1370. return new d(this.x, this.y)
  1371. };
  1372. b.equals = function(a) {
  1373. return this.x == a.x && this.y == a.y
  1374. };
  1375. d.distance = function(a, f) {
  1376. return Math.sqrt((a.x - f.x) * (a.x - f.x) + (a.y - f.y) * (a.y - f.y))
  1377. };
  1378. b.setTo = function(a, f) {
  1379. this.x = a;
  1380. this.y = f
  1381. };
  1382. b.copyForm = function(a) {
  1383. this.x = a.x;
  1384. this.y = a.y
  1385. };
  1386. d.identity = new d(0, 0);
  1387. return d
  1388. } (c.HashObject);
  1389. c.Point = g;
  1390. g.prototype.__class__ = "egret.Point"
  1391. })(egret || (egret = {})); (function(c) {
  1392. var g = function(c) {
  1393. function d(a, f, b, d) {
  1394. void 0 === a && (a = 0);
  1395. void 0 === f && (f = 0);
  1396. void 0 === b && (b = 0);
  1397. void 0 === d && (d = 0);
  1398. c.call(this);
  1399. this.x = a;
  1400. this.y = f;
  1401. this.width = b;
  1402. this.height = d
  1403. }
  1404. __extends(d, c);
  1405. var b = d.prototype;
  1406. Object.defineProperty(b, "left", {
  1407. get: function() {
  1408. return this.x
  1409. },
  1410. set: function(a) {
  1411. this.width += this.x - a;
  1412. this.x = a
  1413. },
  1414. enumerable: !0,
  1415. configurable: !0
  1416. });
  1417. Object.defineProperty(b, "right", {
  1418. get: function() {
  1419. return this.x + this.width
  1420. },
  1421. set: function(a) {
  1422. this.width = a - this.x
  1423. },
  1424. enumerable: !0,
  1425. configurable: !0
  1426. });
  1427. Object.defineProperty(b, "top", {
  1428. get: function() {
  1429. return this.y
  1430. },
  1431. set: function(a) {
  1432. this.height += this.y - a;
  1433. this.y = a
  1434. },
  1435. enumerable: !0,
  1436. configurable: !0
  1437. });
  1438. Object.defineProperty(b, "bottom", {
  1439. get: function() {
  1440. return this.y + this.height
  1441. },
  1442. set: function(a) {
  1443. this.height = a - this.y
  1444. },
  1445. enumerable: !0,
  1446. configurable: !0
  1447. });
  1448. b.initialize = function(a, f, b, c) {
  1449. this.x = a;
  1450. this.y = f;
  1451. this.width = b;
  1452. this.height = c;
  1453. return this
  1454. };
  1455. b.contains = function(a, f) {
  1456. return this.x <= a && this.x + this.width >= a && this.y <= f && this.y + this.height >= f
  1457. };
  1458. b.intersects = function(a) {
  1459. return Math.max(this.x, a.x) <= Math.min(this.right, a.right) && Math.max(this.y, a.y) <= Math.min(this.bottom, a.bottom)
  1460. };
  1461. b.setEmpty = function() {
  1462. this.height = this.width = this.y = this.x = 0
  1463. };
  1464. b.clone = function() {
  1465. return new d(this.x, this.y, this.width, this.height)
  1466. };
  1467. b.containsPoint = function(a) {
  1468. return this.x < a.x && this.x + this.width > a.x && this.y < a.y && this.y + this.height > a.y ? !0 : !1
  1469. };
  1470. b.setTo = function(a, f, b, c) {
  1471. this.initialize(a, f, b, c)
  1472. };
  1473. b.copyForm = function(a) {
  1474. this.x = a.x;
  1475. this.y = a.y;
  1476. this.width = a.width;
  1477. this.height = a.height
  1478. };
  1479. b.inflate = function(a, f) {
  1480. this.x -= a;
  1481. this.width += 2 * a;
  1482. this.y -= f;
  1483. this.height += 2 * f
  1484. };
  1485. b.isEmpty = function() {
  1486. return 0 == this.width || 0 == this.height
  1487. };
  1488. d.identity = new d(0, 0, 0, 0);
  1489. return d
  1490. } (c.HashObject);
  1491. c.Rectangle = g;
  1492. g.prototype.__class__ = "egret.Rectangle"
  1493. })(egret || (egret = {})); (function(c) {
  1494. var g = function(c) {
  1495. function d(a, f, b, d, s, g, h, k) {
  1496. void 0 === a && (a = 1);
  1497. void 0 === f && (f = 1);
  1498. void 0 === b && (b = 1);
  1499. void 0 === d && (d = 1);
  1500. void 0 === s && (s = 0);
  1501. void 0 === g && (g = 0);
  1502. void 0 === h && (h = 0);
  1503. void 0 === k && (k = 0);
  1504. c.call(this);
  1505. this._redMultiplier = a;
  1506. this._greenMultiplier = f;
  1507. this._blueMultiplier = b;
  1508. this._alphaMultiplier = d;
  1509. this._redOffset = s;
  1510. this._greenOffset = g;
  1511. this._blueOffset = h;
  1512. this._alphaOffset = k
  1513. }
  1514. __extends(d, c);
  1515. var b = d.prototype;
  1516. Object.defineProperty(b, "alphaMultiplier", {
  1517. get: function() {
  1518. return this._alphaMultiplier
  1519. },
  1520. set: function(a) {
  1521. this._alphaMultiplier = a
  1522. },
  1523. enumerable: !0,
  1524. configurable: !0
  1525. });
  1526. Object.defineProperty(b, "alphaOffset", {
  1527. get: function() {
  1528. return this._alphaOffset
  1529. },
  1530. set: function(a) {
  1531. this._alphaOffset = a
  1532. },
  1533. enumerable: !0,
  1534. configurable: !0
  1535. });
  1536. Object.defineProperty(b, "blueMultiplier", {
  1537. get: function() {
  1538. return this._blueMultiplier
  1539. },
  1540. set: function(a) {
  1541. this._blueMultiplier = a
  1542. },
  1543. enumerable: !0,
  1544. configurable: !0
  1545. });
  1546. Object.defineProperty(b, "blueOffset", {
  1547. get: function() {
  1548. return this._blueOffset
  1549. },
  1550. set: function(a) {
  1551. this._blueOffset = a
  1552. },
  1553. enumerable: !0,
  1554. configurable: !0
  1555. });
  1556. Object.defineProperty(b, "greenMultiplier", {
  1557. get: function() {
  1558. return this._greenMultiplier
  1559. },
  1560. set: function(a) {
  1561. this._greenMultiplier = a
  1562. },
  1563. enumerable: !0,
  1564. configurable: !0
  1565. });
  1566. Object.defineProperty(b, "greenOffset", {
  1567. get: function() {
  1568. return this._greenOffset
  1569. },
  1570. set: function(a) {
  1571. this._greenOffset = a
  1572. },
  1573. enumerable: !0,
  1574. configurable: !0
  1575. });
  1576. Object.defineProperty(b, "redMultiplier", {
  1577. get: function() {
  1578. return this._redMultiplier
  1579. },
  1580. set: function(a) {
  1581. this._redMultiplier = a
  1582. },
  1583. enumerable: !0,
  1584. configurable: !0
  1585. });
  1586. Object.defineProperty(b, "redOffset", {
  1587. get: function() {
  1588. return this._redOffset
  1589. },
  1590. set: function(a) {
  1591. this._redOffset = a
  1592. },
  1593. enumerable: !0,
  1594. configurable: !0
  1595. });
  1596. Object.defineProperty(b, "color", {
  1597. get: function() {
  1598. return this._redOffset << 16 + this._greenOffset << 8 + this._blueOffset
  1599. },
  1600. enumerable: !0,
  1601. configurable: !0
  1602. });
  1603. b.identityColorTransform = function(a) {
  1604. this._alphaMultiplier = a._alphaMultiplier;
  1605. this._alphaOffset = a._alphaOffset;
  1606. this._redMultiplier = a._redMultiplier;
  1607. this._redOffset = a._redOffset;
  1608. this._greenMultiplier = a._greenMultiplier;
  1609. this._greenOffset = a._greenOffset;
  1610. this._blueMultiplier = a._blueMultiplier;
  1611. this._blueOffset = a._blueOffset
  1612. };
  1613. return d
  1614. } (c.HashObject);
  1615. c.ColorTransform = g;
  1616. g.prototype.__class__ = "egret.ColorTransform"
  1617. })(egret || (egret = {})); (function(c) {
  1618. var g = function(e) {
  1619. function d(a) {
  1620. e.call(this);
  1621. this._matrix = new c.Matrix;
  1622. this._matrix2 = new c.Matrix;
  1623. this._colorTransform = new c.ColorTransform;
  1624. this._colorTransform2 = new c.ColorTransform;
  1625. this._display = a
  1626. }
  1627. __extends(d, e);
  1628. var b = d.prototype;
  1629. Object.defineProperty(b, "matrix", {
  1630. get: function() {
  1631. this._matrix2.identityMatrix(this._matrix);
  1632. return this._matrix2
  1633. },
  1634. set: function(a) {
  1635. this._setMatrix(a)
  1636. },
  1637. enumerable: !0,
  1638. configurable: !0
  1639. });
  1640. b._setMatrix = function(a) {
  1641. this._display.__hack_local_matrix || (this._display.__hack_local_matrix = new c.Matrix);
  1642. this._display.__hack_local_matrix.identityMatrix(a);
  1643. this._matrix.identityMatrix(a)
  1644. };
  1645. Object.defineProperty(b, "colorTransform", {
  1646. get: function() {
  1647. this._colorTransform2.identityColorTransform(this._colorTransform);
  1648. return this._colorTransform2
  1649. },
  1650. set: function(a) {
  1651. this._setColorTransform(a)
  1652. },
  1653. enumerable: !0,
  1654. configurable: !0
  1655. });
  1656. b._setColorTransform = function(a) {
  1657. this._colorTransform.identityColorTransform(a)
  1658. };
  1659. return d
  1660. } (c.HashObject);
  1661. c.Transform = g;
  1662. g.prototype.__class__ = "egret.Transform"
  1663. })(egret || (egret = {})); (function(c) {
  1664. var g = function(e) {
  1665. function d() {
  1666. e.call(this);
  1667. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1668. this._xmlDict = {};
  1669. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1670. }
  1671. __extends(d, e);
  1672. var b = d.prototype;
  1673. d.getInstance = function() {
  1674. d._instance || (d._instance = new d);
  1675. return d._instance
  1676. };
  1677. b.parserXML = function(a) {
  1678. for (var f = 0;
  1679. "\n" == a.charAt(f) || "\t" == a.charAt(f) || "\r" == a.charAt(f) || " " == a.charAt(f);) f++;
  1680. 0 != f && (a = a.substring(f, a.length));
  1681. this._isSupportDOMParser ? f = this._parser.parseFromString(a, "text/xml") : (f = new ActiveXObject("Microsoft.XMLDOM"), f.async = "false", f.loadXML(a));
  1682. null == f && c.Logger.infoWithErrorId(1015);
  1683. return f
  1684. };
  1685. d._instance = null;
  1686. return d
  1687. } (c.HashObject);
  1688. c.SAXParser = g;
  1689. g.prototype.__class__ = "egret.SAXParser"
  1690. })(egret || (egret = {})); (function(c) {
  1691. var g = function(a) {
  1692. function b() {
  1693. a.call(this);
  1694. this._designHeight = this._designWidth = 0;
  1695. this._scaleY = this._scaleX = 1;
  1696. this._stageHeight = this._stageWidth = this._offSetY = 0
  1697. }
  1698. __extends(b, a);
  1699. var t = b.prototype;
  1700. b.getInstance = function() {
  1701. null == b.instance && (d.initialize(), b.instance = new b);
  1702. return b.instance
  1703. };
  1704. t.setDesignSize = function(a, f, b) {
  1705. this._designWidth = a;
  1706. this._designHeight = f;
  1707. b && (c.Logger.warningWithErrorId(1001), this._setResolutionPolicy(b))
  1708. };
  1709. t._setResolutionPolicy = function(a) {
  1710. this._resolutionPolicy = a;
  1711. a.init(this);
  1712. a._apply(this, this._designWidth, this._designHeight)
  1713. };
  1714. t.getScaleX = function() {
  1715. return this._scaleX
  1716. };
  1717. t.getScaleY = function() {
  1718. return this._scaleY
  1719. };
  1720. t.getOffSetY = function() {
  1721. return this._offSetY
  1722. };
  1723. b.canvas_name = "egretCanvas";
  1724. b.egret_root_div = "gameDiv";
  1725. b.canvas_div_name = "canvasDiv";
  1726. return b
  1727. } (c.HashObject);
  1728. c.StageDelegate = g;
  1729. g.prototype.__class__ = "egret.StageDelegate";
  1730. var e = function() {
  1731. function a(f, b) {
  1732. this._containerStrategy = f;
  1733. this._contentStrategy = b
  1734. }
  1735. var b = a.prototype;
  1736. b.init = function(a) {
  1737. this._containerStrategy.init(a);
  1738. this._contentStrategy.init(a)
  1739. };
  1740. b._apply = function(a, f, b) {
  1741. this._containerStrategy._apply(a, f, b);
  1742. this._contentStrategy._apply(a, f, b)
  1743. };
  1744. return a
  1745. } ();
  1746. c.ResolutionPolicy = e;
  1747. e.prototype.__class__ = "egret.ResolutionPolicy";
  1748. var d = function() {
  1749. function a() {}
  1750. var c = a.prototype;
  1751. a.initialize = function() {
  1752. a.EQUAL_TO_FRAME = new b
  1753. };
  1754. c.init = function(a) {};
  1755. c._apply = function(a, f, b) {};
  1756. c._setupContainer = function() {
  1757. var a = document.body,
  1758. f;
  1759. a && (f = a.style) && (f.paddingTop = f.paddingTop || "0px", f.paddingRight = f.paddingRight || "0px", f.paddingBottom = f.paddingBottom || "0px", f.paddingLeft = f.paddingLeft || "0px", f.borderTop = f.borderTop || "0px", f.borderRight = f.borderRight || "0px", f.borderBottom = f.borderBottom || "0px", f.borderLeft = f.borderLeft || "0px", f.marginTop = f.marginTop || "0px", f.marginRight = f.marginRight || "0px", f.marginBottom = f.marginBottom || "0px", f.marginLeft = f.marginLeft || "0px")
  1760. };
  1761. return a
  1762. } ();
  1763. c.ContainerStrategy = d;
  1764. d.prototype.__class__ = "egret.ContainerStrategy";
  1765. var b = function(a) {
  1766. function b() {
  1767. a.apply(this, arguments)
  1768. }
  1769. __extends(b, a);
  1770. b.prototype._apply = function(a) {
  1771. this._setupContainer()
  1772. };
  1773. return b
  1774. } (d);
  1775. c.EqualToFrame = b;
  1776. b.prototype.__class__ = "egret.EqualToFrame";
  1777. e = function() {
  1778. function a() {}
  1779. var b = a.prototype;
  1780. b.init = function(a) {};
  1781. b._apply = function(a, f, b) {};
  1782. b.setEgretSize = function(a, f, b, d, v, e) {
  1783. void 0 === e && (e = 0);
  1784. c.StageDelegate.getInstance()._stageWidth = Math.round(a);
  1785. c.StageDelegate.getInstance()._stageHeight = Math.round(f);
  1786. a = document.getElementById(g.canvas_div_name);
  1787. f = document.getElementById(g.egret_root_div);
  1788. a || (a = c.Browser.getInstance().$new("div"), a.id = g.canvas_div_name, f.appendChild(a));
  1789. a.style.width = b + "px";
  1790. a.style.height = d + "px";
  1791. f.style.width = b + "px";
  1792. f.style.height = d + "px";
  1793. f.style.top = e + "px"
  1794. };
  1795. b._getClientWidth = function() {
  1796. return document.documentElement.clientWidth
  1797. };
  1798. b._getClientHeight = function() {
  1799. return document.documentElement.clientHeight
  1800. };
  1801. return a
  1802. } ();
  1803. c.ContentStrategy = e;
  1804. e.prototype.__class__ = "egret.ContentStrategy";
  1805. var a = function(a) {
  1806. function b(c) {
  1807. void 0 === c && (c = 0);
  1808. a.call(this);
  1809. this.minWidth = NaN;
  1810. this.minWidth = c
  1811. }
  1812. __extends(b, a);
  1813. b.prototype._apply = function(a, f, b) {
  1814. f = this._getClientWidth();
  1815. var c = this._getClientHeight(),
  1816. d = c / b,
  1817. v = f / d,
  1818. e = 1;
  1819. 0 != this.minWidth && (e = Math.min(1, v / this.minWidth));
  1820. this.setEgretSize(v / e, b, f, c * e);
  1821. a._scaleX = d * e;
  1822. a._scaleY = d * e
  1823. };
  1824. return b
  1825. } (e);
  1826. c.FixedHeight = a;
  1827. a.prototype.__class__ = "egret.FixedHeight";
  1828. a = function(a) {
  1829. function b(c) {
  1830. void 0 === c && (c = 0);
  1831. a.call(this);
  1832. this.minHeight = NaN;
  1833. this.minHeight = c
  1834. }
  1835. __extends(b, a);
  1836. b.prototype._apply = function(a, f, b) {
  1837. b = this._getClientWidth();
  1838. var c = this._getClientHeight(),
  1839. d = b / f,
  1840. v = c / d,
  1841. e = 1;
  1842. 0 != this.minHeight && (e = Math.min(1, v / this.minHeight));
  1843. this.setEgretSize(f, v / e, b * e, c, b * (1 - e) / 2);
  1844. a._scaleX = d * e;
  1845. a._scaleY = d * e
  1846. };
  1847. return b
  1848. } (e);
  1849. c.FixedWidth = a;
  1850. a.prototype.__class__ = "egret.FixedWidth";
  1851. a = function(a) {
  1852. function b(c, d) {
  1853. a.call(this);
  1854. this.width = c;
  1855. this.height = d
  1856. }
  1857. __extends(b, a);
  1858. b.prototype._apply = function(a, f, b) {
  1859. b = this.width;
  1860. var c = this.height,
  1861. d = b / f;
  1862. this.setEgretSize(f, c / d, b, c);
  1863. a._scaleX = d;
  1864. a._scaleY = d
  1865. };
  1866. return b
  1867. } (e);
  1868. c.FixedSize = a;
  1869. a.prototype.__class__ = "egret.FixedSize";
  1870. a = function(a) {
  1871. function b() {
  1872. a.call(this)
  1873. }
  1874. __extends(b, a);
  1875. b.prototype._apply = function(a, f, b) {
  1876. this.setEgretSize(f, b, f, b, Math.floor((f - f) / 2));
  1877. a._scaleX = 1;
  1878. a._scaleY = 1
  1879. };
  1880. return b
  1881. } (e);
  1882. c.NoScale = a;
  1883. a.prototype.__class__ = "egret.NoScale";
  1884. a = function(a) {
  1885. function b() {
  1886. a.call(this)
  1887. }
  1888. __extends(b, a);
  1889. b.prototype._apply = function(a, f, b) {
  1890. var c = this._getClientWidth(),
  1891. d = this._getClientHeight(),
  1892. v = c,
  1893. e = d,
  1894. g = v / f < e / b ? v / f: e / b,
  1895. v = f * g,
  1896. e = b * g,
  1897. c = Math.floor((c - v) / 2);
  1898. a._offSetY = Math.floor((d - e) / 2);
  1899. this.setEgretSize(f, b / 1, 1 * v, e, c, a._offSetY);
  1900. a._scaleX = 1 * g;
  1901. a._scaleY = 1 * g
  1902. };
  1903. return b
  1904. } (e);
  1905. c.ShowAll = a;
  1906. a.prototype.__class__ = "egret.ShowAll";
  1907. e = function(a) {
  1908. function b() {
  1909. a.call(this)
  1910. }
  1911. __extends(b, a);
  1912. b.prototype._apply = function(a, f, b) {
  1913. var c = this._getClientWidth(),
  1914. d = this._getClientHeight(),
  1915. c = c / f,
  1916. d = d / b;
  1917. this.setEgretSize(f, b, f * c, b * d);
  1918. a._scaleX = c;
  1919. a._scaleY = d
  1920. };
  1921. return b
  1922. } (e);
  1923. c.FullScreen = e;
  1924. e.prototype.__class__ = "egret.FullScreen"
  1925. })(egret || (egret = {})); (function(c) {
  1926. var g = function(e) {
  1927. function d() {
  1928. e.call(this);
  1929. this._originalData = {};
  1930. this._drawAreaList = []
  1931. }
  1932. __extends(d, e);
  1933. var b = d.prototype;
  1934. d.getInstance = function() {
  1935. null == d.instance && (d.instance = new d);
  1936. return d.instance
  1937. };
  1938. b.addDrawArea = function(a) {
  1939. this._drawAreaList.push(a)
  1940. };
  1941. b.clearDrawArea = function() {
  1942. this._drawAreaList = []
  1943. };
  1944. b.drawImage = function(a, f, b, t, e, g, h, k, l, m, p) {
  1945. void 0 === p && (p = void 0);
  1946. h = h || 0;
  1947. k = k || 0;
  1948. var r = f._texture_to_render;
  1949. if (null != r && 0 != g && 0 != e && 0 != l && 0 != m) {
  1950. var q = c.MainContext.instance.rendererContext._texture_scale_factor;
  1951. e /= q;
  1952. g /= q;
  1953. if (0 != this._drawAreaList.length && c.MainContext.instance.rendererContext._cacheCanvasContext) {
  1954. q = c.DisplayObject.getTransformBounds(f._getSize(d.identityRectangle), f._worldTransform);
  1955. f._worldBounds.initialize(q.x, q.y, q.width, q.height);
  1956. q = this._originalData;
  1957. q.sourceX = b;
  1958. q.sourceY = t;
  1959. q.sourceWidth = e;
  1960. q.sourceHeight = g;
  1961. q.destX = h;
  1962. q.destY = k;
  1963. q.destWidth = l;
  1964. q.destHeight = m;
  1965. for (var x = this.getDrawAreaList(), z = 0; z < x.length; z++) if (!this.ignoreRender(f, x[z], q.destX, q.destY)) {
  1966. a.drawImage(r, b, t, e, g, h, k, l, m, p);
  1967. break
  1968. }
  1969. } else a.drawImage(r, b, t, e, g, h, k, l, m, p)
  1970. }
  1971. };
  1972. b.ignoreRender = function(a, f, b, c) {
  1973. var d = a._worldBounds;
  1974. b *= a._worldTransform.a;
  1975. c *= a._worldTransform.d;
  1976. return d.x + d.width + b <= f.x || d.x + b >= f.x + f.width || d.y + d.height + c <= f.y || d.y + c >= f.y + f.height ? !0 : !1
  1977. };
  1978. b.getDrawAreaList = function() {
  1979. var a;
  1980. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)], c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this)), a = this._defaultDrawAreaList) : a = this._drawAreaList;
  1981. return a
  1982. };
  1983. b.onResize = function() {
  1984. c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
  1985. this._defaultDrawAreaList = null
  1986. };
  1987. d.identityRectangle = new c.Rectangle;
  1988. return d
  1989. } (c.HashObject);
  1990. c.RenderFilter = g;
  1991. g.prototype.__class__ = "egret.RenderFilter"
  1992. })(egret || (egret = {})); (function(c) {
  1993. var g = function() {
  1994. function e() {}
  1995. e.mapClass = function(c, b, a) {
  1996. void 0 === a && (a = "");
  1997. c = this.getKey(c) + "#" + a;
  1998. this.mapClassDic[c] = b
  1999. };
  2000. e.getKey = function(d) {
  2001. return "string" == typeof d ? d: c.getQualifiedClassName(d)
  2002. };
  2003. e.mapValue = function(c, b, a) {
  2004. void 0 === a && (a = "");
  2005. c = this.getKey(c) + "#" + a;
  2006. this.mapValueDic[c] = b
  2007. };
  2008. e.hasMapRule = function(c, b) {
  2009. void 0 === b && (b = "");
  2010. var a = this.getKey(c) + "#" + b;
  2011. return this.mapValueDic[a] || this.mapClassDic[a] ? !0 : !1
  2012. };
  2013. e.getInstance = function(d, b) {
  2014. void 0 === b && (b = "");
  2015. var a = this.getKey(d) + "#" + b;
  2016. if (this.mapValueDic[a]) return this.mapValueDic[a];
  2017. var f = this.mapClassDic[a];
  2018. if (f) return f = new f,
  2019. this.mapValueDic[a] = f,
  2020. delete this.mapClassDic[a],
  2021. f;
  2022. throw Error(c.getString(1028, a));
  2023. };
  2024. e.mapClassDic = {};
  2025. e.mapValueDic = {};
  2026. return e
  2027. } ();
  2028. c.Injector = g;
  2029. g.prototype.__class__ = "egret.Injector"
  2030. })(egret || (egret = {})); (function(c) {
  2031. c = c.BitmapFilterQuality || (c.BitmapFilterQuality = {});
  2032. c.LOW = 1;
  2033. c.MEDIUM = 2;
  2034. c.HIGH = 3
  2035. })(egret || (egret = {})); (function(c) {
  2036. var g = function(c) {
  2037. function d() {
  2038. c.apply(this, arguments);
  2039. this.type = null
  2040. }
  2041. __extends(d, c);
  2042. return d
  2043. } (c.HashObject);
  2044. c.Filter = g;
  2045. g.prototype.__class__ = "egret.Filter"
  2046. })(egret || (egret = {})); (function(c) {
  2047. var g = function(c) {
  2048. function d(b, a) {
  2049. c.call(this);
  2050. this.blurX = b;
  2051. this.blurY = a;
  2052. this.type = "blur"
  2053. }
  2054. __extends(d, c);
  2055. return d
  2056. } (c.Filter);
  2057. c.BlurFilter = g;
  2058. g.prototype.__class__ = "egret.BlurFilter"
  2059. })(egret || (egret = {})); (function(c) {
  2060. var g = function(c) {
  2061. function d(a) {
  2062. void 0 === a && (a = null);
  2063. c.call(this);
  2064. this._matrix = [];
  2065. this._matrix2 = [];
  2066. this.type = "colorTransform";
  2067. this._setMatrix(a)
  2068. }
  2069. __extends(d, c);
  2070. var b = d.prototype;
  2071. Object.defineProperty(b, "matrix", {
  2072. get: function() {
  2073. for (var a = 0; 20 > a; a++) this._matrix2[a] = this._matrix[a];
  2074. return this._matrix2
  2075. },
  2076. set: function(a) {
  2077. this._setMatrix(a)
  2078. },
  2079. enumerable: !0,
  2080. configurable: !0
  2081. });
  2082. b._setMatrix = function(a) {
  2083. for (var f = 0; 20 > f; f++) this._matrix[f] = a && a[f] || 0
  2084. };
  2085. return d
  2086. } (c.Filter);
  2087. c.ColorMatrixFilter = g;
  2088. g.prototype.__class__ = "egret.ColorMatrixFilter"
  2089. })(egret || (egret = {})); (function(c) {
  2090. var g = function(c) {
  2091. function d(b, a, f, d, t, s, g, h) {
  2092. void 0 === b && (b = 16711680);
  2093. void 0 === a && (a = 1);
  2094. void 0 === f && (f = 6);
  2095. void 0 === d && (d = 6);
  2096. void 0 === t && (t = 2);
  2097. void 0 === s && (s = 1);
  2098. void 0 === g && (g = !1);
  2099. void 0 === h && (h = !1);
  2100. c.call(this);
  2101. this.color = b;
  2102. this.alpha = a;
  2103. this.blurX = f;
  2104. this.blurY = d;
  2105. this.strength = t;
  2106. this.quality = s;
  2107. this.inner = g;
  2108. this.knockout = h;
  2109. this.type = "glow";
  2110. this._blue = b & 255;
  2111. this._green = (b & 65280) >> 8;
  2112. this._red = b >> 16
  2113. }
  2114. __extends(d, c);
  2115. return d
  2116. } (c.Filter);
  2117. c.GlowFilter = g;
  2118. g.prototype.__class__ = "egret.GlowFilter"
  2119. })(egret || (egret = {})); (function(c) {
  2120. var g = function(c) {
  2121. function d(b, a, f, d, t, s, g, h, k, l, m) {
  2122. void 0 === b && (b = 4);
  2123. void 0 === a && (a = 45);
  2124. void 0 === f && (f = 0);
  2125. void 0 === d && (d = 1);
  2126. void 0 === t && (t = 4);
  2127. void 0 === s && (s = 4);
  2128. void 0 === g && (g = 1);
  2129. void 0 === h && (h = 1);
  2130. void 0 === k && (k = !1);
  2131. void 0 === l && (l = !1);
  2132. c.call(this, f, d, t, s, g, h, k, l);
  2133. this.distance = b;
  2134. this.angle = a
  2135. }
  2136. __extends(d, c);
  2137. return d
  2138. } (c.GlowFilter);
  2139. c.DropShadowFilter = g;
  2140. g.prototype.__class__ = "egret.DropShadowFilter"
  2141. })(egret || (egret = {})); (function(c) {
  2142. var g = function() {
  2143. function c() {}
  2144. c.NORMAL = "normal";
  2145. c.ADD = "add";
  2146. c.ERASE = "erase";
  2147. c.ERASE_REVERSE = "eraseReverse";
  2148. return c
  2149. } ();
  2150. c.BlendMode = g;
  2151. g.prototype.__class__ = "egret.BlendMode"
  2152. })(egret || (egret = {})); (function(c) {
  2153. var g = function() {
  2154. function c() {
  2155. this._name = null;
  2156. this._explicitHeight = this._explicitWidth = NaN;
  2157. this._y = this._x = 0;
  2158. this._scaleY = this._scaleX = 1;
  2159. this._rotation = this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  2160. this._alpha = 1;
  2161. this._skewY = this._skewX = 0;
  2162. this._blendMode = null;
  2163. this._touchEnabled = c.defaultTouchEnabled;
  2164. this._visible = !0;
  2165. this._worldAlpha = 1;
  2166. this._scrollRect = null;
  2167. this._cacheAsBitmap = !1;
  2168. this._stage = this._parent = null;
  2169. this._needDraw = !1;
  2170. this._filters = null;
  2171. this._hasHeightSet = this._hasWidthSet = !1;
  2172. this._sizeDirty = this._normalDirty = !0;
  2173. this._isContainer = !1
  2174. }
  2175. c.defaultTouchEnabled = !1;
  2176. return c
  2177. } ();
  2178. c.DisplayObjectProperties = g;
  2179. g.prototype.__class__ = "egret.DisplayObjectProperties"
  2180. })(egret || (egret = {})); (function(c) {
  2181. var g = function() {
  2182. return function() {
  2183. this._hitTestPointTexture = null;
  2184. this._rectH = this._rectW = 0;
  2185. this._cacheDirty = !1
  2186. }
  2187. } ();
  2188. c.DisplayObjectPrivateProperties = g;
  2189. g.prototype.__class__ = "egret.DisplayObjectPrivateProperties"
  2190. })(egret || (egret = {})); (function(c) {
  2191. var g = function(e) {
  2192. function d() {
  2193. e.call(this);
  2194. this.renderTexture = this.mask = this._sizeChangeCallTarget = this._sizeChangeCallBack = this.__hack_local_matrix = this._worldBounds = this._texture_to_render = null;
  2195. this._DO_Props_ = new c.DisplayObjectProperties;
  2196. this._DO_Privs_ = new c.DisplayObjectPrivateProperties;
  2197. this._worldTransform = new c.Matrix;
  2198. this._worldBounds = new c.Rectangle(0, 0, 0, 0);
  2199. this._DO_Privs_._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  2200. }
  2201. __extends(d, e);
  2202. var b = d.prototype;
  2203. b._setDirty = function() {
  2204. this._DO_Props_._normalDirty = !0
  2205. };
  2206. b.getDirty = function() {
  2207. return this._DO_Props_._normalDirty || this._DO_Props_._sizeDirty
  2208. };
  2209. b._setParentSizeDirty = function() {
  2210. var a = this._DO_Props_._parent;
  2211. a && (a._DO_Props_._hasWidthSet || a._DO_Props_._hasHeightSet ? a._setCacheDirty() : a._setSizeDirty())
  2212. };
  2213. b._setSizeDirty = function() {
  2214. var a = this._DO_Props_;
  2215. a._sizeDirty || (a._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == a._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
  2216. };
  2217. b._clearDirty = function() {
  2218. this._DO_Props_._normalDirty = !1
  2219. };
  2220. b._clearSizeDirty = function() {
  2221. this._DO_Props_._sizeDirty = !1
  2222. };
  2223. Object.defineProperty(b, "name", {
  2224. get: function() {
  2225. return this._DO_Props_._name
  2226. },
  2227. set: function(a) {
  2228. this._DO_Props_._name = a
  2229. },
  2230. enumerable: !0,
  2231. configurable: !0
  2232. });
  2233. Object.defineProperty(b, "parent", {
  2234. get: function() {
  2235. return this._DO_Props_._parent
  2236. },
  2237. enumerable: !0,
  2238. configurable: !0
  2239. });
  2240. b._parentChanged = function(a) {
  2241. this._DO_Props_._parent = a
  2242. };
  2243. Object.defineProperty(b, "x", {
  2244. get: function() {
  2245. return this._DO_Props_._x
  2246. },
  2247. set: function(a) {
  2248. this._setX(a)
  2249. },
  2250. enumerable: !0,
  2251. configurable: !0
  2252. });
  2253. b._setX = function(a) {
  2254. c.NumberUtils.isNumber(a) && this._DO_Props_._x != a && (this._DO_Props_._x = a, this._setDirty(), this._setParentSizeDirty())
  2255. };
  2256. Object.defineProperty(b, "y", {
  2257. get: function() {
  2258. return this._DO_Props_._y
  2259. },
  2260. set: function(a) {
  2261. this._setY(a)
  2262. },
  2263. enumerable: !0,
  2264. configurable: !0
  2265. });
  2266. b._setY = function(a) {
  2267. c.NumberUtils.isNumber(a) && this._DO_Props_._y != a && (this._DO_Props_._y = a, this._setDirty(), this._setParentSizeDirty())
  2268. };
  2269. Object.defineProperty(b, "scaleX", {
  2270. get: function() {
  2271. return this._DO_Props_._scaleX
  2272. },
  2273. set: function(a) {
  2274. c.NumberUtils.isNumber(a) && this._DO_Props_._scaleX != a && (this._DO_Props_._scaleX = a, this._setDirty(), this._setParentSizeDirty())
  2275. },
  2276. enumerable: !0,
  2277. configurable: !0
  2278. });
  2279. Object.defineProperty(b, "scaleY", {
  2280. get: function() {
  2281. return this._DO_Props_._scaleY
  2282. },
  2283. set: function(a) {
  2284. c.NumberUtils.isNumber(a) && this._DO_Props_._scaleY != a && (this._DO_Props_._scaleY = a, this._setDirty(), this._setParentSizeDirty())
  2285. },
  2286. enumerable: !0,
  2287. configurable: !0
  2288. });
  2289. Object.defineProperty(b, "anchorOffsetX", {
  2290. get: function() {
  2291. return this._DO_Props_._anchorOffsetX
  2292. },
  2293. set: function(a) {
  2294. c.NumberUtils.isNumber(a) && this._DO_Props_._anchorOffsetX != a && (this._DO_Props_._anchorOffsetX = a, this._setDirty(), this._setParentSizeDirty())
  2295. },
  2296. enumerable: !0,
  2297. configurable: !0
  2298. });
  2299. Object.defineProperty(b, "anchorOffsetY", {
  2300. get: function() {
  2301. return this._DO_Props_._anchorOffsetY
  2302. },
  2303. set: function(a) {
  2304. c.NumberUtils.isNumber(a) && this._DO_Props_._anchorOffsetY != a && (this._DO_Props_._anchorOffsetY = a, this._setDirty(), this._setParentSizeDirty())
  2305. },
  2306. enumerable: !0,
  2307. configurable: !0
  2308. });
  2309. Object.defineProperty(b, "anchorX", {
  2310. get: function() {
  2311. return this._DO_Props_._anchorX
  2312. },
  2313. set: function(a) {
  2314. this._setAnchorX(a)
  2315. },
  2316. enumerable: !0,
  2317. configurable: !0
  2318. });
  2319. b._setAnchorX = function(a) {
  2320. c.NumberUtils.isNumber(a) && this._DO_Props_._anchorX != a && (this._DO_Props_._anchorX = a, this._setDirty(), this._setParentSizeDirty())
  2321. };
  2322. Object.defineProperty(b, "anchorY", {
  2323. get: function() {
  2324. return this._DO_Props_._anchorY
  2325. },
  2326. set: function(a) {
  2327. this._setAnchorY(a)
  2328. },
  2329. enumerable: !0,
  2330. configurable: !0
  2331. });
  2332. b._setAnchorY = function(a) {
  2333. c.NumberUtils.isNumber(a) && this._DO_Props_._anchorY != a && (this._DO_Props_._anchorY = a, this._setDirty(), this._setParentSizeDirty())
  2334. };
  2335. Object.defineProperty(b, "visible", {
  2336. get: function() {
  2337. return this._DO_Props_._visible
  2338. },
  2339. set: function(a) {
  2340. this._setVisible(a)
  2341. },
  2342. enumerable: !0,
  2343. configurable: !0
  2344. });
  2345. b._setVisible = function(a) {
  2346. this._DO_Props_._visible != a && (this._DO_Props_._visible = a, this._setSizeDirty())
  2347. };
  2348. Object.defineProperty(b, "rotation", {
  2349. get: function() {
  2350. return this._DO_Props_._rotation
  2351. },
  2352. set: function(a) {
  2353. c.NumberUtils.isNumber(a) && this._DO_Props_._rotation != a && (this._DO_Props_._rotation = a, this._setDirty(), this._setParentSizeDirty())
  2354. },
  2355. enumerable: !0,
  2356. configurable: !0
  2357. });
  2358. Object.defineProperty(b, "alpha", {
  2359. get: function() {
  2360. return this._DO_Props_._alpha
  2361. },
  2362. set: function(a) {
  2363. this._setAlpha(a)
  2364. },
  2365. enumerable: !0,
  2366. configurable: !0
  2367. });
  2368. b._setAlpha = function(a) {
  2369. c.NumberUtils.isNumber(a) && this._DO_Props_._alpha != a && (this._DO_Props_._alpha = a, this._setDirty(), this._setCacheDirty())
  2370. };
  2371. Object.defineProperty(b, "skewX", {
  2372. get: function() {
  2373. return this._DO_Props_._skewX
  2374. },
  2375. set: function(a) {
  2376. c.NumberUtils.isNumber(a) && this._DO_Props_._skewX != a && (this._DO_Props_._skewX = a, this._setDirty(), this._setParentSizeDirty())
  2377. },
  2378. enumerable: !0,
  2379. configurable: !0
  2380. });
  2381. Object.defineProperty(b, "skewY", {
  2382. get: function() {
  2383. return this._DO_Props_._skewY
  2384. },
  2385. set: function(a) {
  2386. c.NumberUtils.isNumber(a) && this._DO_Props_._skewY != a && (this._DO_Props_._skewY = a, this._setDirty(), this._setParentSizeDirty())
  2387. },
  2388. enumerable: !0,
  2389. configurable: !0
  2390. });
  2391. Object.defineProperty(b, "touchEnabled", {
  2392. get: function() {
  2393. return this._DO_Props_._touchEnabled
  2394. },
  2395. set: function(a) {
  2396. this._setTouchEnabled(a)
  2397. },
  2398. enumerable: !0,
  2399. configurable: !0
  2400. });
  2401. b._setTouchEnabled = function(a) {
  2402. this._DO_Props_._touchEnabled = a
  2403. };
  2404. Object.defineProperty(b, "blendMode", {
  2405. get: function() {
  2406. return this._DO_Props_._blendMode
  2407. },
  2408. set: function(a) {
  2409. this._DO_Props_._blendMode = a
  2410. },
  2411. enumerable: !0,
  2412. configurable: !0
  2413. });
  2414. Object.defineProperty(b, "scrollRect", {
  2415. get: function() {
  2416. return this._DO_Props_._scrollRect
  2417. },
  2418. set: function(a) {
  2419. this._setScrollRect(a)
  2420. },
  2421. enumerable: !0,
  2422. configurable: !0
  2423. });
  2424. b._setScrollRect = function(a) {
  2425. this._DO_Props_._scrollRect = a;
  2426. this._setSizeDirty()
  2427. };
  2428. Object.defineProperty(b, "measuredWidth", {
  2429. get: function() {
  2430. return this._measureBounds().width
  2431. },
  2432. enumerable: !0,
  2433. configurable: !0
  2434. });
  2435. Object.defineProperty(b, "measuredHeight", {
  2436. get: function() {
  2437. return this._measureBounds().height
  2438. },
  2439. enumerable: !0,
  2440. configurable: !0
  2441. });
  2442. Object.defineProperty(b, "explicitWidth", {
  2443. get: function() {
  2444. return this._DO_Props_._explicitWidth
  2445. },
  2446. enumerable: !0,
  2447. configurable: !0
  2448. });
  2449. Object.defineProperty(b, "explicitHeight", {
  2450. get: function() {
  2451. return this._DO_Props_._explicitHeight
  2452. },
  2453. enumerable: !0,
  2454. configurable: !0
  2455. });
  2456. Object.defineProperty(b, "width", {
  2457. get: function() {
  2458. return this._getWidth()
  2459. },
  2460. set: function(a) {
  2461. this._setWidth(a)
  2462. },
  2463. enumerable: !0,
  2464. configurable: !0
  2465. });
  2466. b._getWidth = function() {
  2467. return this._getSize(c.Rectangle.identity).width
  2468. };
  2469. Object.defineProperty(b, "height", {
  2470. get: function() {
  2471. return this._getHeight()
  2472. },
  2473. set: function(a) {
  2474. this._setHeight(a)
  2475. },
  2476. enumerable: !0,
  2477. configurable: !0
  2478. });
  2479. b._getHeight = function() {
  2480. return this._getSize(c.Rectangle.identity).height
  2481. };
  2482. b._setWidth = function(a) {
  2483. this._setSizeDirty();
  2484. this._setCacheDirty();
  2485. this._DO_Props_._explicitWidth = a;
  2486. this._DO_Props_._hasWidthSet = c.NumberUtils.isNumber(a)
  2487. };
  2488. b._setHeight = function(a) {
  2489. this._setSizeDirty();
  2490. this._setCacheDirty();
  2491. this._DO_Props_._explicitHeight = a;
  2492. this._DO_Props_._hasHeightSet = c.NumberUtils.isNumber(a)
  2493. };
  2494. Object.defineProperty(b, "worldAlpha", {
  2495. get: function() {
  2496. return this._DO_Props_._worldAlpha
  2497. },
  2498. set: function(a) {
  2499. this._DO_Props_._worldAlpha = a
  2500. },
  2501. enumerable: !0,
  2502. configurable: !0
  2503. });
  2504. b._draw = function(a) {
  2505. if (this._DO_Props_._visible && !this.drawCacheTexture(a)) {
  2506. var f = c.MainContext.__use_new_draw && this._DO_Props_._isContainer;
  2507. this._hasFilters() && !f && this._setGlobalFilters(a);
  2508. a.setAlpha(this.worldAlpha, this.blendMode);
  2509. a.setTransform(this._worldTransform);
  2510. var b = this.mask || this._DO_Props_._scrollRect;
  2511. b && !f && a.pushMask(b);
  2512. this._render(a);
  2513. b && !f && a.popMask();
  2514. this._hasFilters() && !f && this._removeGlobalFilters(a)
  2515. }
  2516. this.destroyCacheBounds()
  2517. };
  2518. b._setGlobalFilters = function(a) {
  2519. var f;
  2520. f = this._DO_Props_._filters ? this._DO_Props_._filters.concat() : [];
  2521. if (this._transform) {
  2522. var b = this._transform._colorTransform,
  2523. c = d.color;
  2524. c[0] = b._redMultiplier;
  2525. c[4] = b._redOffset;
  2526. c[6] = b._greenMultiplier;
  2527. c[9] = b._greenOffset;
  2528. c[12] = b._blueMultiplier;
  2529. c[14] = b._blueOffset;
  2530. c[18] = b._alphaMultiplier;
  2531. c[19] = b._alphaOffset;
  2532. d.colorMatrixFilter._matrix = c;
  2533. f.push(d.colorMatrixFilter)
  2534. }
  2535. a.setGlobalFilters(f)
  2536. };
  2537. b._removeGlobalFilters = function(a) {
  2538. a.setGlobalFilters(null)
  2539. };
  2540. b._hasFilters = function() {
  2541. var a = this._DO_Props_._filters && 0 < this._DO_Props_._filters.length;
  2542. if (this._transform) {
  2543. var f = this._transform._colorTransform;
  2544. if (1 != f._redMultiplier || 0 != f._redOffset || 1 != f._greenMultiplier || 0 != f._greenOffset || 1 != f._blueMultiplier || 0 != f._blueOffset || 1 != f._alphaMultiplier || 0 != f._alphaOffset) a = !0
  2545. }
  2546. return a
  2547. };
  2548. b._pushMask = function(a) {
  2549. a.setTransform(this._worldTransform);
  2550. var f = this.mask || this._DO_Props_._scrollRect;
  2551. f && a.pushMask(f)
  2552. };
  2553. b._popMask = function(a) {
  2554. a.popMask()
  2555. };
  2556. b.drawCacheTexture = function(a) {
  2557. if (!1 == this._DO_Props_._cacheAsBitmap) return ! 1;
  2558. var f = this.getBounds(c.Rectangle.identity);
  2559. if (this._DO_Privs_._cacheDirty || null == this._texture_to_render || 1 <= Math.round(f.width) - this._texture_to_render._textureWidth || 1 <= Math.round(f.height) - this._texture_to_render._textureHeight) f = this._makeBitmapCache(),
  2560. this._DO_Privs_._cacheDirty = !f;
  2561. if (null == this._texture_to_render) return ! 1;
  2562. var b = this._texture_to_render,
  2563. f = b._offsetX,
  2564. d = b._offsetY,
  2565. e = b._textureWidth,
  2566. b = b._textureHeight;
  2567. this._updateTransform();
  2568. a.setAlpha(this.worldAlpha, this.blendMode);
  2569. a.setTransform(this._worldTransform);
  2570. c.RenderFilter.getInstance().drawImage(a, this, 0, 0, e, b, f, d, e, b);
  2571. return ! 0
  2572. };
  2573. Object.defineProperty(b, "needDraw", {
  2574. get: function() {
  2575. return this._DO_Props_._needDraw
  2576. },
  2577. set: function(a) {
  2578. this._DO_Props_._needDraw = a
  2579. },
  2580. enumerable: !0,
  2581. configurable: !0
  2582. });
  2583. b._updateTransform = function() {
  2584. var a = this._DO_Props_;
  2585. a._visible && (this._calculateWorldTransform(), "updateTransform" == c.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || a._cacheAsBitmap) && c.RenderCommand.push(this._draw, this))
  2586. };
  2587. b._calculateWorldTransform = function() {
  2588. var a = this._DO_Props_,
  2589. f = this._worldTransform,
  2590. b = a._parent;
  2591. f.identityMatrix(b._worldTransform);
  2592. this._getMatrix(f);
  2593. var c = a._scrollRect;
  2594. c && f.append(1, 0, 0, 1, -c.x, -c.y);
  2595. this.worldAlpha = b.worldAlpha * a._alpha
  2596. };
  2597. b._render = function(a) {};
  2598. b.getBounds = function(a, f) {
  2599. void 0 === f && (f = !0);
  2600. var b = this._DO_Props_,
  2601. d = this._DO_Privs_,
  2602. e = this._measureBounds(),
  2603. g = b._hasWidthSet ? b._explicitWidth: e.width,
  2604. h = b._hasHeightSet ? b._explicitHeight: e.height;
  2605. d._rectW = e.width;
  2606. d._rectH = e.height;
  2607. this._clearSizeDirty();
  2608. var k = e.x,
  2609. e = e.y,
  2610. l = 0,
  2611. m = 0;
  2612. f && (0 != b._anchorX || 0 != b._anchorY ? (l = g * b._anchorX, m = h * b._anchorY) : (l = b._anchorOffsetX, m = b._anchorOffsetY));
  2613. d._cacheBounds.initialize(k - l, e - m, g, h);
  2614. b = d._cacheBounds;
  2615. a || (a = new c.Rectangle);
  2616. return a.initialize(b.x, b.y, b.width, b.height)
  2617. };
  2618. b.destroyCacheBounds = function() {
  2619. var a = this._DO_Privs_;
  2620. a._cacheBounds.x = 0;
  2621. a._cacheBounds.y = 0;
  2622. a._cacheBounds.width = 0;
  2623. a._cacheBounds.height = 0
  2624. };
  2625. b._getConcatenatedMatrix = function() {
  2626. for (var a = d.identityMatrixForGetConcatenated.identity(), f = this; null != f;) {
  2627. var b = f._DO_Props_;
  2628. 0 != b._anchorX || 0 != b._anchorY ? (f = f._getSize(c.Rectangle.identity), a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, f.width * b._anchorX, f.height * b._anchorY)) : a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, b._anchorOffsetX, b._anchorOffsetY);
  2629. b._scrollRect && a.prepend(1, 0, 0, 1, -b._scrollRect.x, -b._scrollRect.y);
  2630. f = b._parent
  2631. }
  2632. return a
  2633. };
  2634. b.localToGlobal = function(a, f, b) {
  2635. void 0 === a && (a = 0);
  2636. void 0 === f && (f = 0);
  2637. var d = this._getConcatenatedMatrix();
  2638. d.append(1, 0, 0, 1, a, f);
  2639. b || (b = new c.Point);
  2640. b.x = d.tx;
  2641. b.y = d.ty;
  2642. return b
  2643. };
  2644. b.globalToLocal = function(a, f, b) {
  2645. void 0 === a && (a = 0);
  2646. void 0 === f && (f = 0);
  2647. var d = this._getConcatenatedMatrix();
  2648. d.invert();
  2649. d.append(1, 0, 0, 1, a, f);
  2650. b || (b = new c.Point);
  2651. b.x = d.tx;
  2652. b.y = d.ty;
  2653. return b
  2654. };
  2655. b.hitTest = function(a, f, b) {
  2656. void 0 === b && (b = !1);
  2657. var d = this._DO_Props_;
  2658. if (!d._visible || !b && !d._touchEnabled) return null;
  2659. b = this.getBounds(c.Rectangle.identity, !1);
  2660. a -= b.x;
  2661. f -= b.y;
  2662. return 0 <= a && a < b.width && 0 <= f && f < b.height ? this.mask || d._scrollRect ? d._scrollRect && a > d._scrollRect.x && f > d._scrollRect.y && a < d._scrollRect.x + d._scrollRect.width && f < d._scrollRect.y + d._scrollRect.height || this.mask && this.mask.x <= a && a < this.mask.x + this.mask.width && this.mask.y <= f && f < this.mask.y + this.mask.height ? this: null: this: null
  2663. };
  2664. b.hitTestPoint = function(a, f, b) {
  2665. var d = this._DO_Privs_;
  2666. a = this.globalToLocal(a, f);
  2667. return b ? (d._hitTestPointTexture || (d._hitTestPointTexture = new c.RenderTexture), b = d._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(a.x - d._hitTestPointTexture._offsetX, a.y - d._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(a.x, a.y, !0)
  2668. };
  2669. b._getMatrix = function(a) {
  2670. a || (a = c.Matrix.identity.identity());
  2671. var f = this._DO_Props_,
  2672. b, d;
  2673. d = this._getOffsetPoint();
  2674. b = d.x;
  2675. d = d.y;
  2676. var e = this.__hack_local_matrix;
  2677. e ? (a.append(e.a, e.b, e.c, e.d, e.tx, e.ty), a.append(1, 0, 0, 1, -b, -d)) : a.appendTransform(f._x, f._y, f._scaleX, f._scaleY, f._rotation, f._skewX, f._skewY, b, d);
  2678. return a
  2679. };
  2680. b._getSize = function(a) {
  2681. var f = this._DO_Props_;
  2682. if (f._hasHeightSet && f._hasWidthSet) return this._clearSizeDirty(),
  2683. a.initialize(0, 0, f._explicitWidth, f._explicitHeight);
  2684. this._measureSize(a);
  2685. f._hasWidthSet && (a.width = f._explicitWidth);
  2686. f._hasHeightSet && (a.height = f._explicitHeight);
  2687. return a
  2688. };
  2689. b._measureSize = function(a) {
  2690. var f = this._DO_Privs_;
  2691. this._DO_Props_._sizeDirty ? (a = this._measureBounds(), f._rectW = a.width, f._rectH = a.height, this._clearSizeDirty()) : (a.width = f._rectW, a.height = f._rectH);
  2692. a.x = 0;
  2693. a.y = 0;
  2694. return a
  2695. };
  2696. b._measureBounds = function() {
  2697. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  2698. };
  2699. b._getOffsetPoint = function() {
  2700. var a = this._DO_Props_,
  2701. f = a._anchorOffsetX,
  2702. b = a._anchorOffsetY;
  2703. if (0 != a._anchorX || 0 != a._anchorY) b = this._getSize(c.Rectangle.identity),
  2704. f = a._anchorX * b.width,
  2705. b = a._anchorY * b.height;
  2706. a = c.Point.identity;
  2707. a.x = f;
  2708. a.y = b;
  2709. return a
  2710. };
  2711. b._onAddToStage = function() {
  2712. this._DO_Props_._stage = c.MainContext.instance.stage;
  2713. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2714. };
  2715. b._onRemoveFromStage = function() {
  2716. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2717. };
  2718. Object.defineProperty(b, "stage", {
  2719. get: function() {
  2720. return this._DO_Props_._stage
  2721. },
  2722. enumerable: !0,
  2723. configurable: !0
  2724. });
  2725. b.addEventListener = function(a, f, b, t, s) {
  2726. void 0 === t && (t = !1);
  2727. void 0 === s && (s = 0);
  2728. e.prototype.addEventListener.call(this, a, f, b, t, s); ((t = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._insertEventBin(t ? d._enterFrameCallBackList: d._renderCallBackList, f, b, s, this)
  2729. };
  2730. b.removeEventListener = function(a, f, b, t) {
  2731. void 0 === t && (t = !1);
  2732. e.prototype.removeEventListener.call(this, a, f, b, t); ((t = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._removeEventBin(t ? d._enterFrameCallBackList: d._renderCallBackList, f, b, this)
  2733. };
  2734. b.dispatchEvent = function(a) {
  2735. if (!a._bubbles) return e.prototype.dispatchEvent.call(this, a);
  2736. for (var f = [], b = this; b;) f.push(b),
  2737. b = b._DO_Props_._parent;
  2738. a._reset();
  2739. this._dispatchPropagationEvent(a, f);
  2740. return ! a._isDefaultPrevented
  2741. };
  2742. b._dispatchPropagationEvent = function(a, f, b) {
  2743. b = f.length;
  2744. for (var c = 1,
  2745. d = b - 1; 0 <= d; d--) {
  2746. var e = f[d];
  2747. a._currentTarget = e;
  2748. a._target = this;
  2749. a._eventPhase = c;
  2750. e._notifyListener(a);
  2751. if (a._isPropagationStopped || a._isPropagationImmediateStopped) return
  2752. }
  2753. e = f[0];
  2754. a._currentTarget = e;
  2755. a._target = this;
  2756. a._eventPhase = 2;
  2757. e._notifyListener(a);
  2758. if (!a._isPropagationStopped && !a._isPropagationImmediateStopped) for (c = 3, d = 1; d < b && (e = f[d], a._currentTarget = e, a._target = this, a._eventPhase = c, e._notifyListener(a), !a._isPropagationStopped && !a._isPropagationImmediateStopped); d++);
  2759. };
  2760. b.willTrigger = function(a) {
  2761. for (var f = this; f;) {
  2762. if (f.hasEventListener(a)) return ! 0;
  2763. f = f._DO_Props_._parent
  2764. }
  2765. return ! 1
  2766. };
  2767. Object.defineProperty(b, "cacheAsBitmap", {
  2768. get: function() {
  2769. return this._DO_Props_._cacheAsBitmap
  2770. },
  2771. set: function(a) { (this._DO_Props_._cacheAsBitmap = a) ? c.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2772. },
  2773. enumerable: !0,
  2774. configurable: !0
  2775. });
  2776. b._makeBitmapCache = function() {
  2777. this.renderTexture || (this.renderTexture = new c.RenderTexture);
  2778. var a = this.renderTexture.drawToTexture(this);
  2779. this._texture_to_render = a ? this.renderTexture: null;
  2780. return a
  2781. };
  2782. b._setCacheDirty = function(a) {
  2783. void 0 === a && (a = !0);
  2784. this._DO_Privs_._cacheDirty = a
  2785. };
  2786. d.getTransformBounds = function(a, f) {
  2787. var b = a.x,
  2788. c = a.y,
  2789. d = a.width,
  2790. e = a.height; (b || c) && f.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2791. var g = d * f.a,
  2792. d = d * f.b,
  2793. k = e * f.c,
  2794. e = e * f.d,
  2795. l = f.tx,
  2796. m = f.ty,
  2797. p = l,
  2798. r = l,
  2799. q = m,
  2800. x = m; (b = g + l) < p ? p = b: b > r && (r = b); (b = g + k + l) < p ? p = b: b > r && (r = b); (b = k + l) < p ? p = b: b > r && (r = b); (c = d + m) < q ? q = c: c > x && (x = c); (c = d + e + m) < q ? q = c: c > x && (x = c); (c = e + m) < q ? q = c: c > x && (x = c);
  2801. return a.initialize(p, q, r - p, x - q)
  2802. };
  2803. Object.defineProperty(b, "filters", {
  2804. get: function() {
  2805. return this._DO_Props_._filters
  2806. },
  2807. set: function(a) {
  2808. this._DO_Props_._filters = a
  2809. },
  2810. enumerable: !0,
  2811. configurable: !0
  2812. });
  2813. Object.defineProperty(b, "transform", {
  2814. get: function() {
  2815. this._transform || (this._transform = new c.Transform(this));
  2816. return this._transform
  2817. },
  2818. enumerable: !0,
  2819. configurable: !0
  2820. });
  2821. d.color = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
  2822. d.colorMatrixFilter = new c.ColorMatrixFilter;
  2823. d.identityMatrixForGetConcatenated = new c.Matrix;
  2824. d._enterFrameCallBackList = [];
  2825. d._renderCallBackList = [];
  2826. return d
  2827. } (c.EventDispatcher);
  2828. c.DisplayObject = g;
  2829. g.prototype.__class__ = "egret.DisplayObject"
  2830. })(egret || (egret = {})); (function(c) {
  2831. var g = function(e) {
  2832. function d() {
  2833. e.call(this);
  2834. this._touchChildren = !0;
  2835. this._children = [];
  2836. this._DO_Props_._isContainer = !0
  2837. }
  2838. __extends(d, e);
  2839. var b = d.prototype;
  2840. Object.defineProperty(b, "touchChildren", {
  2841. get: function() {
  2842. return this._touchChildren
  2843. },
  2844. set: function(a) {
  2845. this._touchChildren = a
  2846. },
  2847. enumerable: !0,
  2848. configurable: !0
  2849. });
  2850. Object.defineProperty(b, "numChildren", {
  2851. get: function() {
  2852. return this._children.length
  2853. },
  2854. enumerable: !0,
  2855. configurable: !0
  2856. });
  2857. b.setChildIndex = function(a, f) {
  2858. this.doSetChildIndex(a, f)
  2859. };
  2860. b.doSetChildIndex = function(a, f) {
  2861. var b = this._children.indexOf(a);
  2862. 0 > b && c.Logger.fatalWithErrorId(1006);
  2863. this._children.splice(b, 1);
  2864. 0 > f || this._children.length <= f ? this._children.push(a) : this._children.splice(f, 0, a)
  2865. };
  2866. b.addChild = function(a) {
  2867. var f = this._children.length;
  2868. a.parent == this && f--;
  2869. return this._doAddChild(a, f)
  2870. };
  2871. b.addChildAt = function(a, f) {
  2872. return this._doAddChild(a, f)
  2873. };
  2874. b._doAddChild = function(a, f, b) {
  2875. void 0 === b && (b = !0);
  2876. if (a == this) return a;
  2877. if (0 > f || f > this._children.length) return c.Logger.fatalWithErrorId(1007),
  2878. a;
  2879. var e = a.parent;
  2880. if (e == this) return this.doSetChildIndex(a, f),
  2881. a;
  2882. if (e) {
  2883. var g = e._children.indexOf(a);
  2884. 0 <= g && e._doRemoveChild(g)
  2885. }
  2886. this._children.splice(f, 0, a);
  2887. a._parentChanged(this);
  2888. b && a.dispatchEventWith(c.Event.ADDED, !0);
  2889. if (this._DO_Props_._stage) for (a._onAddToStage(), f = d.__EVENT__ADD_TO_STAGE_LIST; 0 < f.length;) e = f.shift(),
  2890. b && e.dispatchEventWith(c.Event.ADDED_TO_STAGE);
  2891. a._setDirty();
  2892. this._setSizeDirty();
  2893. return a
  2894. };
  2895. b.removeChild = function(a) {
  2896. a = this._children.indexOf(a);
  2897. if (0 <= a) return this._doRemoveChild(a);
  2898. c.Logger.fatalWithErrorId(1008);
  2899. return null
  2900. };
  2901. b.removeChildAt = function(a) {
  2902. if (0 <= a && a < this._children.length) return this._doRemoveChild(a);
  2903. c.Logger.fatalWithErrorId(1007);
  2904. return null
  2905. };
  2906. b._doRemoveChild = function(a, f) {
  2907. void 0 === f && (f = !0);
  2908. var b = this._children,
  2909. e = b[a];
  2910. f && e.dispatchEventWith(c.Event.REMOVED, !0);
  2911. if (this._DO_Props_._stage) {
  2912. e._onRemoveFromStage();
  2913. for (var g = d.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2914. var n = g.shift();
  2915. f && n.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
  2916. n._DO_Props_._stage = null
  2917. }
  2918. }
  2919. e._parentChanged(null);
  2920. b.splice(a, 1);
  2921. this._setSizeDirty();
  2922. return e
  2923. };
  2924. b.getChildAt = function(a) {
  2925. if (0 <= a && a < this._children.length) return this._children[a];
  2926. c.Logger.fatalWithErrorId(1007);
  2927. return null
  2928. };
  2929. b.contains = function(a) {
  2930. for (; a;) {
  2931. if (a == this) return ! 0;
  2932. a = a.parent
  2933. }
  2934. return ! 1
  2935. };
  2936. b.swapChildrenAt = function(a, f) {
  2937. 0 <= a && a < this._children.length && 0 <= f && f < this._children.length ? this._swapChildrenAt(a, f) : c.Logger.fatalWithErrorId(1007)
  2938. };
  2939. b.swapChildren = function(a, f) {
  2940. var b = this._children.indexOf(a),
  2941. d = this._children.indexOf(f); - 1 == b || -1 == d ? c.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(b, d)
  2942. };
  2943. b._swapChildrenAt = function(a, f) {
  2944. if (a != f) {
  2945. var b = this._children,
  2946. c = b[a];
  2947. b[a] = b[f];
  2948. b[f] = c
  2949. }
  2950. };
  2951. b.getChildIndex = function(a) {
  2952. return this._children.indexOf(a)
  2953. };
  2954. b.removeChildren = function() {
  2955. for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
  2956. };
  2957. b._updateTransform = function() {
  2958. if (this._DO_Props_._visible) {
  2959. this._hasFilters() && c.RenderCommand.push(this._setGlobalFilters, this);
  2960. var a = this.mask || this._DO_Props_._scrollRect;
  2961. a && c.RenderCommand.push(this._pushMask, this);
  2962. e.prototype._updateTransform.call(this);
  2963. if (!this._DO_Props_._cacheAsBitmap || !this._texture_to_render) for (var f = 0,
  2964. b = this._children,
  2965. d = b.length; f < d; f++) b[f]._updateTransform();
  2966. a && c.RenderCommand.push(this._popMask, this);
  2967. this._hasFilters() && c.RenderCommand.push(this._removeGlobalFilters, this)
  2968. }
  2969. };
  2970. b._render = function(a) {
  2971. if (!c.MainContext.__use_new_draw) for (var f = 0,
  2972. b = this._children,
  2973. d = b.length; f < d; f++) b[f]._draw(a)
  2974. };
  2975. b._measureBounds = function() {
  2976. for (var a = 0,
  2977. f = 0,
  2978. b = 0,
  2979. d = 0,
  2980. e = this._children,
  2981. g = e.length,
  2982. h = 0; h < g; h++) {
  2983. var k = e[h];
  2984. if (k.visible) {
  2985. var l = k.getBounds(c.Rectangle.identity, !1),
  2986. m = l.x,
  2987. p = l.y,
  2988. r = l.width,
  2989. l = l.height,
  2990. k = k._getMatrix(),
  2991. k = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(m, p, r, l), k),
  2992. m = k.x,
  2993. p = k.y,
  2994. r = k.width + k.x,
  2995. k = k.height + k.y;
  2996. if (m < a || 0 == h) a = m;
  2997. if (r > f || 0 == h) f = r;
  2998. if (p < b || 0 == h) b = p;
  2999. if (k > d || 0 == h) d = k
  3000. }
  3001. }
  3002. return c.Rectangle.identity.initialize(a, b, f - a, d - b)
  3003. };
  3004. b.hitTest = function(a, f, b) {
  3005. void 0 === b && (b = !1);
  3006. var d;
  3007. if (!this._DO_Props_._visible) return null;
  3008. if (this._DO_Props_._scrollRect) {
  3009. if (a < this._DO_Props_._scrollRect.x || f < this._DO_Props_._scrollRect.y || a > this._DO_Props_._scrollRect.x + this._DO_Props_._scrollRect.width || f > this._DO_Props_._scrollRect.y + this._DO_Props_._scrollRect.height) return null
  3010. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > f || f > this.mask.y + this.mask.height)) return null;
  3011. for (var g = this._children,
  3012. n = this._touchChildren,
  3013. h = g.length - 1; 0 <= h; h--) {
  3014. var k = g[h],
  3015. l = k._getMatrix(),
  3016. m = k.scrollRect;
  3017. m && l.append(1, 0, 0, 1, -m.x, -m.y);
  3018. l.invert();
  3019. l = c.Matrix.transformCoords(l, a, f);
  3020. if (k = k.hitTest(l.x, l.y, !0)) {
  3021. if (!n) return this;
  3022. if (k._DO_Props_._touchEnabled && n) return k;
  3023. d = this
  3024. }
  3025. }
  3026. return d ? d: this._texture_to_render ? e.prototype.hitTest.call(this, a, f, b) : null
  3027. };
  3028. b._onAddToStage = function() {
  3029. e.prototype._onAddToStage.call(this);
  3030. for (var a = this._children.length,
  3031. f = 0; f < a; f++) this._children[f]._onAddToStage()
  3032. };
  3033. b._onRemoveFromStage = function() {
  3034. e.prototype._onRemoveFromStage.call(this);
  3035. for (var a = this._children,
  3036. f = a.length,
  3037. b = 0; b < f; b++) a[b]._onRemoveFromStage()
  3038. };
  3039. b.getChildByName = function(a) {
  3040. for (var f = this._children,
  3041. b = f.length,
  3042. c, d = 0; d < b; d++) if (c = f[d], c.name == a) return c;
  3043. return null
  3044. };
  3045. d.__EVENT__ADD_TO_STAGE_LIST = [];
  3046. d.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  3047. return d
  3048. } (c.DisplayObject);
  3049. c.DisplayObjectContainer = g;
  3050. g.prototype.__class__ = "egret.DisplayObjectContainer"
  3051. })(egret || (egret = {})); (function(c) {
  3052. var g = function() {
  3053. function c() {}
  3054. c.NO_BORDER = "noBorder";
  3055. c.NO_SCALE = "noScale";
  3056. c.SHOW_ALL = "showAll";
  3057. c.EXACT_FIT = "exactFit";
  3058. return c
  3059. } ();
  3060. c.StageScaleMode = g;
  3061. g.prototype.__class__ = "egret.StageScaleMode"
  3062. })(egret || (egret = {})); (function(c) {
  3063. var g = function(e) {
  3064. function d(a, f) {
  3065. void 0 === a && (a = 480);
  3066. void 0 === f && (f = 800);
  3067. e.call(this);
  3068. this._changeSizeDispatchFlag = !0;
  3069. this._scaleMode = "";
  3070. this._stageHeight = this._stageWidth = NaN;
  3071. this.touchEnabled = !0;
  3072. this._DO_Props_._stage = this;
  3073. this._stageWidth = a;
  3074. this._stageHeight = f
  3075. }
  3076. __extends(d, e);
  3077. var b = d.prototype;
  3078. b.invalidate = function() {
  3079. d._invalidateRenderFlag = !0
  3080. };
  3081. Object.defineProperty(b, "scaleMode", {
  3082. get: function() {
  3083. return this._scaleMode
  3084. },
  3085. set: function(a) {
  3086. this._scaleMode != a && (this._scaleMode = a, this.setResolutionPolicy())
  3087. },
  3088. enumerable: !0,
  3089. configurable: !0
  3090. });
  3091. b.changeSize = function() {
  3092. this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(c.Event.RESIZE))
  3093. };
  3094. b.setResolutionPolicy = function() {
  3095. var a = d.SCALE_MODE_ENUM[this._scaleMode];
  3096. if (!a) throw Error(c.getString(1024));
  3097. var f = new c.EqualToFrame,
  3098. a = new c.ResolutionPolicy(f, a);
  3099. c.StageDelegate.getInstance()._setResolutionPolicy(a);
  3100. this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
  3101. this._stageHeight = c.StageDelegate.getInstance()._stageHeight
  3102. };
  3103. Object.defineProperty(b, "stageWidth", {
  3104. get: function() {
  3105. return this._stageWidth
  3106. },
  3107. enumerable: !0,
  3108. configurable: !0
  3109. });
  3110. Object.defineProperty(b, "stageHeight", {
  3111. get: function() {
  3112. return this._stageHeight
  3113. },
  3114. enumerable: !0,
  3115. configurable: !0
  3116. });
  3117. b.hitTest = function(a, f, b) {
  3118. if (!this._DO_Props_._touchEnabled) return null;
  3119. var d;
  3120. if (!this._touchChildren) return this;
  3121. b = this._children;
  3122. for (var e = b.length - 1; 0 <= e; e--) {
  3123. d = b[e];
  3124. var g = d._getMatrix(),
  3125. h = d.scrollRect;
  3126. h && g.append(1, 0, 0, 1, -h.x, -h.y);
  3127. g.invert();
  3128. g = c.Matrix.transformCoords(g, a, f);
  3129. if ((d = d.hitTest(g.x, g.y, !0)) && d.touchEnabled) return d
  3130. }
  3131. return this
  3132. };
  3133. b.getBounds = function(a) {
  3134. a || (a = new c.Rectangle);
  3135. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  3136. };
  3137. b._updateTransform = function() {
  3138. for (var a = 0,
  3139. f = this._children.length; a < f; a++) this._children[a]._updateTransform()
  3140. };
  3141. Object.defineProperty(b, "focus", {
  3142. get: function() {
  3143. return null
  3144. },
  3145. enumerable: !0,
  3146. configurable: !0
  3147. });
  3148. d.registerScaleMode = function(a, f, b) {
  3149. d.SCALE_MODE_ENUM[a] && !b ? c.Logger.warningWithErrorId(1009, a) : d.SCALE_MODE_ENUM[a] = f
  3150. };
  3151. d._invalidateRenderFlag = !1;
  3152. d.SCALE_MODE_ENUM = {};
  3153. return d
  3154. } (c.DisplayObjectContainer);
  3155. c.Stage = g;
  3156. g.prototype.__class__ = "egret.Stage"
  3157. })(egret || (egret = {}));
  3158. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
  3159. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
  3160. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
  3161. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen; (function(c) {
  3162. var g = function() {
  3163. return function() {
  3164. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  3165. this._scrollTop = this._scrollLeft = 0;
  3166. this._vCanScroll = this._hCanScroll = !1;
  3167. this._lastTouchPosition = new c.Point(0, 0);
  3168. this._touchStartPosition = new c.Point(0, 0);
  3169. this._scrollStarted = !1;
  3170. this._lastTouchTime = 0;
  3171. this._lastTouchEvent = null;
  3172. this._velocitys = [];
  3173. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  3174. this._vScrollTween = this._hScrollTween = null
  3175. }
  3176. } ();
  3177. c.ScrollViewProperties = g;
  3178. g.prototype.__class__ = "egret.ScrollViewProperties"
  3179. })(egret || (egret = {})); (function(c) {
  3180. var g = function(e) {
  3181. function d(a) {
  3182. void 0 === a && (a = null);
  3183. e.call(this);
  3184. this.scrollBeginThreshold = 10;
  3185. this.scrollSpeed = 1;
  3186. this.touchBeginTimer = this.delayTouchBeginEvent = this._content = null;
  3187. this.touchEnabled = !0;
  3188. this._ScrV_Props_ = new c.ScrollViewProperties;
  3189. a && this.setContent(a)
  3190. }
  3191. __extends(d, e);
  3192. var b = d.prototype;
  3193. b.setContent = function(a) {
  3194. this._content !== a && (this.removeContent(), a && (this._content = a, e.prototype.addChild.call(this, a), this._addEvents()))
  3195. };
  3196. b.removeContent = function() {
  3197. this._content && (this._removeEvents(), e.prototype.removeChildAt.call(this, 0));
  3198. this._content = null
  3199. };
  3200. Object.defineProperty(b, "verticalScrollPolicy", {
  3201. get: function() {
  3202. return this._ScrV_Props_._verticalScrollPolicy
  3203. },
  3204. set: function(a) {
  3205. a != this._ScrV_Props_._verticalScrollPolicy && (this._ScrV_Props_._verticalScrollPolicy = a)
  3206. },
  3207. enumerable: !0,
  3208. configurable: !0
  3209. });
  3210. Object.defineProperty(b, "horizontalScrollPolicy", {
  3211. get: function() {
  3212. return this._ScrV_Props_._horizontalScrollPolicy
  3213. },
  3214. set: function(a) {
  3215. a != this._ScrV_Props_._horizontalScrollPolicy && (this._ScrV_Props_._horizontalScrollPolicy = a)
  3216. },
  3217. enumerable: !0,
  3218. configurable: !0
  3219. });
  3220. Object.defineProperty(b, "scrollLeft", {
  3221. get: function() {
  3222. return this._ScrV_Props_._scrollLeft
  3223. },
  3224. set: function(a) {
  3225. a != this._ScrV_Props_._scrollLeft && (this._ScrV_Props_._scrollLeft = a, this._validatePosition(!1, !0), this._updateContentPosition())
  3226. },
  3227. enumerable: !0,
  3228. configurable: !0
  3229. });
  3230. Object.defineProperty(b, "scrollTop", {
  3231. get: function() {
  3232. return this._ScrV_Props_._scrollTop
  3233. },
  3234. set: function(a) {
  3235. a != this._ScrV_Props_._scrollTop && (this._ScrV_Props_._scrollTop = a, this._validatePosition(!0, !1), this._updateContentPosition())
  3236. },
  3237. enumerable: !0,
  3238. configurable: !0
  3239. });
  3240. b.setScrollPosition = function(a, f, b) {
  3241. void 0 === b && (b = !1);
  3242. if (!b || 0 != a || 0 != f) if (b || this._ScrV_Props_._scrollTop != a || this._ScrV_Props_._scrollLeft != f) {
  3243. if (b) {
  3244. b = this._isOnTheEdge(!0);
  3245. var c = this._isOnTheEdge(!1);
  3246. this._ScrV_Props_._scrollTop += b ? a / 2 : a;
  3247. this._ScrV_Props_._scrollLeft += c ? f / 2 : f
  3248. } else this._ScrV_Props_._scrollTop = a,
  3249. this._ScrV_Props_._scrollLeft = f;
  3250. this._validatePosition(!0, !0);
  3251. this._updateContentPosition()
  3252. }
  3253. };
  3254. b._isOnTheEdge = function(a) {
  3255. void 0 === a && (a = !0);
  3256. var f = this._ScrV_Props_._scrollTop,
  3257. b = this._ScrV_Props_._scrollLeft;
  3258. return a ? 0 > f || f > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  3259. };
  3260. b._validatePosition = function(a, f) {
  3261. void 0 === a && (a = !1);
  3262. void 0 === f && (f = !1);
  3263. if (a) {
  3264. var b = this.height,
  3265. c = this._getContentHeight();
  3266. this._ScrV_Props_._scrollTop = Math.max(this._ScrV_Props_._scrollTop, (0 - b) / 2);
  3267. this._ScrV_Props_._scrollTop = Math.min(this._ScrV_Props_._scrollTop, c > b ? c - b / 2 : b / 2)
  3268. }
  3269. f && (b = this.width, c = this._getContentWidth(), this._ScrV_Props_._scrollLeft = Math.max(this._ScrV_Props_._scrollLeft, (0 - b) / 2), this._ScrV_Props_._scrollLeft = Math.min(this._ScrV_Props_._scrollLeft, c > b ? c - b / 2 : b / 2))
  3270. };
  3271. b._setWidth = function(a) {
  3272. this._DO_Props_._explicitWidth != a && (e.prototype._setWidth.call(this, a), this._updateContentPosition())
  3273. };
  3274. b._setHeight = function(a) {
  3275. this._DO_Props_._explicitHeight != a && (e.prototype._setHeight.call(this, a), this._updateContentPosition())
  3276. };
  3277. b._updateContentPosition = function() {
  3278. var a = this.getBounds(c.Rectangle.identity);
  3279. this.scrollRect = new c.Rectangle(this._ScrV_Props_._scrollLeft, this._ScrV_Props_._scrollTop, a.width, a.height);
  3280. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  3281. };
  3282. b._checkScrollPolicy = function() {
  3283. var a = this.__checkScrollPolicy(this._ScrV_Props_._horizontalScrollPolicy, this._getContentWidth(), this.width);
  3284. this._ScrV_Props_._hCanScroll = a;
  3285. var f = this.__checkScrollPolicy(this._ScrV_Props_._verticalScrollPolicy, this._getContentHeight(), this.height);
  3286. this._ScrV_Props_._vCanScroll = f;
  3287. return a || f
  3288. };
  3289. b.__checkScrollPolicy = function(a, f, b) {
  3290. return "on" == a ? !0 : "off" == a ? !1 : f > b
  3291. };
  3292. b._addEvents = function() {
  3293. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  3294. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  3295. this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  3296. };
  3297. b._removeEvents = function() {
  3298. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  3299. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  3300. this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  3301. };
  3302. b._onTouchBegin = function(a) { ! a._isDefaultPrevented && this._checkScrollPolicy() && (this._ScrV_Props_._touchStartPosition.x = a.stageX, this._ScrV_Props_._touchStartPosition.y = a.stageY, (this._ScrV_Props_._isHTweenPlaying || this._ScrV_Props_._isVTweenPlaying) && this._onScrollFinished(), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this), this.stage.addEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(a), a.preventDefault())
  3303. };
  3304. b._onTouchBeginCapture = function(a) {
  3305. var f = this._checkScrollPolicy();
  3306. if (f) {
  3307. for (var b = a.target; b != this;) {
  3308. if ("_checkScrollPolicy" in b && (f = b._checkScrollPolicy())) return;
  3309. b = b.parent
  3310. }
  3311. a.stopPropagation();
  3312. this.delayTouchBeginEvent = this.cloneTouchEvent(a);
  3313. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  3314. this.touchBeginTimer.start();
  3315. this._onTouchBegin(a)
  3316. }
  3317. };
  3318. b._onTouchEndCapture = function(a) {
  3319. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  3320. };
  3321. b._onTouchBeginTimer = function() {
  3322. this.touchBeginTimer.stop();
  3323. var a = this.delayTouchBeginEvent;
  3324. this.delayTouchBeginEvent = null;
  3325. this.stage && this.dispatchPropagationEvent(a)
  3326. };
  3327. b.dispatchPropagationEvent = function(a) {
  3328. for (var f = [], b = a._target, c = 0; b;) b == this && (c = f.length),
  3329. f.push(b),
  3330. b = b.parent;
  3331. b = f.slice(0, c);
  3332. b = b.reverse();
  3333. f = b.concat(f);
  3334. this._dispatchPropagationEvent(a, f, c)
  3335. };
  3336. b._dispatchPropagationEvent = function(a, f, b) {
  3337. for (var c = f.length,
  3338. d = 0; d < c; d++) {
  3339. var e = f[d];
  3340. a._currentTarget = e;
  3341. a._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  3342. e._notifyListener(a);
  3343. if (a._isPropagationStopped || a._isPropagationImmediateStopped) break
  3344. }
  3345. };
  3346. b._onTouchMove = function(a) {
  3347. if (this._ScrV_Props_._lastTouchPosition.x != a.stageX || this._ScrV_Props_._lastTouchPosition.y != a.stageY) {
  3348. if (!this._ScrV_Props_._scrollStarted) {
  3349. var f = a.stageX - this._ScrV_Props_._touchStartPosition.x,
  3350. b = a.stageY - this._ScrV_Props_._touchStartPosition.y;
  3351. if (Math.sqrt(f * f + b * b) < this.scrollBeginThreshold) {
  3352. this._logTouchEvent(a);
  3353. return
  3354. }
  3355. }
  3356. this._ScrV_Props_._scrollStarted = !0;
  3357. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  3358. this.touchChildren = !1;
  3359. f = this._getPointChange(a);
  3360. this.setScrollPosition(f.y, f.x, !0);
  3361. this._calcVelocitys(a);
  3362. this._logTouchEvent(a)
  3363. }
  3364. };
  3365. b._onTouchEnd = function(a) {
  3366. this.touchChildren = !0;
  3367. this._ScrV_Props_._scrollStarted = !1;
  3368. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  3369. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  3370. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  3371. this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
  3372. this._moveAfterTouchEnd()
  3373. };
  3374. b._onEnterFrame = function(a) {
  3375. a = c.getTimer();
  3376. 100 < a - this._ScrV_Props_._lastTouchTime && 300 > a - this._ScrV_Props_._lastTouchTime && this._calcVelocitys(this._ScrV_Props_._lastTouchEvent)
  3377. };
  3378. b._logTouchEvent = function(a) {
  3379. this._ScrV_Props_._lastTouchPosition.x = a.stageX;
  3380. this._ScrV_Props_._lastTouchPosition.y = a.stageY;
  3381. this._ScrV_Props_._lastTouchEvent = this.cloneTouchEvent(a);
  3382. this._ScrV_Props_._lastTouchTime = c.getTimer()
  3383. };
  3384. b._getPointChange = function(a) {
  3385. return {
  3386. x: !1 === this._ScrV_Props_._hCanScroll ? 0 : this._ScrV_Props_._lastTouchPosition.x - a.stageX,
  3387. y: !1 === this._ScrV_Props_._vCanScroll ? 0 : this._ScrV_Props_._lastTouchPosition.y - a.stageY
  3388. }
  3389. };
  3390. b._calcVelocitys = function(a) {
  3391. var f = c.getTimer();
  3392. if (0 == this._ScrV_Props_._lastTouchTime) this._ScrV_Props_._lastTouchTime = f;
  3393. else {
  3394. var b = this._getPointChange(a),
  3395. f = f - this._ScrV_Props_._lastTouchTime;
  3396. b.x /= f;
  3397. b.y /= f;
  3398. this._ScrV_Props_._velocitys.push(b);
  3399. 5 < this._ScrV_Props_._velocitys.length && this._ScrV_Props_._velocitys.shift();
  3400. this._ScrV_Props_._lastTouchPosition.x = a.stageX;
  3401. this._ScrV_Props_._lastTouchPosition.y = a.stageY
  3402. }
  3403. };
  3404. b._getContentWidth = function() {
  3405. return this._content.explicitWidth || this._content.width
  3406. };
  3407. b._getContentHeight = function() {
  3408. return this._content.explicitHeight || this._content.height
  3409. };
  3410. b.getMaxScrollLeft = function() {
  3411. var a = this._getContentWidth() - this.width;
  3412. return Math.max(0, a)
  3413. };
  3414. b.getMaxScrollTop = function() {
  3415. var a = this._getContentHeight() - this.height;
  3416. return Math.max(0, a)
  3417. };
  3418. b._moveAfterTouchEnd = function() {
  3419. if (0 != this._ScrV_Props_._velocitys.length) {
  3420. for (var a = 0,
  3421. f = 0,
  3422. b = 0,
  3423. c = 0; c < this._ScrV_Props_._velocitys.length; c++) var e = this._ScrV_Props_._velocitys[c],
  3424. g = d.weight[c],
  3425. a = a + e.x * g,
  3426. f = f + e.y * g,
  3427. b = b + g;
  3428. this._ScrV_Props_._velocitys.length = 0;
  3429. 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
  3430. a = a / b * this.scrollSpeed;
  3431. f = f / b * this.scrollSpeed;
  3432. e = Math.abs(a);
  3433. b = Math.abs(f);
  3434. g = this.getMaxScrollLeft();
  3435. c = this.getMaxScrollTop();
  3436. a = 0.02 < e ? this.getAnimationDatas(a, this._ScrV_Props_._scrollLeft, g) : {
  3437. position: this._ScrV_Props_._scrollLeft,
  3438. duration: 1
  3439. };
  3440. f = 0.02 < b ? this.getAnimationDatas(f, this._ScrV_Props_._scrollTop, c) : {
  3441. position: this._ScrV_Props_._scrollTop,
  3442. duration: 1
  3443. };
  3444. this.setScrollLeft(a.position, a.duration);
  3445. this.setScrollTop(f.position, f.duration)
  3446. }
  3447. };
  3448. b._onTweenFinished = function(a) {
  3449. a == this._ScrV_Props_._vScrollTween && (this._ScrV_Props_._isVTweenPlaying = !1);
  3450. a == this._ScrV_Props_._hScrollTween && (this._ScrV_Props_._isHTweenPlaying = !1); ! 1 == this._ScrV_Props_._isHTweenPlaying && !1 == this._ScrV_Props_._isVTweenPlaying && this._onScrollFinished()
  3451. };
  3452. b._onScrollStarted = function() {};
  3453. b._onScrollFinished = function() {
  3454. c.Tween.removeTweens(this);
  3455. this._ScrV_Props_._hScrollTween = null;
  3456. this._ScrV_Props_._vScrollTween = null;
  3457. this._ScrV_Props_._isHTweenPlaying = !1;
  3458. this._ScrV_Props_._isVTweenPlaying = !1;
  3459. this.dispatchEvent(new c.Event(c.Event.COMPLETE))
  3460. };
  3461. b.setScrollTop = function(a, f) {
  3462. void 0 === f && (f = 0);
  3463. var b = Math.min(this.getMaxScrollTop(), Math.max(a, 0));
  3464. if (0 == f) return this.scrollTop = b,
  3465. null;
  3466. var d = c.Tween.get(this).to({
  3467. scrollTop: a
  3468. },
  3469. f, c.Ease.quartOut);
  3470. b != a && d.to({
  3471. scrollTop: b
  3472. },
  3473. 300, c.Ease.quintOut);
  3474. this._ScrV_Props_._isVTweenPlaying = !0;
  3475. this._ScrV_Props_._vScrollTween = d;
  3476. d.call(this._onTweenFinished, this, [d]);
  3477. this._ScrV_Props_._isHTweenPlaying || this._onScrollStarted();
  3478. return d
  3479. };
  3480. b.setScrollLeft = function(a, f) {
  3481. void 0 === f && (f = 0);
  3482. var b = Math.min(this.getMaxScrollLeft(), Math.max(a, 0));
  3483. if (0 == f) return this.scrollLeft = b,
  3484. null;
  3485. var d = c.Tween.get(this).to({
  3486. scrollLeft: a
  3487. },
  3488. f, c.Ease.quartOut);
  3489. b != a && d.to({
  3490. scrollLeft: b
  3491. },
  3492. 300, c.Ease.quintOut);
  3493. this._ScrV_Props_._isHTweenPlaying = !0;
  3494. this._ScrV_Props_._hScrollTween = d;
  3495. d.call(this._onTweenFinished, this, [d]);
  3496. this._ScrV_Props_._isVTweenPlaying || this._onScrollStarted();
  3497. return d
  3498. };
  3499. b.getAnimationDatas = function(a, f, b) {
  3500. var c = Math.abs(a),
  3501. d = 0,
  3502. e = f + 500 * a;
  3503. if (0 > e || e > b) for (e = f; Infinity != Math.abs(a) && 0.02 < Math.abs(a);) e += a,
  3504. a = 0 > e || e > b ? 0.998 * a * 0.95 : 0.998 * a,
  3505. d++;
  3506. else d = 500 * -Math.log(0.02 / c);
  3507. return {
  3508. position: Math.min(b + 50, Math.max(e, -50)),
  3509. duration: d
  3510. }
  3511. };
  3512. b.cloneTouchEvent = function(a) {
  3513. var f = new c.TouchEvent(a._type, a._bubbles, a.cancelable);
  3514. f.touchPointID = a.touchPointID;
  3515. f._stageX = a._stageX;
  3516. f._stageY = a._stageY;
  3517. f.ctrlKey = a.ctrlKey;
  3518. f.altKey = a.altKey;
  3519. f.shiftKey = a.shiftKey;
  3520. f.touchDown = a.touchDown;
  3521. f._isDefaultPrevented = !1;
  3522. f._target = a._target;
  3523. return f
  3524. };
  3525. b.throwNotSupportedError = function() {
  3526. throw Error(c.getString(1023));
  3527. };
  3528. b.addChild = function(a) {
  3529. this.throwNotSupportedError();
  3530. return null
  3531. };
  3532. b.addChildAt = function(a, f) {
  3533. this.throwNotSupportedError();
  3534. return null
  3535. };
  3536. b.removeChild = function(a) {
  3537. this.throwNotSupportedError();
  3538. return null
  3539. };
  3540. b.removeChildAt = function(a) {
  3541. this.throwNotSupportedError();
  3542. return null
  3543. };
  3544. b.setChildIndex = function(a, f) {
  3545. this.throwNotSupportedError()
  3546. };
  3547. b.swapChildren = function(a, f) {
  3548. this.throwNotSupportedError()
  3549. };
  3550. b.swapChildrenAt = function(a, f) {
  3551. this.throwNotSupportedError()
  3552. };
  3553. b.hitTest = function(a, f, b) {
  3554. void 0 === b && (b = !1);
  3555. var d = e.prototype.hitTest.call(this, a, f, b);
  3556. return d ? d: c.DisplayObject.prototype.hitTest.call(this, a, f, b)
  3557. };
  3558. d.weight = [1, 1.33, 1.66, 2, 2.33];
  3559. return d
  3560. } (c.DisplayObjectContainer);
  3561. c.ScrollView = g;
  3562. g.prototype.__class__ = "egret.ScrollView"
  3563. })(egret || (egret = {})); (function(c) {
  3564. var g = function() {
  3565. function c() {}
  3566. c.REPEAT = "repeat";
  3567. c.SCALE = "scale";
  3568. return c
  3569. } ();
  3570. c.BitmapFillMode = g;
  3571. g.prototype.__class__ = "egret.BitmapFillMode"
  3572. })(egret || (egret = {})); (function(c) {
  3573. var g = function(e) {
  3574. function d(a) {
  3575. e.call(this);
  3576. this.scale9Grid = this._texture = null;
  3577. this.fillMode = "scale";
  3578. a && (this._texture = a, this._setSizeDirty());
  3579. this.needDraw = !0
  3580. }
  3581. __extends(d, e);
  3582. var b = d.prototype;
  3583. Object.defineProperty(b, "texture", {
  3584. get: function() {
  3585. return this._texture
  3586. },
  3587. set: function(a) {
  3588. a != this._texture && (this._setSizeDirty(), this._texture = a)
  3589. },
  3590. enumerable: !0,
  3591. configurable: !0
  3592. });
  3593. b._render = function(a) {
  3594. var f = this._texture;
  3595. f ? (this._texture_to_render = f, d._drawBitmap(a, this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: f._textureWidth, this._DO_Props_._hasHeightSet ? this._DO_Props_._explicitHeight: f._textureHeight, this)) : this._texture_to_render = null
  3596. };
  3597. d._drawBitmap = function(a, f, b, c) {
  3598. var e = c._texture_to_render;
  3599. if (e) {
  3600. var g = e._textureWidth,
  3601. h = e._textureHeight;
  3602. if ("scale" == c.fillMode) {
  3603. var k = c.scale9Grid || e.scale9Grid;
  3604. if (k && g - k.width < f && h - k.height < b) d.drawScale9GridImage(a, c, k, f, b);
  3605. else {
  3606. var k = e._offsetX,
  3607. l = e._offsetY,
  3608. m = e._bitmapWidth || g,
  3609. p = e._bitmapHeight || h;
  3610. f /= g;
  3611. k = Math.round(k * f);
  3612. f = Math.round(m * f);
  3613. b /= h;
  3614. l = Math.round(l * b);
  3615. b = Math.round(p * b);
  3616. d.renderFilter.drawImage(a, c, e._bitmapX, e._bitmapY, m, p, k, l, f, b)
  3617. }
  3618. } else d.drawRepeatImage(a, c, f, b, c.fillMode)
  3619. }
  3620. };
  3621. d.drawRepeatImage = function(a, f, b, d, e) {
  3622. var g = f._texture_to_render;
  3623. if (g) {
  3624. var h = g._textureWidth,
  3625. k = g._textureHeight,
  3626. l = g._bitmapX,
  3627. m = g._bitmapY,
  3628. h = g._bitmapWidth || h,
  3629. k = g._bitmapHeight || k,
  3630. p = g._offsetX,
  3631. g = g._offsetY;
  3632. c.RenderFilter.getInstance().drawImage(a, f, l, m, h, k, p, g, b, d, e)
  3633. }
  3634. };
  3635. d.drawScale9GridImage = function(a, f, b, d, e) {
  3636. var g = c.MainContext.instance.rendererContext._texture_scale_factor,
  3637. h = f._texture_to_render;
  3638. if (h && b) {
  3639. var k = h._textureWidth,
  3640. l = h._textureHeight,
  3641. m = h._bitmapX,
  3642. p = h._bitmapY,
  3643. r = h._bitmapWidth || k,
  3644. q = h._bitmapHeight || l;
  3645. d -= k - r;
  3646. e -= l - q;
  3647. if (!a.drawImageScale9(h, m, p, r, q, h._offsetX, h._offsetY, d, e, b)) {
  3648. k = h._offsetX / g;
  3649. l = h._offsetY / g;
  3650. h = c.RenderFilter.getInstance();
  3651. b = c.Rectangle.identity.initialize(b.x - Math.round(k), b.y - Math.round(k), b.width, b.height);
  3652. k = Math.round(k);
  3653. l = Math.round(l);
  3654. b.y == b.bottom && (b.bottom < q ? b.bottom++:b.y--);
  3655. b.x == b.right && (b.right < r ? b.right++:b.x--);
  3656. var x = m + b.x / g,
  3657. z = m + b.right / g,
  3658. u = r - b.right,
  3659. y = p + b.y / g,
  3660. g = p + b.bottom / g,
  3661. w = q - b.bottom,
  3662. B = k + b.x,
  3663. A = l + b.y,
  3664. q = e - (q - b.bottom),
  3665. r = d - (r - b.right);
  3666. h.drawImage(a, f, m, p, b.x, b.y, k, l, b.x, b.y);
  3667. h.drawImage(a, f, x, p, b.width, b.y, B, l, r - b.x, b.y);
  3668. h.drawImage(a, f, z, p, u, b.y, k + r, l, d - r, b.y);
  3669. h.drawImage(a, f, m, y, b.x, b.height, k, A, b.x, q - b.y);
  3670. h.drawImage(a, f, x, y, b.width, b.height, B, A, r - b.x, q - b.y);
  3671. h.drawImage(a, f, z, y, u, b.height, k + r, A, d - r, q - b.y);
  3672. h.drawImage(a, f, m, g, b.x, w, k, l + q, b.x, e - q);
  3673. h.drawImage(a, f, x, g, b.width, w, B, l + q, r - b.x, e - q);
  3674. h.drawImage(a, f, z, g, u, w, k + r, l + q, d - r, e - q)
  3675. }
  3676. }
  3677. };
  3678. b._measureBounds = function() {
  3679. var a = this._texture;
  3680. return a ? c.Rectangle.identity.initialize(0, 0, a._textureWidth, a._textureHeight) : e.prototype._measureBounds.call(this)
  3681. };
  3682. d.renderFilter = c.RenderFilter.getInstance();
  3683. return d
  3684. } (c.DisplayObject);
  3685. c.Bitmap = g;
  3686. g.prototype.__class__ = "egret.Bitmap"
  3687. })(egret || (egret = {})); (function(c) {
  3688. var g = function(e) {
  3689. function d() {
  3690. e.call(this);
  3691. this._text = "";
  3692. this._textChanged = !1;
  3693. this._font = null;
  3694. this._fontChanged = !1;
  3695. this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = this._lineSpacing = this._letterSpacing = 0;
  3696. this.textLinesChange = !0;
  3697. this._lineHeights = [];
  3698. this.needDraw = this.cacheAsBitmap = !0
  3699. }
  3700. __extends(d, e);
  3701. var b = d.prototype;
  3702. Object.defineProperty(b, "text", {
  3703. get: function() {
  3704. return this._text
  3705. },
  3706. set: function(a) {
  3707. this._text != a && (this._textChanged = !0, this._text = a, this._setSizeDirty())
  3708. },
  3709. enumerable: !0,
  3710. configurable: !0
  3711. });
  3712. Object.defineProperty(b, "font", {
  3713. get: function() {
  3714. return this._font
  3715. },
  3716. set: function(a) {
  3717. this._font != a && (this._font = a, this._fontChanged = !0, this._setSizeDirty())
  3718. },
  3719. enumerable: !0,
  3720. configurable: !0
  3721. });
  3722. Object.defineProperty(b, "letterSpacing", {
  3723. get: function() {
  3724. return this._letterSpacing
  3725. },
  3726. set: function(a) {
  3727. this._setLetterSpacing(a)
  3728. },
  3729. enumerable: !0,
  3730. configurable: !0
  3731. });
  3732. b._setLetterSpacing = function(a) {
  3733. this._letterSpacing = a;
  3734. this._setSizeDirty()
  3735. };
  3736. Object.defineProperty(b, "lineSpacing", {
  3737. get: function() {
  3738. return this._lineSpacing
  3739. },
  3740. set: function(a) {
  3741. this._setLineSpacing(a)
  3742. },
  3743. enumerable: !0,
  3744. configurable: !0
  3745. });
  3746. b._setLineSpacing = function(a) {
  3747. this._lineSpacing = a
  3748. };
  3749. b._setSizeDirty = function() {
  3750. e.prototype._setSizeDirty.call(this);
  3751. this.textLinesChange = !0
  3752. };
  3753. b._render = function(a) {
  3754. var f = this._getTextLines(),
  3755. b = f.length;
  3756. if (0 != b) {
  3757. for (var e = this._font,
  3758. g = e._getFirstCharHeight(), g = Math.ceil(g * d.EMPTY_FACTOR), n = 0, h = this._DO_Props_._hasHeightSet ? this._DO_Props_._explicitHeight: Number.POSITIVE_INFINITY, k = this._lineHeights, l = 0; l < b; l++) {
  3759. var m = k[l];
  3760. if (0 < l && n + m > h) break;
  3761. for (var p = f[l], r = p.length, q = 0, x = 0; x < r; x++) {
  3762. var z = p.charAt(x),
  3763. u = e.getTexture(z);
  3764. if (u) {
  3765. var z = u._bitmapWidth || u._textureWidth,
  3766. y = u._bitmapHeight || u._textureHeight;
  3767. this._texture_to_render = u;
  3768. c.RenderFilter.getInstance().drawImage(a, this, u._bitmapX, u._bitmapY, z, y, q + u._offsetX, n + u._offsetY, z, y);
  3769. q += u._textureWidth + this._letterSpacing
  3770. } else " " == z ? q += g: c.Logger.warningWithErrorId(1011, z)
  3771. }
  3772. n += m + this._lineSpacing
  3773. }
  3774. this._texture_to_render = null
  3775. }
  3776. };
  3777. b._measureBounds = function() {
  3778. var a = this._getTextLines();
  3779. return 0 == a.length ? c.Rectangle.identity.initialize(0, 0, 0, 0) : c.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY + (a.length - 1) * this._lineSpacing)
  3780. };
  3781. b._getTextLines = function() {
  3782. if (!this.textLinesChange) return this._textLines;
  3783. var a = [];
  3784. this._textLines = a;
  3785. this.textLinesChange = !1;
  3786. var f = [];
  3787. this._lineHeights = f;
  3788. if (!this._text || !this._font) return a;
  3789. for (var b = 0,
  3790. e = 0,
  3791. g = 0,
  3792. n = 0,
  3793. h = this._DO_Props_._hasWidthSet,
  3794. k = this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: Number.POSITIVE_INFINITY, l = this._font, m = l._getFirstCharHeight(), p = Math.ceil(m * d.EMPTY_FACTOR), r = this._text.split(/(?:\r\n|\r|\n)/), q = r.length, x = !0, z = 0; z < q; z++) {
  3795. for (var u = r[z], y = u.length, w = 0, B = 0, A = !0, C = 0; C < y; C++) {
  3796. A || (B += this._letterSpacing);
  3797. var D = u.charAt(C),
  3798. F,
  3799. G = 0,
  3800. H = 0,
  3801. E = l.getTexture(D);
  3802. if (E) D = E._textureWidth,
  3803. F = E._textureHeight,
  3804. G = E._offsetX,
  3805. H = E._offsetY;
  3806. else if (" " == D) D = p,
  3807. F = m;
  3808. else {
  3809. c.Logger.warningWithErrorId(1011, D);
  3810. A && (A = !1);
  3811. continue
  3812. }
  3813. A && (A = !1, g = Math.min(G, g));
  3814. x && (n = Math.min(H, n));
  3815. h && 0 < C && B + D > k ? (a.push(u.substring(0, C)), f.push(w), e += w, b = Math.max(B, b), u = u.substring(C), y = u.length, C = 0, B = D, w = F) : (B += D, w = Math.max(F, w))
  3816. }
  3817. x && (x = !1);
  3818. a.push(u);
  3819. f.push(w);
  3820. e += w;
  3821. b = Math.max(B, b)
  3822. }
  3823. this._textWidth = b;
  3824. this._textHeight = e;
  3825. this._textOffsetX = g;
  3826. this._textOffsetY = n;
  3827. return a
  3828. };
  3829. d.EMPTY_FACTOR = 0.33;
  3830. return d
  3831. } (c.DisplayObject);
  3832. c.BitmapText = g;
  3833. g.prototype.__class__ = "egret.BitmapText"
  3834. })(egret || (egret = {})); (function(c) {
  3835. var g = function() {
  3836. function d() {
  3837. this.fillStyleColor = this.strokeStyleColor = this.commandQueue = this._renderContext = null;
  3838. this._dirty = !1;
  3839. this.lineY = this.lineX = 0;
  3840. this._firstCheck = !0;
  3841. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3842. this.commandQueue = []
  3843. }
  3844. var b = d.prototype;
  3845. b.beginFill = function(a, f) {
  3846. void 0 === f && (f = 1);
  3847. this.fillStyleColor = this._parseColor(a, f);
  3848. this._pushCommand(new e(this._setStyle, this, [this.fillStyleColor]))
  3849. };
  3850. b._parseColor = function(a, f) {
  3851. return "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + f + ")"
  3852. };
  3853. b._setStyle = function(a) {
  3854. this._renderContext.fillStyle = a;
  3855. this._renderContext.beginPath()
  3856. };
  3857. b.drawRect = function(a, f, b, c) {
  3858. this._pushCommand(new e(function(a, f, b, c) {
  3859. this._renderContext.beginPath();
  3860. this._renderContext.rect(a, f, b, c);
  3861. this._renderContext.closePath()
  3862. },
  3863. this, [a, f, b, c]));
  3864. this._checkRect(a, f, b, c)
  3865. };
  3866. b.drawCircle = function(a, f, b) {
  3867. this._pushCommand(new e(function(a, f, b) {
  3868. this._renderContext.beginPath();
  3869. this._renderContext.arc(a, f, b, 0, 2 * Math.PI);
  3870. this._renderContext.closePath()
  3871. },
  3872. this, [a, f, b]));
  3873. this._checkRect(a - b, f - b, 2 * b, 2 * b)
  3874. };
  3875. b.drawRoundRect = function(a, f, b, c, d, g) {
  3876. this._pushCommand(new e(function(a, f, b, c, d, v) {
  3877. d /= 2;
  3878. v = v ? v / 2 : d;
  3879. b = a + b;
  3880. c = f + c;
  3881. var e = c - v;
  3882. this._renderContext.beginPath();
  3883. this._renderContext.moveTo(b, e);
  3884. this._renderContext.quadraticCurveTo(b, c, b - d, c);
  3885. this._renderContext.lineTo(a + d, c);
  3886. this._renderContext.quadraticCurveTo(a, c, a, c - v);
  3887. this._renderContext.lineTo(a, f + v);
  3888. this._renderContext.quadraticCurveTo(a, f, a + d, f);
  3889. this._renderContext.lineTo(b - d, f);
  3890. this._renderContext.quadraticCurveTo(b, f, b, f + v);
  3891. this._renderContext.lineTo(b, e);
  3892. this._renderContext.closePath()
  3893. },
  3894. this, [a, f, b, c, d, g]));
  3895. this._checkRect(a, f, b, c)
  3896. };
  3897. b.drawEllipse = function(a, f, b, c) {
  3898. this._pushCommand(new e(function(a, f, b, c) {
  3899. a += b / 2;
  3900. f += c / 2;
  3901. var d = b > c ? b: c;
  3902. b /= d;
  3903. c /= d;
  3904. d /= 2;
  3905. this._renderContext.scale(b, c);
  3906. this._renderContext.beginPath();
  3907. this._renderContext.arc(a / b, f / c, d, 0, 2 * Math.PI);
  3908. this._renderContext.closePath();
  3909. this._renderContext.scale(1 / b, 1 / c)
  3910. },
  3911. this, [a, f, b, c]));
  3912. this._checkRect(a, f, b, c)
  3913. };
  3914. b.lineStyle = function(a, f, b, c, d, g, h, k) {
  3915. void 0 === a && (a = NaN);
  3916. void 0 === f && (f = 0);
  3917. void 0 === b && (b = 1);
  3918. void 0 === c && (c = !1);
  3919. void 0 === d && (d = "normal");
  3920. void 0 === g && (g = null);
  3921. void 0 === h && (h = null);
  3922. void 0 === k && (k = 3);
  3923. this.strokeStyleColor && (this._createEndLineCommand(), this._pushCommand(this._endLineCommand));
  3924. this.strokeStyleColor = this._parseColor(f, b);
  3925. this._pushCommand(new e(function(a, f) {
  3926. this._renderContext.lineWidth = a;
  3927. this._renderContext.strokeStyle = f;
  3928. this._renderContext.beginPath()
  3929. },
  3930. this, [a, this.strokeStyleColor]));
  3931. this.moveTo(this.lineX, this.lineY)
  3932. };
  3933. b.lineTo = function(a, f) {
  3934. this._pushCommand(new e(function(a, f) {
  3935. this._renderContext.lineTo(a, f)
  3936. },
  3937. this, [a, f]));
  3938. this._checkPoint(this.lineX, this.lineY);
  3939. this.lineX = a;
  3940. this.lineY = f;
  3941. this._checkPoint(a, f)
  3942. };
  3943. b.curveTo = function(a, f, b, c) {
  3944. this._pushCommand(new e(function(a, f, b, c) {
  3945. this._renderContext.quadraticCurveTo(a, f, b, c)
  3946. },
  3947. this, [a, f, b, c]));
  3948. this._checkPoint(this.lineX, this.lineY);
  3949. this.lineX = b;
  3950. this.lineY = c;
  3951. this._checkPoint(a, f);
  3952. this._checkPoint(b, c)
  3953. };
  3954. b.cubicCurveTo = function(a, f, b, c, d, g) {
  3955. this._pushCommand(new e(function(a, f, b, c, d, v) {
  3956. this._renderContext.bezierCurveTo(a, f, b, c, d, v)
  3957. },
  3958. this, [a, f, b, c, d, g]));
  3959. this._checkPoint(this.lineX, this.lineY);
  3960. this.lineX = d;
  3961. this.lineY = g;
  3962. this._checkPoint(a, f);
  3963. this._checkPoint(b, c);
  3964. this._checkPoint(d, g)
  3965. };
  3966. b.moveTo = function(a, f) {
  3967. this._pushCommand(new e(function(a, f) {
  3968. this._renderContext.moveTo(a, f)
  3969. },
  3970. this, [a, f]));
  3971. this.lineX = a;
  3972. this.lineY = f
  3973. };
  3974. b.clear = function() {
  3975. this.lineY = this.lineX = this.commandQueue.length = 0;
  3976. this.fillStyleColor = this.strokeStyleColor = null;
  3977. this._maxY = this._maxX = this._minY = this._minX = 0;
  3978. this._dirty = this._firstCheck = !0
  3979. };
  3980. b.endFill = function() {
  3981. null != this.fillStyleColor && (this._fill(), this.fillStyleColor = null)
  3982. };
  3983. b._beginDraw = function(a) {};
  3984. b._endDraw = function(a) {};
  3985. b._draw = function(a) {
  3986. var f = this.commandQueue.length;
  3987. if (0 != f) {
  3988. this._beginDraw(a);
  3989. for (var b = 0; b < f; b++) {
  3990. var c = this.commandQueue[b];
  3991. c.method.apply(c.thisObject, c.args)
  3992. }
  3993. this.fillStyleColor && (this._createEndFillCommand(), c = this._endFillCommand, c.method.apply(c.thisObject, c.args));
  3994. this.strokeStyleColor && (this._createEndLineCommand(), c = this._endLineCommand, c.method.apply(c.thisObject, c.args));
  3995. this._endDraw(a);
  3996. this._dirty = !1
  3997. }
  3998. };
  3999. b._checkRect = function(a, f, b, c) {
  4000. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = f, this._maxX = a + b, this._maxY = f + c) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, f), this._maxX = Math.max(this._maxX, a + b), this._maxY = Math.max(this._maxY, f + c));
  4001. this._dirty = !0
  4002. };
  4003. b._checkPoint = function(a, f) {
  4004. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = f, this._maxX = a, this._maxY = f) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, f), this._maxX = Math.max(this._maxX, a), this._maxY = Math.max(this._maxY, f));
  4005. this._lastX = a;
  4006. this._lastY = f;
  4007. this._dirty = !0
  4008. };
  4009. b._measureBounds = function() {
  4010. return c.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
  4011. };
  4012. b._createEndFillCommand = function() {
  4013. this._endFillCommand || (this._endFillCommand = new e(function() {
  4014. this._renderContext.fill();
  4015. this._renderContext.closePath()
  4016. },
  4017. this, null))
  4018. };
  4019. b._fill = function() {
  4020. this.fillStyleColor && (this._createEndFillCommand(), this._pushCommand(this._endFillCommand));
  4021. this.strokeStyleColor && (this._createEndLineCommand(), this._pushCommand(this._endLineCommand))
  4022. };
  4023. b._createEndLineCommand = function() {
  4024. this._endLineCommand || (this._endLineCommand = new e(function() {
  4025. this._renderContext.stroke();
  4026. this._renderContext.closePath()
  4027. },
  4028. this, null))
  4029. };
  4030. b._pushCommand = function(a) {
  4031. this.commandQueue.push(a);
  4032. this._dirty = !0
  4033. };
  4034. return d
  4035. } ();
  4036. c.Graphics = g;
  4037. g.prototype.__class__ = "egret.Graphics";
  4038. var e = function() {
  4039. return function(c, b, a) {
  4040. this.method = c;
  4041. this.thisObject = b;
  4042. this.args = a
  4043. }
  4044. } ();
  4045. e.prototype.__class__ = "egret.Command"
  4046. })(egret || (egret = {})); (function(c) {
  4047. var g = function(e) {
  4048. function d() {
  4049. e.call(this);
  4050. this._graphics = null
  4051. }
  4052. __extends(d, e);
  4053. var b = d.prototype;
  4054. Object.defineProperty(b, "graphics", {
  4055. get: function() {
  4056. this._graphics || (this._graphics = new c.Graphics, this.needDraw = !0);
  4057. return this._graphics
  4058. },
  4059. enumerable: !0,
  4060. configurable: !0
  4061. });
  4062. b._draw = function(a) {
  4063. this._graphics && this._graphics._dirty && this._setCacheDirty();
  4064. e.prototype._draw.call(this, a)
  4065. };
  4066. b._render = function(a) {
  4067. this._graphics && this._graphics._draw(a)
  4068. };
  4069. b._measureBounds = function() {
  4070. var a = this._graphics;
  4071. return a ? a._measureBounds() : e.prototype._measureBounds.call(this)
  4072. };
  4073. return d
  4074. } (c.DisplayObject);
  4075. c.Shape = g;
  4076. g.prototype.__class__ = "egret.Shape"
  4077. })(egret || (egret = {})); (function(c) {
  4078. var g = function(e) {
  4079. function d() {
  4080. e.call(this);
  4081. this._graphics = null
  4082. }
  4083. __extends(d, e);
  4084. var b = d.prototype;
  4085. Object.defineProperty(b, "graphics", {
  4086. get: function() {
  4087. this._graphics || (this._graphics = new c.Graphics, this.needDraw = !0);
  4088. return this._graphics
  4089. },
  4090. enumerable: !0,
  4091. configurable: !0
  4092. });
  4093. b._draw = function(a) {
  4094. this._graphics && this._graphics._dirty && this._setCacheDirty();
  4095. e.prototype._draw.call(this, a)
  4096. };
  4097. b._render = function(a) {
  4098. this._graphics && this._graphics._draw(a);
  4099. e.prototype._render.call(this, a)
  4100. };
  4101. b._measureBounds = function() {
  4102. for (var a = 0,
  4103. f = 0,
  4104. b = 0,
  4105. d = 0,
  4106. e = this._children.length,
  4107. g = 0; g < e; g++) {
  4108. var h = this._children[g];
  4109. if (h.visible) {
  4110. var k = h.getBounds(c.Rectangle.identity, !1),
  4111. l = k.x,
  4112. m = k.y,
  4113. p = k.width,
  4114. k = k.height,
  4115. h = h._getMatrix(),
  4116. h = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(l, m, p, k), h),
  4117. l = h.x,
  4118. m = h.y,
  4119. p = h.width + h.x,
  4120. h = h.height + h.y;
  4121. if (l < a || 0 == g) a = l;
  4122. if (p > f || 0 == g) f = p;
  4123. if (m < b || 0 == g) b = m;
  4124. if (h > d || 0 == g) d = h
  4125. }
  4126. }
  4127. if (this._graphics) {
  4128. e = this._graphics._measureBounds();
  4129. l = e.x;
  4130. m = e.y;
  4131. p = e.width + e.x;
  4132. h = e.height + e.y;
  4133. if (l < a || 0 == g) a = l;
  4134. if (p > f || 0 == g) f = p;
  4135. if (m < b || 0 == g) b = m;
  4136. if (h > d || 0 == g) d = h
  4137. }
  4138. return c.Rectangle.identity.initialize(a, b, f - a, d - b)
  4139. };
  4140. b.hitTest = function(a, f, b) {
  4141. void 0 === b && (b = !1);
  4142. var d = e.prototype.hitTest.call(this, a, f, b);
  4143. return d ? d: this._graphics ? c.DisplayObject.prototype.hitTest.call(this, a, f, b) : null
  4144. };
  4145. return d
  4146. } (c.DisplayObjectContainer);
  4147. c.Sprite = g;
  4148. g.prototype.__class__ = "egret.Sprite"
  4149. })(egret || (egret = {})); (function(c) {
  4150. var g = function() {
  4151. function e() {}
  4152. e._getStartLine = function(c) {
  4153. var b = e._getTextHeight(c),
  4154. a = 0;
  4155. c._DO_Props_._hasHeightSet && (!(b < c._DO_Props_._explicitHeight) && b > c._DO_Props_._explicitHeight && (a = Math.max(c._TF_Props_._scrollV - 1, 0), a = Math.min(c._TF_Props_._numLines - 1, a)), c._TF_Props_._multiline || (a = Math.max(c._TF_Props_._scrollV - 1, 0), a = Math.min(c._TF_Props_._numLines - 1, a)));
  4156. return a
  4157. };
  4158. e._getHalign = function(d) {
  4159. var b = d._getLinesArr(),
  4160. a = 0;
  4161. d._TF_Props_._textAlign == c.HorizontalAlign.CENTER ? a = 0.5 : d._TF_Props_._textAlign == c.HorizontalAlign.RIGHT && (a = 1);
  4162. d._TF_Props_._type == c.TextFieldType.INPUT && !d._TF_Props_._multiline && 1 < b.length && (a = 0);
  4163. return a
  4164. };
  4165. e._getTextHeight = function(d) {
  4166. return c.TextFieldType.INPUT != d._TF_Props_._type || d._TF_Props_._multiline ? d._TF_Props_._textMaxHeight + (d._TF_Props_._numLines - 1) * d._TF_Props_._lineSpacing: d._TF_Props_._size
  4167. };
  4168. e._getValign = function(d) {
  4169. var b = e._getTextHeight(d);
  4170. return d._TF_Props_._type == c.TextFieldType.INPUT ? d._TF_Props_._multiline ? 0 : 0.5 : d._DO_Props_._hasHeightSet && b < d._DO_Props_._explicitHeight ? (b = 0, d._TF_Props_._verticalAlign == c.VerticalAlign.MIDDLE ? b = 0.5 : d._TF_Props_._verticalAlign == c.VerticalAlign.BOTTOM && (b = 1), b) : 0
  4171. };
  4172. e._getTextElement = function(c, b, a) {
  4173. b = e._getHit(c, b, a);
  4174. c = c._getLinesArr();
  4175. return b && c[b.lineIndex] && c[b.lineIndex].elements[b.textElementIndex] ? c[b.lineIndex].elements[b.textElementIndex] : null
  4176. };
  4177. e._getHit = function(c, b, a) {
  4178. var f = c._getLinesArr();
  4179. if (0 == c._TF_Props_._textMaxWidth) return null;
  4180. var v = 0,
  4181. t = e._getTextHeight(c),
  4182. g = 0;
  4183. c._DO_Props_._hasHeightSet && c._DO_Props_._explicitHeight > t && (g = e._getValign(c) * (c._DO_Props_._explicitHeight - t), 0 != g && (a -= g));
  4184. g = 0;
  4185. for (t = e._getStartLine(c); t < f.length; t++) {
  4186. var n = f[t];
  4187. if (g + n.height >= a) {
  4188. v = t + 1;
  4189. break
  4190. } else g += n.height;
  4191. if (g + c._TF_Props_._lineSpacing > a) return null;
  4192. g += c._TF_Props_._lineSpacing
  4193. }
  4194. if (0 === v) return null;
  4195. c = f[v - 1];
  4196. for (t = a = 0; t < c.elements.length; t++) if (f = c.elements[t], a + f.width < b) a += f.width;
  4197. else return {
  4198. lineIndex: v - 1,
  4199. textElementIndex: t
  4200. };
  4201. return null
  4202. };
  4203. e._getScrollNum = function(c) {
  4204. var b = 1;
  4205. if (c._TF_Props_._multiline) {
  4206. var a = c.height,
  4207. f = c.size;
  4208. c = c.lineSpacing;
  4209. b = Math.floor(a / (f + c));
  4210. a - (f + c) * b > f / 2 && b++
  4211. }
  4212. return b
  4213. };
  4214. return e
  4215. } ();
  4216. c.TextFieldUtils = g;
  4217. g.prototype.__class__ = "egret.TextFieldUtils"
  4218. })(egret || (egret = {})); (function(c) {
  4219. var g = function() {
  4220. return function() {
  4221. this._text = this._type = "";
  4222. this._displayAsPassword = !1;
  4223. this._fontFamily = c.TextField.default_fontFamily;
  4224. this._size = 30;
  4225. this._bold = this._italic = !1;
  4226. this._textColorString = "#FFFFFF";
  4227. this._textColor = 16777215;
  4228. this._strokeColorString = "#000000";
  4229. this._stroke = this._strokeColor = 0;
  4230. this._border = !1;
  4231. this._borderColor = 0;
  4232. this._background = !1;
  4233. this._backgroundColor = 16777215;
  4234. this._textAlign = "left";
  4235. this._verticalAlign = "top";
  4236. this._maxChars = this._textMaxHeight = this._textMaxWidth = 0;
  4237. this._scrollV = -1;
  4238. this._numLines = this._lineSpacing = 0;
  4239. this._multiline = !1
  4240. }
  4241. } ();
  4242. c.TextFieldProperties = g;
  4243. g.prototype.__class__ = "egret.TextFieldProperties"
  4244. })(egret || (egret = {})); (function(c) {
  4245. var g = function(e) {
  4246. function d() {
  4247. e.call(this);
  4248. this._inputEnabled = !1;
  4249. this._bgGraphics = this._inputUtils = null;
  4250. this._isFlow = !1;
  4251. this._textArr = [];
  4252. this._isArrayChanged = !1;
  4253. this._linesArr = [];
  4254. this._isTyping = !1;
  4255. this.needDraw = !0;
  4256. this._TF_Props_ = new c.TextFieldProperties
  4257. }
  4258. __extends(d, e);
  4259. var b = d.prototype;
  4260. b.isInput = function() {
  4261. return this._TF_Props_._type == c.TextFieldType.INPUT
  4262. };
  4263. b._setTouchEnabled = function(a) {
  4264. e.prototype._setTouchEnabled.call(this, a);
  4265. this.isInput() && (this._inputEnabled = !0)
  4266. };
  4267. Object.defineProperty(b, "type", {
  4268. get: function() {
  4269. return this._TF_Props_._type
  4270. },
  4271. set: function(a) {
  4272. this._setType(a)
  4273. },
  4274. enumerable: !0,
  4275. configurable: !0
  4276. });
  4277. b._setType = function(a) {
  4278. var f = this._TF_Props_;
  4279. f._type != a && (f._type = a, f._type == c.TextFieldType.INPUT ? (this._DO_Props_._hasWidthSet || this._setWidth(100), this._DO_Props_._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._DO_Props_._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  4280. };
  4281. Object.defineProperty(b, "text", {
  4282. get: function() {
  4283. return this._getText()
  4284. },
  4285. set: function(a) {
  4286. this._setText(a)
  4287. },
  4288. enumerable: !0,
  4289. configurable: !0
  4290. });
  4291. b._getText = function() {
  4292. return this._TF_Props_._type == c.TextFieldType.INPUT ? this._inputUtils._getText() : this._TF_Props_._text
  4293. };
  4294. b._setSizeDirty = function() {
  4295. e.prototype._setSizeDirty.call(this);
  4296. this._isArrayChanged = !0
  4297. };
  4298. b._setTextDirty = function() {
  4299. this._setSizeDirty()
  4300. };
  4301. b._setBaseText = function(a) {
  4302. null == a && (a = "");
  4303. var f = this._TF_Props_;
  4304. this._isFlow = !1;
  4305. f._text != a && (this._setTextDirty(), f._text = a, a = "", a = f._displayAsPassword ? this.changeToPassText(f._text) : f._text, this.setMiddleStyle([{
  4306. text: a
  4307. }]))
  4308. };
  4309. b._setText = function(a) {
  4310. null == a && (a = "");
  4311. this._setBaseText(a);
  4312. this._inputUtils && this._inputUtils._setText(this._TF_Props_._text)
  4313. };
  4314. Object.defineProperty(b, "displayAsPassword", {
  4315. get: function() {
  4316. return this._TF_Props_._displayAsPassword
  4317. },
  4318. set: function(a) {
  4319. this._setDisplayAsPassword(a)
  4320. },
  4321. enumerable: !0,
  4322. configurable: !0
  4323. });
  4324. b._setDisplayAsPassword = function(a) {
  4325. var f = this._TF_Props_;
  4326. f._displayAsPassword != a && (f._displayAsPassword = a, this._setTextDirty(), a = "", a = f._displayAsPassword ? this.changeToPassText(f._text) : f._text, this.setMiddleStyle([{
  4327. text: a
  4328. }]))
  4329. };
  4330. Object.defineProperty(b, "fontFamily", {
  4331. get: function() {
  4332. return this._TF_Props_._fontFamily
  4333. },
  4334. set: function(a) {
  4335. this._setFontFamily(a)
  4336. },
  4337. enumerable: !0,
  4338. configurable: !0
  4339. });
  4340. b._setFontFamily = function(a) {
  4341. this._TF_Props_._fontFamily != a && (this._setTextDirty(), this._TF_Props_._fontFamily = a)
  4342. };
  4343. Object.defineProperty(b, "size", {
  4344. get: function() {
  4345. return this._TF_Props_._size
  4346. },
  4347. set: function(a) {
  4348. this._setSize(a)
  4349. },
  4350. enumerable: !0,
  4351. configurable: !0
  4352. });
  4353. b._setSize = function(a) {
  4354. this._TF_Props_._size != a && (this._setTextDirty(), this._TF_Props_._size = a)
  4355. };
  4356. Object.defineProperty(b, "italic", {
  4357. get: function() {
  4358. return this._TF_Props_._italic
  4359. },
  4360. set: function(a) {
  4361. this._setItalic(a)
  4362. },
  4363. enumerable: !0,
  4364. configurable: !0
  4365. });
  4366. b._setItalic = function(a) {
  4367. this._TF_Props_._italic != a && (this._setTextDirty(), this._TF_Props_._italic = a)
  4368. };
  4369. Object.defineProperty(b, "bold", {
  4370. get: function() {
  4371. return this._TF_Props_._bold
  4372. },
  4373. set: function(a) {
  4374. this._setBold(a)
  4375. },
  4376. enumerable: !0,
  4377. configurable: !0
  4378. });
  4379. b._setBold = function(a) {
  4380. this._TF_Props_._bold != a && (this._setTextDirty(), this._TF_Props_._bold = a)
  4381. };
  4382. Object.defineProperty(b, "textColor", {
  4383. get: function() {
  4384. return this._TF_Props_._textColor
  4385. },
  4386. set: function(a) {
  4387. this._setTextColor(a)
  4388. },
  4389. enumerable: !0,
  4390. configurable: !0
  4391. });
  4392. b._setTextColor = function(a) {
  4393. this._TF_Props_._textColor != a && (this._setTextDirty(), this._TF_Props_._textColor = a, this._TF_Props_._textColorString = c.toColorString(a))
  4394. };
  4395. Object.defineProperty(b, "strokeColor", {
  4396. get: function() {
  4397. return this._TF_Props_._strokeColor
  4398. },
  4399. set: function(a) {
  4400. this._setStrokeColor(a)
  4401. },
  4402. enumerable: !0,
  4403. configurable: !0
  4404. });
  4405. b._setStrokeColor = function(a) {
  4406. this._TF_Props_._strokeColor != a && (this._setTextDirty(), this._TF_Props_._strokeColor = a, this._TF_Props_._strokeColorString = c.toColorString(a))
  4407. };
  4408. Object.defineProperty(b, "stroke", {
  4409. get: function() {
  4410. return this._TF_Props_._stroke
  4411. },
  4412. set: function(a) {
  4413. this._setStroke(a)
  4414. },
  4415. enumerable: !0,
  4416. configurable: !0
  4417. });
  4418. b._setStroke = function(a) {
  4419. this._TF_Props_._stroke != a && (this._setTextDirty(), this._TF_Props_._stroke = a)
  4420. };
  4421. Object.defineProperty(b, "textAlign", {
  4422. get: function() {
  4423. return this._TF_Props_._textAlign
  4424. },
  4425. set: function(a) {
  4426. this._setTextAlign(a)
  4427. },
  4428. enumerable: !0,
  4429. configurable: !0
  4430. });
  4431. b._setTextAlign = function(a) {
  4432. this._TF_Props_._textAlign != a && (this._setTextDirty(), this._TF_Props_._textAlign = a)
  4433. };
  4434. Object.defineProperty(b, "verticalAlign", {
  4435. get: function() {
  4436. return this._TF_Props_._verticalAlign
  4437. },
  4438. set: function(a) {
  4439. this._setVerticalAlign(a)
  4440. },
  4441. enumerable: !0,
  4442. configurable: !0
  4443. });
  4444. b._setVerticalAlign = function(a) {
  4445. this._TF_Props_._verticalAlign != a && (this._setTextDirty(), this._TF_Props_._verticalAlign = a)
  4446. };
  4447. Object.defineProperty(b, "maxChars", {
  4448. get: function() {
  4449. return this._TF_Props_._maxChars
  4450. },
  4451. set: function(a) {
  4452. this._setMaxChars(a)
  4453. },
  4454. enumerable: !0,
  4455. configurable: !0
  4456. });
  4457. b._setMaxChars = function(a) {
  4458. this._TF_Props_._maxChars != a && (this._TF_Props_._maxChars = a)
  4459. };
  4460. Object.defineProperty(b, "scrollV", {
  4461. get: function() {
  4462. return Math.min(Math.max(this._TF_Props_._scrollV, 1), this.maxScrollV)
  4463. },
  4464. set: function(a) {
  4465. this._TF_Props_._scrollV = Math.max(a, 1);
  4466. this._setDirty()
  4467. },
  4468. enumerable: !0,
  4469. configurable: !0
  4470. });
  4471. Object.defineProperty(b, "maxScrollV", {
  4472. get: function() {
  4473. this._getLinesArr();
  4474. return Math.max(this._TF_Props_._numLines - c.TextFieldUtils._getScrollNum(this) + 1, 1)
  4475. },
  4476. enumerable: !0,
  4477. configurable: !0
  4478. });
  4479. Object.defineProperty(b, "selectionBeginIndex", {
  4480. get: function() {
  4481. return 0
  4482. },
  4483. enumerable: !0,
  4484. configurable: !0
  4485. });
  4486. Object.defineProperty(b, "selectionEndIndex", {
  4487. get: function() {
  4488. return 0
  4489. },
  4490. enumerable: !0,
  4491. configurable: !0
  4492. });
  4493. Object.defineProperty(b, "caretIndex", {
  4494. get: function() {
  4495. return 0
  4496. },
  4497. enumerable: !0,
  4498. configurable: !0
  4499. });
  4500. b._setSelection = function(a, f) {};
  4501. Object.defineProperty(b, "lineSpacing", {
  4502. get: function() {
  4503. return this._TF_Props_._lineSpacing
  4504. },
  4505. set: function(a) {
  4506. this._setLineSpacing(a)
  4507. },
  4508. enumerable: !0,
  4509. configurable: !0
  4510. });
  4511. b._setLineSpacing = function(a) {
  4512. this._TF_Props_._lineSpacing != a && (this._setTextDirty(), this._TF_Props_._lineSpacing = a)
  4513. };
  4514. b._getLineHeight = function() {
  4515. return this._TF_Props_._lineSpacing + this._TF_Props_._size
  4516. };
  4517. Object.defineProperty(b, "numLines", {
  4518. get: function() {
  4519. return this._TF_Props_._numLines
  4520. },
  4521. enumerable: !0,
  4522. configurable: !0
  4523. });
  4524. Object.defineProperty(b, "multiline", {
  4525. get: function() {
  4526. return this._TF_Props_._multiline
  4527. },
  4528. set: function(a) {
  4529. this._setMultiline(a)
  4530. },
  4531. enumerable: !0,
  4532. configurable: !0
  4533. });
  4534. b._setMultiline = function(a) {
  4535. this._TF_Props_._multiline = a;
  4536. this._setDirty()
  4537. };
  4538. b._setWidth = function(a) {
  4539. e.prototype._setWidth.call(this, a);
  4540. this.fillBackground()
  4541. };
  4542. b._setHeight = function(a) {
  4543. e.prototype._setHeight.call(this, a);
  4544. this.fillBackground()
  4545. };
  4546. Object.defineProperty(b, "border", {
  4547. get: function() {
  4548. return this._TF_Props_._border
  4549. },
  4550. set: function(a) {
  4551. this._TF_Props_._border = a;
  4552. this.fillBackground()
  4553. },
  4554. enumerable: !0,
  4555. configurable: !0
  4556. });
  4557. Object.defineProperty(b, "borderColor", {
  4558. get: function() {
  4559. return this._TF_Props_._borderColor
  4560. },
  4561. set: function(a) {
  4562. this._TF_Props_._borderColor = a;
  4563. this.fillBackground()
  4564. },
  4565. enumerable: !0,
  4566. configurable: !0
  4567. });
  4568. Object.defineProperty(b, "background", {
  4569. get: function() {
  4570. return this._TF_Props_._background
  4571. },
  4572. set: function(a) {
  4573. this._TF_Props_._background = a;
  4574. this.fillBackground()
  4575. },
  4576. enumerable: !0,
  4577. configurable: !0
  4578. });
  4579. Object.defineProperty(b, "backgroundColor", {
  4580. get: function() {
  4581. return this._TF_Props_._backgroundColor
  4582. },
  4583. set: function(a) {
  4584. this._TF_Props_._backgroundColor = a;
  4585. this.fillBackground()
  4586. },
  4587. enumerable: !0,
  4588. configurable: !0
  4589. });
  4590. b.fillBackground = function() {
  4591. var a = this._bgGraphics,
  4592. f = this._TF_Props_;
  4593. a && a.clear();
  4594. if (f._background || f._border) null == a && (a = this._bgGraphics = new c.Graphics),
  4595. f._background && a.beginFill(f._backgroundColor, 1),
  4596. f._border && a.lineStyle(1, f._borderColor),
  4597. a.drawRect(0, 0, this._getWidth(), this._getHeight()),
  4598. a.endFill()
  4599. };
  4600. b.setFocus = function() {
  4601. c.Logger.warningWithErrorId(1013)
  4602. };
  4603. b._onRemoveFromStage = function() {
  4604. e.prototype._onRemoveFromStage.call(this);
  4605. this._removeEvent();
  4606. this._TF_Props_._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
  4607. };
  4608. b._onAddToStage = function() {
  4609. e.prototype._onAddToStage.call(this);
  4610. this._addEvent();
  4611. this._TF_Props_._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
  4612. };
  4613. b._updateBaseTransform = function() {
  4614. this._getLinesArr();
  4615. 0 == this._TF_Props_._textMaxWidth && this._TF_Props_._type != c.TextFieldType.INPUT || e.prototype._updateTransform.call(this)
  4616. };
  4617. b._updateTransform = function() {
  4618. this._TF_Props_._type == c.TextFieldType.INPUT ? this._DO_Props_._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() : this._updateBaseTransform()
  4619. };
  4620. b._draw = function(a) {
  4621. var f = this._TF_Props_;
  4622. if (f._type == c.TextFieldType.INPUT) {
  4623. if (this._isTyping) return
  4624. } else if (0 == f._textMaxWidth) return;
  4625. e.prototype._draw.call(this, a)
  4626. };
  4627. b._render = function(a) {
  4628. this._bgGraphics && this._bgGraphics._draw(a);
  4629. this.drawText(a);
  4630. this._clearDirty()
  4631. };
  4632. b._measureBounds = function() {
  4633. var a = this._TF_Props_;
  4634. this._getLinesArr();
  4635. return 0 == a._textMaxWidth ? c.Rectangle.identity.initialize(0, 0, 0, 0) : c.Rectangle.identity.initialize(0, 0, a._textMaxWidth, c.TextFieldUtils._getTextHeight(this))
  4636. };
  4637. Object.defineProperty(b, "textFlow", {
  4638. get: function() {
  4639. return this._textArr
  4640. },
  4641. set: function(a) {
  4642. var f = this._TF_Props_;
  4643. this._isFlow = !0;
  4644. var b = "";
  4645. null == a && (a = []);
  4646. for (var c = 0; c < a.length; c++) b += a[c].text;
  4647. f._displayAsPassword ? this._setBaseText(b) : (f._text = b, this.setMiddleStyle(a))
  4648. },
  4649. enumerable: !0,
  4650. configurable: !0
  4651. });
  4652. b.changeToPassText = function(a) {
  4653. if (this._TF_Props_._displayAsPassword) {
  4654. for (var f = "",
  4655. b = 0,
  4656. c = a.length; b < c; b++) switch (a.charAt(b)) {
  4657. case "\n":
  4658. f += "\n";
  4659. break;
  4660. case "\r":
  4661. break;
  4662. default:
  4663. f += "*"
  4664. }
  4665. return f
  4666. }
  4667. return a
  4668. };
  4669. b.setMiddleStyle = function(a) {
  4670. this._isArrayChanged = !0;
  4671. this._textArr = a;
  4672. this._setSizeDirty()
  4673. };
  4674. Object.defineProperty(b, "textWidth", {
  4675. get: function() {
  4676. return this._TF_Props_._textMaxWidth
  4677. },
  4678. enumerable: !0,
  4679. configurable: !0
  4680. });
  4681. Object.defineProperty(b, "textHeight", {
  4682. get: function() {
  4683. return c.TextFieldUtils._getTextHeight(this)
  4684. },
  4685. enumerable: !0,
  4686. configurable: !0
  4687. });
  4688. b.appendText = function(a) {
  4689. this.appendElement({
  4690. text: a
  4691. })
  4692. };
  4693. b.appendElement = function(a) {
  4694. this._textArr.push(a);
  4695. this.setMiddleStyle(this._textArr)
  4696. };
  4697. b._getLinesArr = function() {
  4698. var a = this._TF_Props_;
  4699. if (!this._isArrayChanged) return this._linesArr;
  4700. this._isArrayChanged = !1;
  4701. var f = this._textArr,
  4702. b = c.MainContext.instance.rendererContext;
  4703. this._linesArr.length = 0;
  4704. a._textMaxHeight = 0;
  4705. a._textMaxWidth = 0;
  4706. if (this._DO_Props_._hasWidthSet && 0 == this._DO_Props_._explicitWidth) return a._numLines = 0,
  4707. [{
  4708. width: 0,
  4709. height: 0,
  4710. charNum: 0,
  4711. elements: [],
  4712. hasNextLine: !1
  4713. }];
  4714. this._isFlow || b.setupFont(this);
  4715. for (var d = this._linesArr,
  4716. e = 0,
  4717. g = 0,
  4718. h = 0,
  4719. k = 0,
  4720. l, m = 0,
  4721. p = f.length; m < p; m++) {
  4722. var r = f[m];
  4723. r.style = r.style || {};
  4724. for (var q = r.text.toString().split(/(?:\r\n|\r|\n)/), x = 0, z = q.length; x < z; x++) {
  4725. null == d[k] && (l = {
  4726. width: 0,
  4727. height: 0,
  4728. elements: [],
  4729. charNum: 0,
  4730. hasNextLine: !1
  4731. },
  4732. d[k] = l, g = h = e = 0);
  4733. var h = a._type == c.TextFieldType.INPUT ? a._size: Math.max(h, r.style.size || a._size),
  4734. u = !0;
  4735. if ("" == q[x]) x == z - 1 && (u = !1);
  4736. else {
  4737. this._isFlow && b.setupFont(this, r.style);
  4738. var y = b.measureText(q[x]);
  4739. if (this._DO_Props_._hasWidthSet) if (e + y <= this._DO_Props_._explicitWidth) l.elements.push({
  4740. width: y,
  4741. text: q[x],
  4742. style: r.style
  4743. }),
  4744. e += y,
  4745. g += q[x].length,
  4746. x == z - 1 && (u = !1);
  4747. else {
  4748. for (var w = u = 0,
  4749. B = q[x], A = B.length; u < A; u++) {
  4750. y = b.measureText(B.charAt(u));
  4751. if (e + y > this._DO_Props_._explicitWidth && 0 != e + u) break;
  4752. w += y;
  4753. e += y;
  4754. g += 1
  4755. }
  4756. 0 < u && (l.elements.push({
  4757. width: w,
  4758. text: B.substring(0, u),
  4759. style: r.style
  4760. }), q[x] = B.substring(u));
  4761. x--;
  4762. u = !1
  4763. } else e += y,
  4764. g += q[x].length,
  4765. l.elements.push({
  4766. width: y,
  4767. text: q[x],
  4768. style: r.style
  4769. }),
  4770. x == z - 1 && (u = !1)
  4771. }
  4772. u && (g++, l.hasNextLine = !0);
  4773. x < q.length - 1 && (l.width = e, l.height = h, l.charNum = g, a._textMaxWidth = Math.max(a._textMaxWidth, e), a._textMaxHeight += h, k++)
  4774. }
  4775. m == f.length - 1 && l && (l.width = e, l.height = h, l.charNum = g, a._textMaxWidth = Math.max(a._textMaxWidth, e), a._textMaxHeight += h)
  4776. }
  4777. a._numLines = d.length;
  4778. return d
  4779. };
  4780. b.drawText = function(a) {
  4781. var f = this._TF_Props_,
  4782. b = this._getLinesArr();
  4783. if (0 != f._textMaxWidth) {
  4784. var d = this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: f._textMaxWidth,
  4785. e = c.TextFieldUtils._getTextHeight(this),
  4786. g = 0,
  4787. h = c.TextFieldUtils._getStartLine(this);
  4788. if (this._DO_Props_._hasHeightSet && this._DO_Props_._explicitHeight > e) var k = c.TextFieldUtils._getValign(this),
  4789. g = g + k * (this._DO_Props_._explicitHeight - e);
  4790. for (var g = Math.round(g), e = c.TextFieldUtils._getHalign(this), k = 0, l = h, m = f._numLines; l < m; l++) {
  4791. var p = b[l],
  4792. r = p.height,
  4793. g = g + r / 2;
  4794. if (l != h) {
  4795. if (f._type == c.TextFieldType.INPUT && !f._multiline) break;
  4796. if (this._DO_Props_._hasHeightSet && g > this._DO_Props_._explicitHeight) break
  4797. }
  4798. for (var k = Math.round((d - p.width) * e), q = 0, x = p.elements.length; q < x; q++) {
  4799. var z = p.elements[q];
  4800. a.drawText(this, z.text, k, g + (r - (z.style.size || f._size)) / 2, z.width, z.style);
  4801. k += z.width
  4802. }
  4803. g += r / 2 + f._lineSpacing
  4804. }
  4805. }
  4806. };
  4807. b._addEvent = function() {
  4808. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4809. };
  4810. b._removeEvent = function() {
  4811. this.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4812. };
  4813. b.onTapHandler = function(a) {
  4814. if (this._TF_Props_._type != c.TextFieldType.INPUT && (a = c.TextFieldUtils._getTextElement(this, a.localX, a.localY), null != a && (a = a.style) && a.href && a.href.match(/^event:/))) {
  4815. var f = a.href.match(/^event:/)[0];
  4816. c.TextEvent.dispatchTextEvent(this, c.TextEvent.LINK, a.href.substring(f.length))
  4817. }
  4818. };
  4819. d.default_fontFamily = "Arial";
  4820. return d
  4821. } (c.DisplayObject);
  4822. c.TextField = g;
  4823. g.prototype.__class__ = "egret.TextField"
  4824. })(egret || (egret = {})); (function(c) {
  4825. var g = function() {
  4826. function c() {
  4827. this.resutlArr = []
  4828. }
  4829. var d = c.prototype;
  4830. d.parser = function(b) {
  4831. this.stackArray = [];
  4832. this.resutlArr = [];
  4833. for (var a = 0,
  4834. f = b.length; a < f;) {
  4835. var c = b.indexOf("<", a);
  4836. 0 > c ? (this.addToResultArr(b.substring(a)), a = f) : (this.addToResultArr(b.substring(a, c)), a = b.indexOf(">", c), "/" == b.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(b.substring(c + 1, a)), a += 1)
  4837. }
  4838. return this.resutlArr
  4839. };
  4840. d.addToResultArr = function(b) {
  4841. if ("" != b) {
  4842. var a = [];
  4843. a.push(["&lt;", "<"]);
  4844. a.push(["&gt;", ">"]);
  4845. a.push(["&amp;", "&"]);
  4846. a.push(["&quot;", '"']);
  4847. a.push(["&apos;;", "'"]);
  4848. for (var f = 0; f < a.length; f++) b.replace(new RegExp(a[f][0], "g"), a[f][1]);
  4849. 0 < this.stackArray.length ? this.resutlArr.push({
  4850. text: b,
  4851. style: this.stackArray[this.stackArray.length - 1]
  4852. }) : this.resutlArr.push({
  4853. text: b
  4854. })
  4855. }
  4856. };
  4857. d.changeStringToObject = function(b) {
  4858. var a = {};
  4859. b = b.replace(/( )+/g, " ").split(" ");
  4860. for (var f = 0; f < b.length; f++) this.addProperty(a, b[f]);
  4861. return a
  4862. };
  4863. d.addProperty = function(b, a) {
  4864. var f = a.replace(/( )*=( )*/g, "=").split("=");
  4865. f[1] && (f[1] = f[1].replace(/(\"|\')/g, ""));
  4866. switch (f[0].toLowerCase()) {
  4867. case "color":
  4868. case "textcolor":
  4869. f[1] = f[1].replace(/#/, "0x");
  4870. b.textColor = parseInt(f[1]);
  4871. break;
  4872. case "strokecolor":
  4873. f[1] = f[1].replace(/#/, "0x");
  4874. b.strokeColor = parseInt(f[1]);
  4875. break;
  4876. case "stroke":
  4877. b.stroke = parseInt(f[1]);
  4878. break;
  4879. case "b":
  4880. b.bold = "true" == (f[1] || "true");
  4881. break;
  4882. case "i":
  4883. b.italic = "true" == (f[1] || "true");
  4884. break;
  4885. case "size":
  4886. b.size = parseInt(f[1]);
  4887. break;
  4888. case "fontfamily":
  4889. b.fontFamily = f[1];
  4890. break;
  4891. case "href":
  4892. b.href = f[1]
  4893. }
  4894. };
  4895. d.addToArray = function(b) {
  4896. b = this.changeStringToObject(b);
  4897. if (0 != this.stackArray.length) {
  4898. var a = this.stackArray[this.stackArray.length - 1],
  4899. f;
  4900. for (f in a) null == b[f] && (b[f] = a[f])
  4901. }
  4902. this.stackArray.push(b)
  4903. };
  4904. return c
  4905. } ();
  4906. c.HtmlTextParser = g;
  4907. g.prototype.__class__ = "egret.HtmlTextParser"
  4908. })(egret || (egret = {})); (function(c) {
  4909. var g = function() {
  4910. function c() {}
  4911. c.DYNAMIC = "dynamic";
  4912. c.INPUT = "input";
  4913. return c
  4914. } ();
  4915. c.TextFieldType = g;
  4916. g.prototype.__class__ = "egret.TextFieldType"
  4917. })(egret || (egret = {})); (function(c) {
  4918. var g = function(e) {
  4919. function d(a) {
  4920. e.call(this);
  4921. this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
  4922. this._textureMap = {};
  4923. this.texture = a;
  4924. this._sourceWidth = a._sourceWidth;
  4925. this._sourceHeight = a._sourceHeight;
  4926. this._bitmapX = a._bitmapX - a._offsetX;
  4927. this._bitmapY = a._bitmapY - a._offsetY
  4928. }
  4929. __extends(d, e);
  4930. var b = d.prototype;
  4931. b.getTexture = function(a) {
  4932. return this._textureMap[a]
  4933. };
  4934. b.createTexture = function(a, f, b, d, e, g, h, k, l) {
  4935. void 0 === g && (g = 0);
  4936. void 0 === h && (h = 0);
  4937. "undefined" === typeof k && (k = g + d);
  4938. "undefined" === typeof l && (l = h + e);
  4939. var m = this.texture._clone(),
  4940. p = c.MainContext.instance.rendererContext._texture_scale_factor;
  4941. m._bitmapX = this._bitmapX + f;
  4942. m._bitmapY = this._bitmapY + b;
  4943. m._bitmapWidth = d * p;
  4944. m._bitmapHeight = e * p;
  4945. m._offsetX = g;
  4946. m._offsetY = h;
  4947. m._textureWidth = k * p;
  4948. m._textureHeight = l * p;
  4949. m._sourceWidth = this._sourceWidth;
  4950. m._sourceHeight = this._sourceHeight;
  4951. return this._textureMap[a] = m
  4952. };
  4953. b.dispose = function() {
  4954. this.texture && this.texture.dispose()
  4955. };
  4956. return d
  4957. } (c.HashObject);
  4958. c.SpriteSheet = g;
  4959. g.prototype.__class__ = "egret.SpriteSheet"
  4960. })(egret || (egret = {})); (function(c) {
  4961. var g = function(e) {
  4962. function d() {
  4963. e.call(this);
  4964. this._text = null;
  4965. this._isFocus = !1
  4966. }
  4967. __extends(d, e);
  4968. var b = d.prototype;
  4969. b.init = function(a) {
  4970. this._text = a;
  4971. this.stageText = c.StageText.create();
  4972. this.stageText._setTextField(this._text)
  4973. };
  4974. b._addStageText = function() {
  4975. this._text._inputEnabled || (this._text._DO_Props_._touchEnabled = !0);
  4976. this.stageText._add();
  4977. this.stageText._addListeners();
  4978. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4979. this._text.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  4980. c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);
  4981. this.stageText.addEventListener("blur", this.blurHandler, this);
  4982. this.stageText.addEventListener("focus", this.focusHandler, this)
  4983. };
  4984. b._removeStageText = function() {
  4985. this._text._inputEnabled || (this._text._DO_Props_._touchEnabled = !1);
  4986. this.stageText._remove();
  4987. this.stageText._removeListeners();
  4988. this.stageText._removeInput();
  4989. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4990. this._text.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  4991. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);
  4992. this.stageText.removeEventListener("blur", this.blurHandler, this);
  4993. this.stageText.removeEventListener("focus", this.focusHandler, this)
  4994. };
  4995. b._getText = function() {
  4996. return this.stageText._getText()
  4997. };
  4998. b._setText = function(a) {
  4999. this.stageText._setText(a)
  5000. };
  5001. b.focusHandler = function(a) {
  5002. this._isFocus = !0;
  5003. this._text._isTyping = !0;
  5004. this._text.dispatchEvent(new c.FocusEvent(c.FocusEvent.FOCUS_IN))
  5005. };
  5006. b.blurHandler = function(a) {
  5007. this._isFocus = !1;
  5008. this._text._isTyping = !1;
  5009. this._text.dispatchEvent(new c.FocusEvent(c.FocusEvent.FOCUS_OUT))
  5010. };
  5011. b.onMouseDownHandler = function(a) {
  5012. a.stopPropagation();
  5013. this._text._DO_Props_._visible && !this._isFocus && (this._isFocus = !0, this.stageText._show(this._text._TF_Props_._multiline, this._text.size, this._text.width, this._text.height), a = this._text.localToGlobal(), this.stageText._initElement(a.x, a.y, this._text._worldTransform.a, this._text._worldTransform.d))
  5014. };
  5015. b.onStageDownHandler = function(a) {
  5016. this.stageText._hide()
  5017. };
  5018. b.updateTextHandler = function(a) {
  5019. this.resetText();
  5020. this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
  5021. };
  5022. b.resetText = function() {
  5023. this._text._setBaseText(this.stageText._getText())
  5024. };
  5025. b._hideInput = function() {
  5026. this.stageText._removeInput()
  5027. };
  5028. b._updateTransform = function() {
  5029. this._text._updateBaseTransform(); ! this._text._DO_Props_._visible && this.stageText && this._hideInput()
  5030. };
  5031. b._updateProperties = function() {
  5032. if (!this._isFocus) {
  5033. var a = this._text._DO_Props_._stage;
  5034. if (null == a) this.stageText._setVisible(!1);
  5035. else {
  5036. for (var f = this._text,
  5037. b = f._DO_Props_._visible; b;) {
  5038. f = f.parent;
  5039. if (f == a) break;
  5040. b = f._DO_Props_._visible
  5041. }
  5042. this.stageText._setVisible(b)
  5043. }
  5044. this.stageText._setMultiline(this._text._TF_Props_._multiline);
  5045. this.stageText._setTextType(this._text._TF_Props_._displayAsPassword ? "password": "text");
  5046. this.stageText._setText(this._text._TF_Props_._text);
  5047. this.stageText._resetStageText()
  5048. }
  5049. this._updateTransform()
  5050. };
  5051. return d
  5052. } (c.HashObject);
  5053. c.InputController = g;
  5054. g.prototype.__class__ = "egret.InputController"
  5055. })(egret || (egret = {})); (function(c) {
  5056. var g = function(c) {
  5057. function d(a, f) {
  5058. c.call(this, a);
  5059. this.firstCharHeight = 0;
  5060. "string" == typeof f ? this.charList = this.parseConfig(f) : f && f.hasOwnProperty("frames") ? this.charList = f.frames: this.charList = {}
  5061. }
  5062. __extends(d, c);
  5063. var b = d.prototype;
  5064. b.getTexture = function(a) {
  5065. var f = this._textureMap[a];
  5066. if (!f) {
  5067. f = this.charList[a];
  5068. if (!f) return null;
  5069. f = this.createTexture(a, f.x, f.y, f.w, f.h, f.offX, f.offY, f.sourceW, f.sourceH);
  5070. this._textureMap[a] = f
  5071. }
  5072. return f
  5073. };
  5074. b._getFirstCharHeight = function() {
  5075. if (0 == this.firstCharHeight) for (var a in this.charList) {
  5076. var f = this.charList[a];
  5077. if (f) {
  5078. var b = f.sourceH;
  5079. void 0 === b && (b = f.h, void 0 === b && (b = 0), f = f.offY, void 0 === f && (f = 0), b += f);
  5080. if (! (0 >= b)) {
  5081. this.firstCharHeight = b;
  5082. break
  5083. }
  5084. }
  5085. }
  5086. return this.firstCharHeight
  5087. };
  5088. b.parseConfig = function(a) {
  5089. a = a.split("\r\n").join("\n");
  5090. a = a.split("\n");
  5091. for (var f = this.getConfigByKey(a[3], "count"), b = {},
  5092. c = 4; c < 4 + f; c++) {
  5093. var d = a[c],
  5094. e = String.fromCharCode(this.getConfigByKey(d, "id")),
  5095. g = {};
  5096. b[e] = g;
  5097. g.x = this.getConfigByKey(d, "x");
  5098. g.y = this.getConfigByKey(d, "y");
  5099. g.w = this.getConfigByKey(d, "width");
  5100. g.h = this.getConfigByKey(d, "height");
  5101. g.offX = this.getConfigByKey(d, "xoffset");
  5102. g.offY = this.getConfigByKey(d, "yoffset")
  5103. }
  5104. return b
  5105. };
  5106. b.getConfigByKey = function(a, f) {
  5107. for (var b = a.split(" "), c = 0, d = b.length; c < d; c++) {
  5108. var e = b[c];
  5109. if (f == e.substring(0, f.length)) return b = e.substring(f.length + 1),
  5110. parseInt(b)
  5111. }
  5112. return 0
  5113. };
  5114. return d
  5115. } (c.SpriteSheet);
  5116. c.BitmapFont = g;
  5117. g.prototype.__class__ = "egret.BitmapFont"
  5118. })(egret || (egret = {})); (function(c) {
  5119. var g = function(e) {
  5120. function d(a) {
  5121. e.call(this);
  5122. this._isAddedToStage = !1;
  5123. this._frames = this._movieClipData = this._textureToRender = null;
  5124. this._totalFrames = 0;
  5125. this._frameLabels = null;
  5126. this._frameIntervalTime = 0;
  5127. this._eventPool = null;
  5128. this._isPlaying = !1;
  5129. this._isStopped = !0;
  5130. this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
  5131. this._setMovieClipData(a);
  5132. this.needDraw = !0
  5133. }
  5134. __extends(d, e);
  5135. var b = d.prototype;
  5136. b._init = function() {
  5137. this._reset();
  5138. var a = this._movieClipData;
  5139. a && a._isDataValid() && (this._frames = a.frames, this._totalFrames = a.numFrames, this._frameLabels = a.labels, this._frameIntervalTime = 1E3 / a.frameRate, this._initFrame())
  5140. };
  5141. b._reset = function() {
  5142. this._frames = null;
  5143. this._playTimes = 0;
  5144. this._isPlaying = !1;
  5145. this.setIsStopped(!0);
  5146. this._currentFrameNum = 0;
  5147. this._nextFrameNum = 1;
  5148. this._passedTime = this._displayedKeyFrameNum = 0;
  5149. this._eventPool = []
  5150. };
  5151. b._initFrame = function() {
  5152. this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
  5153. };
  5154. b._render = function(a) {
  5155. var f = this._textureToRender;
  5156. if (this._texture_to_render = f) {
  5157. var b = Math.round(f._offsetX),
  5158. c = Math.round(f._offsetY),
  5159. e = f._bitmapWidth || f._textureWidth,
  5160. g = f._bitmapHeight || f._textureHeight,
  5161. h = Math.round(e),
  5162. k = Math.round(g);
  5163. d.renderFilter.drawImage(a, this, f._bitmapX, f._bitmapY, e, g, b, c, h, k)
  5164. }
  5165. };
  5166. b._measureBounds = function() {
  5167. var a = this._textureToRender;
  5168. return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : e.prototype._measureBounds.call(this)
  5169. };
  5170. b._onAddToStage = function() {
  5171. e.prototype._onAddToStage.call(this);
  5172. this._isAddedToStage = !0;
  5173. this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
  5174. };
  5175. b._onRemoveFromStage = function() {
  5176. e.prototype._onRemoveFromStage.call(this);
  5177. this._isAddedToStage = !1;
  5178. this.setIsStopped(!0)
  5179. };
  5180. b._getFrameLabelByName = function(a, f) {
  5181. void 0 === f && (f = !1);
  5182. f && (a = a.toLowerCase());
  5183. var b = this._frameLabels;
  5184. if (b) for (var c = null,
  5185. d = 0; d < b.length; d++) if (c = b[d], f ? c.name.toLowerCase() === a: c.name === a) return c;
  5186. return null
  5187. };
  5188. b._getFrameLabelByFrame = function(a) {
  5189. var b = this._frameLabels;
  5190. if (b) for (var c = null,
  5191. d = 0; d < b.length; d++) if (c = b[d], c.frame === a) return c;
  5192. return null
  5193. };
  5194. b._getFrameLabelForFrame = function(a) {
  5195. var b = null,
  5196. c = null,
  5197. d = this._frameLabels;
  5198. if (d) for (var e = 0; e < d.length; e++) {
  5199. c = d[e];
  5200. if (c.frame > a) break;
  5201. b = c
  5202. }
  5203. return b
  5204. };
  5205. b.play = function(a) {
  5206. void 0 === a && (a = 0);
  5207. this._isPlaying = !0;
  5208. this.setPlayTimes(a);
  5209. 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
  5210. };
  5211. b.stop = function() {
  5212. this._isPlaying = !1;
  5213. this.setIsStopped(!0)
  5214. };
  5215. b.prevFrame = function() {
  5216. this.gotoAndStop(this._currentFrameNum - 1)
  5217. };
  5218. b.nextFrame = function() {
  5219. this.gotoAndStop(this._currentFrameNum + 1)
  5220. };
  5221. b.gotoAndPlay = function(a, b) {
  5222. void 0 === b && (b = 0);
  5223. if (0 === arguments.length || 2 < arguments.length) throw Error(c.getString(1022, "MovieClip.gotoAndPlay()"));
  5224. this.play(b);
  5225. this._gotoFrame(a)
  5226. };
  5227. b.gotoAndStop = function(a) {
  5228. if (1 != arguments.length) throw Error(c.getString(1022, "MovieClip.gotoAndStop()"));
  5229. this.stop();
  5230. this._gotoFrame(a)
  5231. };
  5232. b._gotoFrame = function(a) {
  5233. var b;
  5234. if ("string" === typeof a) b = this._getFrameLabelByName(a).frame;
  5235. else if (b = parseInt(a + "", 10), b != a) throw Error(c.getString(1022, "Frame Label Not Found"));
  5236. 1 > b ? b = 1 : b > this._totalFrames && (b = this._totalFrames);
  5237. b !== this._nextFrameNum && (this._nextFrameNum = b, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
  5238. };
  5239. b._advanceTime = function(a) {
  5240. var b = this._frameIntervalTime;
  5241. a = this._passedTime + a;
  5242. this._passedTime = a % b;
  5243. b = a / b;
  5244. if (! (1 > b)) {
  5245. for (; 1 <= b;) {
  5246. b--;
  5247. this._nextFrameNum++;
  5248. if (this._nextFrameNum > this._totalFrames) if ( - 1 == this._playTimes) this._eventPool.push(c.Event.LOOP_COMPLETE),
  5249. this._nextFrameNum = 1;
  5250. else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(c.Event.LOOP_COMPLETE),
  5251. this._nextFrameNum = 1;
  5252. else {
  5253. this._nextFrameNum = this._totalFrames;
  5254. this._eventPool.push(c.Event.COMPLETE);
  5255. this.stop();
  5256. break
  5257. }
  5258. this._advanceFrame()
  5259. }
  5260. this._constructFrame();
  5261. this._handlePendingEvent();
  5262. this._setDirty()
  5263. }
  5264. };
  5265. b._advanceFrame = function() {
  5266. this._currentFrameNum = this._nextFrameNum
  5267. };
  5268. b._constructFrame = function() {
  5269. var a = this._currentFrameNum;
  5270. this._displayedKeyFrameNum != a && (this._textureToRender = this._movieClipData.getTextureByFrame(a), this._DO_Props_._sizeDirty = !0, this._displayedKeyFrameNum = a)
  5271. };
  5272. b._handlePendingEvent = function() {
  5273. if (0 != this._eventPool.length) {
  5274. this._eventPool.reverse();
  5275. for (var a = this._eventPool,
  5276. b = a.length,
  5277. d = !1,
  5278. e = !1,
  5279. g = 0; g < b; g++) {
  5280. var n = a.pop();
  5281. n == c.Event.LOOP_COMPLETE ? e = !0 : n == c.Event.COMPLETE ? d = !0 : this.dispatchEventWith(n)
  5282. }
  5283. e && this.dispatchEventWith(c.Event.LOOP_COMPLETE);
  5284. d && this.dispatchEventWith(c.Event.COMPLETE)
  5285. }
  5286. };
  5287. Object.defineProperty(b, "totalFrames", {
  5288. get: function() {
  5289. return this._totalFrames
  5290. },
  5291. enumerable: !0,
  5292. configurable: !0
  5293. });
  5294. Object.defineProperty(b, "currentFrame", {
  5295. get: function() {
  5296. return this._currentFrameNum
  5297. },
  5298. enumerable: !0,
  5299. configurable: !0
  5300. });
  5301. Object.defineProperty(b, "currentFrameLabel", {
  5302. get: function() {
  5303. var a = this._getFrameLabelByFrame(this._currentFrameNum);
  5304. return a && a.name
  5305. },
  5306. enumerable: !0,
  5307. configurable: !0
  5308. });
  5309. Object.defineProperty(b, "currentLabel", {
  5310. get: function() {
  5311. var a = this._getFrameLabelForFrame(this._currentFrameNum);
  5312. return a ? a.name: null
  5313. },
  5314. enumerable: !0,
  5315. configurable: !0
  5316. });
  5317. Object.defineProperty(b, "frameRate", {
  5318. get: function() {
  5319. return this.movieClipData.frameRate
  5320. },
  5321. set: function(a) {
  5322. a != this._movieClipData.frameRate && (this._movieClipData.frameRate = a, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
  5323. },
  5324. enumerable: !0,
  5325. configurable: !0
  5326. });
  5327. Object.defineProperty(b, "isPlaying", {
  5328. get: function() {
  5329. return this._isPlaying
  5330. },
  5331. enumerable: !0,
  5332. configurable: !0
  5333. });
  5334. Object.defineProperty(b, "movieClipData", {
  5335. get: function() {
  5336. return this._movieClipData
  5337. },
  5338. set: function(a) {
  5339. this._setMovieClipData(a)
  5340. },
  5341. enumerable: !0,
  5342. configurable: !0
  5343. });
  5344. b._setMovieClipData = function(a) {
  5345. this._movieClipData != a && (this._movieClipData = a, this._init())
  5346. };
  5347. b.setPlayTimes = function(a) {
  5348. if (0 > a || 1 <= a) this._playTimes = 0 > a ? -1 : Math.floor(a)
  5349. };
  5350. b.setIsStopped = function(a) {
  5351. this._isStopped != a && ((this._isStopped = a) ? (this._playTimes = 0, c.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, c.Ticker.getInstance().register(this._advanceTime, this)))
  5352. };
  5353. d.renderFilter = c.RenderFilter.getInstance();
  5354. return d
  5355. } (c.DisplayObject);
  5356. c.MovieClip = g;
  5357. g.prototype.__class__ = "egret.MovieClip"
  5358. })(egret || (egret = {})); (function(c) {
  5359. var g = function(c) {
  5360. function d(a, b) {
  5361. c.call(this);
  5362. this._name = a;
  5363. this._frame = b | 0
  5364. }
  5365. __extends(d, c);
  5366. var b = d.prototype;
  5367. Object.defineProperty(b, "name", {
  5368. get: function() {
  5369. return this._name
  5370. },
  5371. enumerable: !0,
  5372. configurable: !0
  5373. });
  5374. Object.defineProperty(b, "frame", {
  5375. get: function() {
  5376. return this._frame
  5377. },
  5378. enumerable: !0,
  5379. configurable: !0
  5380. });
  5381. b.clone = function() {
  5382. return new d(this._name, this._frame)
  5383. };
  5384. return d
  5385. } (c.EventDispatcher);
  5386. c.FrameLabel = g;
  5387. g.prototype.__class__ = "egret.FrameLabel"
  5388. })(egret || (egret = {})); (function(c) {
  5389. var g = function(e) {
  5390. function d() {
  5391. e.call(this);
  5392. this._mcData = null;
  5393. this.numFrames = 1;
  5394. this.frames = [];
  5395. this.labels = null;
  5396. this.frameRate = 0;
  5397. this.spriteSheet = this.textureData = null
  5398. }
  5399. __extends(d, e);
  5400. var b = d.prototype;
  5401. b._init = function(a, b, c) {
  5402. this.textureData = b;
  5403. this.spriteSheet = c;
  5404. this._setMCData(a)
  5405. };
  5406. b.getKeyFrameData = function(a) {
  5407. a = this.frames[a - 1];
  5408. a.frame && (a = this.frames[a.frame - 1]);
  5409. return a
  5410. };
  5411. b.getTextureByFrame = function(a) {
  5412. a = this.getKeyFrameData(a);
  5413. if (a.res) {
  5414. var b = this.getTextureByResName(a.res);
  5415. b._offsetX = a.x | 0;
  5416. b._offsetY = a.y | 0;
  5417. return b
  5418. }
  5419. return null
  5420. };
  5421. b.getTextureByResName = function(a) {
  5422. var b = this.spriteSheet.getTexture(a);
  5423. b || (b = this.textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  5424. return b
  5425. };
  5426. b._isDataValid = function() {
  5427. return 0 < this.frames.length
  5428. };
  5429. b._isTextureValid = function() {
  5430. return null != this.textureData && null != this.spriteSheet
  5431. };
  5432. b._fillMCData = function(a) {
  5433. this.frameRate = a.frameRate || 24;
  5434. this._fillFramesData(a.frames);
  5435. this._fillFrameLabelsData(a.labels)
  5436. };
  5437. b._fillFramesData = function(a) {
  5438. for (var b = this.frames,
  5439. c = a ? a.length: 0, d, e = 0; e < c; e++) if (d = a[e], b.push(d), d.duration) {
  5440. var g = parseInt(d.duration);
  5441. if (1 < g) {
  5442. d = b.length;
  5443. for (var h = 1; h < g; h++) b.push({
  5444. frame: d
  5445. })
  5446. }
  5447. }
  5448. this.numFrames = b.length
  5449. };
  5450. b._fillFrameLabelsData = function(a) {
  5451. if (a) {
  5452. var b = a.length;
  5453. if (0 < b) {
  5454. this.labels = [];
  5455. for (var d = 0; d < b; d++) {
  5456. var e = a[d];
  5457. this.labels.push(new c.FrameLabel(e.name, e.frame))
  5458. }
  5459. }
  5460. }
  5461. };
  5462. Object.defineProperty(b, "mcData", {
  5463. get: function() {
  5464. return this._mcData
  5465. },
  5466. set: function(a) {
  5467. this._setMCData(a)
  5468. },
  5469. enumerable: !0,
  5470. configurable: !0
  5471. });
  5472. b._setMCData = function(a) {
  5473. this._mcData != a && (this._mcData = a) && this._fillMCData(a)
  5474. };
  5475. return d
  5476. } (c.HashObject);
  5477. c.MovieClipData = g;
  5478. g.prototype.__class__ = "egret.MovieClipData"
  5479. })(egret || (egret = {})); (function(c) {
  5480. var g = function(e) {
  5481. function d(a, b) {
  5482. e.call(this);
  5483. this.enableCache = !0;
  5484. this._mcDataCache = {};
  5485. this._mcDataSet = a;
  5486. this.setTexture(b)
  5487. }
  5488. __extends(d, e);
  5489. var b = d.prototype;
  5490. b.clearCache = function() {
  5491. this._mcDataCache = {}
  5492. };
  5493. b.generateMovieClipData = function(a) {
  5494. void 0 === a && (a = "");
  5495. if ("" == a && this._mcDataSet) for (a in this._mcDataSet.mc) break;
  5496. if ("" == a) return null;
  5497. var b = this._findFromCache(a, this._mcDataCache);
  5498. b || (b = new c.MovieClipData, this._fillData(a, b, this._mcDataCache));
  5499. return b
  5500. };
  5501. b._findFromCache = function(a, b) {
  5502. return this.enableCache && b[a] ? b[a] : null
  5503. };
  5504. b._fillData = function(a, b, c) {
  5505. if (this._mcDataSet) {
  5506. var d = this._mcDataSet.mc[a];
  5507. d && (b._init(d, this._mcDataSet.res, this._spriteSheet), this.enableCache && (c[a] = b))
  5508. }
  5509. };
  5510. Object.defineProperty(b, "mcDataSet", {
  5511. get: function() {
  5512. return this._mcDataSet
  5513. },
  5514. set: function(a) {
  5515. this._mcDataSet = a
  5516. },
  5517. enumerable: !0,
  5518. configurable: !0
  5519. });
  5520. Object.defineProperty(b, "texture", {
  5521. set: function(a) {
  5522. this.setTexture(a)
  5523. },
  5524. enumerable: !0,
  5525. configurable: !0
  5526. });
  5527. Object.defineProperty(b, "spriteSheet", {
  5528. get: function() {
  5529. return this._spriteSheet
  5530. },
  5531. enumerable: !0,
  5532. configurable: !0
  5533. });
  5534. b.setTexture = function(a) {
  5535. this._spriteSheet = a ? new c.SpriteSheet(a) : null
  5536. };
  5537. return d
  5538. } (c.EventDispatcher);
  5539. c.MovieClipDataFactory = g;
  5540. g.prototype.__class__ = "egret.MovieClipDataFactory"
  5541. })(egret || (egret = {})); (function(c) {
  5542. var g = function(c) {
  5543. function d() {
  5544. c.call(this);
  5545. this._scaleY = this._scaleX = 1;
  5546. this._size = 30;
  5547. this._color = "#FFFFFF";
  5548. this._fontFamily = "Arial";
  5549. this._italic = this._bold = !1;
  5550. this._textAlign = "left";
  5551. this._verticalAlign = "top";
  5552. this._visible = !1;
  5553. this._height = this._width = 0;
  5554. this._multiline = !1;
  5555. this._maxChars = 0
  5556. }
  5557. __extends(d, c);
  5558. var b = d.prototype;
  5559. b._setTextField = function(a) {
  5560. this._textfield = a
  5561. };
  5562. b._getText = function() {
  5563. return null
  5564. };
  5565. b._setText = function(a) {};
  5566. b._setTextType = function(a) {};
  5567. b._getTextType = function() {
  5568. return null
  5569. };
  5570. b._show = function(a, b, c, d) {};
  5571. b._add = function() {};
  5572. b._remove = function() {};
  5573. b._hide = function() {};
  5574. b._addListeners = function() {};
  5575. b._removeListeners = function() {};
  5576. b._setScale = function(a, b) {
  5577. this._scaleX = a;
  5578. this._scaleY = b
  5579. };
  5580. b.changePosition = function(a, b) {};
  5581. b._setSize = function(a) {
  5582. this._size = a
  5583. };
  5584. b._setTextColor = function(a) {
  5585. this._color = a
  5586. };
  5587. b._setTextFontFamily = function(a) {
  5588. this._fontFamily = a
  5589. };
  5590. b._setBold = function(a) {
  5591. this._bold = a
  5592. };
  5593. b._setItalic = function(a) {
  5594. this._italic = a
  5595. };
  5596. b._setTextAlign = function(a) {
  5597. this._textAlign = a
  5598. };
  5599. b._setVerticalAlign = function(a) {
  5600. this._verticalAlign = a
  5601. };
  5602. b._setVisible = function(a) {
  5603. this._visible = a
  5604. };
  5605. b._setWidth = function(a) {
  5606. this._width = a
  5607. };
  5608. b._setHeight = function(a) {
  5609. this._height = a
  5610. };
  5611. b._setMultiline = function(a) {
  5612. this._multiline = a
  5613. };
  5614. b._setMaxChars = function(a) {
  5615. this._maxChars = a
  5616. };
  5617. b._resetStageText = function() {};
  5618. b._initElement = function(a, b, c, d) {};
  5619. b._removeInput = function() {};
  5620. d.create = function() {
  5621. return null
  5622. };
  5623. return d
  5624. } (c.EventDispatcher);
  5625. c.StageText = g;
  5626. g.prototype.__class__ = "egret.StageText"
  5627. })(egret || (egret = {})); (function(c) {
  5628. var g = function() {
  5629. function c() {}
  5630. c.GET = "get";
  5631. c.POST = "post";
  5632. return c
  5633. } ();
  5634. c.URLRequestMethod = g;
  5635. g.prototype.__class__ = "egret.URLRequestMethod"
  5636. })(egret || (egret = {})); (function(c) {
  5637. var g = function() {
  5638. function c() {}
  5639. c.BINARY = "binary";
  5640. c.TEXT = "text";
  5641. c.VARIABLES = "variables";
  5642. c.TEXTURE = "texture";
  5643. c.SOUND = "sound";
  5644. return c
  5645. } ();
  5646. c.URLLoaderDataFormat = g;
  5647. g.prototype.__class__ = "egret.URLLoaderDataFormat"
  5648. })(egret || (egret = {})); (function(c) {
  5649. var g = function(c) {
  5650. function d(a) {
  5651. void 0 === a && (a = null);
  5652. c.call(this);
  5653. this.variables = null;
  5654. null !== a && this.decode(a)
  5655. }
  5656. __extends(d, c);
  5657. var b = d.prototype;
  5658. b.decode = function(a) {
  5659. this.variables || (this.variables = {});
  5660. a = a.split("+").join(" ");
  5661. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) {
  5662. var d = decodeURIComponent(b[1]);
  5663. b = decodeURIComponent(b[2]);
  5664. if (!1 == d in this.variables) this.variables[d] = b;
  5665. else {
  5666. var e = this.variables[d];
  5667. e instanceof Array ? e.push(b) : this.variables[d] = [e, b]
  5668. }
  5669. }
  5670. };
  5671. b.toString = function() {
  5672. if (!this.variables) return "";
  5673. var a = this.variables,
  5674. b = [],
  5675. c;
  5676. for (c in a) b.push(this.encodeValue(c, a[c]));
  5677. return b.join("&")
  5678. };
  5679. b.encodeValue = function(a, b) {
  5680. return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5681. };
  5682. b.encodeArray = function(a, b) {
  5683. return a ? 0 == b.length ? encodeURIComponent(a) + "=": b.map(function(b) {
  5684. return encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5685. }).join("&") : ""
  5686. };
  5687. return d
  5688. } (c.HashObject);
  5689. c.URLVariables = g;
  5690. g.prototype.__class__ = "egret.URLVariables"
  5691. })(egret || (egret = {})); (function(c) {
  5692. var g = function() {
  5693. return function(c, d) {
  5694. this.value = this.name = "";
  5695. this.name = c;
  5696. this.value = d
  5697. }
  5698. } ();
  5699. c.URLRequestHeader = g;
  5700. g.prototype.__class__ = "egret.URLRequestHeader"
  5701. })(egret || (egret = {})); (function(c) {
  5702. var g = function(e) {
  5703. function d(b) {
  5704. void 0 === b && (b = null);
  5705. e.call(this);
  5706. this.data = null;
  5707. this.method = c.URLRequestMethod.GET;
  5708. this.url = "";
  5709. this.url = b
  5710. }
  5711. __extends(d, e);
  5712. return d
  5713. } (c.HashObject);
  5714. c.URLRequest = g;
  5715. g.prototype.__class__ = "egret.URLRequest"
  5716. })(egret || (egret = {})); (function(c) {
  5717. var g = function(e) {
  5718. function d(a) {
  5719. void 0 === a && (a = null);
  5720. e.call(this);
  5721. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  5722. this._request = this.data = null;
  5723. this._status = -1;
  5724. a && this.load(a)
  5725. }
  5726. __extends(d, e);
  5727. var b = d.prototype;
  5728. b.load = function(a) {
  5729. this._request = a;
  5730. this.data = null;
  5731. c.MainContext.instance.netContext.proceed(this)
  5732. };
  5733. b.__recycle = function() {
  5734. this.data = this._request = null
  5735. };
  5736. return d
  5737. } (c.EventDispatcher);
  5738. c.URLLoader = g;
  5739. g.prototype.__class__ = "egret.URLLoader"
  5740. })(egret || (egret = {})); (function(c) {
  5741. var g = function(e) {
  5742. function d() {
  5743. e.call(this);
  5744. this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
  5745. this._bitmapData = null
  5746. }
  5747. __extends(d, e);
  5748. var b = d.prototype;
  5749. Object.defineProperty(b, "textureWidth", {
  5750. get: function() {
  5751. return this._textureWidth
  5752. },
  5753. enumerable: !0,
  5754. configurable: !0
  5755. });
  5756. Object.defineProperty(b, "textureHeight", {
  5757. get: function() {
  5758. return this._textureHeight
  5759. },
  5760. enumerable: !0,
  5761. configurable: !0
  5762. });
  5763. b._setBitmapData = function(a) {
  5764. var b = c.MainContext.instance.rendererContext._texture_scale_factor;
  5765. this._bitmapData = a;
  5766. this._sourceWidth = a.width;
  5767. this._sourceHeight = a.height;
  5768. this._textureWidth = this._sourceWidth * b;
  5769. this._textureHeight = this._sourceHeight * b;
  5770. this._bitmapWidth = this._textureWidth;
  5771. this._bitmapHeight = this._textureHeight;
  5772. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  5773. };
  5774. b.getPixel32 = function(a, b) {
  5775. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  5776. };
  5777. b.dispose = function() {
  5778. var a = this._bitmapData;
  5779. a.dispose && a.dispose()
  5780. };
  5781. b._clone = function() {
  5782. var a = new d;
  5783. a._bitmapData = this._bitmapData;
  5784. return a
  5785. };
  5786. b.draw = function(a, b, c, d, e, g, h, k, l, m) {};
  5787. b._drawForCanvas = function(a, b, c, d, e, g, h, k, l, m) {
  5788. var p = this._bitmapData;
  5789. p && p.avaliable && (void 0 != m ? this._drawRepeatImageForCanvas(a, b, c, d, e, g, h, k, l, m) : a.drawImage(p, b, c, d, e, g, h, k, l))
  5790. };
  5791. b._drawForNative = function(a, b, c, d, e, g, h, k, l, m) {
  5792. var p = this._bitmapData;
  5793. p && p.avaliable && (void 0 !== m ? this._drawRepeatImageForNative(a, b, c, d, e, g, h, k, l, m) : a.drawImage(p, b, c, d, e, g, h, k, l))
  5794. };
  5795. b._drawRepeatImageForNative = function(a, b, d, e, g, n, h, k, l, m) {
  5796. m = c.MainContext.instance.rendererContext._texture_scale_factor;
  5797. e *= m;
  5798. for (g *= m; n < k; n += e) for (var p = h; p < l; p += g) {
  5799. var r = Math.min(e, k - n),
  5800. q = Math.min(g, l - p);
  5801. this._drawForNative(a, b, d, r / m, q / m, n, p, r, q, void 0)
  5802. }
  5803. };
  5804. b._drawRepeatImageForCanvas = function(a, b, d, e, g, n, h, k, l, m) {
  5805. if (void 0 === this.pattern) {
  5806. var p = c.MainContext.instance.rendererContext._texture_scale_factor,
  5807. r = this._bitmapData,
  5808. q = r;
  5809. if (r.width != e || r.height != g || 1 != p) q = document.createElement("canvas"),
  5810. q.width = e * p,
  5811. q.height = g * p,
  5812. q.getContext("2d").drawImage(r, b, d, e, g, 0, 0, e * p, g * p);
  5813. this.pattern = a.createPattern(q, m)
  5814. }
  5815. a.fillStyle = this.pattern;
  5816. a.translate(n, h);
  5817. a.fillRect(0, 0, k, l);
  5818. a.translate( - n, -h)
  5819. };
  5820. b._disposeForCanvas = function() {
  5821. d.deleteWebGLTexture(this);
  5822. var a = this._bitmapData;
  5823. a.onload = null;
  5824. a.onerror = null;
  5825. a.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAATSURBVHjaYvj//z8DAAAA//8DAAj8Av7TpXVhAAAAAElFTkSuQmCC";
  5826. a.avaliable = !1;
  5827. console.log("_disposeForCanvas")
  5828. };
  5829. b._disposeForNative = function() {
  5830. var a = this._bitmapData;
  5831. a.dispose();
  5832. a.avaliable = !1;
  5833. console.log("_disposeForNative")
  5834. };
  5835. d.deleteWebGLTexture = function(a) {
  5836. if (a = a._bitmapData) {
  5837. var b = a.webGLTexture;
  5838. if (b) for (var c in b) {
  5839. var d = b[c];
  5840. d.glContext.deleteTexture(d)
  5841. }
  5842. a.webGLTexture = null
  5843. }
  5844. };
  5845. d.createBitmapData = function(a, b) {};
  5846. d._createBitmapDataForCanvasAndWebGl = function(a, b) {
  5847. var e = d._bitmapDataFactory[a];
  5848. e || (e = document.createElement("img"), e.setAttribute("bitmapSrc", a), d._bitmapDataFactory[a] = e);
  5849. if (e.avaliable) b(0, e);
  5850. else {
  5851. e.crossOrigin = d.crossOrigin;
  5852. var g = window.URL || window.webkitURL;
  5853. if (null == d._bitmapCallbackMap[a]) if (d._addToCallbackList(a, b), 0 != a.indexOf("data:") && 0 != a.indexOf("http:") && 0 != a.indexOf("https:") && c.Browser.getInstance().isIOS() && 7 <= parseInt(c.Browser.getInstance().getIOSVersion().charAt(0)) && g) {
  5854. var s = new XMLHttpRequest;
  5855. s.open("get", a, !0);
  5856. s.responseType = "blob";
  5857. s.onload = function() {
  5858. if (200 == this.status) {
  5859. var c = this.response;
  5860. e.onload = function() {
  5861. g.revokeObjectURL(e.src);
  5862. d._onLoad(a, e)
  5863. };
  5864. e.onerror = function() {
  5865. d._onError(a, e)
  5866. };
  5867. e.src = g.createObjectURL(c)
  5868. } else b(1, null)
  5869. };
  5870. s.send()
  5871. } else e.onload = function() {
  5872. d._onLoad(a, e)
  5873. },
  5874. e.onerror = function() {
  5875. d._onError(a, e)
  5876. },
  5877. e.src = a;
  5878. else d._addToCallbackList(a, b)
  5879. }
  5880. };
  5881. d._onLoad = function(a, b) {
  5882. b.avaliable = !0;
  5883. b.onload && (b.onload = null);
  5884. b.onerror && (b.onerror = null);
  5885. var c = d._bitmapCallbackMap[a];
  5886. if (c && c.length) {
  5887. delete d._bitmapCallbackMap[a];
  5888. for (var e = c.length,
  5889. g = 0; g < e; g++)(0, c[g])(0, b)
  5890. }
  5891. };
  5892. d._onError = function(a, b) {
  5893. var c = d._bitmapCallbackMap[a];
  5894. if (c && c.length) {
  5895. delete d._bitmapCallbackMap[a];
  5896. for (var e = c.length,
  5897. g = 0; g < e; g++)(0, c[g])(1, b)
  5898. }
  5899. };
  5900. d._createBitmapDataForNative = function(a, b) {
  5901. console.log("_createBitmapDataForNative:" + a);
  5902. var e = d._bitmapDataFactory[a];
  5903. e ? (e.avaliable || (console.log("reload"), e.reload(), e.avaliable = !0), b(0, e)) : c.NativeNetContext.__use_asyn ? d._bitmapCallbackMap[a] ? d._addToCallbackList(a, b) : (d._addToCallbackList(a, b), e = new c.PromiseObject, e.onSuccessFunc = function(b) {
  5904. d._bitmapDataFactory[a] = b;
  5905. d._onLoad(a, b)
  5906. },
  5907. e.onErrorFunc = function() {
  5908. d._onError(a, null)
  5909. },
  5910. console.log("addTextureAsyn"), egret_native.Texture.addTextureAsyn(a, e)) : (console.log("addTexture"), e = egret_native.Texture.addTexture(a), d._bitmapDataFactory[a] = e, e.avaliable = !0, b(0, e))
  5911. };
  5912. d._addToCallbackList = function(a, b) {
  5913. var c = d._bitmapCallbackMap[a];
  5914. c || (c = []);
  5915. c.push(b);
  5916. d._bitmapCallbackMap[a] = c
  5917. };
  5918. d.crossOrigin = null;
  5919. d._bitmapDataFactory = {};
  5920. d._bitmapCallbackMap = {};
  5921. return d
  5922. } (c.HashObject);
  5923. c.Texture = g;
  5924. g.prototype.__class__ = "egret.Texture"
  5925. })(egret || (egret = {})); (function(c) {
  5926. var g = function(e) {
  5927. function d() {
  5928. e.call(this)
  5929. }
  5930. __extends(d, e);
  5931. var b = d.prototype;
  5932. b.init = function() {
  5933. this._bitmapData = document.createElement("canvas");
  5934. this._bitmapData.avaliable = !0;
  5935. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  5936. };
  5937. b.drawToTexture = function(a, b, e) {
  5938. var g = b || a.getBounds(c.Rectangle.identity);
  5939. if (0 == g.width || 0 == g.height) return ! 1;
  5940. this._bitmapData || this.init();
  5941. var s = g.x,
  5942. n = g.y,
  5943. h = g.width,
  5944. g = g.height,
  5945. k, l, m = c.MainContext.instance.rendererContext._texture_scale_factor;
  5946. k = h / m;
  5947. l = g / m;
  5948. k = Math.round(k);
  5949. l = Math.round(l);
  5950. this.setSize(k, l);
  5951. this.begin();
  5952. a._worldTransform.identity();
  5953. a._worldTransform.a = 1 / m;
  5954. a._worldTransform.d = 1 / m;
  5955. e && (a._worldTransform.a *= e, a._worldTransform.d *= e);
  5956. e = a._DO_Props_._anchorOffsetX;
  5957. m = a._DO_Props_._anchorOffsetY;
  5958. if (0 != a._DO_Props_._anchorX || 0 != a._DO_Props_._anchorY) e = a._DO_Props_._anchorX * k,
  5959. m = a._DO_Props_._anchorY * l;
  5960. this._offsetX = s + e;
  5961. this._offsetY = n + m;
  5962. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  5963. b && (this._offsetX -= s, this._offsetY -= n);
  5964. a.worldAlpha = 1;
  5965. if (a instanceof c.DisplayObjectContainer) for (b = a._children, s = 0, n = b.length; s < n; s++) b[s]._updateTransform();
  5966. this.renderContext.setTransform(a._worldTransform);
  5967. b = c.RenderFilter.getInstance();
  5968. s = b._drawAreaList.concat();
  5969. b._drawAreaList.length = 0;
  5970. this.renderContext.clearScreen();
  5971. this.renderContext.onRenderStart();
  5972. c.Texture.deleteWebGLTexture(this);
  5973. a._hasFilters() && a._setGlobalFilters(this.renderContext); (n = a.mask || a._DO_Props_._scrollRect) && this.renderContext.pushMask(n);
  5974. e = c.MainContext.__use_new_draw;
  5975. c.MainContext.__use_new_draw = !1;
  5976. a._render(this.renderContext);
  5977. c.MainContext.__use_new_draw = e;
  5978. n && this.renderContext.popMask();
  5979. a._hasFilters() && a._removeGlobalFilters(this.renderContext);
  5980. d.identityRectangle.width = k;
  5981. d.identityRectangle.height = l;
  5982. b.addDrawArea(d.identityRectangle);
  5983. this.renderContext.onRenderFinish();
  5984. b._drawAreaList = s;
  5985. this._sourceWidth = k;
  5986. this._sourceHeight = l;
  5987. this._textureWidth = Math.round(h);
  5988. this._textureHeight = Math.round(g);
  5989. this.end();
  5990. return ! 0
  5991. };
  5992. b.setSize = function(a, b) {
  5993. var c = this._bitmapData;
  5994. c.width = a;
  5995. c.height = b;
  5996. c.style.width = a + "px";
  5997. c.style.height = b + "px";
  5998. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
  5999. };
  6000. b.begin = function() {};
  6001. b.end = function() {};
  6002. b.dispose = function() {
  6003. this._bitmapData && (this.renderContext = this._bitmapData = null)
  6004. };
  6005. d.create = function() {
  6006. return d._pool.length ? d._pool.pop() : new d
  6007. };
  6008. d.release = function(a) {
  6009. d._pool.push(a)
  6010. };
  6011. d.identityRectangle = new c.Rectangle;
  6012. d._pool = [];
  6013. return d
  6014. } (c.Texture);
  6015. c.RenderTexture = g;
  6016. g.prototype.__class__ = "egret.RenderTexture"
  6017. })(egret || (egret = {})); (function(c) {
  6018. var g = function(e) {
  6019. function d() {
  6020. e.call(this);
  6021. this.renderCost = 0;
  6022. this._texture_scale_factor = 1;
  6023. this.profiler = c.Profiler.getInstance();
  6024. d.blendModesForGL || d.initBlendMode()
  6025. }
  6026. __extends(d, e);
  6027. var b = d.prototype;
  6028. Object.defineProperty(b, "texture_scale_factor", {
  6029. get: function() {
  6030. return this._texture_scale_factor
  6031. },
  6032. set: function(a) {
  6033. this._setTextureScaleFactor(a)
  6034. },
  6035. enumerable: !0,
  6036. configurable: !0
  6037. });
  6038. b._setTextureScaleFactor = function(a) {
  6039. this._texture_scale_factor = a
  6040. };
  6041. b.clearScreen = function() {};
  6042. b.clearRect = function(a, b, c, d) {};
  6043. b.drawImage = function(a, b, c, d, e, g, h, k, l, m) {
  6044. this.profiler.onDrawImage()
  6045. };
  6046. b.drawImageScale9 = function(a, b, c, d, e, g, h, k, l, m) {
  6047. return ! 1
  6048. };
  6049. b._addOneDraw = function() {
  6050. this.profiler.onDrawImage()
  6051. };
  6052. b.setTransform = function(a) {};
  6053. b.setAlpha = function(a, b) {};
  6054. b.setupFont = function(a, b) {};
  6055. b.measureText = function(a) {
  6056. return 0
  6057. };
  6058. b.drawText = function(a, b, c, d, e, g) {
  6059. this.profiler.onDrawImage()
  6060. };
  6061. b.strokeRect = function(a, b, c, d, e) {};
  6062. b.pushMask = function(a) {};
  6063. b.popMask = function() {};
  6064. b.onRenderStart = function() {};
  6065. b.onRenderFinish = function() {};
  6066. b.setGlobalFilters = function(a) {};
  6067. b.drawCursor = function(a, b, c, d) {};
  6068. d.createRendererContext = function(a) {
  6069. return null
  6070. };
  6071. d.initBlendMode = function() {
  6072. d.blendModesForGL = {};
  6073. d.blendModesForGL[c.BlendMode.NORMAL] = [1, 771];
  6074. d.blendModesForGL[c.BlendMode.ADD] = [770, 1];
  6075. d.blendModesForGL[c.BlendMode.ERASE] = [0, 771];
  6076. d.blendModesForGL[c.BlendMode.ERASE_REVERSE] = [0, 770]
  6077. };
  6078. d.registerBlendModeForGL = function(a, b, e, g) {
  6079. d.blendModesForGL[a] && !g ? c.Logger.warningWithErrorId(1005, a) : d.blendModesForGL[a] = [b, e]
  6080. };
  6081. d.imageSmoothingEnabled = !0;
  6082. d.blendModesForGL = null;
  6083. return d
  6084. } (c.HashObject);
  6085. c.RendererContext = g;
  6086. g.prototype.__class__ = "egret.RendererContext"
  6087. })(egret || (egret = {})); (function(c) {
  6088. var g = function() {
  6089. function c() {}
  6090. c.MOUSE = "mouse";
  6091. c.TOUCH = "touch";
  6092. c.mode = "touch";
  6093. return c
  6094. } ();
  6095. c.InteractionMode = g;
  6096. g.prototype.__class__ = "egret.InteractionMode"
  6097. })(egret || (egret = {})); (function(c) {
  6098. var g = function(e) {
  6099. function d() {
  6100. e.call(this);
  6101. this._currentTouchTarget = {};
  6102. this.maxTouches = 2;
  6103. this.touchDownTarget = {};
  6104. this.touchingIdentifiers = [];
  6105. this.lastTouchY = this.lastTouchX = -1
  6106. }
  6107. __extends(d, e);
  6108. var b = d.prototype;
  6109. b.run = function() {};
  6110. b.getTouchData = function(a, b, c) {
  6111. var d = this._currentTouchTarget[a];
  6112. null == d && (d = {},
  6113. this._currentTouchTarget[a] = d);
  6114. d.stageX = b;
  6115. d.stageY = c;
  6116. d.identifier = a;
  6117. return d
  6118. };
  6119. b.dispatchEvent = function(a, b) {
  6120. c.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX, b.stageY, !1, !1, !1, !0 == this.touchDownTarget[b.identifier])
  6121. };
  6122. b.onTouchBegan = function(a, b, d) {
  6123. if (this.touchingIdentifiers.length != this.maxTouches) {
  6124. this.lastTouchX = a;
  6125. this.lastTouchY = b;
  6126. var e = c.MainContext.instance.stage.hitTest(a, b);
  6127. e && (a = this.getTouchData(d, a, b), this.touchDownTarget[d] = !0, a.target = e, a.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
  6128. this.touchingIdentifiers.push(d)
  6129. }
  6130. };
  6131. b.onTouchMove = function(a, b, d) {
  6132. if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || b != this.lastTouchY)) {
  6133. this.lastTouchX = a;
  6134. this.lastTouchY = b;
  6135. var e = c.MainContext.instance.stage.hitTest(a, b);
  6136. e && (a = this.getTouchData(d, a, b), a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
  6137. }
  6138. };
  6139. b.onTouchEnd = function(a, b, d) {
  6140. var e = this.touchingIdentifiers.indexOf(d); - 1 != e && (this.touchingIdentifiers.splice(e, 1), e = c.MainContext.instance.stage.hitTest(a, b)) && (a = this.getTouchData(d, a, b), delete this.touchDownTarget[d], d = a.beginTarget, a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), d == e ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  6141. };
  6142. return d
  6143. } (c.HashObject);
  6144. c.TouchContext = g;
  6145. g.prototype.__class__ = "egret.TouchContext"
  6146. })(egret || (egret = {})); (function(c) {
  6147. var g = function(e) {
  6148. function d() {
  6149. e.call(this)
  6150. }
  6151. __extends(d, e);
  6152. var b = d.prototype;
  6153. b.proceed = function(a) {};
  6154. d._getUrl = function(a) {
  6155. var b = a.url; - 1 == b.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (b = b + "?" + a.data.toString());
  6156. return b
  6157. };
  6158. b.getChangeList = function() {
  6159. return []
  6160. };
  6161. return d
  6162. } (c.HashObject);
  6163. c.NetContext = g;
  6164. g.prototype.__class__ = "egret.NetContext"
  6165. })(egret || (egret = {})); (function(c) {
  6166. var g = function(c) {
  6167. function d() {
  6168. c.call(this);
  6169. this.frameRate = 60
  6170. }
  6171. __extends(d, c);
  6172. d.prototype.executeMainLoop = function(b, a) {};
  6173. return d
  6174. } (c.HashObject);
  6175. c.DeviceContext = g;
  6176. g.prototype.__class__ = "egret.DeviceContext"
  6177. })(egret || (egret = {})); (function(c) {
  6178. var g = function() {
  6179. function c() {}
  6180. c.call = function(c, b) {};
  6181. c.addCallback = function(c, b) {};
  6182. return c
  6183. } ();
  6184. c.ExternalInterface = g;
  6185. g.prototype.__class__ = "egret.ExternalInterface"
  6186. })(egret || (egret = {})); (function(c) {
  6187. var g = function(e) {
  6188. function d() {
  6189. e.call(this);
  6190. this.header = this.trans = null;
  6191. this.ua = navigator.userAgent.toLowerCase();
  6192. this.trans = this.getTrans("transform")
  6193. }
  6194. __extends(d, e);
  6195. var b = d.prototype;
  6196. d.getInstance = function() {
  6197. null == d.instance && (d.instance = new d);
  6198. return d.instance
  6199. };
  6200. Object.defineProperty(b, "isMobile", {
  6201. get: function() {
  6202. c.Logger.warningWithErrorId(1E3);
  6203. return c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE
  6204. },
  6205. enumerable: !0,
  6206. configurable: !0
  6207. });
  6208. b.isIOS = function() {
  6209. return 0 > this.ua.indexOf("windows") && (0 <= this.ua.indexOf("iphone") || 0 <= this.ua.indexOf("ipad") || 0 <= this.ua.indexOf("ipod"))
  6210. };
  6211. b.getIOSVersion = function() {
  6212. return this.ua.toLowerCase().match(/cpu [^\d]*\d.*like mac os x/)[0].match(/\d(_\d)*/)[0]
  6213. };
  6214. b.getUserAgent = function() {
  6215. return this.ua
  6216. };
  6217. b.getTrans = function(a, b) {
  6218. void 0 === b && (b = !1);
  6219. var c = "";
  6220. b ? c = this.getHeader(a) : (null == this.header && (this.header = this.getHeader("transform")), c = this.header);
  6221. return "" == c ? a: c + a.charAt(0).toUpperCase() + a.substring(1, a.length)
  6222. };
  6223. b.getHeader = function(a) {
  6224. var b = document.createElement("div").style;
  6225. if (a in b) return "";
  6226. a = a.charAt(0).toUpperCase() + a.substring(1, a.length);
  6227. for (var c = ["webkit", "ms", "Moz", "O"], d = 0; d < c.length; d++) if (c[d] + a in b) return c[d];
  6228. return ""
  6229. };
  6230. b.$new = function(a) {
  6231. return this.$(document.createElement(a))
  6232. };
  6233. b.$ = function(a) {
  6234. var b = document;
  6235. if (a = a instanceof HTMLElement ? a: b.querySelector(a)) a.find = a.find || this.$,
  6236. a.hasClass = a.hasClass ||
  6237. function(a) {
  6238. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  6239. },
  6240. a.addClass = a.addClass ||
  6241. function(a) {
  6242. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  6243. return this
  6244. },
  6245. a.removeClass = a.removeClass ||
  6246. function(a) {
  6247. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  6248. return this
  6249. },
  6250. a.remove = a.remove ||
  6251. function() {},
  6252. a.appendTo = a.appendTo ||
  6253. function(a) {
  6254. a.appendChild(this);
  6255. return this
  6256. },
  6257. a.prependTo = a.prependTo ||
  6258. function(a) {
  6259. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  6260. return this
  6261. },
  6262. a.transforms = a.transforms ||
  6263. function() {
  6264. this.style[d.getInstance().trans] = d.getInstance().translate(this.position) + d.getInstance().rotate(this.rotation) + d.getInstance().scale(this.scale) + d.getInstance().skew(this.skew);
  6265. return this
  6266. },
  6267. a.position = a.position || {
  6268. x: 0,
  6269. y: 0
  6270. },
  6271. a.rotation = a.rotation || 0,
  6272. a.scale = a.scale || {
  6273. x: 1,
  6274. y: 1
  6275. },
  6276. a.skew = a.skew || {
  6277. x: 0,
  6278. y: 0
  6279. },
  6280. a.translates = function(a, b) {
  6281. this.position.x = a;
  6282. this.position.y = b - c.MainContext.instance.stage.stageHeight;
  6283. this.transforms();
  6284. return this
  6285. },
  6286. a.rotate = function(a) {
  6287. this.rotation = a;
  6288. this.transforms();
  6289. return this
  6290. },
  6291. a.resize = function(a, b) {
  6292. this.scale.x = a;
  6293. this.scale.y = b;
  6294. this.transforms();
  6295. return this
  6296. },
  6297. a.setSkew = function(a, b) {
  6298. this.skew.x = a;
  6299. this.skew.y = b;
  6300. this.transforms();
  6301. return this
  6302. };
  6303. return a
  6304. };
  6305. b.translate = function(a) {
  6306. return "translate(" + a.x + "px, " + a.y + "px) "
  6307. };
  6308. b.rotate = function(a) {
  6309. return "rotate(" + a + "deg) "
  6310. };
  6311. b.scale = function(a) {
  6312. return "scale(" + a.x + ", " + a.y + ") "
  6313. };
  6314. b.skew = function(a) {
  6315. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  6316. };
  6317. return d
  6318. } (c.HashObject);
  6319. c.Browser = g;
  6320. g.prototype.__class__ = "egret.Browser"
  6321. })(egret || (egret = {})); (function(c) { (function(c) {
  6322. c.getItem = function(c) {
  6323. return null
  6324. };
  6325. c.setItem = function(c, d) {
  6326. return ! 1
  6327. };
  6328. c.removeItem = function(c) {};
  6329. c.clear = function() {}
  6330. })(c.localStorage || (c.localStorage = {}))
  6331. })(egret || (egret = {})); (function(c) {
  6332. var g = function() {
  6333. function e() {}
  6334. e.parse = function(d) {
  6335. d = c.SAXParser.getInstance().parserXML(d);
  6336. if (!d || !d.childNodes) return null;
  6337. for (var b = d.childNodes.length,
  6338. a = !1,
  6339. f = 0; f < b; f++) {
  6340. var g = d.childNodes[f];
  6341. if (1 == g.nodeType) {
  6342. a = !0;
  6343. break
  6344. }
  6345. }
  6346. return a ? e.parseNode(g) : null
  6347. };
  6348. e.parseNode = function(c) {
  6349. if (!c || 1 != c.nodeType) return null;
  6350. var b = {};
  6351. b.localName = c.localName;
  6352. b.name = c.nodeName;
  6353. c.namespaceURI && (b.namespace = c.namespaceURI);
  6354. c.prefix && (b.prefix = c.prefix);
  6355. for (var a = c.attributes,
  6356. f = a.length,
  6357. g = 0; g < f; g++) {
  6358. var t = a[g],
  6359. s = t.name;
  6360. 0 != s.indexOf("xmlns:") && (b["$" + s] = t.value)
  6361. }
  6362. a = c.childNodes;
  6363. f = a.length;
  6364. for (g = 0; g < f; g++) if (t = e.parseNode(a[g])) b.children || (b.children = []),
  6365. t.parent = b,
  6366. b.children.push(t); ! b.children && (c = c.textContent.trim()) && (b.text = c);
  6367. return b
  6368. };
  6369. e.findChildren = function(c, b, a) {
  6370. a ? a.length = 0 : a = [];
  6371. e.findByPath(c, b, a);
  6372. return a
  6373. };
  6374. e.findByPath = function(c, b, a) {
  6375. var f = b.indexOf("."),
  6376. g; - 1 == f ? (g = b, f = !0) : (g = b.substring(0, f), b = b.substring(f + 1), f = !1);
  6377. if (c = c.children) for (var t = c.length,
  6378. s = 0; s < t; s++) {
  6379. var n = c[s];
  6380. n.localName == g && (f ? a.push(n) : e.findByPath(n, b, a))
  6381. }
  6382. };
  6383. e.getAttributes = function(c, b) {
  6384. b ? b.length = 0 : b = [];
  6385. for (var a in c)"$" == a.charAt(0) && b.push(a.substring(1));
  6386. return b
  6387. };
  6388. return e
  6389. } ();
  6390. c.XML = g;
  6391. g.prototype.__class__ = "egret.XML"
  6392. })(egret || (egret = {})); (function(c) {
  6393. var g = function() {
  6394. function c() {}
  6395. c.LITTLE_ENDIAN = "littleEndian";
  6396. c.BIG_ENDIAN = "bigEndian";
  6397. return c
  6398. } ();
  6399. c.Endian = g;
  6400. g.prototype.__class__ = "egret.Endian";
  6401. var e = function() {
  6402. function d(a) {
  6403. this.BUFFER_EXT_SIZE = 0;
  6404. this.EOF_code_point = this.EOF_byte = -1;
  6405. this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
  6406. this.endian = g.BIG_ENDIAN
  6407. }
  6408. var b = d.prototype;
  6409. b._setArrayBuffer = function(a) {
  6410. this.write_position = a.byteLength;
  6411. this.data = new DataView(a);
  6412. this._position = 0
  6413. };
  6414. b.setArrayBuffer = function(a) {};
  6415. Object.defineProperty(b, "buffer", {
  6416. get: function() {
  6417. return this.data.buffer
  6418. },
  6419. set: function(a) {
  6420. this.data = new DataView(a)
  6421. },
  6422. enumerable: !0,
  6423. configurable: !0
  6424. });
  6425. Object.defineProperty(b, "dataView", {
  6426. get: function() {
  6427. return this.data
  6428. },
  6429. set: function(a) {
  6430. this.data = a;
  6431. this.write_position = a.byteLength
  6432. },
  6433. enumerable: !0,
  6434. configurable: !0
  6435. });
  6436. Object.defineProperty(b, "bufferOffset", {
  6437. get: function() {
  6438. return this.data.byteOffset
  6439. },
  6440. enumerable: !0,
  6441. configurable: !0
  6442. });
  6443. Object.defineProperty(b, "position", {
  6444. get: function() {
  6445. return this._position
  6446. },
  6447. set: function(a) {
  6448. this._position < a && !this.validate(a - this._position) || (this._position = a, this.write_position = a > this.write_position ? a: this.write_position)
  6449. },
  6450. enumerable: !0,
  6451. configurable: !0
  6452. });
  6453. Object.defineProperty(b, "length", {
  6454. get: function() {
  6455. return this.write_position
  6456. },
  6457. set: function(a) {
  6458. this.validateBuffer(a, !0)
  6459. },
  6460. enumerable: !0,
  6461. configurable: !0
  6462. });
  6463. Object.defineProperty(b, "bytesAvailable", {
  6464. get: function() {
  6465. return this.data.byteLength - this._position
  6466. },
  6467. enumerable: !0,
  6468. configurable: !0
  6469. });
  6470. b.clear = function() {
  6471. this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
  6472. };
  6473. b.readBoolean = function() {
  6474. return this.validate(d.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
  6475. };
  6476. b.readByte = function() {
  6477. return this.validate(d.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
  6478. };
  6479. b.readBytes = function(a, b, c) {
  6480. void 0 === b && (b = 0);
  6481. void 0 === c && (c = 0);
  6482. if (0 == c) c = this.bytesAvailable;
  6483. else if (!this.validate(c)) return null;
  6484. a ? a.validateBuffer(c) : a = new d(new ArrayBuffer(c));
  6485. for (var e = 0; e < c; e++) a.data.setUint8(e + b, this.data.getUint8(this.position++))
  6486. };
  6487. b.readDouble = function() {
  6488. if (!this.validate(d.SIZE_OF_FLOAT64)) return null;
  6489. var a = this.data.getFloat64(this.position, this.endian == g.LITTLE_ENDIAN);
  6490. this.position += d.SIZE_OF_FLOAT64;
  6491. return a
  6492. };
  6493. b.readFloat = function() {
  6494. if (!this.validate(d.SIZE_OF_FLOAT32)) return null;
  6495. var a = this.data.getFloat32(this.position, this.endian == g.LITTLE_ENDIAN);
  6496. this.position += d.SIZE_OF_FLOAT32;
  6497. return a
  6498. };
  6499. b.readInt = function() {
  6500. if (!this.validate(d.SIZE_OF_INT32)) return null;
  6501. var a = this.data.getInt32(this.position, this.endian == g.LITTLE_ENDIAN);
  6502. this.position += d.SIZE_OF_INT32;
  6503. return a
  6504. };
  6505. b.readShort = function() {
  6506. if (!this.validate(d.SIZE_OF_INT16)) return null;
  6507. var a = this.data.getInt16(this.position, this.endian == g.LITTLE_ENDIAN);
  6508. this.position += d.SIZE_OF_INT16;
  6509. return a
  6510. };
  6511. b.readUnsignedByte = function() {
  6512. return this.validate(d.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
  6513. };
  6514. b.readUnsignedInt = function() {
  6515. if (!this.validate(d.SIZE_OF_UINT32)) return null;
  6516. var a = this.data.getUint32(this.position, this.endian == g.LITTLE_ENDIAN);
  6517. this.position += d.SIZE_OF_UINT32;
  6518. return a
  6519. };
  6520. b.readUnsignedShort = function() {
  6521. if (!this.validate(d.SIZE_OF_UINT16)) return null;
  6522. var a = this.data.getUint16(this.position, this.endian == g.LITTLE_ENDIAN);
  6523. this.position += d.SIZE_OF_UINT16;
  6524. return a
  6525. };
  6526. b.readUTF = function() {
  6527. if (!this.validate(d.SIZE_OF_UINT16)) return null;
  6528. var a = this.data.getUint16(this.position, this.endian == g.LITTLE_ENDIAN);
  6529. this.position += d.SIZE_OF_UINT16;
  6530. return 0 < a ? this.readUTFBytes(a) : ""
  6531. };
  6532. b.readUTFBytes = function(a) {
  6533. if (!this.validate(a)) return null;
  6534. var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
  6535. this.position += a;
  6536. return this.decodeUTF8(b)
  6537. };
  6538. b.writeBoolean = function(a) {
  6539. this.validateBuffer(d.SIZE_OF_BOOLEAN);
  6540. this.data.setUint8(this.position++, a ? 1 : 0)
  6541. };
  6542. b.writeByte = function(a) {
  6543. this.validateBuffer(d.SIZE_OF_INT8);
  6544. this.data.setInt8(this.position++, a)
  6545. };
  6546. b.writeBytes = function(a, b, c) {
  6547. void 0 === b && (b = 0);
  6548. void 0 === c && (c = 0);
  6549. if (! (0 > b || 0 > c) && (c = 0 == c ? a.length - b: Math.min(a.length - b, c), 0 < c)) {
  6550. this.validateBuffer(c);
  6551. a = new DataView(a.buffer);
  6552. for (var d = b; d < c + b; d++) this.data.setUint8(this.position++, a.getUint8(d))
  6553. }
  6554. };
  6555. b.writeDouble = function(a) {
  6556. this.validateBuffer(d.SIZE_OF_FLOAT64);
  6557. this.data.setFloat64(this.position, a, this.endian == g.LITTLE_ENDIAN);
  6558. this.position += d.SIZE_OF_FLOAT64
  6559. };
  6560. b.writeFloat = function(a) {
  6561. this.validateBuffer(d.SIZE_OF_FLOAT32);
  6562. this.data.setFloat32(this.position, a, this.endian == g.LITTLE_ENDIAN);
  6563. this.position += d.SIZE_OF_FLOAT32
  6564. };
  6565. b.writeInt = function(a) {
  6566. this.validateBuffer(d.SIZE_OF_INT32);
  6567. this.data.setInt32(this.position, a, this.endian == g.LITTLE_ENDIAN);
  6568. this.position += d.SIZE_OF_INT32
  6569. };
  6570. b.writeShort = function(a) {
  6571. this.validateBuffer(d.SIZE_OF_INT16);
  6572. this.data.setInt16(this.position, a, this.endian == g.LITTLE_ENDIAN);
  6573. this.position += d.SIZE_OF_INT16
  6574. };
  6575. b.writeUnsignedInt = function(a) {
  6576. this.validateBuffer(d.SIZE_OF_UINT32);
  6577. this.data.setUint32(this.position, a, this.endian == g.LITTLE_ENDIAN);
  6578. this.position += d.SIZE_OF_UINT32
  6579. };
  6580. b.writeUTF = function(a) {
  6581. a = this.encodeUTF8(a);
  6582. var b = a.length;
  6583. this.validateBuffer(d.SIZE_OF_UINT16 + b);
  6584. this.data.setUint16(this.position, b, this.endian === g.LITTLE_ENDIAN);
  6585. this.position += d.SIZE_OF_UINT16;
  6586. this._writeUint8Array(a, !1)
  6587. };
  6588. b.writeUTFBytes = function(a) {
  6589. this._writeUint8Array(this.encodeUTF8(a))
  6590. };
  6591. b.toString = function() {
  6592. return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
  6593. };
  6594. b._writeUint8Array = function(a, b) {
  6595. void 0 === b && (b = !0);
  6596. b && this.validateBuffer(this.position + a.length);
  6597. for (var c = 0; c < a.length; c++) this.data.setUint8(this.position++, a[c])
  6598. };
  6599. b.validate = function(a) {
  6600. if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return ! 0;
  6601. throw c.getString(1025);
  6602. };
  6603. b.validateBuffer = function(a, b) {
  6604. void 0 === b && (b = !1);
  6605. this.write_position = a > this.write_position ? a: this.write_position;
  6606. a += this._position;
  6607. if (this.data.byteLength < a || b) {
  6608. var c = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)),
  6609. d = Math.min(this.data.buffer.byteLength, a + this.BUFFER_EXT_SIZE);
  6610. c.set(new Uint8Array(this.data.buffer, 0, d));
  6611. this.buffer = c.buffer
  6612. }
  6613. };
  6614. b.encodeUTF8 = function(a) {
  6615. var b = 0;
  6616. a = this.stringToCodePoints(a);
  6617. for (var c = []; a.length > b;) {
  6618. var d = a[b++];
  6619. if (this.inRange(d, 55296, 57343)) this.encoderError(d);
  6620. else if (this.inRange(d, 0, 127)) c.push(d);
  6621. else {
  6622. var e, g;
  6623. this.inRange(d, 128, 2047) ? (e = 1, g = 192) : this.inRange(d, 2048, 65535) ? (e = 2, g = 224) : this.inRange(d, 65536, 1114111) && (e = 3, g = 240);
  6624. for (c.push(this.div(d, Math.pow(64, e)) + g); 0 < e;) {
  6625. var h = this.div(d, Math.pow(64, e - 1));
  6626. c.push(128 + h % 64);
  6627. e -= 1
  6628. }
  6629. }
  6630. }
  6631. return new Uint8Array(c)
  6632. };
  6633. b.decodeUTF8 = function(a) {
  6634. for (var b = 0,
  6635. c = "",
  6636. d, e = 0,
  6637. g = 0,
  6638. h = 0,
  6639. k = 0; a.length > b;) {
  6640. d = a[b++];
  6641. if (d === this.EOF_byte) d = 0 !== g ? this.decoderError(!1) : this.EOF_code_point;
  6642. else if (0 === g) this.inRange(d, 0, 127) || (this.inRange(d, 194, 223) ? (g = 1, k = 128, e = d - 192) : this.inRange(d, 224, 239) ? (g = 2, k = 2048, e = d - 224) : this.inRange(d, 240, 244) ? (g = 3, k = 65536, e = d - 240) : this.decoderError(!1), e *= Math.pow(64, g), d = null);
  6643. else if (this.inRange(d, 128, 191)) if (h += 1, e += (d - 128) * Math.pow(64, g - h), h !== g) d = null;
  6644. else {
  6645. var l = e,
  6646. m = k,
  6647. k = h = g = e = 0;
  6648. d = this.inRange(l, m, 1114111) && !this.inRange(l, 55296, 57343) ? l: this.decoderError(!1, d)
  6649. } else k = h = g = e = 0,
  6650. b--,
  6651. d = this.decoderError(!1, d);
  6652. null !== d && d !== this.EOF_code_point && (65535 >= d ? 0 < d && (c += String.fromCharCode(d)) : (d -= 65536, c += String.fromCharCode(55296 + (d >> 10 & 1023)), c += String.fromCharCode(56320 + (d & 1023))))
  6653. }
  6654. return c
  6655. };
  6656. b.encoderError = function(a) {
  6657. throw c.getString(1026, a);
  6658. };
  6659. b.decoderError = function(a, b) {
  6660. if (a) throw c.getString(1027);
  6661. return b || 65533
  6662. };
  6663. b.inRange = function(a, b, c) {
  6664. return b <= a && a <= c
  6665. };
  6666. b.div = function(a, b) {
  6667. return Math.floor(a / b)
  6668. };
  6669. b.stringToCodePoints = function(a) {
  6670. for (var b = [], c = 0, d = a.length; c < a.length;) {
  6671. var e = a.charCodeAt(c);
  6672. if (this.inRange(e, 55296, 57343)) if (this.inRange(e, 56320, 57343)) b.push(65533);
  6673. else if (c === d - 1) b.push(65533);
  6674. else {
  6675. var g = a.charCodeAt(c + 1);
  6676. this.inRange(g, 56320, 57343) ? (e &= 1023, g &= 1023, c += 1, b.push(65536 + (e << 10) + g)) : b.push(65533)
  6677. } else b.push(e);
  6678. c += 1
  6679. }
  6680. return b
  6681. };
  6682. d.SIZE_OF_BOOLEAN = 1;
  6683. d.SIZE_OF_INT8 = 1;
  6684. d.SIZE_OF_INT16 = 2;
  6685. d.SIZE_OF_INT32 = 4;
  6686. d.SIZE_OF_UINT8 = 1;
  6687. d.SIZE_OF_UINT16 = 2;
  6688. d.SIZE_OF_UINT32 = 4;
  6689. d.SIZE_OF_FLOAT32 = 4;
  6690. d.SIZE_OF_FLOAT64 = 8;
  6691. return d
  6692. } ();
  6693. c.ByteArray = e;
  6694. e.prototype.__class__ = "egret.ByteArray"
  6695. })(egret || (egret = {})); (function(c) {
  6696. c.getOption = function(c) {
  6697. if (window.hasOwnProperty("location")) {
  6698. var e = location.search;
  6699. if ("" == e) return "";
  6700. for (var e = e.slice(1), e = e.split("&"), d = e.length, b = 0; b < d; b++) {
  6701. var a = e[b].split("=");
  6702. if (a[0] == c) return a[1]
  6703. }
  6704. }
  6705. return ""
  6706. }
  6707. })(egret || (egret = {})); (function(c) {
  6708. var g = function(e) {
  6709. function d(a, b, c) {
  6710. e.call(this);
  6711. this._target = null;
  6712. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  6713. this._actions = this._steps = this.pluginData = null;
  6714. this.paused = !1;
  6715. this.duration = 0;
  6716. this._prevPos = -1;
  6717. this.position = null;
  6718. this._stepPosition = this._prevPosition = 0;
  6719. this.passive = !1;
  6720. this.initialize(a, b, c)
  6721. }
  6722. __extends(d, e);
  6723. var b = d.prototype;
  6724. d.get = function(a, b, c, e) {
  6725. void 0 === b && (b = null);
  6726. void 0 === c && (c = null);
  6727. void 0 === e && (e = !1);
  6728. e && d.removeTweens(a);
  6729. return new d(a, b, c)
  6730. };
  6731. d.removeTweens = function(a) {
  6732. if (a.tween_count) {
  6733. for (var b = d._tweens,
  6734. c = b.length - 1; 0 <= c; c--) b[c]._target == a && (b[c].paused = !0, b.splice(c, 1));
  6735. a.tween_count = 0
  6736. }
  6737. };
  6738. d.pauseTweens = function(a) {
  6739. if (a.tween_count) for (var b = c.Tween._tweens,
  6740. d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !0)
  6741. };
  6742. d.resumeTweens = function(a) {
  6743. if (a.tween_count) for (var b = c.Tween._tweens,
  6744. d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !1)
  6745. };
  6746. d.tick = function(a, b) {
  6747. void 0 === b && (b = !1);
  6748. for (var c = d._tweens.concat(), e = c.length - 1; 0 <= e; e--) {
  6749. var g = c[e];
  6750. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : a)
  6751. }
  6752. };
  6753. d._register = function(a, b) {
  6754. var e = a._target,
  6755. g = d._tweens;
  6756. if (b) e && (e.tween_count = 0 < e.tween_count ? e.tween_count + 1 : 1),
  6757. g.push(a),
  6758. d._inited || (c.Ticker.getInstance().register(d.tick, null), d._inited = !0);
  6759. else for (e && e.tween_count--, e = g.length; e--;) if (g[e] == a) {
  6760. g.splice(e, 1);
  6761. break
  6762. }
  6763. };
  6764. d.removeAllTweens = function() {
  6765. for (var a = d._tweens,
  6766. b = 0,
  6767. c = a.length; b < c; b++) {
  6768. var e = a[b];
  6769. e.paused = !0;
  6770. e._target.tweenjs_count = 0
  6771. }
  6772. a.length = 0
  6773. };
  6774. b.initialize = function(a, b, c) {
  6775. this._target = a;
  6776. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && d.removeTweens(a));
  6777. this.pluginData = c || {};
  6778. this._curQueueProps = {};
  6779. this._initQueueProps = {};
  6780. this._steps = [];
  6781. this._actions = [];
  6782. b && b.paused ? this.paused = !0 : d._register(this, !0);
  6783. b && null != b.position && this.setPosition(b.position, d.NONE)
  6784. };
  6785. b.setPosition = function(a, b) {
  6786. void 0 === b && (b = 1);
  6787. 0 > a && (a = 0);
  6788. var c = a,
  6789. d = !1;
  6790. c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
  6791. if (c == this._prevPos) return d;
  6792. var e = this._prevPos;
  6793. this.position = this._prevPos = c;
  6794. this._prevPosition = a;
  6795. if (this._target) if (d) this._updateTargetProps(null, 1);
  6796. else if (0 < this._steps.length) {
  6797. for (var g = 0,
  6798. h = this._steps.length; g < h && !(this._steps[g].t > c); g++);
  6799. g = this._steps[g - 1];
  6800. this._updateTargetProps(g, (this._stepPosition = c - g.t) / g.d)
  6801. }
  6802. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
  6803. d && this.setPaused(!0);
  6804. this.dispatchEventWith("change");
  6805. return d
  6806. };
  6807. b._runActions = function(a, b, c) {
  6808. void 0 === c && (c = !1);
  6809. var d = a,
  6810. e = b,
  6811. g = -1,
  6812. h = this._actions.length,
  6813. k = 1;
  6814. a > b && (d = b, e = a, g = h, h = k = -1);
  6815. for (; (g += k) != h;) {
  6816. b = this._actions[g];
  6817. var l = b.t; (l == e || l > d && l < e || c && l == a) && b.f.apply(b.o, b.p)
  6818. }
  6819. };
  6820. b._updateTargetProps = function(a, b) {
  6821. var c, e, g, n;
  6822. if (a || 1 != b) {
  6823. if (this.passive = !!a.v) return;
  6824. a.e && (b = a.e(b, 0, 1, 1));
  6825. c = a.p0;
  6826. e = a.p1
  6827. } else this.passive = !1,
  6828. c = e = this._curQueueProps;
  6829. for (var h in this._initQueueProps) {
  6830. null == (g = c[h]) && (c[h] = g = this._initQueueProps[h]);
  6831. null == (n = e[h]) && (e[h] = n = g);
  6832. g = g == n || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? n: g: g + (n - g) * b;
  6833. var k = !1;
  6834. if (n = d._plugins[h]) for (var l = 0,
  6835. m = n.length; l < m; l++) {
  6836. var p = n[l].tween(this, h, g, c, e, b, !!a && c == e, !a);
  6837. p == d.IGNORE ? k = !0 : g = p
  6838. }
  6839. k || (this._target[h] = g)
  6840. }
  6841. };
  6842. b.setPaused = function(a) {
  6843. this.paused = a;
  6844. d._register(this, !a);
  6845. return this
  6846. };
  6847. b._cloneProps = function(a) {
  6848. var b = {},
  6849. c;
  6850. for (c in a) b[c] = a[c];
  6851. return b
  6852. };
  6853. b._addStep = function(a) {
  6854. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  6855. return this
  6856. };
  6857. b._appendQueueProps = function(a) {
  6858. var b, c, e, g, n, h;
  6859. for (h in a) if (void 0 === this._initQueueProps[h]) {
  6860. c = this._target[h];
  6861. if (b = d._plugins[h]) for (e = 0, g = b.length; e < g; e++) c = b[e].init(this, h, c);
  6862. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === c ? null: c
  6863. }
  6864. for (h in a) {
  6865. c = this._curQueueProps[h];
  6866. if (b = d._plugins[h]) for (n = n || {},
  6867. e = 0, g = b.length; e < g; e++) b[e].step && b[e].step(this, h, c, a[h], n);
  6868. this._curQueueProps[h] = a[h]
  6869. }
  6870. n && this._appendQueueProps(n);
  6871. return this._curQueueProps
  6872. };
  6873. b._addAction = function(a) {
  6874. a.t = this.duration;
  6875. this._actions.push(a);
  6876. return this
  6877. };
  6878. b._set = function(a, b) {
  6879. for (var c in a) b[c] = a[c]
  6880. };
  6881. b.wait = function(a, b) {
  6882. if (null == a || 0 >= a) return this;
  6883. var c = this._cloneProps(this._curQueueProps);
  6884. return this._addStep({
  6885. d: a,
  6886. p0: c,
  6887. p1: c,
  6888. v: b
  6889. })
  6890. };
  6891. b.to = function(a, b, c) {
  6892. void 0 === c && (c = void 0);
  6893. if (isNaN(b) || 0 > b) b = 0;
  6894. return this._addStep({
  6895. d: b || 0,
  6896. p0: this._cloneProps(this._curQueueProps),
  6897. e: c,
  6898. p1: this._cloneProps(this._appendQueueProps(a))
  6899. })
  6900. };
  6901. b.call = function(a, b, c) {
  6902. void 0 === b && (b = void 0);
  6903. void 0 === c && (c = void 0);
  6904. return this._addAction({
  6905. f: a,
  6906. p: c ? c: [],
  6907. o: b ? b: this._target
  6908. })
  6909. };
  6910. b.set = function(a, b) {
  6911. void 0 === b && (b = null);
  6912. return this._addAction({
  6913. f: this._set,
  6914. o: this,
  6915. p: [a, b ? b: this._target]
  6916. })
  6917. };
  6918. b.play = function(a) {
  6919. a || (a = this);
  6920. return this.call(a.setPaused, a, [!1])
  6921. };
  6922. b.pause = function(a) {
  6923. a || (a = this);
  6924. return this.call(a.setPaused, a, [!0])
  6925. };
  6926. b.tick = function(a) {
  6927. this.paused || this.setPosition(this._prevPosition + a)
  6928. };
  6929. d.NONE = 0;
  6930. d.LOOP = 1;
  6931. d.REVERSE = 2;
  6932. d._tweens = [];
  6933. d.IGNORE = {};
  6934. d._plugins = {};
  6935. d._inited = !1;
  6936. return d
  6937. } (c.EventDispatcher);
  6938. c.Tween = g;
  6939. g.prototype.__class__ = "egret.Tween"
  6940. })(egret || (egret = {})); (function(c) {
  6941. var g = function() {
  6942. function e() {
  6943. c.Logger.fatalWithErrorId(1014)
  6944. }
  6945. e.get = function(c) { - 1 > c && (c = -1);
  6946. 1 < c && (c = 1);
  6947. return function(b) {
  6948. return 0 == c ? b: 0 > c ? b * (b * -c + 1 + c) : b * ((2 - b) * c + (1 - c))
  6949. }
  6950. };
  6951. e.getPowIn = function(c) {
  6952. return function(b) {
  6953. return Math.pow(b, c)
  6954. }
  6955. };
  6956. e.getPowOut = function(c) {
  6957. return function(b) {
  6958. return 1 - Math.pow(1 - b, c)
  6959. }
  6960. };
  6961. e.getPowInOut = function(c) {
  6962. return function(b) {
  6963. return 1 > (b *= 2) ? 0.5 * Math.pow(b, c) : 1 - 0.5 * Math.abs(Math.pow(2 - b, c))
  6964. }
  6965. };
  6966. e.sineIn = function(c) {
  6967. return 1 - Math.cos(c * Math.PI / 2)
  6968. };
  6969. e.sineOut = function(c) {
  6970. return Math.sin(c * Math.PI / 2)
  6971. };
  6972. e.sineInOut = function(c) {
  6973. return - 0.5 * (Math.cos(Math.PI * c) - 1)
  6974. };
  6975. e.getBackIn = function(c) {
  6976. return function(b) {
  6977. return b * b * ((c + 1) * b - c)
  6978. }
  6979. };
  6980. e.getBackOut = function(c) {
  6981. return function(b) {
  6982. return--b * b * ((c + 1) * b + c) + 1
  6983. }
  6984. };
  6985. e.getBackInOut = function(c) {
  6986. c *= 1.525;
  6987. return function(b) {
  6988. return 1 > (b *= 2) ? 0.5 * b * b * ((c + 1) * b - c) : 0.5 * ((b -= 2) * b * ((c + 1) * b + c) + 2)
  6989. }
  6990. };
  6991. e.circIn = function(c) {
  6992. return - (Math.sqrt(1 - c * c) - 1)
  6993. };
  6994. e.circOut = function(c) {
  6995. return Math.sqrt(1 - --c * c)
  6996. };
  6997. e.circInOut = function(c) {
  6998. return 1 > (c *= 2) ? -0.5 * (Math.sqrt(1 - c * c) - 1) : 0.5 * (Math.sqrt(1 - (c -= 2) * c) + 1)
  6999. };
  7000. e.bounceIn = function(c) {
  7001. return 1 - e.bounceOut(1 - c)
  7002. };
  7003. e.bounceOut = function(c) {
  7004. return c < 1 / 2.75 ? 7.5625 * c * c: c < 2 / 2.75 ? 7.5625 * (c -= 1.5 / 2.75) * c + 0.75 : c < 2.5 / 2.75 ? 7.5625 * (c -= 2.25 / 2.75) * c + 0.9375 : 7.5625 * (c -= 2.625 / 2.75) * c + 0.984375
  7005. };
  7006. e.bounceInOut = function(c) {
  7007. return 0.5 > c ? 0.5 * e.bounceIn(2 * c) : 0.5 * e.bounceOut(2 * c - 1) + 0.5
  7008. };
  7009. e.getElasticIn = function(c, b) {
  7010. var a = 2 * Math.PI;
  7011. return function(f) {
  7012. if (0 == f || 1 == f) return f;
  7013. var e = b / a * Math.asin(1 / c);
  7014. return - (c * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - e) * a / b))
  7015. }
  7016. };
  7017. e.getElasticOut = function(c, b) {
  7018. var a = 2 * Math.PI;
  7019. return function(f) {
  7020. if (0 == f || 1 == f) return f;
  7021. var e = b / a * Math.asin(1 / c);
  7022. return c * Math.pow(2, -10 * f) * Math.sin((f - e) * a / b) + 1
  7023. }
  7024. };
  7025. e.getElasticInOut = function(c, b) {
  7026. var a = 2 * Math.PI;
  7027. return function(f) {
  7028. var e = b / a * Math.asin(1 / c);
  7029. return 1 > (f *= 2) ? -0.5 * c * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - e) * a / b) : c * Math.pow(2, -10 * (f -= 1)) * Math.sin((f - e) * a / b) * 0.5 + 1
  7030. }
  7031. };
  7032. e.quadIn = e.getPowIn(2);
  7033. e.quadOut = e.getPowOut(2);
  7034. e.quadInOut = e.getPowInOut(2);
  7035. e.cubicIn = e.getPowIn(3);
  7036. e.cubicOut = e.getPowOut(3);
  7037. e.cubicInOut = e.getPowInOut(3);
  7038. e.quartIn = e.getPowIn(4);
  7039. e.quartOut = e.getPowOut(4);
  7040. e.quartInOut = e.getPowInOut(4);
  7041. e.quintIn = e.getPowIn(5);
  7042. e.quintOut = e.getPowOut(5);
  7043. e.quintInOut = e.getPowInOut(5);
  7044. e.backIn = e.getBackIn(1.7);
  7045. e.backOut = e.getBackOut(1.7);
  7046. e.backInOut = e.getBackInOut(1.7);
  7047. e.elasticIn = e.getElasticIn(1, 0.3);
  7048. e.elasticOut = e.getElasticOut(1, 0.3);
  7049. e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
  7050. return e
  7051. } ();
  7052. c.Ease = g;
  7053. g.prototype.__class__ = "egret.Ease"
  7054. })(egret || (egret = {})); (function(c) {
  7055. var g = function(e) {
  7056. function d() {
  7057. e.call(this);
  7058. this.path = "";
  7059. this.audio = null;
  7060. this.type = d.EFFECT;
  7061. this._pauseTime = 0;
  7062. this._listeners = []
  7063. }
  7064. __extends(d, e);
  7065. var b = d.prototype;
  7066. Object.defineProperty(b, "position", {
  7067. get: function() {
  7068. return this.audio ? Math.floor(1E3 * this.audio._getCurrentTime()) : 0
  7069. },
  7070. enumerable: !0,
  7071. configurable: !0
  7072. });
  7073. b.play = function(a, b) {
  7074. void 0 === a && (a = !1);
  7075. void 0 === b && (b = 0);
  7076. var c = this.audio;
  7077. c && (c._setCurrentTime(b / 1E3), c._setLoop(a), c._play(this.type))
  7078. };
  7079. b.stop = function() {
  7080. var a = this.audio;
  7081. a && (this._pauseTime = 0, a._setCurrentTime(0), a._pause())
  7082. };
  7083. b.pause = function() {
  7084. var a = this.audio;
  7085. a && (this._pauseTime = a._getCurrentTime(), a._pause())
  7086. };
  7087. b.resume = function() {
  7088. var a = this.audio;
  7089. a && (a._setCurrentTime(this._pauseTime), this._pauseTime = 0, a._play(this.type))
  7090. };
  7091. b.load = function() {
  7092. var a = this.audio;
  7093. a && a._load()
  7094. };
  7095. b.addEventListener = function(a, b, d) {
  7096. e.prototype.addEventListener.call(this, a, b, d);
  7097. var g = this;
  7098. this.audio && 1 == this._eventsMap[a].length && (b = a == c.SoundEvent.SOUND_COMPLETE ?
  7099. function(a) {
  7100. c.Event._dispatchByTarget(c.SoundEvent, g, c.SoundEvent.SOUND_COMPLETE)
  7101. }: function(a) {
  7102. c.Event._dispatchByTarget(c.Event, g, a.type)
  7103. },
  7104. this._listeners.push({
  7105. type: a,
  7106. func: b
  7107. }), a = g.getVirtualType(a), this.audio._addEventListener(a, b, !1))
  7108. };
  7109. b.removeEventListener = function(a, b, c) {
  7110. e.prototype.removeEventListener.call(this, a, b, c);
  7111. if (this.audio && (!this._eventsMap || !this._eventsMap[a] || 0 == this._eventsMap[a].length)) for (c = 0; c < this._listeners.length; c++) if (b = this._listeners[c], b.type == a) {
  7112. this._listeners.splice(c, 1);
  7113. a = this.getVirtualType(a);
  7114. this.audio._removeEventListener(a, b.func, !1);
  7115. break
  7116. }
  7117. };
  7118. b.getVirtualType = function(a) {
  7119. switch (a) {
  7120. case c.SoundEvent.SOUND_COMPLETE:
  7121. return "ended";
  7122. default:
  7123. return a
  7124. }
  7125. };
  7126. Object.defineProperty(b, "volume", {
  7127. get: function() {
  7128. return this.audio ? this.audio._getVolume() : 0
  7129. },
  7130. set: function(a) {
  7131. var b = this.audio;
  7132. b && b._setVolume(Math.max(0, Math.min(a, 1)))
  7133. },
  7134. enumerable: !0,
  7135. configurable: !0
  7136. });
  7137. b.setVolume = function(a) {
  7138. c.Logger.warningWithErrorId(1031);
  7139. this.volume = a
  7140. };
  7141. b.getVolume = function() {
  7142. c.Logger.warningWithErrorId(1032);
  7143. return this.volume
  7144. };
  7145. b.preload = function(a, b, c) {
  7146. void 0 === b && (b = null);
  7147. void 0 === c && (c = null);
  7148. this.type = a;
  7149. this.audio._preload(a, b, c)
  7150. };
  7151. b._setAudio = function(a) {
  7152. this.audio = a
  7153. };
  7154. b.destroy = function() {
  7155. this.audio._destroy()
  7156. };
  7157. d.MUSIC = "music";
  7158. d.EFFECT = "effect";
  7159. return d
  7160. } (c.EventDispatcher);
  7161. c.Sound = g;
  7162. g.prototype.__class__ = "egret.Sound"
  7163. })(egret || (egret = {})); (function(c) {
  7164. var g = function() {
  7165. function c() {}
  7166. c.isNumber = function(c) {
  7167. return "number" === typeof c && !isNaN(c)
  7168. };
  7169. c.sin = function(d) {
  7170. var b = Math.floor(d),
  7171. a = b + 1,
  7172. f = c.sinInt(b),
  7173. g = c.sinInt(a);
  7174. return (d - b) * g + (a - d) * f
  7175. };
  7176. c.sinInt = function(c) {
  7177. c %= 360;
  7178. 0 > c && (c += 360);
  7179. return 90 > c ? egret_sin_map[c] : 180 > c ? egret_cos_map[c - 90] : 270 > c ? -egret_sin_map[c - 180] : -egret_cos_map[c - 270]
  7180. };
  7181. c.cos = function(d) {
  7182. var b = Math.floor(d),
  7183. a = b + 1,
  7184. f = c.cosInt(b),
  7185. g = c.cosInt(a);
  7186. return (d - b) * g + (a - d) * f
  7187. };
  7188. c.cosInt = function(c) {
  7189. c %= 360;
  7190. 0 > c && (c += 360);
  7191. return 90 > c ? egret_cos_map[c] : 180 > c ? -egret_sin_map[c - 90] : 270 > c ? -egret_cos_map[c - 180] : egret_sin_map[c - 270]
  7192. };
  7193. return c
  7194. } ();
  7195. c.NumberUtils = g;
  7196. g.prototype.__class__ = "egret.NumberUtils"
  7197. })(egret || (egret = {}));
  7198. for (var egret_sin_map = {},
  7199. egret_cos_map = {},
  7200. NumberUtils_i = 0; 90 >= NumberUtils_i; NumberUtils_i++) egret_sin_map[NumberUtils_i] = Math.sin(NumberUtils_i * egret.Matrix.DEG_TO_RAD),
  7201. egret_cos_map[NumberUtils_i] = Math.cos(NumberUtils_i * egret.Matrix.DEG_TO_RAD);
  7202. Function.prototype.bind || (Function.prototype.bind = function(c) {
  7203. if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
  7204. var g = Array.prototype.slice.call(arguments, 1),
  7205. e = this,
  7206. d = function() {},
  7207. b = function() {
  7208. return e.apply(this instanceof d && c ? this: c, g.concat(Array.prototype.slice.call(arguments)))
  7209. };
  7210. d.prototype = this.prototype;
  7211. b.prototype = new d;
  7212. return b
  7213. }); (function(c) {
  7214. var g = function() {
  7215. function e() {
  7216. this.downloadingSizeThisObject = this.downloadingSizeFunc = this.onErrorThisObject = this.onErrorFunc = this.onSuccessThisObject = this.onSuccessFunc = null
  7217. }
  7218. var d = e.prototype;
  7219. e.create = function() {
  7220. return e.promiseObjectList.length ? e.promiseObjectList.pop() : new c.PromiseObject
  7221. };
  7222. d.onSuccess = function() {
  7223. for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
  7224. this.onSuccessFunc && this.onSuccessFunc.apply(this.onSuccessThisObject, b);
  7225. this.destroy()
  7226. };
  7227. d.onError = function() {
  7228. for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
  7229. this.onErrorFunc && this.onErrorFunc.apply(this.onErrorThisObject, b);
  7230. this.destroy()
  7231. };
  7232. d.downloadingSize = function() {
  7233. for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
  7234. this.downloadingSizeFunc && this.downloadingSizeFunc.apply(this.downloadingSizeThisObject, b)
  7235. };
  7236. d.destroy = function() {
  7237. this.downloadingSizeThisObject = this.downloadingSizeFunc = this.onErrorThisObject = this.onErrorFunc = this.onSuccessThisObject = this.onSuccessFunc = void 0;
  7238. e.promiseObjectList.push(this)
  7239. };
  7240. e.promiseObjectList = [];
  7241. return e
  7242. } ();
  7243. c.PromiseObject = g;
  7244. g.prototype.__class__ = "egret.PromiseObject"
  7245. })(egret || (egret = {})); (function(c) {
  7246. var g = function(e) {
  7247. function d(a) {
  7248. void 0 === a && (a = 60);
  7249. e.call(this);
  7250. this.frameRate = a;
  7251. this._time = 0;
  7252. this._requestAnimationId = NaN;
  7253. this._isActivate = !0;
  7254. d.countTime = 0;
  7255. 0 == 60 % a && (d.countTime = 60 / a - 1, d.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, d.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  7256. d.requestAnimationFrame || (d.requestAnimationFrame = function(b) {
  7257. return window.setTimeout(b, 1E3 / a)
  7258. });
  7259. d.cancelAnimationFrame || (d.cancelAnimationFrame = function(a) {
  7260. return window.clearTimeout(a)
  7261. });
  7262. d.instance = this;
  7263. this.registerListener()
  7264. }
  7265. __extends(d, e);
  7266. var b = d.prototype;
  7267. b.enterFrame = function() {
  7268. var a = d.instance,
  7269. b = d._thisObject,
  7270. e = d._callback,
  7271. g = c.getTimer(),
  7272. s = g - a._time;
  7273. a._requestAnimationId = d.requestAnimationFrame.call(window, d.prototype.enterFrame);
  7274. d.count < d.countTime ? d.count++:(d.count = 0, e.call(b, s), a._time = g)
  7275. };
  7276. b.executeMainLoop = function(a, b) {
  7277. d._callback = a;
  7278. d._thisObject = b;
  7279. this.enterFrame()
  7280. };
  7281. b.reset = function() {
  7282. var a = d.instance;
  7283. a._requestAnimationId && (a._time = c.getTimer(), d.cancelAnimationFrame.call(window, a._requestAnimationId), a.enterFrame())
  7284. };
  7285. b.registerListener = function() {
  7286. var a = this,
  7287. b = function() {
  7288. a._isActivate && (a._isActivate = !1, c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.DEACTIVATE)))
  7289. },
  7290. e = function() {
  7291. a._isActivate || (a._isActivate = !0, d.instance.reset(), c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.ACTIVATE)))
  7292. },
  7293. g = function() {
  7294. document[s] ? b() : e()
  7295. };
  7296. window.addEventListener("focus", e, !1);
  7297. window.addEventListener("blur", b, !1);
  7298. var s, n;
  7299. "undefined" !== typeof document.hidden ? (s = "hidden", n = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (s = "mozHidden", n = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (s = "msHidden", n = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (s = "webkitHidden", n = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (s = "oHidden", n = "ovisibilitychange");
  7300. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", b, !1));
  7301. s && n && document.addEventListener(n, g, !1);
  7302. g = navigator.userAgent;
  7303. n = /micromessenger/gi.test(g);
  7304. var h = /mqq/ig.test(g);
  7305. if (/mobile.*qq/gi.test(g) || n) h = !1;
  7306. h && (g = window.browser || {},
  7307. g.execWebFn = g.execWebFn || {},
  7308. g.execWebFn.postX5GamePlayerMessage = function(a) {
  7309. a = a.type;
  7310. "app_enter_background" == a ? b() : "app_enter_foreground" == a && e()
  7311. },
  7312. window.browser = g)
  7313. };
  7314. d.instance = null;
  7315. d.countTime = 0;
  7316. d.requestAnimationFrame = null;
  7317. d.cancelAnimationFrame = null;
  7318. d._thisObject = null;
  7319. d._callback = null;
  7320. d.count = 0;
  7321. return d
  7322. } (c.DeviceContext);
  7323. c.HTML5DeviceContext = g;
  7324. g.prototype.__class__ = "egret.HTML5DeviceContext"
  7325. })(egret || (egret = {}));
  7326. var egret_html5_localStorage; (function(c) {
  7327. c.getItem = function(c) {
  7328. return window.localStorage.getItem(c)
  7329. };
  7330. c.setItem = function(c, e) {
  7331. try {
  7332. return window.localStorage.setItem(c, e),
  7333. !0
  7334. } catch(d) {
  7335. return egret.Logger.infoWithErrorId(1018, c, e),
  7336. !1
  7337. }
  7338. };
  7339. c.removeItem = function(c) {
  7340. window.localStorage.removeItem(c)
  7341. };
  7342. c.clear = function() {
  7343. window.localStorage.clear()
  7344. };
  7345. c.init = function() {
  7346. for (var g in c) egret.localStorage[g] = c[g]
  7347. }
  7348. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  7349. egret_html5_localStorage.init(); (function(c) {
  7350. var g = function(e) {
  7351. function d(a, b) {
  7352. void 0 === b && (b = !0);
  7353. e.call(this);
  7354. this.useCacheCanvas = b;
  7355. c.Texture.prototype.draw = c.Texture.prototype._drawForCanvas;
  7356. c.Texture.prototype.dispose = c.Texture.prototype._disposeForCanvas;
  7357. this.canvas = a || this.createCanvas();
  7358. this.canvasContext = this.canvas.getContext("2d");
  7359. 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;
  7360. var d = this.drawCanvasContext;
  7361. if (void 0 == d.imageSmoothingEnabled) {
  7362. for (var g = ["webkitImageSmoothingEnabled", "mozImageSmoothingEnabled", "msImageSmoothingEnabled"], s = 0; s < g.length; s++) {
  7363. var n = g[s];
  7364. if (void 0 != d[n]) break
  7365. }
  7366. Object.defineProperty(d, "imageSmoothingEnabled", {
  7367. get: function() {
  7368. return this[n]
  7369. },
  7370. set: function(a) {
  7371. this[n] = a
  7372. },
  7373. enumerable: !0,
  7374. configurable: !0
  7375. })
  7376. }
  7377. this.onResize();
  7378. var h = this.drawCanvasContext.setTransform,
  7379. k = this;
  7380. this.drawCanvasContext.setTransform = function(a, b, c, f, d, e) {
  7381. k._matrixA = a;
  7382. k._matrixB = b;
  7383. k._matrixC = c;
  7384. k._matrixD = f;
  7385. k._matrixTx = d;
  7386. k._matrixTy = e;
  7387. h.call(k.drawCanvasContext, a, b, c, f, d, e)
  7388. };
  7389. this._matrixA = 1;
  7390. this._matrixC = this._matrixB = 0;
  7391. this._matrixD = 1;
  7392. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  7393. this.initBlendMode()
  7394. }
  7395. __extends(d, e);
  7396. var b = d.prototype;
  7397. b.createCanvas = function() {
  7398. var a = c.Browser.getInstance().$("#egretCanvas");
  7399. if (!a) {
  7400. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  7401. a = c.Browser.getInstance().$new("canvas");
  7402. a.id = "egretCanvas";
  7403. b.appendChild(a)
  7404. }
  7405. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
  7406. return a
  7407. };
  7408. b.onResize = function() {
  7409. if (this.canvas) {
  7410. var a = document.getElementById(c.StageDelegate.canvas_div_name);
  7411. this.canvas.width = c.MainContext.instance.stage.stageWidth;
  7412. this.canvas.height = c.MainContext.instance.stage.stageHeight;
  7413. this.canvas.style.width = a.style.width;
  7414. this.canvas.style.height = a.style.height;
  7415. this.useCacheCanvas && (this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height);
  7416. this.drawCanvasContext.imageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled
  7417. }
  7418. };
  7419. b.clearScreen = function() {
  7420. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, d = a.length; b < d; b++) {
  7421. var e = a[b];
  7422. this.clearRect(e.x, e.y, e.width, e.height)
  7423. }
  7424. a = c.MainContext.instance.stage;
  7425. this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  7426. this.renderCost = 0
  7427. };
  7428. b.clearRect = function(a, b, c, d) {
  7429. this.canvasContext.clearRect(a, b, c, d)
  7430. };
  7431. b.drawImage = function(a, b, d, g, s, n, h, k, l, m) {
  7432. void 0 === m && (m = void 0);
  7433. n += this._transformTx;
  7434. h += this._transformTy;
  7435. var p = c.getTimer();
  7436. a.draw(this.drawCanvasContext, b, d, g, s, n, h, k, l, m);
  7437. e.prototype.drawImage.call(this, a, b, d, g, s, n, h, k, l, m);
  7438. this.renderCost += c.getTimer() - p
  7439. };
  7440. b.setTransform = function(a) {
  7441. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  7442. };
  7443. b.setAlpha = function(a, b) {
  7444. this.drawCanvasContext.globalAlpha = a;
  7445. b ? (this.blendValue = this.blendModes[b], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = this.blendModes[c.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
  7446. };
  7447. b.initBlendMode = function() {
  7448. this.blendModes = {};
  7449. this.blendModes[c.BlendMode.NORMAL] = "source-over";
  7450. this.blendModes[c.BlendMode.ADD] = "lighter";
  7451. this.blendModes[c.BlendMode.ERASE] = "destination-out";
  7452. this.blendModes[c.BlendMode.ERASE_REVERSE] = "destination-in"
  7453. };
  7454. b.setupFont = function(a, b) {
  7455. void 0 === b && (b = null);
  7456. b = b || {};
  7457. var c = a._TF_Props_,
  7458. d = null == b.size ? c._size: b.size,
  7459. e = null == b.fontFamily ? c._fontFamily: b.fontFamily,
  7460. g = this.drawCanvasContext,
  7461. h = (null == b.italic ? c._italic: b.italic) ? "italic ": "normal ",
  7462. h = h + ((null == b.bold ? c._bold: b.bold) ? "bold ": "normal ");
  7463. g.font = h + (d + "px " + e);
  7464. g.textAlign = "left";
  7465. g.textBaseline = "middle"
  7466. };
  7467. b.measureText = function(a) {
  7468. return this.drawCanvasContext.measureText(a).width
  7469. };
  7470. b.drawText = function(a, b, d, g, s, n) {
  7471. void 0 === n && (n = null);
  7472. this.setupFont(a, n);
  7473. n = n || {};
  7474. var h = a._TF_Props_,
  7475. k;
  7476. k = null != n.textColor ? c.toColorString(n.textColor) : h._textColorString;
  7477. var l;
  7478. l = null != n.strokeColor ? c.toColorString(n.strokeColor) : h._strokeColorString;
  7479. var h = null != n.stroke ? n.stroke: h._stroke,
  7480. m = this.drawCanvasContext;
  7481. m.fillStyle = k;
  7482. m.strokeStyle = l;
  7483. h && (m.lineWidth = 2 * h, m.strokeText(b, d + this._transformTx, g + this._transformTy, s || 65535));
  7484. m.fillText(b, d + this._transformTx, g + this._transformTy, s || 65535);
  7485. e.prototype.drawText.call(this, a, b, d, g, s, n)
  7486. };
  7487. b.strokeRect = function(a, b, c, d, e) {
  7488. this.drawCanvasContext.strokeStyle = e;
  7489. this.drawCanvasContext.strokeRect(a, b, c, d)
  7490. };
  7491. b.pushMask = function(a) {
  7492. this.drawCanvasContext.save();
  7493. this.drawCanvasContext.beginPath();
  7494. this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  7495. this.drawCanvasContext.clip();
  7496. this.drawCanvasContext.closePath()
  7497. };
  7498. b.popMask = function() {
  7499. this.drawCanvasContext.restore();
  7500. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  7501. };
  7502. b.onRenderStart = function() {
  7503. this.drawCanvasContext.save()
  7504. };
  7505. b.onRenderFinish = function() {
  7506. this.drawCanvasContext.restore();
  7507. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  7508. if (this.useCacheCanvas) for (var a = this._cacheCanvas.width,
  7509. b = this._cacheCanvas.height,
  7510. d = c.RenderFilter.getInstance().getDrawAreaList(), e = 0, g = d.length; e < g; e++) {
  7511. var n = d[e],
  7512. h = n.x,
  7513. k = n.y,
  7514. l = n.width,
  7515. n = n.height;
  7516. h + l > a && (l = a - h);
  7517. k + n > b && (n = b - k);
  7518. 0 < l && 0 < n && this.canvasContext.drawImage(this._cacheCanvas, h, k, l, n, h, k, l, n)
  7519. }
  7520. };
  7521. b.drawCursor = function(a, b, c, d) {
  7522. this.drawCanvasContext.strokeStyle = "#40a5ff";
  7523. this.drawCanvasContext.lineWidth = 2;
  7524. this.drawCanvasContext.beginPath();
  7525. this.drawCanvasContext.moveTo(Math.round(a + this._transformTx), Math.round(b + this._transformTy));
  7526. this.drawCanvasContext.lineTo(Math.round(c + this._transformTx), Math.round(d + this._transformTy));
  7527. this.drawCanvasContext.closePath();
  7528. this.drawCanvasContext.stroke()
  7529. };
  7530. return d
  7531. } (c.RendererContext);
  7532. c.HTML5CanvasRenderer = g;
  7533. g.prototype.__class__ = "egret.HTML5CanvasRenderer"
  7534. })(egret || (egret = {}));
  7535. egret.RendererContext.createRendererContext = function(c) {
  7536. return new egret.HTML5CanvasRenderer(c, !1)
  7537. };
  7538. egret.Graphics.prototype._beginDraw = function(c) {
  7539. this._renderContext = c.drawCanvasContext;
  7540. var g = c._transformTx;
  7541. c = c._transformTy;
  7542. 0 == g && 0 == c || this._renderContext.translate(g, c)
  7543. };
  7544. egret.Graphics.prototype._endDraw = function(c) {
  7545. this._renderContext = c.drawCanvasContext;
  7546. var g = c._transformTx;
  7547. c = c._transformTy;
  7548. 0 == g && 0 == c || this._renderContext.translate( - g, -c)
  7549. }; (function(c) {
  7550. var g = function(e) {
  7551. function d(a) {
  7552. e.call(this);
  7553. this.glID = this.gl = this.canvas = null;
  7554. this.size = 2E3;
  7555. this.vertices = null;
  7556. this.vertSize = 5;
  7557. this.indices = null;
  7558. this.projectionY = this.projectionX = NaN;
  7559. this.shaderManager = null;
  7560. this.contextLost = !1;
  7561. this.glContextId = 0;
  7562. this.currentBlendMode = "";
  7563. this.currentBaseTexture = null;
  7564. this.currentBatchSize = 0;
  7565. this.worldTransform = null;
  7566. this.worldAlpha = 1;
  7567. this.maskList = [];
  7568. this.maskDataFreeList = [];
  7569. this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints = this.filterType = this.colorTransformMatrix = null;
  7570. this.graphicsStyle = {};
  7571. c.Texture.prototype.dispose = c.Texture.prototype._disposeForCanvas;
  7572. this.canvas = a || this.createCanvas();
  7573. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7574. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  7575. this.html5Canvas = document.createElement("canvas");
  7576. this.canvasContext = new c.HTML5CanvasRenderer(this.html5Canvas);
  7577. this.onResize();
  7578. this.projectionX = this.canvas.width / 2;
  7579. this.projectionY = -this.canvas.height / 2;
  7580. a = 6 * this.size;
  7581. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7582. this.indices = new Uint16Array(a);
  7583. for (var b = 0,
  7584. d = 0; b < a; b += 6, d += 4) this.indices[b + 0] = d + 0,
  7585. this.indices[b + 1] = d + 1,
  7586. this.indices[b + 2] = d + 2,
  7587. this.indices[b + 3] = d + 0,
  7588. this.indices[b + 4] = d + 2,
  7589. this.indices[b + 5] = d + 3;
  7590. this.initWebGL();
  7591. this.shaderManager = new c.WebGLShaderManager(this.gl);
  7592. this.worldTransform = new c.Matrix;
  7593. this.initAll()
  7594. }
  7595. __extends(d, e);
  7596. var b = d.prototype;
  7597. b.onRenderFinish = function() {
  7598. this._drawWebGL()
  7599. };
  7600. d.initWebGLCanvas = function() {
  7601. c.RenderTexture.WebGLCanvas || (c.RenderTexture.WebGLCanvas = document.createElement("canvas"), c.RenderTexture.WebGLCanvas.avaliable = !0, c.RenderTexture.WebGLRenderer = new c.WebGLRenderer(c.RenderTexture.WebGLCanvas), c.RenderTexture.WebGLRenderer.setAlpha(1))
  7602. };
  7603. b.initAll = function() {
  7604. d.isInit || (d.isInit = !0, egret_webgl_graphics.init(), c.TextField.prototype._makeBitmapCache = function() {
  7605. this.renderTexture || (this.renderTexture = new c.RenderTexture);
  7606. var a = this.getBounds(c.Rectangle.identity);
  7607. if (0 == a.width || 0 == a.height) return this._texture_to_render = null,
  7608. !1;
  7609. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this._bitmapData.avaliable = !0, this.renderContext = c.RendererContext.createRendererContext(this._bitmapData));
  7610. var b = this._bitmapData,
  7611. d = a.width,
  7612. a = a.height,
  7613. e, g, n = c.MainContext.instance.rendererContext._texture_scale_factor;
  7614. e = d / n;
  7615. g = a / n;
  7616. e = Math.round(e);
  7617. g = Math.round(g);
  7618. b.width = e;
  7619. b.height = g;
  7620. b.style.width = e + "px";
  7621. b.style.height = g + "px";
  7622. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e, this.renderContext._cacheCanvas.height = g);
  7623. this._worldTransform.identity();
  7624. this._worldTransform.a = 1 / n;
  7625. this._worldTransform.d = 1 / n;
  7626. this.renderContext.setTransform(this._worldTransform);
  7627. this.worldAlpha = 1;
  7628. b = c.RenderFilter.getInstance();
  7629. n = b._drawAreaList.concat();
  7630. b._drawAreaList.length = 0;
  7631. this.renderContext.clearScreen();
  7632. this.renderContext.onRenderStart();
  7633. c.Texture.deleteWebGLTexture(this.renderTexture);
  7634. this.renderTexture.dispose();
  7635. this._hasFilters() && this._setGlobalFilters(this.renderContext);
  7636. var h = this.mask || this._DO_Props_._scrollRect;
  7637. h && this.renderContext.pushMask(h);
  7638. this._render(this.renderContext);
  7639. h && this.renderContext.popMask();
  7640. this._hasFilters() && this._removeGlobalFilters(this.renderContext);
  7641. c.RenderTexture.identityRectangle.width = e;
  7642. c.RenderTexture.identityRectangle.height = g;
  7643. b.addDrawArea(c.RenderTexture.identityRectangle);
  7644. this.renderContext.onRenderFinish();
  7645. b._drawAreaList = n;
  7646. this.renderTexture._bitmapData = this._bitmapData;
  7647. this.renderTexture._sourceWidth = e;
  7648. this.renderTexture._sourceHeight = g;
  7649. this.renderTexture._textureWidth = d;
  7650. this.renderTexture._textureHeight = a;
  7651. this._texture_to_render = this.renderTexture;
  7652. return ! 0
  7653. },
  7654. c.TextField.prototype._draw = function(a) {
  7655. this._TF_Props_._type == c.TextFieldType.INPUT && this._isTyping || (this.getDirty() && (this._texture_to_render = this.renderTexture, this._DO_Props_._cacheAsBitmap = !0), c.DisplayObject.prototype._draw.call(this, a))
  7656. },
  7657. c.RenderTexture.prototype.init = function() {
  7658. this._bitmapData = document.createElement("canvas");
  7659. this._bitmapData.avaliable = !0;
  7660. this.canvasContext = this._bitmapData.getContext("2d");
  7661. d.initWebGLCanvas();
  7662. this._webglBitmapData = c.RenderTexture.WebGLCanvas;
  7663. this.renderContext = c.RenderTexture.WebGLRenderer
  7664. },
  7665. c.RenderTexture.prototype.setSize = function(a, b) {
  7666. this._webglBitmapData && this.renderContext.setSize(a, b);
  7667. if (this._bitmapData) {
  7668. var c = this._bitmapData;
  7669. c.width = a;
  7670. c.height = b;
  7671. c.style.width = a + "px";
  7672. c.style.height = b + "px"
  7673. }
  7674. },
  7675. c.RenderTexture.prototype.end = function() {},
  7676. c.RenderTexture.prototype.drawToTexture = function(a, b, d) {
  7677. var e = b || a.getBounds(c.Rectangle.identity);
  7678. if (0 == e.width || 0 == e.height) return ! 1;
  7679. "undefined" == typeof d && (d = 1);
  7680. this._bitmapData || this.init();
  7681. var g = e.x,
  7682. n = e.y,
  7683. h = e.width,
  7684. e = e.height,
  7685. e = e / d,
  7686. k = c.MainContext.instance.rendererContext._texture_scale_factor,
  7687. h = Math.round(h / d),
  7688. e = Math.round(e);
  7689. this.setSize(h, e);
  7690. var l = this._bitmapData,
  7691. m = h / k * d,
  7692. p = e / k * d;
  7693. l.width = m;
  7694. l.height = p;
  7695. l.style.width = m + "px";
  7696. l.style.height = p + "px";
  7697. this.begin();
  7698. a._worldTransform.identity();
  7699. l = a._DO_Props_._anchorOffsetX;
  7700. m = a._DO_Props_._anchorOffsetY;
  7701. if (0 != a._DO_Props_._anchorX || 0 != a._DO_Props_._anchorY) l = a._DO_Props_._anchorX * h,
  7702. m = a._DO_Props_._anchorY * e;
  7703. this._offsetX = g + l;
  7704. this._offsetY = n + m;
  7705. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  7706. b && (this._offsetX -= g, this._offsetY -= n);
  7707. a.worldAlpha = 1;
  7708. b = c.MainContext.__use_new_draw;
  7709. c.MainContext.__use_new_draw = !1;
  7710. if (a instanceof c.DisplayObjectContainer) for (g = a._children, n = 0, l = g.length; n < l; n++) g[n]._updateTransform();
  7711. this.renderContext.setTransform(a._worldTransform);
  7712. g = c.RenderFilter.getInstance();
  7713. n = g._drawAreaList.concat();
  7714. g._drawAreaList.length = 0;
  7715. l = this.renderContext.gl;
  7716. l.viewport(0, 0, h, e);
  7717. l.bindFramebuffer(l.FRAMEBUFFER, null);
  7718. l.clearColor(0, 0, 0, 0);
  7719. l.clear(l.COLOR_BUFFER_BIT);
  7720. this.renderContext.onRenderStart();
  7721. c.Texture.deleteWebGLTexture(this);
  7722. a._hasFilters() && a._setGlobalFilters(this.renderContext); (l = a.mask || a._DO_Props_._scrollRect) && this.renderContext.pushMask(l);
  7723. a._render(this.renderContext);
  7724. this.renderContext._drawWebGL();
  7725. c.MainContext.__use_new_draw = b;
  7726. l && this.renderContext.popMask();
  7727. a._hasFilters() && a._removeGlobalFilters(this.renderContext);
  7728. c.RenderTexture.identityRectangle.width = h;
  7729. c.RenderTexture.identityRectangle.height = e;
  7730. g.addDrawArea(c.RenderTexture.identityRectangle);
  7731. this.renderContext.onRenderFinish();
  7732. g._drawAreaList = n;
  7733. this._sourceWidth = h / k * d;
  7734. this._sourceHeight = e / k * d;
  7735. this._textureWidth = h * d;
  7736. this._textureHeight = e * d;
  7737. this.canvasContext.drawImage(this._webglBitmapData, 0, 0, h, e, 0, 0, this._sourceWidth, this._sourceHeight);
  7738. return ! 0
  7739. })
  7740. };
  7741. b.createCanvas = function() {
  7742. var a = c.Browser.getInstance().$("#egretCanvas");
  7743. if (!a) {
  7744. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  7745. a = c.Browser.getInstance().$new("canvas");
  7746. a.id = "egretCanvas";
  7747. b.appendChild(a)
  7748. }
  7749. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
  7750. return a
  7751. };
  7752. b.onResize = function() {
  7753. this.setSize(c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)
  7754. };
  7755. b.setSize = function(a, b) {
  7756. var d = document.getElementById(c.StageDelegate.canvas_div_name);
  7757. this.canvas && (this.canvas.width = a, this.canvas.height = b, this.canvas.style.width = d.style.width, this.canvas.style.height = d.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
  7758. this.html5Canvas && (this.html5Canvas.width = a, this.html5Canvas.height = b, this.html5Canvas.style.width = d.style.width, this.html5Canvas.style.height = d.style.height);
  7759. this.width = a;
  7760. this.height = b
  7761. };
  7762. b.handleContextLost = function() {
  7763. this.contextLost = !0
  7764. };
  7765. b.handleContextRestored = function() {
  7766. this.initWebGL();
  7767. this.shaderManager.setContext(this.gl);
  7768. this.contextLost = !1
  7769. };
  7770. b.initWebGL = function() {
  7771. for (var a = {},
  7772. b, e = ["experimental-webgl", "webgl"], g = 0; g < e.length; g++) {
  7773. try {
  7774. b = this.canvas.getContext(e[g], a)
  7775. } catch(s) {}
  7776. if (b) break
  7777. }
  7778. if (!b) throw Error(c.getString(1021));
  7779. d.glID++;
  7780. this.glID = d.glID;
  7781. this.setContext(b)
  7782. };
  7783. b.setContext = function(a) {
  7784. this.gl = a;
  7785. a.id = this.glContextId++;
  7786. this.vertexBuffer = a.createBuffer();
  7787. this.indexBuffer = a.createBuffer();
  7788. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7789. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7790. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7791. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7792. a.disable(a.DEPTH_TEST);
  7793. a.disable(a.CULL_FACE);
  7794. a.enable(a.BLEND);
  7795. a.colorMask(!0, !0, !0, !0)
  7796. };
  7797. b.start = function() {
  7798. if (!this.contextLost) {
  7799. var a = this.gl;
  7800. a.activeTexture(a.TEXTURE0);
  7801. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7802. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7803. var b;
  7804. b = "colorTransform" == this.filterType ? this.shaderManager.colorTransformShader: "blur" == this.filterType ? this.shaderManager.blurShader: this.shaderManager.defaultShader;
  7805. this.shaderManager.activateShader(b);
  7806. b.syncUniforms();
  7807. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7808. var c = 4 * this.vertSize;
  7809. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  7810. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  7811. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  7812. }
  7813. };
  7814. b.clearScreen = function() {
  7815. var a = this.gl;
  7816. a.colorMask(!0, !0, !0, !0);
  7817. for (var b = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = b.length; d < e; d++) {
  7818. var g = b[d];
  7819. a.viewport(g.x, g.y, g.width, g.height);
  7820. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7821. a.clearColor(0, 0, 0, 0);
  7822. a.clear(a.COLOR_BUFFER_BIT)
  7823. }
  7824. a.viewport(0, 0, this.width, this.height);
  7825. this.renderCost = 0
  7826. };
  7827. b.setBlendMode = function(a) {
  7828. a || (a = c.BlendMode.NORMAL);
  7829. if (this.currentBlendMode != a) {
  7830. var b = c.RendererContext.blendModesForGL[a];
  7831. b && (this._drawWebGL(), this.gl.blendFunc(b[0], b[1]), this.currentBlendMode = a)
  7832. }
  7833. };
  7834. b.drawRepeatImage = function(a, b, d, e, g, n, h, k, l, m) {
  7835. m = c.MainContext.instance.rendererContext._texture_scale_factor;
  7836. e *= m;
  7837. for (g *= m; n < k; n += e) for (var p = h; p < l; p += g) {
  7838. var r = Math.min(e, k - n),
  7839. q = Math.min(g, l - p);
  7840. this.drawImage(a, b, d, r / m, q / m, n, p, r, q)
  7841. }
  7842. };
  7843. b.drawImage = function(a, b, c, d, e, g, h, k, l, m) {
  7844. void 0 === m && (m = void 0);
  7845. if (!this.contextLost) {
  7846. var p = a._bitmapData;
  7847. if (p && p.avaliable) if (void 0 !== m) this.drawRepeatImage(a, b, c, d, e, g, h, k, l, m);
  7848. else {
  7849. if (this.filters) for (m = 0; 1 > m; m++) if ("glow" == this.filters[0].type) {
  7850. this.useGlow(a, b, c, d, e, g, h, k, l);
  7851. return
  7852. }
  7853. this._drawImage(a, b, c, d, e, g, h, k, l)
  7854. }
  7855. }
  7856. };
  7857. b._drawImage = function(a, b, c, d, e, g, h, k, l) {
  7858. this.createWebGLTexture(a);
  7859. var m = a._bitmapData.webGLTexture[this.glID];
  7860. if (m !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._drawWebGL(),
  7861. this.currentBaseTexture = m;
  7862. var p = this.worldTransform,
  7863. r = p.a,
  7864. q = p.b,
  7865. x = p.c,
  7866. z = p.d,
  7867. u = p.tx,
  7868. y = p.ty;
  7869. 0 == g && 0 == h || p.append(1, 0, 0, 1, g, h);
  7870. 1 == d / k && 1 == e / l || p.append(k / d, 0, 0, l / e, 0, 0);
  7871. g = p.a;
  7872. h = p.b;
  7873. k = p.c;
  7874. l = p.d;
  7875. var m = p.tx,
  7876. w = p.ty;
  7877. p.a = r;
  7878. p.b = q;
  7879. p.c = x;
  7880. p.d = z;
  7881. p.tx = u;
  7882. p.ty = y;
  7883. r = a._sourceWidth;
  7884. q = a._sourceHeight;
  7885. a = d;
  7886. p = e;
  7887. b /= r;
  7888. c /= q;
  7889. d /= r;
  7890. e /= q;
  7891. r = this.vertices;
  7892. q = 4 * this.currentBatchSize * this.vertSize;
  7893. x = this.worldAlpha;
  7894. r[q++] = m;
  7895. r[q++] = w;
  7896. r[q++] = b;
  7897. r[q++] = c;
  7898. r[q++] = x;
  7899. r[q++] = g * a + m;
  7900. r[q++] = h * a + w;
  7901. r[q++] = d + b;
  7902. r[q++] = c;
  7903. r[q++] = x;
  7904. r[q++] = g * a + k * p + m;
  7905. r[q++] = l * p + h * a + w;
  7906. r[q++] = d + b;
  7907. r[q++] = e + c;
  7908. r[q++] = x;
  7909. r[q++] = k * p + m;
  7910. r[q++] = l * p + w;
  7911. r[q++] = b;
  7912. r[q++] = e + c;
  7913. r[q++] = x;
  7914. this.currentBatchSize++
  7915. };
  7916. b.useGlow = function(a, b, e, g, s, n, h, k, l) {
  7917. var m = this.filters[0],
  7918. p = m.distance || 0,
  7919. r = m.angle || 0,
  7920. q = 0,
  7921. x = 0;
  7922. 0 != p && 0 != r && (q = Math.ceil(p * c.NumberUtils.cos(r)), x = Math.ceil(p * c.NumberUtils.sin(r)));
  7923. var p = m.quality,
  7924. r = m.blurX / 10,
  7925. z = m.blurY / 10,
  7926. u = k + 2 * r + 20 + Math.abs(q),
  7927. y = l + 2 * z + 20 + Math.abs(x);
  7928. d.initWebGLCanvas();
  7929. var w = c.RenderTexture.WebGLRenderer,
  7930. B = c.RenderTexture.WebGLCanvas,
  7931. A = c.RenderTexture.create();
  7932. A._bitmapData || A.init();
  7933. A.setSize(u, y);
  7934. A._sourceWidth = u;
  7935. A._sourceHeight = y;
  7936. var C = c.RenderTexture.create();
  7937. C._bitmapData || C.init();
  7938. C.setSize(u, y);
  7939. C._sourceWidth = u;
  7940. C._sourceHeight = y;
  7941. w.clearScreen();
  7942. w.filterType = "colorTransform";
  7943. w.setGlobalColorTransform([0, 0, 0, 0, m._red, 0, 0, 0, 0, m._green, 0, 0, 0, 0, m._blue, 0, 0, 0, 0, 255 * m.alpha]);
  7944. w.setAlpha(1, c.BlendMode.NORMAL);
  7945. w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
  7946. w.drawImage(a, b, e, g, s, r + 10, z + 10, k, l);
  7947. w._drawWebGL();
  7948. w.filterType = null;
  7949. A.canvasContext.clearRect(0, 0, u, y);
  7950. A.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
  7951. w.clearScreen();
  7952. w.setAlpha(1, c.BlendMode.NORMAL);
  7953. w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
  7954. w.filterType = "blur";
  7955. w.setBlurData(r, 0);
  7956. c.Texture.deleteWebGLTexture(A);
  7957. w.drawImage(A, r, z, u - 2 * r, y - 2 * z, r, z, u - 2 * r, y - 2 * z);
  7958. w._drawWebGL();
  7959. w.filterType = null;
  7960. C.canvasContext.clearRect(0, 0, u, y);
  7961. C.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
  7962. w.clearScreen();
  7963. w.setAlpha(1, c.BlendMode.NORMAL);
  7964. w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
  7965. w.filterType = "blur";
  7966. w.setBlurData(0, z);
  7967. c.Texture.deleteWebGLTexture(C);
  7968. w.drawImage(C, 0, z, u, y - 2 * z, 0, z + 5, u, y - 2 * z);
  7969. w._drawWebGL();
  7970. w.filterType = null;
  7971. A.canvasContext.clearRect(0, 0, u, y);
  7972. A.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
  7973. w.clearScreen();
  7974. w.setAlpha(1, c.BlendMode.NORMAL);
  7975. w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
  7976. c.Texture.deleteWebGLTexture(A);
  7977. for (m = 0; m < p; m++) w.drawImage(A, 0, 0, u, y, q, x, u, y);
  7978. w._drawWebGL();
  7979. w.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);
  7980. w.currentBlendMode = null;
  7981. w.drawImage(a, b, e, g, s, n + r + 10, h + z + 15, k, l);
  7982. w._drawWebGL();
  7983. C.canvasContext.clearRect(0, 0, u, y);
  7984. C.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
  7985. c.Texture.deleteWebGLTexture(C);
  7986. this._drawImage(C, 0, 0, u, y, n - r - 10, h - z - 15, u, y);
  7987. this._drawWebGL();
  7988. c.RenderTexture.release(A);
  7989. c.RenderTexture.release(C)
  7990. };
  7991. b._drawWebGL = function() {
  7992. if (0 != this.currentBatchSize && !this.contextLost) {
  7993. var a = c.getTimer();
  7994. this.start();
  7995. var b = this.gl;
  7996. b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
  7997. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  7998. b.bufferSubData(b.ARRAY_BUFFER, 0, d);
  7999. b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
  8000. this.currentBatchSize = 0;
  8001. this.renderCost += c.getTimer() - a;
  8002. c.Profiler.getInstance().onDrawImage()
  8003. }
  8004. };
  8005. b.setTransform = function(a) {
  8006. var b = this.worldTransform;
  8007. b.a = a.a;
  8008. b.b = a.b;
  8009. b.c = a.c;
  8010. b.d = a.d;
  8011. b.tx = a.tx;
  8012. b.ty = a.ty
  8013. };
  8014. b.setAlpha = function(a, b) {
  8015. this.worldAlpha = a;
  8016. this.setBlendMode(b)
  8017. };
  8018. b.createWebGLTexture = function(a) {
  8019. a = a._bitmapData;
  8020. a.webGLTexture || (a.webGLTexture = {});
  8021. if (!a.webGLTexture[this.glID]) {
  8022. var b = this.gl;
  8023. a.webGLTexture[this.glID] = b.createTexture();
  8024. a.webGLTexture[this.glID].glContext = b;
  8025. b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
  8026. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  8027. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
  8028. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  8029. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  8030. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  8031. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  8032. b.bindTexture(b.TEXTURE_2D, null)
  8033. }
  8034. };
  8035. b.pushMask = function(a) {
  8036. this._drawWebGL();
  8037. var b = this.gl;
  8038. 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
  8039. a = this.getScissorRect(a);
  8040. this.maskList.push(a);
  8041. this.scissor(a.x, a.y, a.width, a.height)
  8042. };
  8043. b.getScissorRect = function(a) {
  8044. var b = this.maskList[this.maskList.length - 1],
  8045. d,
  8046. e,
  8047. g;
  8048. b ? b.intersects(b) ? (d = Math.max(a.x + this.worldTransform.tx, b.x), e = Math.max(a.y + this.worldTransform.ty, b.y), g = Math.min(a.x + this.worldTransform.tx + a.width, b.x + b.width) - d, a = Math.min(a.y + this.worldTransform.ty + a.height, b.y + b.height) - e) : a = g = e = d = 0 : (d = a.x + this.worldTransform.tx, e = a.y + this.worldTransform.ty, g = a.width, a = a.height); (b = this.maskDataFreeList.pop()) ? (b.x = d, b.y = e, b.width = g, b.height = a) : b = new c.Rectangle(d, e, g, a);
  8049. return b
  8050. };
  8051. b.popMask = function() {
  8052. this._drawWebGL();
  8053. var a = this.gl,
  8054. b = this.maskList.pop();
  8055. this.maskDataFreeList.push(b);
  8056. b = this.maskList.length;
  8057. 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)
  8058. };
  8059. b.scissor = function(a, b, d, e) {
  8060. var g = this.gl;
  8061. 0 > d && (d = 0);
  8062. 0 > e && (e = 0);
  8063. g.scissor(a, -b + c.MainContext.instance.stage.stageHeight - e, d, e)
  8064. };
  8065. b.setGlobalColorTransform = function(a) {
  8066. if (this.colorTransformMatrix != a && (this._drawWebGL(), this.colorTransformMatrix = a)) {
  8067. a = a.concat();
  8068. var b = this.shaderManager.colorTransformShader;
  8069. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  8070. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  8071. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  8072. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  8073. b.uniforms.matrix.value = a
  8074. }
  8075. };
  8076. b.setBlurData = function(a, b) {
  8077. var c = this.shaderManager.blurShader;
  8078. c.uniforms.blur.value.x = a;
  8079. c.uniforms.blur.value.y = b
  8080. };
  8081. b.setGlobalFilters = function(a) {
  8082. this._drawWebGL();
  8083. this.setFilterProperties(a)
  8084. };
  8085. b.setFilterProperties = function(a) {
  8086. if ((this.filters = a) && a.length) for (var b = 0; 1 > b; b++) {
  8087. var c = a[b];
  8088. this.filterType = c.type;
  8089. switch (c.type) {
  8090. case "blur":
  8091. this.setBlurData(c.blurX, c.blurY);
  8092. break;
  8093. case "colorTransform":
  8094. this.setGlobalColorTransform(c._matrix)
  8095. }
  8096. } else this.filterType = null
  8097. };
  8098. b.setupFont = function(a, b) {
  8099. void 0 === b && (b = null);
  8100. this.canvasContext.setupFont(a, b)
  8101. };
  8102. b.measureText = function(a) {
  8103. return this.canvasContext.measureText(a)
  8104. };
  8105. b.renderGraphics = function(a) {
  8106. this._drawWebGL();
  8107. var b = this.gl,
  8108. c = this.shaderManager.primitiveShader;
  8109. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  8110. this.updateGraphics(a);
  8111. this.shaderManager.activateShader(c);
  8112. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  8113. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  8114. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  8115. b.uniform2f(c.offsetVector, 0, 0);
  8116. b.uniform3fv(c.tintColor, [1, 1, 1]);
  8117. b.uniform1f(c.alpha, this.worldAlpha);
  8118. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  8119. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  8120. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  8121. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  8122. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  8123. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  8124. };
  8125. b.updateGraphics = function(a) {
  8126. var b = this.gl;
  8127. this.buildRectangle(a);
  8128. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  8129. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  8130. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  8131. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  8132. };
  8133. b.buildRectangle = function(a) {
  8134. var b = a.x,
  8135. c = a.y,
  8136. d = a.w;
  8137. a = a.h;
  8138. var e = this.graphicsStyle.a,
  8139. g = this.graphicsStyle.r * e,
  8140. h = this.graphicsStyle.g * e,
  8141. k = this.graphicsStyle.b * e,
  8142. l = this.graphicsPoints,
  8143. m = this.graphicsIndices,
  8144. p = l.length / 6;
  8145. l.push(b, c);
  8146. l.push(g, h, k, e);
  8147. l.push(b + d, c);
  8148. l.push(g, h, k, e);
  8149. l.push(b, c + a);
  8150. l.push(g, h, k, e);
  8151. l.push(b + d, c + a);
  8152. l.push(g, h, k, e);
  8153. m.push(p, p, p + 1, p + 2, p + 3, p + 3)
  8154. };
  8155. b.setGraphicsStyle = function(a, b, c, d) {
  8156. this.graphicsStyle.r = a;
  8157. this.graphicsStyle.g = b;
  8158. this.graphicsStyle.b = c;
  8159. this.graphicsStyle.a = d
  8160. };
  8161. d.glID = 0;
  8162. d.isInit = !1;
  8163. return d
  8164. } (c.RendererContext);
  8165. c.WebGLRenderer = g;
  8166. g.prototype.__class__ = "egret.WebGLRenderer"
  8167. })(egret || (egret = {}));
  8168. var egret_webgl_graphics; (function(c) {
  8169. c.beginFill = function(c, d) {
  8170. void 0 === d && (d = 1);
  8171. this._pushCommand(new g(this._setStyle, this, [(c >> 16) / 255, ((c & 65280) >> 8) / 255, (c & 255) / 255, d]))
  8172. };
  8173. c.drawRect = function(c, d, b, a) {
  8174. this._pushCommand(new g(function(a) {
  8175. this.renderContext.renderGraphics(a)
  8176. },
  8177. this, [{
  8178. x: c,
  8179. y: d,
  8180. w: b,
  8181. h: a
  8182. }]));
  8183. this._checkRect(c, d, b, a)
  8184. };
  8185. c.drawCircle = function(c, d, b) {};
  8186. c.drawRoundRect = function(c, d, b, a, f, g) {};
  8187. c.drawEllipse = function(c, d, b, a) {};
  8188. c.lineStyle = function(c, d, b, a, f, g, t, s) {};
  8189. c.lineTo = function(c, d) {};
  8190. c.curveTo = function(c, d, b, a) {};
  8191. c.cubicCurveTo = function(c, d, b, a, f, g) {};
  8192. c.moveTo = function(c, d) {};
  8193. c.clear = function() {
  8194. this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
  8195. };
  8196. c.endFill = function() {};
  8197. c._pushCommand = function(c) {
  8198. this.commandQueue.push(c)
  8199. };
  8200. c._draw = function(c) {
  8201. var d = this.commandQueue.length;
  8202. if (0 != d) for (this.renderContext = c, c = 0; c < d; c++) {
  8203. var b = this.commandQueue[c];
  8204. b.method.apply(b.thisObject, b.args)
  8205. }
  8206. };
  8207. var g = function() {
  8208. return function(c, d, b) {
  8209. this.method = c;
  8210. this.thisObject = d;
  8211. this.args = b
  8212. }
  8213. } ();
  8214. g.prototype.__class__ = "egret_webgl_graphics.Command";
  8215. c._setStyle = function(c, d, b, a) {
  8216. this.renderContext.setGraphicsStyle(c, d, b, a)
  8217. };
  8218. c.init = function() {
  8219. for (var e in c) egret.Graphics.prototype[e] = c[e]
  8220. }
  8221. })(egret_webgl_graphics || (egret_webgl_graphics = {})); (function(c) {
  8222. var g = function() {
  8223. function e() {}
  8224. e.compileProgram = function(d, b, a) {
  8225. a = e.compileFragmentShader(d, a);
  8226. b = e.compileVertexShader(d, b);
  8227. var f = d.createProgram();
  8228. d.attachShader(f, b);
  8229. d.attachShader(f, a);
  8230. d.linkProgram(f);
  8231. d.getProgramParameter(f, d.LINK_STATUS) || c.Logger.infoWithErrorId(1020);
  8232. return f
  8233. };
  8234. e.compileFragmentShader = function(c, b) {
  8235. return e._compileShader(c, b, c.FRAGMENT_SHADER)
  8236. };
  8237. e.compileVertexShader = function(c, b) {
  8238. return e._compileShader(c, b, c.VERTEX_SHADER)
  8239. };
  8240. e._compileShader = function(d, b, a) {
  8241. a = d.createShader(a);
  8242. d.shaderSource(a, b);
  8243. d.compileShader(a);
  8244. return d.getShaderParameter(a, d.COMPILE_STATUS) ? a: (c.Logger.info(d.getShaderInfoLog(a)), null)
  8245. };
  8246. e.checkCanUseWebGL = function() {
  8247. if (void 0 == e.canUseWebGL) try {
  8248. var c = document.createElement("canvas");
  8249. e.canUseWebGL = !!window.WebGLRenderingContext && !(!c.getContext("webgl") && !c.getContext("experimental-webgl"))
  8250. } catch(b) {
  8251. e.canUseWebGL = !1
  8252. }
  8253. return e.canUseWebGL
  8254. };
  8255. return e
  8256. } ();
  8257. c.WebGLUtils = g;
  8258. g.prototype.__class__ = "egret.WebGLUtils"
  8259. })(egret || (egret = {})); (function(c) {
  8260. var g = function() {
  8261. function e(b) {
  8262. 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}";
  8263. this.program = this.gl = null;
  8264. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  8265. this.uniforms = null;
  8266. this.gl = b;
  8267. this.init()
  8268. }
  8269. var d = e.prototype;
  8270. d.init = function() {
  8271. var b = this.gl,
  8272. a = c.WebGLUtils.compileProgram(b, this.defaultVertexSrc, this.fragmentSrc);
  8273. b.useProgram(a);
  8274. this.uSampler = b.getUniformLocation(a, "uSampler");
  8275. this.projectionVector = b.getUniformLocation(a, "projectionVector");
  8276. this.offsetVector = b.getUniformLocation(a, "offsetVector");
  8277. this.dimensions = b.getUniformLocation(a, "dimensions");
  8278. this.aVertexPosition = b.getAttribLocation(a, "aVertexPosition");
  8279. this.aTextureCoord = b.getAttribLocation(a, "aTextureCoord");
  8280. this.colorAttribute = b.getAttribLocation(a, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  8281. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  8282. for (var d in this.uniforms) this.uniforms[d].uniformLocation = b.getUniformLocation(a, d);
  8283. this.initUniforms();
  8284. this.program = a
  8285. };
  8286. d.initUniforms = function() {
  8287. if (this.uniforms) {
  8288. var b = this.gl,
  8289. a, c;
  8290. for (c in this.uniforms) {
  8291. a = this.uniforms[c];
  8292. var d = a.type;
  8293. "mat2" === d || "mat3" === d || "mat4" === d ? (a.glMatrix = !0, a.glValueLength = 1, "mat2" === d ? a.glFunc = b.uniformMatrix2fv: "mat3" === d ? a.glFunc = b.uniformMatrix3fv: "mat4" === d && (a.glFunc = b.uniformMatrix4fv)) : (a.glFunc = b["uniform" + d], a.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  8294. }
  8295. }
  8296. };
  8297. d.syncUniforms = function() {
  8298. if (this.uniforms) {
  8299. var b, a = this.gl,
  8300. c;
  8301. for (c in this.uniforms) b = this.uniforms[c],
  8302. 1 === b.glValueLength ? !0 === b.glMatrix ? b.glFunc.call(a, b.uniformLocation, b.transpose, b.value) : b.glFunc.call(a, b.uniformLocation, b.value) : 2 === b.glValueLength ? b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y) : 3 === b.glValueLength ? b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y, b.value.z) : 4 === b.glValueLength && b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y, b.value.z, b.value.w)
  8303. }
  8304. };
  8305. return e
  8306. } ();
  8307. c.EgretShader = g;
  8308. g.prototype.__class__ = "egret.EgretShader"
  8309. })(egret || (egret = {})); (function(c) {
  8310. var g = function(c) {
  8311. function d(b) {
  8312. c.call(this, b);
  8313. 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 texColor = texture2D(uSampler, vTextureCoord);\nvec4 locColor = texColor * matrix;\nif(texColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = vec4(locColor.rgb*locColor.a,locColor.a);\n}";
  8314. this.uniforms = {
  8315. matrix: {
  8316. type: "mat4",
  8317. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  8318. },
  8319. colorAdd: {
  8320. type: "4f",
  8321. value: {
  8322. x: 0,
  8323. y: 0,
  8324. z: 0,
  8325. w: 0
  8326. }
  8327. }
  8328. };
  8329. this.init()
  8330. }
  8331. __extends(d, c);
  8332. return d
  8333. } (c.EgretShader);
  8334. c.ColorTransformShader = g;
  8335. g.prototype.__class__ = "egret.ColorTransformShader"
  8336. })(egret || (egret = {})); (function(c) {
  8337. var g = function(c) {
  8338. function d(b) {
  8339. c.call(this, b);
  8340. 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;}";
  8341. this.uniforms = {
  8342. blur: {
  8343. type: "2f",
  8344. value: {
  8345. x: 2,
  8346. y: 2
  8347. }
  8348. }
  8349. };
  8350. this.init()
  8351. }
  8352. __extends(d, c);
  8353. return d
  8354. } (c.EgretShader);
  8355. c.BlurShader = g;
  8356. g.prototype.__class__ = "egret.BlurShader"
  8357. })(egret || (egret = {})); (function(c) {
  8358. var g = function() {
  8359. function e(c) {
  8360. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
  8361. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  8362. 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}";
  8363. this.gl = c;
  8364. this.init()
  8365. }
  8366. e.prototype.init = function() {
  8367. var d = this.gl,
  8368. b = c.WebGLUtils.compileProgram(d, this.vertexSrc, this.fragmentSrc);
  8369. d.useProgram(b);
  8370. this.projectionVector = d.getUniformLocation(b, "projectionVector");
  8371. this.offsetVector = d.getUniformLocation(b, "offsetVector");
  8372. this.tintColor = d.getUniformLocation(b, "tint");
  8373. this.aVertexPosition = d.getAttribLocation(b, "aVertexPosition");
  8374. this.colorAttribute = d.getAttribLocation(b, "aColor");
  8375. this.attributes = [this.aVertexPosition, this.colorAttribute];
  8376. this.translationMatrix = d.getUniformLocation(b, "translationMatrix");
  8377. this.alpha = d.getUniformLocation(b, "alpha");
  8378. this.program = b
  8379. };
  8380. return e
  8381. } ();
  8382. c.PrimitiveShader = g;
  8383. g.prototype.__class__ = "egret.PrimitiveShader"
  8384. })(egret || (egret = {})); (function(c) {
  8385. var g = function() {
  8386. function e(b) {
  8387. this.gl = null;
  8388. this.maxAttibs = 10;
  8389. this.attribState = [];
  8390. this.tempAttribState = [];
  8391. this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
  8392. for (var a = 0; a < this.maxAttibs; a++) this.attribState[a] = !1;
  8393. this.setContext(b)
  8394. }
  8395. var d = e.prototype;
  8396. d.setContext = function(b) {
  8397. this.gl = b;
  8398. this.primitiveShader = new c.PrimitiveShader(b);
  8399. this.defaultShader = new c.EgretShader(b);
  8400. this.colorTransformShader = new c.ColorTransformShader(b);
  8401. this.blurShader = new c.BlurShader(b);
  8402. this.activateShader(this.defaultShader)
  8403. };
  8404. d.activateShader = function(b) {
  8405. this.currentShader != b && (this.gl.useProgram(b.program), this.setAttribs(b.attributes), this.currentShader = b)
  8406. };
  8407. d.setAttribs = function(b) {
  8408. var a, c;
  8409. c = this.tempAttribState.length;
  8410. for (a = 0; a < c; a++) this.tempAttribState[a] = !1;
  8411. c = b.length;
  8412. for (a = 0; a < c; a++) this.tempAttribState[b[a]] = !0;
  8413. b = this.gl;
  8414. c = this.attribState.length;
  8415. for (a = 0; a < c; a++) this.attribState[a] !== this.tempAttribState[a] && (this.attribState[a] = this.tempAttribState[a], this.tempAttribState[a] ? b.enableVertexAttribArray(a) : b.disableVertexAttribArray(a))
  8416. };
  8417. return e
  8418. } ();
  8419. c.WebGLShaderManager = g;
  8420. g.prototype.__class__ = "egret.WebGLShaderManager"
  8421. })(egret || (egret = {})); (function(c) {
  8422. var g = function(e) {
  8423. function d() {
  8424. e.call(this);
  8425. c.Texture.createBitmapData = c.Texture._createBitmapDataForCanvasAndWebGl
  8426. }
  8427. __extends(d, e);
  8428. var b = d.prototype;
  8429. b.initVersion = function(a) {
  8430. this._versionCtr = a
  8431. };
  8432. b.proceed = function(a) {
  8433. function b() {
  8434. if (4 == e.readyState) if (e.status != a._status && (a._status = e.status, c.HTTPStatusEvent.dispatchHTTPStatusEvent(a, e.status)), 400 <= e.status || 0 == e.status) c.IOErrorEvent.dispatchIOErrorEvent(a);
  8435. else {
  8436. switch (a.dataFormat) {
  8437. case c.URLLoaderDataFormat.TEXT:
  8438. a.data = e.responseText;
  8439. break;
  8440. case c.URLLoaderDataFormat.VARIABLES:
  8441. a.data = new c.URLVariables(e.responseText);
  8442. break;
  8443. case c.URLLoaderDataFormat.BINARY:
  8444. a.data = e.response;
  8445. break;
  8446. default:
  8447. a.data = e.responseText
  8448. }
  8449. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  8450. }
  8451. }
  8452. if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  8453. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) c.Html5Capatibility._audioType == c.AudioType.WEB_AUDIO ? this.loadWebAudio(a) : c.Html5Capatibility._audioType == c.AudioType.QQ_AUDIO ? this.loadQQAudio(a) : this.loadSound(a);
  8454. else {
  8455. var d = a._request,
  8456. e = this.getXHR();
  8457. e.onreadystatechange = b;
  8458. var g = this.getVirtualUrl(c.NetContext._getUrl(d));
  8459. e.open(d.method, g, !0);
  8460. this.setResponseType(e, a.dataFormat);
  8461. d.method != c.URLRequestMethod.GET && d.data ? d.data instanceof c.URLVariables ? (e.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), e.send(d.data.toString())) : (e.setRequestHeader("Content-Type", "multipart/form-data"), e.send(d.data)) : e.send()
  8462. }
  8463. };
  8464. b.loadSound = function(a) {
  8465. function b(e) {
  8466. c.clearTimeout(g.__timeoutId);
  8467. g.removeEventListener("canplaythrough", b, !1);
  8468. g.removeEventListener("error", d, !1);
  8469. e = new c.Html5Audio;
  8470. e._setAudio(g);
  8471. var h = new c.Sound;
  8472. h._setAudio(e);
  8473. a.data = h;
  8474. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  8475. }
  8476. function d(e) {
  8477. c.clearTimeout(g.__timeoutId);
  8478. g.removeEventListener("canplaythrough", b, !1);
  8479. g.removeEventListener("error", d, !1);
  8480. c.IOErrorEvent.dispatchIOErrorEvent(a)
  8481. }
  8482. var e = this.getVirtualUrl(a._request.url),
  8483. g = new Audio(e);
  8484. g.__timeoutId = c.setTimeout(b, this, 100);
  8485. g.addEventListener("canplaythrough", b, !1);
  8486. g.addEventListener("error", d, !1);
  8487. g.load()
  8488. };
  8489. b.loadQQAudio = function(a) {
  8490. var b = c.Html5Capatibility._QQRootPath + this.getVirtualUrl(a._request.url);
  8491. console.log("loadQQAudio");
  8492. QZAppExternal.preloadSound(function(d) {
  8493. if (0 == d.code) {
  8494. d = new c.QQAudio;
  8495. d._setPath(b);
  8496. var e = new c.Sound;
  8497. e._setAudio(d);
  8498. a.data = e;
  8499. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  8500. } else c.IOErrorEvent.dispatchIOErrorEvent(a)
  8501. },
  8502. {
  8503. bid: -1,
  8504. url: b,
  8505. refresh: 1
  8506. })
  8507. };
  8508. b.loadWebAudio = function(a) {
  8509. var b = this.getVirtualUrl(a._request.url),
  8510. d = new XMLHttpRequest;
  8511. d.open("GET", b, !0);
  8512. d.responseType = "arraybuffer";
  8513. console.log("loadWebAudio");
  8514. d.onload = function() {
  8515. var b = new c.WebAudio;
  8516. b._setArrayBuffer(d.response,
  8517. function() {
  8518. var d = new c.Sound;
  8519. d._setAudio(b);
  8520. a.data = d;
  8521. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  8522. })
  8523. };
  8524. d.send()
  8525. };
  8526. b.getXHR = function() {
  8527. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  8528. };
  8529. b.setResponseType = function(a, b) {
  8530. switch (b) {
  8531. case c.URLLoaderDataFormat.TEXT:
  8532. case c.URLLoaderDataFormat.VARIABLES:
  8533. a.responseType = c.URLLoaderDataFormat.TEXT;
  8534. break;
  8535. case c.URLLoaderDataFormat.BINARY:
  8536. a.responseType = "arraybuffer";
  8537. break;
  8538. default:
  8539. a.responseType = b
  8540. }
  8541. };
  8542. b.loadTexture = function(a) {
  8543. var b = this.getVirtualUrl(a._request.url);
  8544. c.Texture.createBitmapData(b,
  8545. function(b, d) {
  8546. if (0 != b) c.IOErrorEvent.dispatchIOErrorEvent(a);
  8547. else {
  8548. var f = new c.Texture;
  8549. f._setBitmapData(d);
  8550. a.data = f;
  8551. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  8552. }
  8553. })
  8554. };
  8555. b.getVirtualUrl = function(a) {
  8556. return this._versionCtr ? this._versionCtr.getVirtualUrl(a) : a
  8557. };
  8558. return d
  8559. } (c.NetContext);
  8560. c.HTML5NetContext = g;
  8561. g.prototype.__class__ = "egret.HTML5NetContext"
  8562. })(egret || (egret = {})); (function(c) {
  8563. var g = function(e) {
  8564. function d() {
  8565. e.call(this);
  8566. this._isTouchDown = !1;
  8567. this.rootDiv = null;
  8568. this.rootDiv = document.getElementById(c.StageDelegate.canvas_div_name);
  8569. if (!this.rootDiv) {
  8570. var a = document.getElementById(c.StageDelegate.egret_root_div);
  8571. this.rootDiv = c.Browser.getInstance().$new("div");
  8572. this.rootDiv.id = c.StageDelegate.canvas_div_name;
  8573. a.appendChild(this.rootDiv)
  8574. }
  8575. }
  8576. __extends(d, e);
  8577. var b = d.prototype;
  8578. b.prevent = function(a) {
  8579. a.stopPropagation(); ! 0 == a.isScroll || c.HTMLInput.getInstance().isInputOn() || a.preventDefault()
  8580. };
  8581. b.run = function() {
  8582. var a = this;
  8583. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown",
  8584. function(b) {
  8585. a._onTouchBegin(b);
  8586. a.prevent(b)
  8587. },
  8588. !1), this.rootDiv.addEventListener("MSPointerMove",
  8589. function(b) {
  8590. a._onTouchMove(b);
  8591. a.prevent(b)
  8592. },
  8593. !1), this.rootDiv.addEventListener("MSPointerUp",
  8594. function(b) {
  8595. a._onTouchEnd(b);
  8596. a.prevent(b)
  8597. },
  8598. !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  8599. window.addEventListener("mousedown",
  8600. function(b) {
  8601. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  8602. });
  8603. window.addEventListener("mouseup",
  8604. function(b) {
  8605. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  8606. a._isTouchDown = !1
  8607. })
  8608. };
  8609. b.addMouseListener = function() {
  8610. var a = this;
  8611. this.rootDiv.addEventListener("mousedown",
  8612. function(b) {
  8613. a._onTouchBegin(b)
  8614. });
  8615. this.rootDiv.addEventListener("mousemove",
  8616. function(b) {
  8617. a._onTouchMove(b)
  8618. });
  8619. this.rootDiv.addEventListener("mouseup",
  8620. function(b) {
  8621. a._onTouchEnd(b)
  8622. })
  8623. };
  8624. b.addTouchListener = function() {
  8625. var a = this;
  8626. this.rootDiv.addEventListener("touchstart",
  8627. function(b) {
  8628. for (var c = b.changedTouches.length,
  8629. d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  8630. a.prevent(b)
  8631. },
  8632. !1);
  8633. this.rootDiv.addEventListener("touchmove",
  8634. function(b) {
  8635. for (var c = b.changedTouches.length,
  8636. d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  8637. a.prevent(b)
  8638. },
  8639. !1);
  8640. this.rootDiv.addEventListener("touchend",
  8641. function(b) {
  8642. for (var c = b.changedTouches.length,
  8643. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  8644. a.prevent(b)
  8645. },
  8646. !1);
  8647. this.rootDiv.addEventListener("touchcancel",
  8648. function(b) {
  8649. for (var c = b.changedTouches.length,
  8650. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  8651. a.prevent(b)
  8652. },
  8653. !1)
  8654. };
  8655. b.inOutOfCanvas = function(a) {
  8656. var b = this.getLocation(this.rootDiv, a);
  8657. a = b.x;
  8658. var b = b.y,
  8659. d = c.MainContext.instance.stage;
  8660. return 0 > a || 0 > b || a > d.stageWidth || b > d.stageHeight ? !0 : !1
  8661. };
  8662. b.dispatchLeaveStageEvent = function() {
  8663. this.touchingIdentifiers.length = 0;
  8664. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  8665. };
  8666. b._onTouchBegin = function(a) {
  8667. var b = this.getLocation(this.rootDiv, a),
  8668. c = -1;
  8669. a.hasOwnProperty("identifier") && (c = a.identifier);
  8670. this.onTouchBegan(b.x, b.y, c)
  8671. };
  8672. b._onTouchMove = function(a) {
  8673. var b = this.getLocation(this.rootDiv, a),
  8674. c = -1;
  8675. a.hasOwnProperty("identifier") && (c = a.identifier);
  8676. this.onTouchMove(b.x, b.y, c)
  8677. };
  8678. b._onTouchEnd = function(a) {
  8679. var b = this.getLocation(this.rootDiv, a),
  8680. c = -1;
  8681. a.hasOwnProperty("identifier") && (c = a.identifier);
  8682. this.onTouchEnd(b.x, b.y, c)
  8683. };
  8684. b.getLocation = function(a, b) {
  8685. var d = document.documentElement,
  8686. e = window,
  8687. g, n;
  8688. "function" === typeof a.getBoundingClientRect ? (n = a.getBoundingClientRect(), g = n.left, n = n.top) : n = g = 0;
  8689. g += e.pageXOffset - d.clientLeft;
  8690. n += e.pageYOffset - d.clientTop;
  8691. null != b.pageX ? (d = b.pageX, e = b.pageY) : (g -= document.body.scrollLeft, n -= document.body.scrollTop, d = b.clientX, e = b.clientY);
  8692. var h = c.Point.identity;
  8693. h.x = (d - g) / c.StageDelegate.getInstance().getScaleX();
  8694. h.y = (e - n) / c.StageDelegate.getInstance().getScaleY();
  8695. return h
  8696. };
  8697. return d
  8698. } (c.TouchContext);
  8699. c.HTML5TouchContext = g;
  8700. g.prototype.__class__ = "egret.HTML5TouchContext"
  8701. })(egret || (egret = {})); (function(c) {
  8702. var g = function(d) {
  8703. function b() {
  8704. d.call(this);
  8705. this._isNeedShow = !1;
  8706. this.inputDiv = this.inputElement = null;
  8707. this._gscaleY = this._gscaleX = 0;
  8708. this._isNeesHide = !1;
  8709. this.textValue = "";
  8710. this._styleInfoes = {};
  8711. e.getInstance()
  8712. }
  8713. __extends(b, d);
  8714. var a = b.prototype;
  8715. a._initElement = function(a, b, d, e) {
  8716. var g = c.StageDelegate.getInstance().getScaleX(),
  8717. h = c.StageDelegate.getInstance().getScaleY();
  8718. this.inputDiv.style.left = a * g + "px";
  8719. this.inputDiv.style.top = b * h + "px";
  8720. this._gscaleX = g * d;
  8721. this._gscaleY = h * e
  8722. };
  8723. a._show = function(a, b, c, d) {
  8724. this._multiline = a;
  8725. e.getInstance().isCurrentStageText(this) ? this.inputElement.onblur = null: (this.inputElement = e.getInstance().getInputElement(this), this.inputDiv = e.getInstance()._inputDIV);
  8726. this._isNeedShow = e.getInstance()._needShow = !0
  8727. };
  8728. a.onBlurHandler = function() {
  8729. e.getInstance().clearInputElement();
  8730. window.scrollTo(0, 0)
  8731. };
  8732. a.executeShow = function() {
  8733. this.inputElement.value = this._getText();
  8734. null == this.inputElement.onblur && (this.inputElement.onblur = this.onBlurHandler);
  8735. this._resetStageText();
  8736. 0 < this._textfield._TF_Props_._maxChars ? this.inputElement.setAttribute("maxlength", this._textfield._TF_Props_._maxChars) : this.inputElement.removeAttribute("maxlength");
  8737. this.inputElement.selectionStart = this.inputElement.value.length;
  8738. this.inputElement.selectionEnd = this.inputElement.value.length;
  8739. this.inputElement.focus()
  8740. };
  8741. a._hide = function() {
  8742. this._isNeesHide = !0;
  8743. 0 <= c.Browser.getInstance().getUserAgent().indexOf("ios") && e.getInstance().disconnectStageText(this)
  8744. };
  8745. a._getText = function() {
  8746. this.textValue || (this.textValue = "");
  8747. return this.textValue
  8748. };
  8749. a._setText = function(a) {
  8750. this.textValue = a;
  8751. this.resetText()
  8752. };
  8753. a.resetText = function() {
  8754. this.inputElement && (this.inputElement.value = this.textValue)
  8755. };
  8756. a._onInput = function() {
  8757. this.textValue = this.inputElement.value;
  8758. c.Event.dispatchEvent(this, "updateText", !1)
  8759. };
  8760. a._onClickHandler = function(a) {
  8761. this._isNeedShow && (a.stopImmediatePropagation(), this._isNeedShow = !1, this.executeShow(), this.dispatchEvent(new c.Event("focus")))
  8762. };
  8763. a._onDisconnect = function() {
  8764. this.inputElement = null;
  8765. this.dispatchEvent(new c.Event("blur"))
  8766. };
  8767. a.setElementStyle = function(a, b) {
  8768. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b)
  8769. };
  8770. a._removeInput = function() {
  8771. this.inputElement && e.getInstance().disconnectStageText(this)
  8772. };
  8773. a._resetStageText = function() {
  8774. if (this.inputElement) {
  8775. var a = this._textfield,
  8776. b = a._TF_Props_;
  8777. this.setElementStyle("fontFamily", b._fontFamily);
  8778. this.setElementStyle("fontStyle", b._italic ? "italic": "normal");
  8779. this.setElementStyle("fontWeight", b._bold ? "bold": "normal");
  8780. this.setElementStyle("textAlign", b._textAlign);
  8781. this.setElementStyle("fontSize", b._size * this._gscaleY + "px");
  8782. this.setElementStyle("lineHeight", b._size * this._gscaleY + "px");
  8783. this.setElementStyle("color", b._textColorString);
  8784. this.setElementStyle("width", a._getSize(c.Rectangle.identity).width * this._gscaleX + "px");
  8785. this.setElementStyle("height", a._getSize(c.Rectangle.identity).height * this._gscaleY + "px");
  8786. this.setElementStyle("verticalAlign", b._verticalAlign)
  8787. }
  8788. };
  8789. return b
  8790. } (c.StageText);
  8791. c.HTML5StageText = g;
  8792. g.prototype.__class__ = "egret.HTML5StageText";
  8793. var e = function() {
  8794. function d() {
  8795. this._needShow = !1
  8796. }
  8797. var b = d.prototype;
  8798. b.isInputOn = function() {
  8799. return null != this._stageText
  8800. };
  8801. b.isCurrentStageText = function(a) {
  8802. return this._stageText == a
  8803. };
  8804. b.initValue = function(a) {
  8805. a.style.position = "absolute";
  8806. a.style.left = "0px";
  8807. a.style.top = "0px";
  8808. a.style.border = "none";
  8809. a.style.padding = "0"
  8810. };
  8811. b._initStageDelegateDiv = function() {
  8812. var a = this,
  8813. b = c.Browser.getInstance().$("#StageDelegateDiv");
  8814. b || (b = c.Browser.getInstance().$new("div"), b.id = "StageDelegateDiv", document.getElementById(c.StageDelegate.egret_root_div).appendChild(b), a.initValue(b), b.style.width = "0px", b.style.height = "0px", a._inputDIV = c.Browser.getInstance().$new("div"), a.initValue(a._inputDIV), a._inputDIV.style.width = "0px", a._inputDIV.style.height = "0px", a._inputDIV.style.left = "0px", a._inputDIV.style.top = "-100px", a._inputDIV.style[c.Browser.getInstance().getTrans("transformOrigin")] = "0% 0% 0px", b.appendChild(a._inputDIV), document.getElementById(c.StageDelegate.canvas_div_name).addEventListener("click",
  8815. function(b) {
  8816. a._needShow ? (a._needShow = !1, c.MainContext.instance.stage._changeSizeDispatchFlag = !1, a._stageText._onClickHandler(b), d.getInstance().show()) : a._inputElement && (a.clearInputElement(), a._inputElement.blur(), a._inputElement = null)
  8817. }), a.initInputElement(!0), a.initInputElement(!1))
  8818. };
  8819. b.initInputElement = function(a) {
  8820. var b = this;
  8821. a ? (a = document.createElement("textarea"), a.style.resize = "none", b._multiElement = a, a.id = "egretTextarea") : (a = document.createElement("input"), b._simpleElement = a, a.id = "egretInput");
  8822. a.type = "text";
  8823. b._inputDIV.appendChild(a);
  8824. a.setAttribute("tabindex", "-1");
  8825. a.style.width = "1px";
  8826. a.style.height = "12px";
  8827. b.initValue(a);
  8828. a.style.outline = "thin";
  8829. a.style.background = "none";
  8830. a.style.overflow = "hidden";
  8831. a.style.wordBreak = "break-all";
  8832. a.style.opacity = 0;
  8833. a.oninput = function() {
  8834. b._stageText && b._stageText._onInput()
  8835. }
  8836. };
  8837. b.show = function() {
  8838. var a = this._inputElement;
  8839. c.__callAsync(function() {
  8840. a.style.opacity = 1
  8841. },
  8842. this)
  8843. };
  8844. b.disconnectStageText = function(a) {
  8845. if (null == this._stageText || this._stageText == a) this.clearInputElement(),
  8846. this._inputElement && this._inputElement.blur()
  8847. };
  8848. b.clearInputElement = function() {
  8849. this._inputElement && (this._inputElement.value = "", this._inputElement.onblur = null, this._inputElement.style.width = "1px", this._inputElement.style.height = "12px", this._inputElement.style.left = "0px", this._inputElement.style.top = "0px", this._inputElement.style.opacity = 0, (this._simpleElement == this._inputElement ? this._multiElement: this._simpleElement).style.display = "block", this._inputDIV.style.left = "0px", this._inputDIV.style.top = "-100px");
  8850. this._stageText && (this._stageText._onDisconnect(), this._stageText = null);
  8851. c.MainContext.instance.stage._changeSizeDispatchFlag = !0
  8852. };
  8853. b.getInputElement = function(a) {
  8854. this.clearInputElement();
  8855. this._stageText = a;
  8856. this._inputElement = this._stageText._multiline ? this._multiElement: this._simpleElement; (this._simpleElement == this._inputElement ? this._multiElement: this._simpleElement).style.display = "none";
  8857. return this._inputElement
  8858. };
  8859. d.getInstance = function() {
  8860. null == d._instance && (d._instance = new c.HTMLInput);
  8861. return d._instance
  8862. };
  8863. return d
  8864. } ();
  8865. c.HTMLInput = e;
  8866. e.prototype.__class__ = "egret.HTMLInput"
  8867. })(egret || (egret = {}));
  8868. egret.StageText.create = function() {
  8869. egret.HTMLInput.getInstance()._initStageDelegateDiv();
  8870. return new egret.HTML5StageText
  8871. }; (function(c) {
  8872. var g = function() {
  8873. function e() {
  8874. this._loop = !1;
  8875. this.paused = !0;
  8876. this._listeners = [];
  8877. this._onEndedCall = null;
  8878. this._volume = 1;
  8879. this._startTime = 0
  8880. }
  8881. var d = e.prototype;
  8882. d._play = function(b) {
  8883. this.removeListeners();
  8884. c.Html5Capatibility._System_OS != c.SystemOSType.WPHONE && (this._audio = this._audio.cloneNode());
  8885. this.paused = !1;
  8886. this._audio.autoplay = !0;
  8887. this._audio.volume = this._volume;
  8888. var a = this,
  8889. d = function(b) {
  8890. a._audio.removeEventListener("ended", d);
  8891. a._onEndedCall && a._onEndedCall.call(null, b);
  8892. a.clear()
  8893. };
  8894. this._audio.addEventListener("ended", d);
  8895. this.initStart();
  8896. try {
  8897. this._audio.currentTime = this._startTime
  8898. } catch(e) {} finally {
  8899. this._audio.play()
  8900. }
  8901. };
  8902. d.clear = function() {
  8903. try {
  8904. this._audio.pause()
  8905. } catch(b) {} finally {
  8906. this.removeListeners(),
  8907. this._loop && !this.paused && this._play()
  8908. }
  8909. };
  8910. d._pause = function() {
  8911. this.paused = !0;
  8912. this._audio.pause()
  8913. };
  8914. d._load = function() {
  8915. this._audio.load()
  8916. };
  8917. d._setAudio = function(b) {
  8918. this._audio = b
  8919. };
  8920. d.initStart = function() {
  8921. for (var b = 0; b < this._listeners.length; b++) {
  8922. var a = this._listeners[b];
  8923. this._audio.addEventListener(a.type, a.listener, a.useCapture)
  8924. }
  8925. };
  8926. d._addEventListener = function(b, a, c) {
  8927. void 0 === c && (c = !1);
  8928. "ended" == b ? this._onEndedCall = a: (this._listeners.push({
  8929. type: b,
  8930. listener: a,
  8931. useCapture: c
  8932. }), this._audio && this._audio.addEventListener(b, a, c))
  8933. };
  8934. d.removeListeners = function() {
  8935. for (var b = 0; b < this._listeners.length; b++) {
  8936. var a = this._listeners[b];
  8937. this._audio && this._audio.removeEventListener(a.type, a.listener, a.useCapture)
  8938. }
  8939. };
  8940. d._removeEventListener = function(b, a, c) {
  8941. void 0 === c && (c = !1);
  8942. if ("ended" == b) this._onEndedCall = null;
  8943. else for (var d = 0; d < this._listeners.length; d++) {
  8944. var e = this._listeners[d];
  8945. if (e.listener == a && e.useCapture == c && e.type == b) {
  8946. this._listeners.splice(d, 1);
  8947. this._audio && this._audio.removeEventListener(b, a, c);
  8948. break
  8949. }
  8950. }
  8951. };
  8952. d._preload = function(b, a, d) {
  8953. void 0 === a && (a = null);
  8954. void 0 === d && (d = null);
  8955. c.callLater(a, d)
  8956. };
  8957. d._destroy = function() {};
  8958. d._getVolume = function() {
  8959. return this._volume
  8960. };
  8961. d._setVolume = function(b) {
  8962. this._volume = Math.max(0, Math.min(b, 1));
  8963. this._audio.volume = this._volume
  8964. };
  8965. d._setLoop = function(b) {
  8966. this._loop = b
  8967. };
  8968. d._getCurrentTime = function() {
  8969. return this._audio.currentTime
  8970. };
  8971. d._setCurrentTime = function(b) {
  8972. this._startTime = b
  8973. };
  8974. return e
  8975. } ();
  8976. c.Html5Audio = g;
  8977. g.prototype.__class__ = "egret.Html5Audio"
  8978. })(egret || (egret = {})); (function(c) {
  8979. var g = function() {
  8980. function e() {
  8981. this.context = e.ctx;
  8982. this.bufferSource = null;
  8983. this.paused = !0;
  8984. this._loop = !1;
  8985. this._listeners = [];
  8986. this._onEndedCall = null;
  8987. this._volume = 1;
  8988. this._currentTime = this._startTime = 0;
  8989. this.gain = e.ctx.createGain ? e.ctx.createGain() : e.ctx.createGainNode()
  8990. }
  8991. var d = e.prototype;
  8992. e.decodeAudios = function() {
  8993. if (! (0 >= e.decodeArr.length || e.isDecoding)) {
  8994. e.isDecoding = !0;
  8995. var b = e.decodeArr.shift();
  8996. e.ctx.decodeAudioData(b.buffer,
  8997. function(a) {
  8998. b.self.audioBuffer = a;
  8999. b.callback && b.callback();
  9000. e.isDecoding = !1;
  9001. e.decodeAudios()
  9002. })
  9003. }
  9004. };
  9005. d._play = function(b) {
  9006. var a = this;
  9007. this.bufferSource && (this.bufferSource.onended = null, this.removeListeners(), this.bufferSource = null);
  9008. b = this.context;
  9009. var c = this.gain,
  9010. d = b.createBufferSource();
  9011. this.bufferSource = d;
  9012. this.addListeners();
  9013. d.buffer = this.audioBuffer;
  9014. d.connect(c);
  9015. c.connect(b.destination);
  9016. d.onended = function(b) {
  9017. a.clear();
  9018. a._onEndedCall && a._onEndedCall.call(null, b);
  9019. a._loop && !a.paused && a._play()
  9020. };
  9021. this.paused = !1;
  9022. this._startTime = Date.now();
  9023. this.gain.gain.value = this._volume;
  9024. d.start(0, this._currentTime);
  9025. this._currentTime = 0
  9026. };
  9027. d.clear = function() {
  9028. if (this.bufferSource) {
  9029. this.removeListeners();
  9030. var b = this.bufferSource;
  9031. b.stop ? b.stop(0) : b.noteOff(0);
  9032. this.bufferSource.disconnect();
  9033. this.bufferSource = null
  9034. }
  9035. };
  9036. d.addListeners = function() {
  9037. for (var b = 0; b < this._listeners.length; b++) {
  9038. var a = this._listeners[b];
  9039. this.bufferSource.addEventListener(a.type, a.listener, a.useCapture)
  9040. }
  9041. };
  9042. d.removeListeners = function() {
  9043. for (var b = 0; b < this._listeners.length; b++) {
  9044. var a = this._listeners[b];
  9045. this.bufferSource.removeEventListener(a.type, a.listener, a.useCapture)
  9046. }
  9047. };
  9048. d._pause = function() {
  9049. this.paused = !0;
  9050. this.clear()
  9051. };
  9052. d._addEventListener = function(b, a, c) {
  9053. void 0 === c && (c = !1);
  9054. "ended" == b ? this._onEndedCall = a: (this._listeners.push({
  9055. type: b,
  9056. listener: a,
  9057. useCapture: c
  9058. }), this.bufferSource && this.bufferSource.addEventListener(b, a, c))
  9059. };
  9060. d._removeEventListener = function(b, a, c) {
  9061. void 0 === c && (c = !1);
  9062. if ("ended" == b) this._onEndedCall = null;
  9063. else for (var d = 0; d < this._listeners.length; d++) {
  9064. var e = this._listeners[d];
  9065. if (e.listener == a && e.useCapture == c && e.type == b) {
  9066. this._listeners.splice(d, 1);
  9067. this.bufferSource && this.bufferSource.removeEventListener(b, a, c);
  9068. break
  9069. }
  9070. }
  9071. };
  9072. d._load = function() {
  9073. this._setArrayBuffer(this._arrayBuffer, null)
  9074. };
  9075. d._setArrayBuffer = function(b, a) {
  9076. this._arrayBuffer = b;
  9077. e.decodeArr.push({
  9078. buffer: b,
  9079. callback: a,
  9080. self: this
  9081. });
  9082. e.decodeAudios()
  9083. };
  9084. d._preload = function(b, a, d) {
  9085. void 0 === a && (a = null);
  9086. void 0 === d && (d = null);
  9087. c.callLater(a, d)
  9088. };
  9089. d._getVolume = function() {
  9090. return this._volume
  9091. };
  9092. d._setVolume = function(b) {
  9093. this._volume = b;
  9094. this.gain.gain.value = b
  9095. };
  9096. d._setLoop = function(b) {
  9097. this._loop = b
  9098. };
  9099. d._getCurrentTime = function() {
  9100. return this.bufferSource ? (Date.now() - this._startTime) / 1E3: 0
  9101. };
  9102. d._setCurrentTime = function(b) {
  9103. this._currentTime = b
  9104. };
  9105. d._destroy = function() {};
  9106. e.canUseWebAudio = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;
  9107. e.ctx = e.canUseWebAudio ? new(window.AudioContext || window.webkitAudioContext || window.mozAudioContext) : void 0;
  9108. e.decodeArr = [];
  9109. e.isDecoding = !1;
  9110. return e
  9111. } ();
  9112. c.WebAudio = g;
  9113. g.prototype.__class__ = "egret.WebAudio"
  9114. })(egret || (egret = {})); (function(c) {
  9115. var g = function() {
  9116. function e() {
  9117. this._loop = !1;
  9118. this._currentTime = 0
  9119. }
  9120. var d = e.prototype;
  9121. d._play = function(b) {
  9122. this._type = b;
  9123. b == c.Sound.EFFECT ? QZAppExternal.playLocalSound(function(a) {
  9124. alert(JSON.stringify(a))
  9125. },
  9126. {
  9127. bid: -1,
  9128. url: this._path,
  9129. loop: this._loop ? -1 : 0
  9130. }) : QZAppExternal.playLocalBackSound({
  9131. bid: -1,
  9132. url: this._path,
  9133. loop: this._loop ? -1 : 0
  9134. })
  9135. };
  9136. d._pause = function() {
  9137. this._type == c.Sound.EFFECT ? QZAppExternal.stopSound() : QZAppExternal.stopBackSound()
  9138. };
  9139. d._addEventListener = function(b, a, c) {};
  9140. d._removeEventListener = function(b, a, c) {};
  9141. d._load = function() {};
  9142. d._preload = function(b, a, d) {
  9143. void 0 === a && (a = null);
  9144. void 0 === d && (d = null);
  9145. c.callLater(a, d)
  9146. };
  9147. d._setPath = function(b) {
  9148. this._path = b
  9149. };
  9150. d._getVolume = function() {
  9151. return 1
  9152. };
  9153. d._setVolume = function(b) {};
  9154. d._setLoop = function(b) {
  9155. this._loop = b
  9156. };
  9157. d._getCurrentTime = function() {
  9158. return 0
  9159. };
  9160. d._setCurrentTime = function(b) {
  9161. this._currentTime = b
  9162. };
  9163. d._destroy = function() {};
  9164. return e
  9165. } ();
  9166. c.QQAudio = g;
  9167. g.prototype.__class__ = "egret.QQAudio"
  9168. })(egret || (egret = {})); (function(c) {
  9169. var g = function() {
  9170. function b() {}
  9171. b.QQ_AUDIO = 1;
  9172. b.WEB_AUDIO = 2;
  9173. b.HTML5_AUDIO = 3;
  9174. return b
  9175. } ();
  9176. c.AudioType = g;
  9177. g.prototype.__class__ = "egret.AudioType";
  9178. var e = function() {
  9179. function b() {}
  9180. b.WPHONE = 1;
  9181. b.IOS = 2;
  9182. b.ADNROID = 3;
  9183. return b
  9184. } ();
  9185. c.SystemOSType = e;
  9186. e.prototype.__class__ = "egret.SystemOSType";
  9187. var d = function(b) {
  9188. function a() {
  9189. b.call(this)
  9190. }
  9191. __extends(a, b);
  9192. a._init = function() {
  9193. var b = navigator.userAgent.toLowerCase();
  9194. a.ua = b;
  9195. a._canUseBlob = !1;
  9196. a._audioType = g.HTML5_AUDIO;
  9197. a._AudioClass = c.Html5Audio;
  9198. if (0 <= b.indexOf("windows phone")) a._System_OS = e.WPHONE;
  9199. else if (0 <= b.indexOf("android")) a._System_OS = e.ADNROID,
  9200. window.hasOwnProperty("QZAppExternal") && 0 <= b.indexOf("qzone") && (a._AudioClass = c.QQAudio, a._audioType = g.QQ_AUDIO, (b = document.getElementsByTagName("base")) && 0 < b.length ? a._QQRootPath = b[0].baseURI: (b = window.location.href.indexOf("?"), -1 == b && (b = window.location.href.length), b = window.location.href.substring(0, b), b = b.substring(0, b.lastIndexOf("/")), a._QQRootPath = b + "/"));
  9201. else if (0 <= b.indexOf("iphone") || 0 <= b.indexOf("ipad") || 0 <= b.indexOf("ipod")) a._System_OS = e.IOS,
  9202. 7 <= a.getIOSVersion() && (a._canUseBlob = !0, a._AudioClass = c.WebAudio, a._audioType = g.WEB_AUDIO);
  9203. window.URL || window.webkitURL || (a._canUseBlob = !1);
  9204. window.AudioContext || window.webkitAudioContext || window.mozAudioContext || a._audioType != g.WEB_AUDIO || (a._audioType = g.HTML5_AUDIO, a._AudioClass = c.Html5Audio)
  9205. };
  9206. a.getIOSVersion = function() {
  9207. var b = a.ua.toLowerCase().match(/cpu [^\d]*\d.*like mac os x/)[0];
  9208. return parseInt(b.match(/\d(_\d)*/)[0]) || 0
  9209. };
  9210. a._canUseBlob = !1;
  9211. a._audioType = 0;
  9212. a._QQRootPath = "";
  9213. a._System_OS = 0;
  9214. a.ua = "";
  9215. return a
  9216. } (c.HashObject);
  9217. c.Html5Capatibility = d;
  9218. d.prototype.__class__ = "egret.Html5Capatibility";
  9219. d._init()
  9220. })(egret || (egret = {})); (function(c) {
  9221. var g = function(e) {
  9222. function d() {
  9223. e.call(this);
  9224. this.localVersionDataPath = "localVersion.manifest";
  9225. this.localVersionData = null;
  9226. this.changeVersionDataPath = "version.manifest";
  9227. this.changeVersionData = null;
  9228. this.baseVersionDataPath = "base.manifest";
  9229. this.baseVersionData = null;
  9230. this.localVersionCodePath = "localCode.manifest";
  9231. this.serverVersionCodePath = "code.manifest";
  9232. this._call = this._load = null
  9233. }
  9234. __extends(d, e);
  9235. var b = d.prototype;
  9236. b.fetchVersion = function() {
  9237. this._load = new c.NativeResourceLoader;
  9238. this._load.addEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
  9239. this._load.addEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
  9240. this.initLocalVersionData()
  9241. };
  9242. b.initLocalVersionData = function() {
  9243. var a = this.getData("appVersion.manifest", !0);
  9244. if (a) {
  9245. if (1 == a.debug) {
  9246. this.baseVersionData = null;
  9247. if (a = this.getData(this.localVersionDataPath, !1)) for (var b in a) this.deleteFile(b);
  9248. this.deleteFile(this.localVersionDataPath);
  9249. this.deleteFile(this.localVersionCodePath);
  9250. this.loadOver();
  9251. return
  9252. }
  9253. var c = this.getData("appVersion.manifest", !1);
  9254. if (null == c || c.version != a.version) {
  9255. this.localVersionData = this.getData(this.localVersionDataPath, !0);
  9256. null == this.localVersionData && (this.localVersionData = {});
  9257. this.deleteFile(this.localVersionCodePath);
  9258. this.save("appVersion.manifest", JSON.stringify(a));
  9259. if (a = this.getData(this.localVersionCodePath, !1)) for (b in a) a[b] != this.localVersionData[b] && this.deleteFile(b);
  9260. else a = {};
  9261. for (b in this.localVersionData) a[b] != this.localVersionData[b] && this.deleteFile(b);
  9262. this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData));
  9263. this.loadCodeVersion();
  9264. return
  9265. }
  9266. }
  9267. this.localVersionData = this.getLocalData(this.localVersionDataPath);
  9268. null == this.localVersionData && (this.localVersionData = this.getLocalData(this.baseVersionDataPath), null == this.localVersionData && (this.localVersionData = {}), this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData)));
  9269. this.loadCodeVersion()
  9270. };
  9271. b.deleteFile = function(a) {
  9272. egret_native.deleteUpdateFile && egret_native.deleteUpdateFile(a)
  9273. };
  9274. b.loadCodeVersion = function() {
  9275. var a = 1;
  9276. this.newCode = 1;
  9277. var b = this.getLocalData(this.localVersionCodePath);
  9278. null != b && (a = b.code);
  9279. b = this.getLocalData(this.serverVersionCodePath);
  9280. null != b && (this.newCode = b.code);
  9281. this.loadBaseVersion(a != this.newCode)
  9282. };
  9283. b.loadBaseVersion = function(a) {
  9284. this.baseVersionData = this.getLocalData(this.baseVersionDataPath);
  9285. this.changeVersionData = this.getLocalData(this.changeVersionDataPath);
  9286. var b = this;
  9287. null == b.baseVersionData || a ? b.loadFile(b.baseVersionDataPath,
  9288. function() {
  9289. b.baseVersionData = b.getLocalData(b.baseVersionDataPath);
  9290. b.loadBaseOver()
  9291. }) : b.loadBaseOver()
  9292. };
  9293. b.loadBaseOver = function() {
  9294. this.save(this.localVersionCodePath, JSON.stringify({
  9295. code: this.newCode
  9296. }));
  9297. this.loadOver()
  9298. };
  9299. b.loadFile = function(a, b) {
  9300. void 0 === b && (b = null);
  9301. this._call = b;
  9302. this._load.load(a, 1E3)
  9303. };
  9304. b.fileLoadComplete = function(a) {
  9305. this._call && this._call()
  9306. };
  9307. b.loadError = function(a) {
  9308. this._load.removeEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
  9309. this._load.removeEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
  9310. this.dispatchEvent(a)
  9311. };
  9312. b.loadOver = function() {
  9313. this._load.removeEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
  9314. this._load.removeEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
  9315. this.dispatchEvent(new c.Event(c.Event.COMPLETE))
  9316. };
  9317. b.save = function(a, b) {
  9318. egret_native.writeFileSync ? egret_native.writeFileSync(a, b) : egret_native.saveRecord && egret_native.saveRecord(a, b)
  9319. };
  9320. b.getData = function(a, b) {
  9321. if (egret_native.readUpdateFileSync && egret_native.readResourceFileSync) {
  9322. var c = b ? egret_native.readResourceFileSync(a) : egret_native.readUpdateFileSync(a);
  9323. return null != c ? JSON.parse(c) : null
  9324. }
  9325. return this.getLocalDataByOld(a)
  9326. };
  9327. b.getLocalData = function(a) {
  9328. if (egret_native.readUpdateFileSync && egret_native.readResourceFileSync) {
  9329. var b = egret_native.readUpdateFileSync(a);
  9330. if (null != b) return JSON.parse(b);
  9331. b = egret_native.readResourceFileSync(a);
  9332. return null != b ? JSON.parse(b) : null
  9333. }
  9334. return this.getLocalDataByOld(a)
  9335. };
  9336. b.getLocalDataByOld = function(a) {
  9337. var b = null;
  9338. egret_native.isRecordExists(a) ? (a = egret_native.loadRecord(a), b = JSON.parse(a)) : egret_native.isFileExists(a) && (a = egret_native.readFileSync(a), b = JSON.parse(a));
  9339. return b
  9340. };
  9341. b.getChangeList = function() {
  9342. if (!this.baseVersionData) return [];
  9343. var a = {},
  9344. b;
  9345. for (b in this.changeVersionData) 1 == this.changeVersionData[b].d ? delete this.baseVersionData[b] : this.baseVersionData[b] = this.changeVersionData[b];
  9346. for (b in this.baseVersionData) null != this.localVersionData[b] && this.compareVersion(this.localVersionData, this.baseVersionData, b) || (a[b] = {
  9347. url: b,
  9348. size: this.baseVersionData[b].s
  9349. });
  9350. var c = [];
  9351. for (b in a) c.push(a[b]);
  9352. return c
  9353. };
  9354. b.compareVersion = function(a, b, c) {
  9355. return null == a[c] || null == b[c] ? !1 : a[c].v == b[c].v
  9356. };
  9357. b.checkIsNewVersion = function(a) {
  9358. return this.baseVersionData ? null != this.changeVersionData[a] ? this.compareVersion(this.changeVersionData, this.localVersionData, a) : null != this.baseVersionData[a] ? this.compareVersion(this.baseVersionData, this.localVersionData, a) : !0 : !0
  9359. };
  9360. b.saveVersion = function(a) {
  9361. if (this.baseVersionData) {
  9362. var b = !1;
  9363. null != this.changeVersionData[a] ? this.compareVersion(this.changeVersionData, this.localVersionData, a) || (b = !0, this.localVersionData[a] = this.changeVersionData[a]) : null == this.baseVersionData[a] || this.compareVersion(this.baseVersionData, this.localVersionData, a) || (b = !0, this.localVersionData[a] = this.baseVersionData[a]);
  9364. b && this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData))
  9365. }
  9366. };
  9367. b.getVirtualUrl = function(a) {
  9368. return a
  9369. };
  9370. return d
  9371. } (c.EventDispatcher);
  9372. c.NativeVersionController = g;
  9373. g.prototype.__class__ = "egret.NativeVersionController"
  9374. })(egret || (egret = {}));
  9375. var RES; (function(c) {
  9376. var g = function(c) {
  9377. function d(b, a, d) {
  9378. void 0 === a && (a = !1);
  9379. void 0 === d && (d = !1);
  9380. c.call(this, b, a, d);
  9381. this.itemsTotal = this.itemsLoaded = 0;
  9382. this.groupName = "";
  9383. this.resItem = null
  9384. }
  9385. __extends(d, c);
  9386. d.dispatchResourceEvent = function(b, a, c, e, g, s) {
  9387. void 0 === c && (c = "");
  9388. void 0 === e && (e = null);
  9389. void 0 === g && (g = 0);
  9390. void 0 === s && (s = 0);
  9391. var n = egret.Event._getPropertyData(d);
  9392. n.groupName = c;
  9393. n.resItem = e;
  9394. n.itemsLoaded = g;
  9395. n.itemsTotal = s;
  9396. egret.Event._dispatchByTarget(d, b, a, n)
  9397. };
  9398. d.ITEM_LOAD_ERROR = "itemLoadError";
  9399. d.CONFIG_COMPLETE = "configComplete";
  9400. d.CONFIG_LOAD_ERROR = "configLoadError";
  9401. d.GROUP_PROGRESS = "groupProgress";
  9402. d.GROUP_COMPLETE = "groupComplete";
  9403. d.GROUP_LOAD_ERROR = "groupLoadError";
  9404. return d
  9405. } (egret.Event);
  9406. c.ResourceEvent = g;
  9407. g.prototype.__class__ = "RES.ResourceEvent"
  9408. })(RES || (RES = {})); (function(c) {
  9409. var g = function() {
  9410. function c(b, a, d) {
  9411. this.groupName = "";
  9412. this.data = null;
  9413. this._loaded = !1;
  9414. this.name = b;
  9415. this.url = a;
  9416. this.type = d
  9417. }
  9418. var d = c.prototype;
  9419. Object.defineProperty(d, "loaded", {
  9420. get: function() {
  9421. return this.data ? this.data.loaded: this._loaded
  9422. },
  9423. set: function(b) {
  9424. this.data && (this.data.loaded = b);
  9425. this._loaded = b
  9426. },
  9427. enumerable: !0,
  9428. configurable: !0
  9429. });
  9430. d.toString = function() {
  9431. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  9432. };
  9433. c.TYPE_XML = "xml";
  9434. c.TYPE_IMAGE = "image";
  9435. c.TYPE_BIN = "bin";
  9436. c.TYPE_TEXT = "text";
  9437. c.TYPE_JSON = "json";
  9438. c.TYPE_SHEET = "sheet";
  9439. c.TYPE_FONT = "font";
  9440. c.TYPE_SOUND = "sound";
  9441. return c
  9442. } ();
  9443. c.ResourceItem = g;
  9444. g.prototype.__class__ = "RES.ResourceItem"
  9445. })(RES || (RES = {})); (function(c) {
  9446. var g = function() {
  9447. function e() {
  9448. this.keyMap = {};
  9449. this.groupDic = {};
  9450. c.configInstance = this
  9451. }
  9452. var d = e.prototype;
  9453. d.getGroupByName = function(b) {
  9454. var a = [];
  9455. if (!this.groupDic[b]) return a;
  9456. b = this.groupDic[b];
  9457. for (var c = b.length,
  9458. d = 0; d < c; d++) a.push(this.parseResourceItem(b[d]));
  9459. return a
  9460. };
  9461. d.getRawGroupByName = function(b) {
  9462. return this.groupDic[b] ? this.groupDic[b] : []
  9463. };
  9464. d.createGroup = function(b, a, c) {
  9465. void 0 === c && (c = !1);
  9466. if (!c && this.groupDic[b] || !a || 0 == a.length) return ! 1;
  9467. c = this.groupDic;
  9468. for (var d = [], e = a.length, g = 0; g < e; g++) {
  9469. var n = a[g],
  9470. h = c[n];
  9471. if (h) for (var n = h.length,
  9472. k = 0; k < n; k++) {
  9473. var l = h[k]; - 1 == d.indexOf(l) && d.push(l)
  9474. } else(l = this.keyMap[n]) ? -1 == d.indexOf(l) && d.push(l) : egret.Logger.warningWithErrorId(2E3, n)
  9475. }
  9476. if (0 == d.length) return ! 1;
  9477. this.groupDic[b] = d;
  9478. return ! 0
  9479. };
  9480. d.parseConfig = function(b, a) {
  9481. if (b) {
  9482. var c = b.resources;
  9483. if (c) for (var d = c.length,
  9484. e = 0; e < d; e++) {
  9485. var g = c[e],
  9486. n = g.url;
  9487. n && -1 == n.indexOf("://") && (g.url = a + n);
  9488. this.addItemToKeyMap(g)
  9489. }
  9490. if (c = b.groups) for (d = c.length, e = 0; e < d; e++) {
  9491. for (var n = c[e], h = [], k = n.keys.split(","), l = k.length, m = 0; m < l; m++) g = k[m].trim(),
  9492. (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
  9493. this.groupDic[n.name] = h
  9494. }
  9495. }
  9496. };
  9497. d.addSubkey = function(b, a) {
  9498. var c = this.keyMap[a];
  9499. c && !this.keyMap[b] && (this.keyMap[b] = c)
  9500. };
  9501. d.addItemToKeyMap = function(b) {
  9502. this.keyMap[b.name] || (this.keyMap[b.name] = b);
  9503. if (b.hasOwnProperty("subkeys")) {
  9504. var a = b.subkeys.split(",");
  9505. b.subkeys = a;
  9506. for (var c = a.length,
  9507. d = 0; d < c; d++) {
  9508. var e = a[d];
  9509. null == this.keyMap[e] && (this.keyMap[e] = b)
  9510. }
  9511. }
  9512. };
  9513. d.getName = function(b) {
  9514. return (b = this.keyMap[b]) ? b.name: ""
  9515. };
  9516. d.getType = function(b) {
  9517. return (b = this.keyMap[b]) ? b.type: ""
  9518. };
  9519. d.getRawResourceItem = function(b) {
  9520. return this.keyMap[b]
  9521. };
  9522. d.getResourceItem = function(b) {
  9523. return (b = this.keyMap[b]) ? this.parseResourceItem(b) : null
  9524. };
  9525. d.parseResourceItem = function(b) {
  9526. var a = new c.ResourceItem(b.name, b.url, b.type);
  9527. a.data = b;
  9528. return a
  9529. };
  9530. return e
  9531. } ();
  9532. c.ResourceConfig = g;
  9533. g.prototype.__class__ = "RES.ResourceConfig"
  9534. })(RES || (RES = {})); (function(c) {
  9535. var g = function(e) {
  9536. function d() {
  9537. e.call(this);
  9538. this.thread = 2;
  9539. this.loadingCount = 0;
  9540. this.resInstance = this.callBack = null;
  9541. this.groupTotalDic = {};
  9542. this.numLoadedDic = {};
  9543. this.itemListDic = {};
  9544. this.groupErrorDic = {};
  9545. this.retryTimesDic = {};
  9546. this.maxRetryTimes = 3;
  9547. this.failedList = [];
  9548. this.priorityQueue = {};
  9549. this.lazyLoadList = [];
  9550. this.analyzerDic = {};
  9551. this.queueIndex = 0
  9552. }
  9553. __extends(d, e);
  9554. var b = d.prototype;
  9555. b.isGroupInLoading = function(a) {
  9556. return void 0 !== this.itemListDic[a]
  9557. };
  9558. b.loadGroup = function(a, b, d) {
  9559. void 0 === d && (d = 0);
  9560. if (!this.itemListDic[b] && b) if (a && 0 != a.length) {
  9561. this.priorityQueue[d] ? this.priorityQueue[d].push(b) : this.priorityQueue[d] = [b];
  9562. this.itemListDic[b] = a;
  9563. d = a.length;
  9564. for (var e = 0; e < d; e++) a[e].groupName = b;
  9565. this.groupTotalDic[b] = a.length;
  9566. this.numLoadedDic[b] = 0;
  9567. this.next()
  9568. } else egret.Logger.warningWithErrorId(2001, b),
  9569. a = new c.ResourceEvent(c.ResourceEvent.GROUP_LOAD_ERROR),
  9570. a.groupName = b,
  9571. this.dispatchEvent(a)
  9572. };
  9573. b.loadItem = function(a) {
  9574. this.lazyLoadList.push(a);
  9575. a.groupName = "";
  9576. this.next()
  9577. };
  9578. b.next = function() {
  9579. for (; this.loadingCount < this.thread;) {
  9580. var a = this.getOneResourceItem();
  9581. if (!a) break;
  9582. this.loadingCount++;
  9583. if (a.loaded) this.onItemComplete(a);
  9584. else {
  9585. var b = this.analyzerDic[a.type];
  9586. b || (b = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  9587. b.loadFile(a, this.onItemComplete, this)
  9588. }
  9589. }
  9590. };
  9591. b.getOneResourceItem = function() {
  9592. if (0 < this.failedList.length) return this.failedList.shift();
  9593. var a = Number.NEGATIVE_INFINITY,
  9594. b;
  9595. for (b in this.priorityQueue) a = Math.max(a, b);
  9596. a = this.priorityQueue[a];
  9597. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  9598. b = a.length;
  9599. for (var c, d = 0; d < b; d++) {
  9600. this.queueIndex >= b && (this.queueIndex = 0);
  9601. c = this.itemListDic[a[this.queueIndex]];
  9602. if (0 < c.length) break;
  9603. this.queueIndex++
  9604. }
  9605. return 0 == c.length ? null: c.shift()
  9606. };
  9607. b.onItemComplete = function(a) {
  9608. this.loadingCount--;
  9609. var b = a.groupName;
  9610. if (!a.loaded) {
  9611. var d = this.retryTimesDic[a.name] || 1;
  9612. if (d > this.maxRetryTimes) delete this.retryTimesDic[a.name],
  9613. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, b, a);
  9614. else {
  9615. this.retryTimesDic[a.name] = d + 1;
  9616. this.failedList.push(a);
  9617. this.next();
  9618. return
  9619. }
  9620. }
  9621. if (b) {
  9622. this.numLoadedDic[b]++;
  9623. var d = this.numLoadedDic[b],
  9624. e = this.groupTotalDic[b];
  9625. a.loaded || (this.groupErrorDic[b] = !0);
  9626. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, b, a, d, e);
  9627. d == e && (a = this.groupErrorDic[b], this.removeGroupName(b), delete this.groupTotalDic[b], delete this.numLoadedDic[b], delete this.itemListDic[b], delete this.groupErrorDic[b], a ? c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_LOAD_ERROR, b) : c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, b))
  9628. } else this.callBack.call(this.resInstance, a);
  9629. this.next()
  9630. };
  9631. b.removeGroupName = function(a) {
  9632. for (var b in this.priorityQueue) {
  9633. for (var c = this.priorityQueue[b], d = c.length, e = 0, g = !1, d = c.length, h = 0; h < d; h++) {
  9634. if (c[h] == a) {
  9635. c.splice(e, 1);
  9636. g = !0;
  9637. break
  9638. }
  9639. e++
  9640. }
  9641. if (g) {
  9642. 0 == c.length && delete this.priorityQueue[b];
  9643. break
  9644. }
  9645. }
  9646. };
  9647. return d
  9648. } (egret.EventDispatcher);
  9649. c.ResourceLoader = g;
  9650. g.prototype.__class__ = "RES.ResourceLoader"
  9651. })(RES || (RES = {})); (function(c) {
  9652. var g = function(e) {
  9653. function d() {
  9654. e.call(this);
  9655. this.resourceConfig = null;
  9656. this.resourceConfig = c.configInstance
  9657. }
  9658. __extends(d, e);
  9659. var b = d.prototype;
  9660. b.addSubkey = function(a, b) {
  9661. this.resourceConfig.addSubkey(a, b)
  9662. };
  9663. b.loadFile = function(a, b, c) {};
  9664. b.getRes = function(a) {};
  9665. b.destroyRes = function(a) {
  9666. return ! 1
  9667. };
  9668. d.getStringPrefix = function(a) {
  9669. if (!a) return "";
  9670. var b = a.indexOf(".");
  9671. return - 1 != b ? a.substring(0, b) : ""
  9672. };
  9673. d.getStringTail = function(a) {
  9674. if (!a) return "";
  9675. var b = a.indexOf(".");
  9676. return - 1 != b ? a.substring(b + 1) : ""
  9677. };
  9678. return d
  9679. } (egret.HashObject);
  9680. c.AnalyzerBase = g;
  9681. g.prototype.__class__ = "RES.AnalyzerBase"
  9682. })(RES || (RES = {})); (function(c) {
  9683. var g = function(c) {
  9684. function d() {
  9685. c.call(this);
  9686. this.fileDic = {};
  9687. this.resItemDic = [];
  9688. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  9689. this.recycler = new egret.Recycler
  9690. }
  9691. __extends(d, c);
  9692. var b = d.prototype;
  9693. b.loadFile = function(a, b, c) {
  9694. if (this.fileDic[a.name]) b.call(c, a);
  9695. else {
  9696. var d = this.getLoader();
  9697. this.resItemDic[d.hashCode] = {
  9698. item: a,
  9699. func: b,
  9700. thisObject: c
  9701. };
  9702. d.load(new egret.URLRequest(a.url))
  9703. }
  9704. };
  9705. b.getLoader = function() {
  9706. var a = this.recycler.pop();
  9707. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  9708. a.dataFormat = this._dataFormat;
  9709. return a
  9710. };
  9711. b.onLoadFinish = function(a) {
  9712. var b = a.target,
  9713. c = this.resItemDic[b.hashCode];
  9714. delete this.resItemDic[b.hashCode];
  9715. var d = c.item,
  9716. e = c.func;
  9717. d.loaded = a.type == egret.Event.COMPLETE;
  9718. d.loaded && this.analyzeData(d, b.data);
  9719. this.recycler.push(b);
  9720. e.call(c.thisObject, d)
  9721. };
  9722. b.analyzeData = function(a, b) {
  9723. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
  9724. };
  9725. b.getRes = function(a) {
  9726. return this.fileDic[a]
  9727. };
  9728. b.hasRes = function(a) {
  9729. return null != this.getRes(a)
  9730. };
  9731. b.destroyRes = function(a) {
  9732. return this.fileDic[a] ? (this.onResourceDestroy(this.fileDic[a]), delete this.fileDic[a], !0) : !1
  9733. };
  9734. b.onResourceDestroy = function(a) {};
  9735. return d
  9736. } (c.AnalyzerBase);
  9737. c.BinAnalyzer = g;
  9738. g.prototype.__class__ = "RES.BinAnalyzer"
  9739. })(RES || (RES = {})); (function(c) {
  9740. var g = function(c) {
  9741. function d() {
  9742. c.call(this);
  9743. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  9744. }
  9745. __extends(d, c);
  9746. var b = d.prototype;
  9747. b.analyzeData = function(a, b) {
  9748. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  9749. };
  9750. b.onResourceDestroy = function(a) {
  9751. a.dispose()
  9752. };
  9753. return d
  9754. } (c.BinAnalyzer);
  9755. c.ImageAnalyzer = g;
  9756. g.prototype.__class__ = "RES.ImageAnalyzer"
  9757. })(RES || (RES = {})); (function(c) {
  9758. var g = function(c) {
  9759. function d() {
  9760. c.call(this);
  9761. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  9762. }
  9763. __extends(d, c);
  9764. d.prototype.analyzeData = function(b, a) {
  9765. var c = b.name;
  9766. if (!this.fileDic[c] && a) try {
  9767. this.fileDic[c] = JSON.parse(a)
  9768. } catch(d) {
  9769. egret.Logger.warningWithErrorId(1017, b.url, a)
  9770. }
  9771. };
  9772. return d
  9773. } (c.BinAnalyzer);
  9774. c.JsonAnalyzer = g;
  9775. g.prototype.__class__ = "RES.JsonAnalyzer"
  9776. })(RES || (RES = {})); (function(c) {
  9777. var g = function(c) {
  9778. function d() {
  9779. c.call(this);
  9780. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  9781. }
  9782. __extends(d, c);
  9783. return d
  9784. } (c.BinAnalyzer);
  9785. c.TextAnalyzer = g;
  9786. g.prototype.__class__ = "RES.TextAnalyzer"
  9787. })(RES || (RES = {})); (function(c) {
  9788. var g = function(e) {
  9789. function d() {
  9790. e.call(this);
  9791. this.sheetMap = {};
  9792. this.textureMap = {};
  9793. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  9794. }
  9795. __extends(d, e);
  9796. var b = d.prototype;
  9797. b.getRes = function(a) {
  9798. var b = this.fileDic[a];
  9799. b || (b = this.textureMap[a]); ! b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.fileDic[b]) && (a = c.AnalyzerBase.getStringTail(a), b = b.getTexture(a));
  9800. return b
  9801. };
  9802. b.onLoadFinish = function(a) {
  9803. var b = a.target,
  9804. c = this.resItemDic[b.hashCode];
  9805. delete this.resItemDic[b.hashCode];
  9806. var d = c.item,
  9807. e = c.func;
  9808. d.loaded = a.type == egret.Event.COMPLETE;
  9809. if (d.loaded) if ("string" == typeof b.data) {
  9810. if (d.loaded = !1, a = this.analyzeConfig(d, b.data)) {
  9811. b = d.url;
  9812. d.url = a;
  9813. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  9814. this.loadFile(d, e, c.thisObject);
  9815. this._dataFormat = egret.URLLoaderDataFormat.TEXT;
  9816. d.url = b;
  9817. return
  9818. }
  9819. } else this.analyzeBitmap(d, b.data);
  9820. this.recycler.push(b);
  9821. e.call(c.thisObject, d)
  9822. };
  9823. b.analyzeConfig = function(a, b) {
  9824. var c = a.name,
  9825. d, e = "";
  9826. try {
  9827. d = JSON.parse(b)
  9828. } catch(g) {
  9829. egret.Logger.warningWithErrorId(1017, a.url, b)
  9830. }
  9831. d && (this.sheetMap[c] = d, e = this.getRelativePath(a.url, d.file));
  9832. return e
  9833. };
  9834. b.analyzeBitmap = function(a, b) {
  9835. var c = a.name;
  9836. if (!this.fileDic[c] && b) {
  9837. var d = this.sheetMap[c];
  9838. delete this.sheetMap[c];
  9839. d = this.parseSpriteSheet(b, d, a.data && a.data.subkeys ? "": c);
  9840. this.fileDic[c] = d
  9841. }
  9842. };
  9843. b.getRelativePath = function(a, b) {
  9844. a = a.split("\\").join("/");
  9845. var c = a.lastIndexOf("/");
  9846. return a = -1 != c ? a.substring(0, c + 1) + b: b
  9847. };
  9848. b.parseSpriteSheet = function(a, b, c) {
  9849. b = b.frames;
  9850. if (!b) return null;
  9851. var d = new egret.SpriteSheet(a),
  9852. e = this.textureMap,
  9853. g;
  9854. for (g in b) {
  9855. var h = b[g];
  9856. a = d.createTexture(g, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH);
  9857. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  9858. null == e[g] && (e[g] = a, c && this.addSubkey(g, c))
  9859. }
  9860. return d
  9861. };
  9862. b.destroyRes = function(a) {
  9863. var b = this.fileDic[a];
  9864. if (b) {
  9865. delete this.fileDic[a];
  9866. for (var c in b._textureMap) this.textureMap[c] && delete this.textureMap[c];
  9867. this.onResourceDestroy(b);
  9868. return ! 0
  9869. }
  9870. return ! 1
  9871. };
  9872. b.onResourceDestroy = function(a) {
  9873. a.dispose()
  9874. };
  9875. return d
  9876. } (c.BinAnalyzer);
  9877. c.SheetAnalyzer = g;
  9878. g.prototype.__class__ = "RES.SheetAnalyzer"
  9879. })(RES || (RES = {})); (function(c) {
  9880. var g = function(c) {
  9881. function d() {
  9882. c.call(this)
  9883. }
  9884. __extends(d, c);
  9885. var b = d.prototype;
  9886. b.analyzeConfig = function(a, b) {
  9887. var c = a.name,
  9888. d, e = "";
  9889. try {
  9890. d = JSON.parse(b)
  9891. } catch(g) {}
  9892. d ? e = this.getRelativePath(a.url, d.file) : (d = b, e = this.getTexturePath(a.url, d));
  9893. this.sheetMap[c] = d;
  9894. return e
  9895. };
  9896. b.analyzeBitmap = function(a, b) {
  9897. var c = a.name;
  9898. if (!this.fileDic[c] && b) {
  9899. var d = this.sheetMap[c];
  9900. delete this.sheetMap[c];
  9901. d = new egret.BitmapFont(b, d);
  9902. this.fileDic[c] = d
  9903. }
  9904. };
  9905. b.getTexturePath = function(a, b) {
  9906. var c = "",
  9907. d = b.split("\n")[2],
  9908. e = d.indexOf('file="'); - 1 != e && (d = d.substring(e + 6), e = d.indexOf('"'), c = d.substring(0, e));
  9909. a = a.split("\\").join("/");
  9910. e = a.lastIndexOf("/");
  9911. return a = -1 != e ? a.substring(0, e + 1) + c: c
  9912. };
  9913. b.onResourceDestroy = function(a) {
  9914. a.dispose()
  9915. };
  9916. return d
  9917. } (c.SheetAnalyzer);
  9918. c.FontAnalyzer = g;
  9919. g.prototype.__class__ = "RES.FontAnalyzer"
  9920. })(RES || (RES = {})); (function(c) {
  9921. var g = function(c) {
  9922. function d() {
  9923. c.call(this);
  9924. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  9925. }
  9926. __extends(d, c);
  9927. d.prototype.analyzeData = function(b, a) {
  9928. var c = b.name; ! this.fileDic[c] && a && (this.fileDic[c] = a, (c = b.data) && c.soundType ? a.preload(c.soundType) : a.preload(egret.Sound.EFFECT))
  9929. };
  9930. return d
  9931. } (c.BinAnalyzer);
  9932. c.SoundAnalyzer = g;
  9933. g.prototype.__class__ = "RES.SoundAnalyzer"
  9934. })(RES || (RES = {})); (function(c) {
  9935. var g = function(c) {
  9936. function d() {
  9937. c.call(this);
  9938. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  9939. }
  9940. __extends(d, c);
  9941. d.prototype.analyzeData = function(b, a) {
  9942. var c = b.name;
  9943. if (!this.fileDic[c] && a) try {
  9944. var d = egret.XML.parse(a);
  9945. this.fileDic[c] = d
  9946. } catch(e) {}
  9947. };
  9948. return d
  9949. } (c.BinAnalyzer);
  9950. c.XMLAnalyzer = g;
  9951. g.prototype.__class__ = "RES.XMLAnalyzer"
  9952. })(RES || (RES = {})); (function(c) {
  9953. c.loadConfig = function(c, b, a) {
  9954. void 0 === b && (b = "");
  9955. void 0 === a && (a = "json");
  9956. e.loadConfig(c, b, a)
  9957. };
  9958. c.loadGroup = function(c, b) {
  9959. void 0 === b && (b = 0);
  9960. e.loadGroup(c, b)
  9961. };
  9962. c.isGroupLoaded = function(c) {
  9963. return e.isGroupLoaded(c)
  9964. };
  9965. c.getGroupByName = function(c) {
  9966. return e.getGroupByName(c)
  9967. };
  9968. c.createGroup = function(c, b, a) {
  9969. void 0 === a && (a = !1);
  9970. return e.createGroup(c, b, a)
  9971. };
  9972. c.hasRes = function(c) {
  9973. return e.hasRes(c)
  9974. };
  9975. c.parseConfig = function(c, b) {
  9976. void 0 === b && (b = "");
  9977. e.parseConfig(c, b)
  9978. };
  9979. c.getRes = function(c) {
  9980. return e.getRes(c)
  9981. };
  9982. c.getResAsync = function(c, b, a) {
  9983. e.getResAsync(c, b, a)
  9984. };
  9985. c.getResByUrl = function(c, b, a, f) {
  9986. void 0 === f && (f = "");
  9987. e.getResByUrl(c, b, a, f)
  9988. };
  9989. c.destroyRes = function(c, b) {
  9990. return e.destroyRes(c, b)
  9991. };
  9992. c.setMaxLoadingThread = function(c) {
  9993. e.setMaxLoadingThread(c)
  9994. };
  9995. c.setMaxRetryTimes = function(c) {
  9996. e.setMaxRetryTimes(c)
  9997. };
  9998. c.addEventListener = function(c, b, a, f, g) {
  9999. void 0 === f && (f = !1);
  10000. void 0 === g && (g = 0);
  10001. e.addEventListener(c, b, a, f, g)
  10002. };
  10003. c.removeEventListener = function(c, b, a, f) {
  10004. void 0 === f && (f = !1);
  10005. e.removeEventListener(c, b, a, f)
  10006. };
  10007. var g = function(d) {
  10008. function b() {
  10009. d.call(this);
  10010. this.analyzerDic = {};
  10011. this.configItemList = [];
  10012. this.configComplete = this.callLaterFlag = !1;
  10013. this.loadedGroups = [];
  10014. this.groupNameList = [];
  10015. this.asyncDic = {};
  10016. this.init()
  10017. }
  10018. __extends(b, d);
  10019. var a = b.prototype;
  10020. a.getAnalyzerByType = function(a) {
  10021. var b = this.analyzerDic[a];
  10022. b || (b = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  10023. return b
  10024. };
  10025. a.init = function() {
  10026. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  10027. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  10028. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  10029. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  10030. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  10031. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  10032. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  10033. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  10034. this.resConfig = new c.ResourceConfig;
  10035. this.resLoader = new c.ResourceLoader;
  10036. this.resLoader.callBack = this.onResourceItemComp;
  10037. this.resLoader.resInstance = this;
  10038. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  10039. this.resLoader.addEventListener(c.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  10040. };
  10041. a.loadConfig = function(a, b, c) {
  10042. void 0 === c && (c = "json");
  10043. this.configItemList.push({
  10044. url: a,
  10045. resourceRoot: b,
  10046. type: c
  10047. });
  10048. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  10049. };
  10050. a.startLoadConfig = function() {
  10051. this.callLaterFlag = !1;
  10052. var a = this.configItemList;
  10053. this.configItemList = [];
  10054. this.loadingConfigList = a;
  10055. for (var d = a.length,
  10056. e = [], g = 0; g < d; g++) {
  10057. var n = a[g],
  10058. n = new c.ResourceItem(n.url, n.url, n.type);
  10059. e.push(n)
  10060. }
  10061. this.resLoader.loadGroup(e, b.GROUP_CONFIG, Number.MAX_VALUE)
  10062. };
  10063. a.isGroupLoaded = function(a) {
  10064. return - 1 != this.loadedGroups.indexOf(a)
  10065. };
  10066. a.getGroupByName = function(a) {
  10067. return this.resConfig.getGroupByName(a)
  10068. };
  10069. a.loadGroup = function(a, b) {
  10070. void 0 === b && (b = 0);
  10071. if ( - 1 != this.loadedGroups.indexOf(a)) c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, a);
  10072. else if (!this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  10073. var d = this.resConfig.getGroupByName(a);
  10074. this.resLoader.loadGroup(d, a, b)
  10075. } else this.groupNameList.push({
  10076. name: a,
  10077. priority: b
  10078. })
  10079. };
  10080. a.createGroup = function(a, b, c) {
  10081. void 0 === c && (c = !1);
  10082. if (c) {
  10083. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  10084. }
  10085. return this.resConfig.createGroup(a, b, c)
  10086. };
  10087. a.onGroupComp = function(a) {
  10088. if (a.groupName == b.GROUP_CONFIG) {
  10089. a = this.loadingConfigList.length;
  10090. for (var d = 0; d < a; d++) {
  10091. var e = this.loadingConfigList[d],
  10092. g = this.getAnalyzerByType(e.type),
  10093. n = g.getRes(e.url);
  10094. g.destroyRes(e.url);
  10095. this.resConfig.parseConfig(n, e.resourceRoot)
  10096. }
  10097. this.configComplete = !0;
  10098. this.loadingConfigList = null;
  10099. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  10100. this.loadDelayGroups()
  10101. } else this.loadedGroups.push(a.groupName),
  10102. this.dispatchEvent(a)
  10103. };
  10104. a.loadDelayGroups = function() {
  10105. var a = this.groupNameList;
  10106. this.groupNameList = [];
  10107. for (var b = a.length,
  10108. c = 0; c < b; c++) {
  10109. var d = a[c];
  10110. this.loadGroup(d.name, d.priority)
  10111. }
  10112. };
  10113. a.onGroupError = function(a) {
  10114. a.groupName == b.GROUP_CONFIG ? (this.loadingConfigList = null, c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  10115. };
  10116. a.hasRes = function(a) {
  10117. var b = this.resConfig.getType(a);
  10118. return "" == b && (a = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(a), "" == b) ? !1 : !0
  10119. };
  10120. a.parseConfig = function(a, b) {
  10121. this.resConfig.parseConfig(a, b);
  10122. this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
  10123. };
  10124. a.getRes = function(a) {
  10125. var b = this.resConfig.getType(a);
  10126. return "" == b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(b), "" == b) ? null: this.getAnalyzerByType(b).getRes(a)
  10127. };
  10128. a.getResAsync = function(a, b, d) {
  10129. var e = this.resConfig.getType(a),
  10130. g = this.resConfig.getName(a);
  10131. if ("" == e && (g = c.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(g), "" == e)) {
  10132. b.call(d, null);
  10133. return
  10134. } (e = this.getAnalyzerByType(e).getRes(a)) ? b.call(d, e) : (a = {
  10135. key: a,
  10136. compFunc: b,
  10137. thisObject: d
  10138. },
  10139. this.asyncDic[g] ? this.asyncDic[g].push(a) : (this.asyncDic[g] = [a], g = this.resConfig.getResourceItem(g), this.resLoader.loadItem(g)))
  10140. };
  10141. a.getResByUrl = function(a, b, d, e) {
  10142. void 0 === e && (e = "");
  10143. if (a) {
  10144. e || (e = this.getTypeByUrl(a));
  10145. var g = this.getAnalyzerByType(e).getRes(a);
  10146. g ? b.call(d, g) : (b = {
  10147. key: a,
  10148. compFunc: b,
  10149. thisObject: d
  10150. },
  10151. this.asyncDic[a] ? this.asyncDic[a].push(b) : (this.asyncDic[a] = [b], a = new c.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  10152. } else b.call(d, null)
  10153. };
  10154. a.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  10155. switch (a) {
  10156. case c.ResourceItem.TYPE_XML:
  10157. case c.ResourceItem.TYPE_JSON:
  10158. case c.ResourceItem.TYPE_SHEET:
  10159. break;
  10160. case "png":
  10161. case "jpg":
  10162. case "gif":
  10163. case "jpeg":
  10164. case "bmp":
  10165. a = c.ResourceItem.TYPE_IMAGE;
  10166. break;
  10167. case "fnt":
  10168. a = c.ResourceItem.TYPE_FONT;
  10169. break;
  10170. case "txt":
  10171. a = c.ResourceItem.TYPE_TEXT;
  10172. break;
  10173. case "mp3":
  10174. case "ogg":
  10175. case "mpeg":
  10176. case "wav":
  10177. case "m4a":
  10178. case "mp4":
  10179. case "aiff":
  10180. case "wma":
  10181. case "mid":
  10182. a = c.ResourceItem.TYPE_SOUND;
  10183. break;
  10184. default:
  10185. a = c.ResourceItem.TYPE_BIN
  10186. }
  10187. return a
  10188. };
  10189. a.onResourceItemComp = function(a) {
  10190. var b = this.asyncDic[a.name];
  10191. delete this.asyncDic[a.name];
  10192. a = this.getAnalyzerByType(a.type);
  10193. for (var c = b.length,
  10194. d = 0; d < c; d++) {
  10195. var e = b[d],
  10196. g = a.getRes(e.key);
  10197. e.compFunc.call(e.thisObject, g, e.key)
  10198. }
  10199. };
  10200. a.destroyRes = function(a, b) {
  10201. void 0 === b && (b = !0);
  10202. var c = this.resConfig.getRawGroupByName(a);
  10203. if (c && 0 < c.length) {
  10204. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  10205. for (var e = c.length,
  10206. g = 0; g < e; g++) if (d = c[g], b || !this.isResInLoadedGroup(d.name)) {
  10207. d.loaded = !1;
  10208. var k = this.getAnalyzerByType(d.type);
  10209. k.destroyRes(d.name);
  10210. this.removeLoadedGroupsByItemName(d.name)
  10211. }
  10212. return ! 0
  10213. }
  10214. c = this.resConfig.getType(a);
  10215. if ("" == c) return ! 1;
  10216. d = this.resConfig.getRawResourceItem(a);
  10217. d.loaded = !1;
  10218. k = this.getAnalyzerByType(c);
  10219. c = k.destroyRes(a);
  10220. this.removeLoadedGroupsByItemName(d.name);
  10221. return c
  10222. };
  10223. a.removeLoadedGroupsByItemName = function(a) {
  10224. for (var b = this.loadedGroups,
  10225. c = b.length,
  10226. d = 0; d < c; d++) for (var e = this.resConfig.getRawGroupByName(b[d]), g = e.length, k = 0; k < g; k++) if (e[k].name == a) {
  10227. b.splice(d, 1);
  10228. d--;
  10229. c = b.length;
  10230. break
  10231. }
  10232. };
  10233. a.isResInLoadedGroup = function(a) {
  10234. for (var b = this.loadedGroups,
  10235. c = b.length,
  10236. d = 0; d < c; d++) for (var e = this.resConfig.getRawGroupByName(b[d]), g = e.length, k = 0; k < g; k++) if (e[k].name == a) return ! 0;
  10237. return ! 1
  10238. };
  10239. a.setMaxLoadingThread = function(a) {
  10240. 1 > a && (a = 1);
  10241. this.resLoader.thread = a
  10242. };
  10243. a.setMaxRetryTimes = function(a) {
  10244. a = Math.max(a, 0);
  10245. this.resLoader.maxRetryTimes = a
  10246. };
  10247. b.GROUP_CONFIG = "RES__CONFIG";
  10248. return b
  10249. } (egret.EventDispatcher);
  10250. g.prototype.__class__ = "RES.Resource";
  10251. var e = new g
  10252. })(RES || (RES = {}));
  10253. var egret_4399_h5api = function() {
  10254. return {
  10255. initGame: function(c, g, e, d) {
  10256. },
  10257. progress: function(c) {
  10258. },
  10259. isWeixinBrowser: function() {
  10260. return;
  10261. },
  10262. share: function(c) {
  10263. dp_share();
  10264. },
  10265. moreGame: function() {
  10266. clickMore();
  10267. },
  10268. submitScore: function(c, g, e) {
  10269. dp_submitScore(c);
  10270. },
  10271. getRank: function(c, g) {
  10272. }
  10273. }
  10274. } (),
  10275. map = function(c) {
  10276. function g() {
  10277. c.call(this);
  10278. var e = new egret.Bitmap(RES.getRes("bg"));
  10279. this.addChild(e);
  10280. e = new egret.Bitmap(RES.getRes("bg"));
  10281. this.addChild(e);
  10282. e.y = e.height;
  10283. var d = new egret.Shape;
  10284. d.graphics.beginFill(13685240, 1);
  10285. d.graphics.drawRect(0, 0, 480, 20);
  10286. d.graphics.endFill();
  10287. this.addChild(d);
  10288. d.y = e.y - 10
  10289. }
  10290. __extends(g, c);
  10291. return g
  10292. } (egret.Sprite);
  10293. map.prototype.__class__ = "map";
  10294. var Game = function(c) {
  10295. function g() {
  10296. c.call(this);
  10297. this.speed = 0.1;
  10298. this.speedsteps = 0.2;
  10299. this.endPoint = -1;
  10300. this.score = 0;
  10301. this.scoretext = new egret.BitmapText;
  10302. this.level = 0;
  10303. this.fx = new egret.Shape;
  10304. g.self = this;
  10305. this.player = new man;
  10306. this.bgmap = new map;
  10307. this.gameEnemy = new enemy(this.player);
  10308. this.fx.graphics.beginFill(16777215, 1);
  10309. this.fx.graphics.drawRect(0, 0, 480, 800);
  10310. this.fx.graphics.endFill();
  10311. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  10312. }
  10313. __extends(g, c);
  10314. var e = g.prototype;
  10315. e.onAddToStage = function(c) {
  10316. this.addChild(this.bgmap);
  10317. c = new egret.Bitmap(RES.getRes("top"));
  10318. c.y = 30;
  10319. c.x = (this.stage.stageWidth - c.width) / 2;
  10320. var b = RES.getRes("text");
  10321. this.scoretext.font = b;
  10322. this.scoretext.x = c.x + 100;
  10323. this.scoretext.y = c.y + 14;
  10324. this.scoretext.text = "0";
  10325. this.addChild(this.gameEnemy);
  10326. this.addChild(c);
  10327. this.addChild(this.scoretext);
  10328. this.addChild(this.player);
  10329. this.gameEnemy.addEventListener("gameover", this.gameover, this);
  10330. this.player.x = this.stage.width / 2 - 80;
  10331. this.player.y = 200;
  10332. this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
  10333. this.addEventListener(egret.Event.ENTER_FRAME, this.GameEnterFrames, this)
  10334. };
  10335. e.onTouchBegin = function(c) {
  10336. this.player.open();
  10337. this.endPoint = 0 < this.player.y - 100 ? this.player.y - 100 : 0
  10338. };
  10339. e.gameover = function(c) {
  10340. this.removeEventListener(egret.Event.ENTER_FRAME, this.GameEnterFrames, this);
  10341. this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
  10342. this.gameEnemy.stop();
  10343. this.stage.addChild(this.fx);
  10344. this.fx.alpha = 0;
  10345. var b = this;
  10346. egret.Tween.get(this.fx).to({
  10347. alpha: 1
  10348. },
  10349. 80).call(function() {
  10350. egret.Tween.get(b.fx).to({
  10351. alpha: 0
  10352. },
  10353. 260);
  10354. egret.Tween.get(b.player).to({
  10355. y: 800
  10356. },
  10357. 500).call(function() {
  10358. b.dispatchEvent(new egret.Event("over", !1, !1))
  10359. })
  10360. })
  10361. };
  10362. e.changelevel = function() {
  10363. 0 == this.score % 80 && 0 < this.score && 8 >= this.level && (this.level += 0.1)
  10364. };
  10365. e.GameEnterFrames = function(c) {
  10366. this.changelevel();
  10367. if ( - 1 >= this.endPoint) 10 > this.speed && (this.speed += this.speedsteps),
  10368. 350 > this.player.y ? this.player.y += this.speed: (this.score += 1, this.scoretext.text = this.score.toString()),
  10369. this.maprun(this.speed),
  10370. this.gameEnemy.speed = this.speed;
  10371. else if (this.player.y -= (this.player.y - this.endPoint) / 10, this.gameEnemy.speed = 0, this.player.y <= this.endPoint + 4 || 0 >= this.player.y) this.speed = 0.1,
  10372. this.endPoint = -1,
  10373. this.player.close()
  10374. };
  10375. e.maprun = function(c) {
  10376. this.bgmap.y -= c;
  10377. this.bgmap.y <= -this.stage.stageHeight && (this.bgmap.y = -(Math.abs(this.bgmap.y) - this.stage.stageHeight))
  10378. };
  10379. return g
  10380. } (egret.Sprite);
  10381. Game.prototype.__class__ = "Game";
  10382. var man = function(c) {
  10383. function g() {
  10384. c.call(this);
  10385. this.p = new egret.Bitmap;
  10386. this.addChild(this.p);
  10387. this.p.texture = RES.getRes("man_close");
  10388. this.p.name = "close"
  10389. }
  10390. __extends(g, c);
  10391. var e = g.prototype;
  10392. e.open = function() {
  10393. this.p.texture = RES.getRes("man_open")
  10394. };
  10395. e.close = function() {
  10396. this.p.texture = RES.getRes("man_close")
  10397. };
  10398. return g
  10399. } (egret.Sprite);
  10400. man.prototype.__class__ = "man";
  10401. var overview = function(c) {
  10402. function g(e) {
  10403. c.call(this);
  10404. this.scoretext = new egret.BitmapText;
  10405. this.scoretext2 = new egret.BitmapText;
  10406. var d = new egret.Shape;
  10407. d.graphics.beginFill(0, 0.6);
  10408. d.graphics.drawRect(0, 0, 480, 800);
  10409. d.graphics.endFill();
  10410. this.addChild(d);
  10411. d = new egret.Bitmap(RES.getRes("over"));
  10412. this.addChild(d);
  10413. var b = new egret.Bitmap(RES.getRes("top"));
  10414. b.y = 380;
  10415. b.x = (480 - b.width) / 2;
  10416. d = RES.getRes("text");
  10417. this.scoretext.font = d;
  10418. this.scoretext.x = b.x + 100;
  10419. this.scoretext.y = b.y + 14;
  10420. this.scoretext.text = e.toString();
  10421. this.addChild(b);
  10422. this.addChild(this.scoretext);
  10423. d = new egret.Bitmap(RES.getRes("over"));
  10424. this.addChild(d);
  10425. b = new egret.Bitmap(RES.getRes("pm"));
  10426. b.y = 440;
  10427. b.x = (480 - b.width) / 2;
  10428. d = RES.getRes("text");
  10429. this.scoretext2.font = d;
  10430. this.scoretext2.x = b.x + 200;
  10431. this.scoretext2.y = b.y + 14;
  10432. var a = this;
  10433. egret_4399_h5api.submitScore(e,
  10434. function() {
  10435. },
  10436. this)
  10437. }
  10438. __extends(g, c);
  10439. return g
  10440. } (egret.Sprite);
  10441. overview.prototype.__class__ = "overview";
  10442. var startview = function(c) {
  10443. function g() {
  10444. c.call(this);
  10445. this.top = new egret.Bitmap(RES.getRes("start_top"));
  10446. this.bottom = new egret.Bitmap(RES.getRes("start_bottom"));
  10447. this.bottom.y = this.top.height;
  10448. this.bg = new map;
  10449. this.addChild(this.bg);
  10450. this.addEventListener(egret.Event.ENTER_FRAME, this.onFrame, this);
  10451. this.addChild(this.top);
  10452. this.addChild(this.bottom)
  10453. }
  10454. __extends(g, c);
  10455. var e = g.prototype;
  10456. e.onFrame = function(c) {
  10457. this.bg.y -= 5; - 800 >= this.bg.y && (this.bg.y = -(Math.abs(this.bg.y) - 800))
  10458. };
  10459. e.over = function(c) {
  10460. var b = this;
  10461. egret.Tween.get(this.top).to({
  10462. y: -this.top.height
  10463. },
  10464. 400);
  10465. egret.Tween.get(this.bottom).to({
  10466. y: 800
  10467. },
  10468. 400).call(function() {
  10469. b.removeEventListener(egret.Event.ENTER_FRAME, b.onFrame, b);
  10470. c()
  10471. })
  10472. };
  10473. return g
  10474. } (egret.Sprite);
  10475. startview.prototype.__class__ = "startview";
  10476. var enemy = function(c) {
  10477. function g(d) {
  10478. c.call(this);
  10479. this.list = [];
  10480. this.speed = -1;
  10481. this.player = d;
  10482. this.addEventListener(egret.Event.ENTER_FRAME, this.onEnemyFrames, this)
  10483. }
  10484. __extends(g, c);
  10485. var e = g.prototype;
  10486. e.stop = function() {
  10487. this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnemyFrames, this)
  10488. };
  10489. e.onEnemyFrames = function(c) {
  10490. if (0 < this.list.length) for (3 != this.list[this.list.length - 1].id && this.list[this.list.length - 1].y < 500 + 20 * Game.self.level && this.createEnemy(), c = 0; c < this.list.length; c++) {
  10491. this.list[c].play();
  10492. this.list[c].y -= this.speed;
  10493. if (this.list[c].hit(this.player, this.list[c].y)) {
  10494. // alert("结束"+parseInt(Game.self.scoretext.text));
  10495. this.dispatchEvent(new egret.Event("gameover", !1, !1));
  10496. break
  10497. }
  10498. this.list[c].y < -this.list[c].height && (console.log("delete"), this.removeChild(this.list[c]), this.list.splice(c, 1), Game.self.score += 100, Game.self.scoretext.text = Game.self.score.toString())
  10499. } else this.createEnemy()
  10500. };
  10501. e.createEnemy = function() {
  10502. this.list.push(new prop);
  10503. this.list[this.list.length - 1].y = 900;
  10504. this.addChild(this.list[this.list.length - 1])
  10505. };
  10506. return g
  10507. } (egret.Sprite);
  10508. enemy.prototype.__class__ = "enemy";
  10509. var prop = function(c) {
  10510. function g(d) {
  10511. c.call(this);
  10512. this.list = [];
  10513. this.on = !1;
  10514. this.delay = 60;
  10515. this.mfStop = 30;
  10516. this.speed = 3;
  10517. this.fd_x = this.angle = 0;
  10518. d ? this.id = d: this.id = Math.floor(3 * Math.random());
  10519. switch (this.id) {
  10520. case 0:
  10521. d = new egret.Bitmap(RES.getRes("z0"));
  10522. this.addChild(d);
  10523. d.x = -d.width;
  10524. this.list.push(d);
  10525. d = new egret.Bitmap(RES.getRes("z0"));
  10526. d.scaleX = -1;
  10527. d.anchorX = 1;
  10528. d.x = 480;
  10529. this.addChild(d);
  10530. this.list.push(d);
  10531. break;
  10532. case 1:
  10533. d = new egret.Bitmap(RES.getRes("line"));
  10534. this.addChild(d);
  10535. d = new egret.Bitmap(RES.getRes("z1"));
  10536. this.list.push(d);
  10537. this.addChild(d);
  10538. d.anchorX = 0.5;
  10539. d.y = -25;
  10540. this.speed = 3 + Game.self.level;
  10541. this.list[0].x = 800;
  10542. this.delay = 0;
  10543. break;
  10544. case 2:
  10545. d = new egret.Bitmap;
  10546. d.texture = RES.getRes("z2");
  10547. this.addChild(d);
  10548. d.anchorX = 0.5;
  10549. this.list.push(d);
  10550. this.speed = 3 + Game.self.level;
  10551. d.x = -400;
  10552. break;
  10553. case 3:
  10554. d = new egret.Bitmap(RES.getRes("z3")),
  10555. d.anchorX = d.anchorY = 0.5,
  10556. this.addChild(d),
  10557. this.fd_x = 0 == Math.floor(2 * Math.random()) ? this.fd_x = 0 : this.fd_x = 480,
  10558. d.x = this.fd_x,
  10559. this.list.push(d),
  10560. this.radius = 240
  10561. }
  10562. }
  10563. __extends(g, c);
  10564. var e = g.prototype;
  10565. e.hit = function(c, b) {
  10566. switch (this.id) {
  10567. case 0:
  10568. if (c.y >= b - (c.height - this.height) && c.y <= b + this.list[0].height - c.height / 2 && -20 < this.list[0].x) return console.log("hit 0"),
  10569. !0;
  10570. break;
  10571. case 1:
  10572. if (c.y >= b - (c.height - this.height) && c.y <= b + this.list[0].height - c.height / 2 && 145 < this.list[0].x && 335 > this.list[0].x) return ! 0;
  10573. break;
  10574. case 2:
  10575. if (c.y >= b - (c.height - this.list[0].height) + this.list[0].y && c.y <= b + this.list[0].height + this.list[0].y && 160 < this.list[0].x && 310 > this.list[0].x) return ! 0;
  10576. break;
  10577. case 3:
  10578. if (210 < this.list[0].x && 280 > this.list[0].x && c.y > b + this.list[0].y - this.list[0].height / 3 && c.y < b + this.list[0].y + this.list[0].height / 3) return ! 0
  10579. }
  10580. return ! 1
  10581. };
  10582. e.play = function() {
  10583. switch (this.id) {
  10584. case 0:
  10585. this.on ? (this.list[0].x -= (this.list[0].x + 250) / (18 - Game.self.level), this.list[1].x += (490 - this.list[1].x) / (18 - Game.self.level), this.list[0].x <= -this.list[0].width && (this.on = !1)) : (this.list[0].x += (10 - this.list[0].x) / (18 - Game.self.level), this.list[1].x -= (this.list[1].x - 230) / (18 - Game.self.level), 0 <= this.list[0].x && (this.on = !0));
  10586. break;
  10587. case 1:
  10588. 0 == this.delay ? (0 == Math.floor(2 * Math.random()) ? (this.list[0].x = 480, this.list[0].scaleX = 1, this.on = !1, this.speed = -Math.abs(this.speed)) : (this.list[0].x = -this.list[0].width, this.list[0].scaleX = -1, this.speed = Math.abs(this.speed), this.on = !0), this.list[0].x += this.speed) : 0 > this.delay && (this.list[0].x += this.speed, this.on && this.list[0].x >= 480 + this.list[0].width && (this.delay = 100 - 10 * Game.self.level), !this.on && this.list[0].x <= -this.list[0].width && (this.delay = 100 - 10 * Game.self.level));
  10589. this.delay -= 1;
  10590. break;
  10591. case 2:
  10592. 0 == this.delay ? (0 == Math.floor(2 * Math.random()) ? (this.list[0].x = 480, this.list[0].scaleX = 1, this.on = !1, this.speed = -Math.abs(this.speed)) : (this.list[0].x = -this.list[0].width, this.list[0].scaleX = -1, this.speed = Math.abs(this.speed), this.on = !0), this.list[0].x += this.speed) : 0 >= this.delay && (this.list[0].y = 50 * Math.sin(this.angle), this.angle += 0.1, this.list[0].x += this.speed, this.on && this.list[0].x >= 480 + this.list[0].width && (this.delay = 10 * Game.self.level), !this.on && this.list[0].x <= -this.list[0].width && (this.delay = 10 * Game.self.level));
  10593. this.delay -= 1;
  10594. break;
  10595. case 3:
  10596. this.list[0].x = this.fd_x + Math.sin(this.angle) * this.radius,
  10597. this.list[0].y = Math.cos(this.angle) * this.radius,
  10598. this.angle += 0.02
  10599. }
  10600. };
  10601. return g
  10602. } (egret.Sprite);
  10603. prop.prototype.__class__ = "prop";
  10604. var Main = function(c) {
  10605. function g() {
  10606. c.call(this);
  10607. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  10608. }
  10609. __extends(g, c);
  10610. var e = g.prototype;
  10611. e.onAddToStage = function(c) {
  10612. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  10613. RES.loadConfig("resource/resource.json", "resource/");
  10614. egret_4399_h5api.initGame(100040989, "\u5c0f\u56e7\u718a\u8df3\u4f1e", this.stage.stageWidth, this.stage.stageHeight)
  10615. };
  10616. e.onConfigComplete = function(c) {
  10617. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  10618. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  10619. RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
  10620. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  10621. RES.loadGroup("preload")
  10622. };
  10623. e.onResourceLoadComplete = function(c) {
  10624. "preload" == c.groupName && (this.startview = new startview, this.stage.addChild(this.startview), this.startview.touchEnabled = !0, this.startview.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this), 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))
  10625. };
  10626. e.onTouch = function(c) {
  10627. c = new egret.Sound;
  10628. c = RES.getRes("bgss");
  10629. c.play(!0);
  10630. var b = this;
  10631. this.startview.over(function() {
  10632. //alert("开始");
  10633. b.stage.removeChild(b.startview);
  10634. b.game = new Game;
  10635. b.addChild(b.game);
  10636. b.game.addEventListener("over", b.over, b)
  10637. })
  10638. };
  10639. e.over = function(c) {
  10640. updateShare(this.game.score);
  10641. Play68.setRankingScoreDesc(this.game.score);
  10642. this.overs = new overview(this.game.score);
  10643. this.stage.addChild(this.overs);
  10644. this.overs.touchEnabled = !0;
  10645. this.overs.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rstart, this)
  10646. };
  10647. e.rstart = function(c) {
  10648. //alert("再来一次");
  10649. console.log(c.stageX, c.stageY);
  10650. 540 > c.stageY || 150 > c.stageX || 340 < c.stageX || 620 < c.stageY || (console.log("rstart"), this.stage.removeChild(this.overs), this.over = null, this.removeChild(this.game), this.game = null, this.game = new Game, this.game.addEventListener("over", this.over2, this), this.addChild(this.game))
  10651. if((c.stageX>185&&c.stageY> 640)&&(c.stageX<290&&c.stageY<680)){
  10652. play68_submitScore(this.game.score);
  10653. }
  10654. if((c.stageX>185&&c.stageY> 725)&&(c.stageX<290&&c.stageY<750)){
  10655. clickMore();
  10656. }
  10657. };
  10658. e.over2 = function(c) {
  10659. updateShare(this.game.score);
  10660. Play68.setRankingScoreDesc(this.game.score);
  10661. this.overs = new overview(this.game.score);
  10662. this.stage.addChild(this.overs);
  10663. this.overs.touchEnabled = !0;
  10664. this.overs.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rstart, this)
  10665. };
  10666. e.onResourceLoadError = function(c) {
  10667. console.warn("Group:" + c.groupName + " has failed to load");
  10668. this.onResourceLoadComplete(c)
  10669. };
  10670. e.onResourceProgress = function(c) {
  10671. "preload" == c.groupName && egret_4399_h5api.progress(c.itemsLoaded / c.itemsTotal * 100)
  10672. };
  10673. return g
  10674. } (egret.DisplayObjectContainer);
  10675. Main.prototype.__class__ = "Main";